Set initial previous peer nonce to zero
This commit is contained in:
parent
1e1e0d7c13
commit
158c766368
@ -72,6 +72,7 @@ alloc_encrypt(struct vtun_host *host)
|
|||||||
if (init_nonce(ctx.nonce, crypto_aead_NPUBBYTES) != 0) {
|
if (init_nonce(ctx.nonce, crypto_aead_NPUBBYTES) != 0) {
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
memset(ctx.previous_decrypted_nonce, 0, crypto_aead_NPUBBYTES);
|
||||||
crypto_aead_aes256gcm_beforenm(ctx.state, host->key);
|
crypto_aead_aes256gcm_beforenm(ctx.state, host->key);
|
||||||
sodium_free(host->key);
|
sodium_free(host->key);
|
||||||
host->key = NULL;
|
host->key = NULL;
|
||||||
|
Loading…
Reference in New Issue
Block a user