From e613f1b9a2e8006527aec57adebd28f01a6b2390 Mon Sep 17 00:00:00 2001 From: jaseg Date: Fri, 16 Nov 2018 16:16:30 +0900 Subject: Key scrubber works but is untested on race conditions due to unexpected reset --- src/noise.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/noise.c') diff --git a/src/noise.c b/src/noise.c index 1ac336b..53e4383 100644 --- a/src/noise.c +++ b/src/noise.c @@ -36,6 +36,7 @@ void noise_state_init(struct NoiseState *st, uint8_t *remote_key_reference, uint int reset_protocol_handshake(struct NoiseState *st) { uninit_handshake(st, HANDSHAKE_UNINITIALIZED); + disarm_key_scrubber(); noise_cipherstate_free(st->tx_cipher); noise_cipherstate_free(st->rx_cipher); st->tx_cipher = NULL; @@ -98,6 +99,7 @@ void uninit_handshake(struct NoiseState *st, enum handshake_state new_state) { noise_handshakestate_free(st->handshake); st->handshake_state = new_state; st->handshake = NULL; + arm_key_scrubber(); } int try_continue_noise_handshake(struct NoiseState *st, uint8_t *buf, size_t len) { -- cgit