From fb8e4d00dfe75f53cdc3bb9f8880763c5d699d05 Mon Sep 17 00:00:00 2001 From: mpex Date: Mon, 24 Jun 2019 13:41:09 +0200 Subject: [PATCH] Update utils.c I noticed that the shielding_key is not used in sodium_mshield() (only filled in crypto_generichash()) Is the wrong key used in crypto_stream_xor? --- src/libsodium/sodium/utils.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libsodium/sodium/utils.c b/src/libsodium/sodium/utils.c index 3124ed64..92560939 100644 --- a/src/libsodium/sodium/utils.c +++ b/src/libsodium/sodium/utils.c @@ -753,7 +753,7 @@ sodium_mshield(void *ptr) memset(nonce, 0, sizeof nonce); memcpy(nonce, &unprotected_ptr, sizeof unprotected_ptr); memcpy(nonce + sizeof unprotected_ptr, &unprotected_size, sizeof unprotected_size); - crypto_stream_xor(unprotected_ptr, unprotected_ptr, unprotected_size, nonce, shielding_prekey); + crypto_stream_xor(unprotected_ptr, unprotected_ptr, unprotected_size, nonce, shielding_key); sodium_memzero(shielding_key, sizeof shielding_key); sodium_memzero(nonce, sizeof nonce);