aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/src/peer.c
diff options
context:
space:
mode:
authorJason A. Donenfeld <Jason@zx2c4.com>2017-05-24 03:35:35 +0200
committerJason A. Donenfeld <Jason@zx2c4.com>2017-05-30 18:07:28 +0200
commita6722232fbc33cecf987ccac68324b7d2f6867c9 (patch)
tree14875b93a6850787569fe75ad707ade1456f653d /src/peer.c
parentnoise: no need to store ephemeral public key (diff)
downloadwireguard-monolithic-historical-a6722232fbc33cecf987ccac68324b7d2f6867c9.tar.xz
wireguard-monolithic-historical-a6722232fbc33cecf987ccac68324b7d2f6867c9.zip
noise: precompute static-static ECDH operation
Diffstat (limited to 'src/peer.c')
-rw-r--r--src/peer.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/peer.c b/src/peer.c
index cc84ce6..411a82e 100644
--- a/src/peer.c
+++ b/src/peer.c
@@ -34,7 +34,10 @@ struct wireguard_peer *peer_create(struct wireguard_device *wg, const u8 public_
peer->internal_id = atomic64_inc_return(&peer_counter);
peer->device = wg;
cookie_init(&peer->latest_cookie);
- noise_handshake_init(&peer->handshake, &wg->static_identity, public_key, preshared_key, peer);
+ if (!noise_handshake_init(&peer->handshake, &wg->static_identity, public_key, preshared_key, peer)) {
+ kfree(peer);
+ return NULL;
+ }
cookie_checker_precompute_peer_keys(peer);
mutex_init(&peer->keypairs.keypair_update_lock);
INIT_WORK(&peer->transmit_handshake_work, packet_send_queued_handshakes);