Skip to content

Commit

Permalink
cleanse stack variable in kdf_pbkdf1_do_derive
Browse files Browse the repository at this point in the history
kdf_pbkdf1_do_derive stores key derivation information in a stack
variable, which is left uncleansed prior to returning.  Ensure that the
stack information is zeroed prior to return to avoid potential leaks of
key information

Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Matt Caswell <matt@openssl.org>
(Merged from #23194)
  • Loading branch information
nhorman committed Jan 5, 2024
1 parent bac7e68 commit 5963aa8
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions providers/implementations/kdfs/pbkdf1.c
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ static int kdf_pbkdf1_do_derive(const unsigned char *pass, size_t passlen,
memcpy(out, md_tmp, n);
ret = 1;
err:
OPENSSL_cleanse(md_tmp, EVP_MAX_MD_SIZE);
EVP_MD_CTX_free(ctx);
return ret;
}
Expand Down

0 comments on commit 5963aa8

Please sign in to comment.