if_wg: release correct lock in noise_remote_begin_session()

The keypair lock is not taken until later.

Obtained from:	Jason A. Donenfeld via OpenBSD
MFC after:	3 days
This commit is contained in:
Kyle Evans 2021-03-07 20:25:33 -06:00
parent 006a01374f
commit d9a50109e2

View File

@ -454,7 +454,7 @@ noise_remote_begin_session(struct noise_remote *r)
NOISE_SYMMETRIC_SIZE, NOISE_SYMMETRIC_SIZE, 0, 0,
hs->hs_ck);
} else {
rw_exit_write(&r->r_keypair_lock);
rw_exit_write(&r->r_handshake_lock);
return EINVAL;
}