aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorMatt Dunwoodie <ncon@mail.noconroy.net>2019-08-11 14:11:25 +1000
committerMatt Dunwoodie <ncon@mail.noconroy.net>2019-08-11 14:11:25 +1000
commit96675e226dd9789efcbd20268f42bbdc972f949b (patch)
treed7de9eef800b01e45877681cdb03ded7b0012486
parentCreate runtime dir for both interface types (diff)
downloadWireGuard-md/openbsd.tar.xz
WireGuard-md/openbsd.zip
Add support for masked/hidden keysmd/openbsd
-rw-r--r--src/tools/ipc.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/tools/ipc.c b/src/tools/ipc.c
index 64ea9e5..b0cb376 100644
--- a/src/tools/ipc.c
+++ b/src/tools/ipc.c
@@ -1010,12 +1010,12 @@ static int openbsd_get_device(struct wgdevice **device, const char *interface)
dev->flags |= WGDEVICE_HAS_LISTEN_PORT;
}
- if (!IS_NULL_KEY(wgs.gs_pubkey)) {
+ if (!IS_NULL_KEY(wgs.gs_pubkey) || IS_MASKED_KEY(wgs.gs_pubkey)) {
memcpy(dev->public_key, wgs.gs_pubkey, WG_KEY_SIZE);
dev->flags |= WGDEVICE_HAS_PUBLIC_KEY;
}
- if (!IS_NULL_KEY(wgs.gs_privkey)) {
+ if (!IS_NULL_KEY(wgs.gs_privkey) || IS_MASKED_KEY(wgs.gs_privkey)) {
memcpy(dev->private_key, wgs.gs_privkey, WG_KEY_SIZE);
dev->flags |= WGDEVICE_HAS_PRIVATE_KEY;
}
@@ -1046,7 +1046,7 @@ static int openbsd_get_device(struct wgdevice **device, const char *interface)
peer->flags |= WGPEER_HAS_PUBLIC_KEY;
}
- if (!IS_NULL_KEY(wgp.gp_psk)) {
+ if (!IS_NULL_KEY(wgp.gp_psk) || IS_MASKED_KEY(wgp.gp_psk)) {
memcpy(peer->preshared_key, wgp.gp_psk, WG_KEY_SIZE);
peer->flags |= WGPEER_HAS_PRESHARED_KEY;
}