memzero() the state if we call generichash_final() twice
This commit is contained in:
parent
6768d82ea2
commit
1090fcfd4d
@ -359,6 +359,7 @@ blake2b_final(blake2b_state *S, uint8_t *out, uint8_t outlen)
|
|||||||
sodium_misuse("blake2b_final(): unsupported output length");
|
sodium_misuse("blake2b_final(): unsupported output length");
|
||||||
}
|
}
|
||||||
if (blake2b_is_lastblock(S)) {
|
if (blake2b_is_lastblock(S)) {
|
||||||
|
sodium_memzero(S, sizeof *S);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
if (S->buflen > BLAKE2B_BLOCKBYTES) {
|
if (S->buflen > BLAKE2B_BLOCKBYTES) {
|
||||||
|
Loading…
Reference in New Issue
Block a user