path: root/src/wireguard.h
diff options
authorMatt Dunwoodie <>2019-05-28 12:01:04 +1000
committerMatt Dunwoodie <>2019-05-28 12:03:08 +1000
commit9b7e83cb06ac0e46a59cba0fe960b53db6a42cf5 (patch)
tree2cd39484505d07199e115abde20f67c7c5f6fc6b /src/wireguard.h
parentFix null pointer dereference (diff)
Add check to peer key
The security of WireGuard relies on peers not establishing a connection with the same key. i.e peer a public key == peer b public key. Currently we don't check this in if_wg.c as that will require some refactoring.
Diffstat (limited to 'src/wireguard.h')
1 files changed, 1 insertions, 1 deletions
diff --git a/src/wireguard.h b/src/wireguard.h
index adfc2a0c72d..700e836975e 100644
--- a/src/wireguard.h
+++ b/src/wireguard.h
@@ -132,7 +132,7 @@ void wg_peer_deinit(struct wg_peer *);
void wg_peer_cleanup(struct wg_peer *);
/* Get/Set functions */
-void wg_peer_set_key(struct wg_peer *, const enum wg_key_type, const u_int8_t [WG_KEY_SIZE]);
+int wg_peer_set_key(struct wg_peer *, const enum wg_key_type, const u_int8_t [WG_KEY_SIZE]);
void wg_peer_set_pka(struct wg_peer *, u_int16_t);
void wg_peer_get_key(struct wg_peer *, const enum wg_key_type, u_int8_t [WG_KEY_SIZE]);
void wg_peer_get_state(struct wg_peer *, struct timespec *, enum wg_role *);