Skip to content

Commit

Permalink
Proper zeroization in hkdf
Browse files Browse the repository at this point in the history
Fixes #1375
  • Loading branch information
jedisct1 committed May 30, 2024
1 parent 7978205 commit 704e97f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/libsodium/crypto_kdf/hkdf/kdf_hkdf_sha256.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
2 changes: 1 addition & 1 deletion src/libsodium/crypto_kdf/hkdf/kdf_hkdf_sha512.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit 704e97f

Please sign in to comment.