summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatt Dunwoodie <ncon@noconroy.net>2021-03-15 17:59:47 +1100
committerMatt Dunwoodie <ncon@noconroy.net>2021-04-04 16:21:39 +1000
commitac972d63926acd11dc5298a438517b80a0bdc259 (patch)
tree257a9e6584b33dc2b013715ec2aff889b2f91a37
parentEnsure a peer has a consistent PSK (if set when creating) (diff)
downloadwireguard-openbsd-ac972d63926acd11dc5298a438517b80a0bdc259.tar.xz
wireguard-openbsd-ac972d63926acd11dc5298a438517b80a0bdc259.zip
Error out if peer provider without public key
-rw-r--r--sys/net/if_wg.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/sys/net/if_wg.c b/sys/net/if_wg.c
index ee637e80941..4789e4b84b5 100644
--- a/sys/net/if_wg.c
+++ b/sys/net/if_wg.c
@@ -2272,8 +2272,10 @@ wg_ioctl_set(struct wg_softc *sc, struct wg_data_io *data)
goto error;
/* Peer must have public key */
- if (!(peer_o.p_flags & WG_PEER_HAS_PUBLIC))
- goto next_peer;
+ if (!(peer_o.p_flags & WG_PEER_HAS_PUBLIC)) {
+ ret = EINVAL;
+ goto error;
+ }
/* 0 = latest protocol, 1 = this protocol */
if (peer_o.p_protocol_version != 0) {