kdf_hkdf_sha*: wipe the entire structure

This commit is contained in:
Frank Denis
2026-01-05 23:51:19 +01:00
parent d89ef3c7ca
commit f703a31935
2 changed files with 2 additions and 2 deletions
@@ -26,7 +26,7 @@ crypto_kdf_hkdf_sha256_extract_final(crypto_kdf_hkdf_sha256_state *state,
unsigned char prk[crypto_kdf_hkdf_sha256_KEYBYTES])
{
crypto_auth_hmacsha256_final(&state->st, prk);
sodium_memzero(state, sizeof state);
sodium_memzero(state, sizeof *state);
return 0;
}
@@ -26,7 +26,7 @@ crypto_kdf_hkdf_sha512_extract_final(crypto_kdf_hkdf_sha512_state *state,
unsigned char prk[crypto_kdf_hkdf_sha512_KEYBYTES])
{
crypto_auth_hmacsha512_final(&state->st, prk);
sodium_memzero(state, sizeof state);
sodium_memzero(state, sizeof *state);
return 0;
}