aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/src/ipc-openbsd.h
diff options
context:
space:
mode:
authorJason A. Donenfeld <Jason@zx2c4.com>2021-03-11 15:35:15 -0700
committerJason A. Donenfeld <Jason@zx2c4.com>2021-03-11 15:35:15 -0700
commit4e4867dc95126f27bbb487a5d72c58916ca53e93 (patch)
treee5a8994c3d6eed8304d45b5a3676f240524aeeec /src/ipc-openbsd.h
parentipc: freebsd: add initial FreeBSD support (diff)
downloadwireguard-tools-4e4867dc95126f27bbb487a5d72c58916ca53e93.tar.xz
wireguard-tools-4e4867dc95126f27bbb487a5d72c58916ca53e93.zip
ipc: uniformly ignore preshared keys that are zero
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
Diffstat (limited to '')
-rw-r--r--src/ipc-openbsd.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/ipc-openbsd.h b/src/ipc-openbsd.h
index 30554b1..c529d9a 100644
--- a/src/ipc-openbsd.h
+++ b/src/ipc-openbsd.h
@@ -129,7 +129,8 @@ static int kernel_get_device(struct wgdevice **device, const char *iface)
if (wg_peer->p_flags & WG_PEER_HAS_PSK) {
memcpy(peer->preshared_key, wg_peer->p_psk, sizeof(peer->preshared_key));
- peer->flags |= WGPEER_HAS_PRESHARED_KEY;
+ if (!key_is_zero(peer->preshared_key))
+ peer->flags |= WGPEER_HAS_PRESHARED_KEY;
}
if (wg_peer->p_flags & WG_PEER_HAS_PKA) {