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?
This commit is contained in:
mpex
2019-06-24 13:41:09 +02:00
committed by GitHub
parent 61992a838d
commit fb8e4d00df
+1 -1
View File
@@ -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);