From 36e60b2d28eec8d6de86cfc67311416378553b78 Mon Sep 17 00:00:00 2001 From: Frank Denis Date: Wed, 3 Feb 2016 01:19:24 +0100 Subject: [PATCH] Wipe secret keys before public keys and nonces --- src/libsodium/crypto_box/crypto_box_seal.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/libsodium/crypto_box/crypto_box_seal.c b/src/libsodium/crypto_box/crypto_box_seal.c index e494b07c..64cc5ff6 100644 --- a/src/libsodium/crypto_box/crypto_box_seal.c +++ b/src/libsodium/crypto_box/crypto_box_seal.c @@ -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; }