aboutsummaryrefslogtreecommitdiffstats
path: root/crypto/cms/cms_asn1.c
diff options
context:
space:
mode:
Diffstat (limited to 'crypto/cms/cms_asn1.c')
-rw-r--r--crypto/cms/cms_asn1.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/crypto/cms/cms_asn1.c b/crypto/cms/cms_asn1.c
index 3b9f7b5c5e..017f55c589 100644
--- a/crypto/cms/cms_asn1.c
+++ b/crypto/cms/cms_asn1.c
@@ -194,12 +194,14 @@ static int cms_kari_cb(int operation, ASN1_VALUE **pval, const ASN1_ITEM *it,
{
CMS_KeyAgreeRecipientInfo *kari = (CMS_KeyAgreeRecipientInfo *)*pval;
if (operation == ASN1_OP_NEW_POST) {
- EVP_CIPHER_CTX_init(&kari->ctx);
- EVP_CIPHER_CTX_set_flags(&kari->ctx, EVP_CIPHER_CTX_FLAG_WRAP_ALLOW);
+ kari->ctx = EVP_CIPHER_CTX_new();
+ if (kari->ctx == NULL)
+ return 0;
+ EVP_CIPHER_CTX_set_flags(kari->ctx, EVP_CIPHER_CTX_FLAG_WRAP_ALLOW);
kari->pctx = NULL;
} else if (operation == ASN1_OP_FREE_POST) {
EVP_PKEY_CTX_free(kari->pctx);
- EVP_CIPHER_CTX_cleanup(&kari->ctx);
+ EVP_CIPHER_CTX_free(kari->ctx);
}
return 1;
}