Skip to content

Commit

Permalink
Clear decrypted block from stack (jedisct1#1190)
Browse files Browse the repository at this point in the history
  • Loading branch information
Sc00bz authored Jun 18, 2022
1 parent f333ea1 commit 0a6178f
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/libsodium/crypto_secretbox/crypto_secretbox_easy.c
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,7 @@ crypto_secretbox_open_detached(unsigned char *m, const unsigned char *c,
for (i = 0U; i < mlen0; i++) {
m[i] = block0[crypto_secretbox_ZEROBYTES + i];
}
sodium_memzero(block0, sizeof block0);
if (clen > mlen0) {
crypto_stream_salsa20_xor_ic(m + mlen0, c + mlen0, clen - mlen0,
n + 16, 1U, subkey);
Expand Down

0 comments on commit 0a6178f

Please sign in to comment.