summaryrefslogtreecommitdiffstats
path: root/crypto/cms
diff options
context:
space:
mode:
Diffstat (limited to 'crypto/cms')
-rw-r--r--crypto/cms/cms_env.c3
-rw-r--r--crypto/cms/cms_sd.c2
2 files changed, 3 insertions, 2 deletions
diff --git a/crypto/cms/cms_env.c b/crypto/cms/cms_env.c
index 3b065ae250..c54667f5df 100644
--- a/crypto/cms/cms_env.c
+++ b/crypto/cms/cms_env.c
@@ -200,7 +200,8 @@ static int cms_RecipientInfo_ktri_init(CMS_RecipientInfo *ri, X509 *recip,
return 0;
X509_up_ref(recip);
- CRYPTO_add(&pk->references, 1, CRYPTO_LOCK_EVP_PKEY);
+ EVP_PKEY_up_ref(pk);
+
ktri->pkey = pk;
ktri->recip = recip;
diff --git a/crypto/cms/cms_sd.c b/crypto/cms/cms_sd.c
index 2757aa9392..151f40f9a5 100644
--- a/crypto/cms/cms_sd.c
+++ b/crypto/cms/cms_sd.c
@@ -283,8 +283,8 @@ CMS_SignerInfo *CMS_add1_signer(CMS_ContentInfo *cms,
/* Call for side-effect of computing hash and caching extensions */
X509_check_purpose(signer, -1, -1);
- CRYPTO_add(&pk->references, 1, CRYPTO_LOCK_EVP_PKEY);
X509_up_ref(signer);
+ EVP_PKEY_up_ref(pk);
si->pkey = pk;
si->signer = signer;