diff options
author | Jason A. Donenfeld <Jason@zx2c4.com> | 2017-05-24 03:35:35 +0200 |
---|---|---|
committer | Jason A. Donenfeld <Jason@zx2c4.com> | 2017-05-30 18:07:28 +0200 |
commit | a6722232fbc33cecf987ccac68324b7d2f6867c9 (patch) | |
tree | 14875b93a6850787569fe75ad707ade1456f653d /src/peer.c | |
parent | noise: no need to store ephemeral public key (diff) | |
download | wireguard-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.c | 5 |
1 files changed, 4 insertions, 1 deletions
@@ -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); |