1
mirror of https://github.com/jedisct1/libsodium.git synced 2024-12-20 02:25:14 -07:00

Wipe secret keys before public keys and nonces

This commit is contained in:
Frank Denis 2016-02-03 01:19:24 +01:00
parent 1b63773986
commit 36e60b2d28

View File

@ -35,9 +35,9 @@ crypto_box_seal(unsigned char *c, const unsigned char *m,
_crypto_box_seal_nonce(nonce, epk, pk);
ret = crypto_box_easy(c + crypto_box_PUBLICKEYBYTES, m, mlen,
nonce, pk, esk);
sodium_memzero(nonce, sizeof nonce);
sodium_memzero(epk, sizeof epk);
sodium_memzero(esk, sizeof esk);
sodium_memzero(epk, sizeof epk);
sodium_memzero(nonce, sizeof nonce);
return ret;
}