summaryrefslogtreecommitdiffstats
path: root/crypto/cms/cms_asn1.c
diff options
context:
space:
mode:
authorRichard Levitte <levitte@openssl.org>2015-12-13 22:08:41 +0100
committerRichard Levitte <levitte@openssl.org>2016-01-12 13:52:22 +0100
commit846ec07d904f9cc81d486db0db14fb84f61ff6e5 (patch)
tree95f8e06e1e66296e20ade5ce79e098216ddbdf99 /crypto/cms/cms_asn1.c
parent936166aff21dafed33aeb92bad0a5b46d730221d (diff)
Adapt all EVP_CIPHER_CTX users for it becoming opaque
Reviewed-by: Rich Salz <rsalz@openssl.org>
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;
}