diff options
author | Kan <chenxinpingc2306@163.com> | 2022-06-12 15:11:01 +0200 |
---|---|---|
committer | Pauli <pauli@openssl.org> | 2022-06-16 07:15:36 +0200 |
commit | 16249341bb64329c2542c3d1e23b97ed3c44fad3 (patch) | |
tree | a870b321431bab8e1727006b84c0a28b11cbba66 /crypto/rsa | |
parent | test/ssl_old_test.c: Add check for OPENSSL_zalloc (diff) | |
download | openssl-16249341bb64329c2542c3d1e23b97ed3c44fad3.tar.xz openssl-16249341bb64329c2542c3d1e23b97ed3c44fad3.zip |
Add sensitive memory clean in priv encode
Fixed #18540
Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Paul Dale <pauli@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/18541)
Diffstat (limited to 'crypto/rsa')
-rw-r--r-- | crypto/rsa/rsa_ameth.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/crypto/rsa/rsa_ameth.c b/crypto/rsa/rsa_ameth.c index bd32700599..9d5c32776d 100644 --- a/crypto/rsa/rsa_ameth.c +++ b/crypto/rsa/rsa_ameth.c @@ -160,6 +160,7 @@ static int rsa_priv_encode(PKCS8_PRIV_KEY_INFO *p8, const EVP_PKEY *pkey) strtype, str, rk, rklen)) { ERR_raise(ERR_LIB_RSA, ERR_R_MALLOC_FAILURE); ASN1_STRING_free(str); + OPENSSL_clear_free(rk, rklen); return 0; } |