openssl-pkcs11/openssl-pkcs11-0.4.8-fix-leak-rsa-object-pkcs11-store-key.patch
Anderson Toshiyuki Sasaki 889aab18fc openssl-pkcs11-0.4.8-2
- Require OpenSSL >= 1.0.2
- Fixed missing declaration of ERR_get_CKR_code()
- Add support to use EC keys and tests (#1619184)
- Exposed check_fork() API
- Fixed memory leak of RSA objects in pkcs11_store_key()
- Updated OpenSSL license in eng_front.c
- Fixed build for old C dialects
- Allow engine to use private key without PIN
- Require DEBUG to be defined to print debug messages
- Changed package description (#1614699)
2018-09-18 10:02:33 +02:00

26 lines
738 B
Diff

From e420b22fab9b81d7f4ec8c82bd836269c9d2dc51 Mon Sep 17 00:00:00 2001
From: lbonn <bonnans.l@gmail.com>
Date: Thu, 30 Aug 2018 14:48:24 +0200
Subject: [PATCH 11/23] Fix leak of RSA object in pkcs11_store_key()
EVP_PKEY_get1_RSA() increments the reference count
---
src/p11_key.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/src/p11_key.c b/src/p11_key.c
index 1e99e0d..6fb844f 100644
--- a/src/p11_key.c
+++ b/src/p11_key.c
@@ -265,6 +265,7 @@ static int pkcs11_store_key(PKCS11_TOKEN *token, EVP_PKEY *pk,
RSA_get0_key(rsa, &rsa_n, &rsa_e, &rsa_d);
RSA_get0_factors(rsa, &rsa_p, &rsa_q);
RSA_get0_crt_params(rsa, &rsa_dmp1, &rsa_dmq1, &rsa_iqmp);
+ RSA_free(rsa);
#else
rsa_n=rsa->n;
rsa_e=rsa->e;
--
2.17.1