mirror of
https://github.com/jedisct1/libsodium.git
synced 2024-12-19 18:15:18 -07:00
Clear decrypted block from stack (#1190)
This commit is contained in:
parent
f333ea1beb
commit
0a6178f203
@ -134,6 +134,7 @@ crypto_secretbox_open_detached(unsigned char *m, const unsigned char *c,
|
|||||||
for (i = 0U; i < mlen0; i++) {
|
for (i = 0U; i < mlen0; i++) {
|
||||||
m[i] = block0[crypto_secretbox_ZEROBYTES + i];
|
m[i] = block0[crypto_secretbox_ZEROBYTES + i];
|
||||||
}
|
}
|
||||||
|
sodium_memzero(block0, sizeof block0);
|
||||||
if (clen > mlen0) {
|
if (clen > mlen0) {
|
||||||
crypto_stream_salsa20_xor_ic(m + mlen0, c + mlen0, clen - mlen0,
|
crypto_stream_salsa20_xor_ic(m + mlen0, c + mlen0, clen - mlen0,
|
||||||
n + 16, 1U, subkey);
|
n + 16, 1U, subkey);
|
||||||
|
Loading…
Reference in New Issue
Block a user