diff options
Diffstat (limited to 'src/lib/libcrypto/cms/cms_env.c')
-rw-r--r-- | src/lib/libcrypto/cms/cms_env.c | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/src/lib/libcrypto/cms/cms_env.c b/src/lib/libcrypto/cms/cms_env.c index c1426b457b..4f1a0b1445 100644 --- a/src/lib/libcrypto/cms/cms_env.c +++ b/src/lib/libcrypto/cms/cms_env.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: cms_env.c,v 1.20 2019/08/11 10:43:57 jsing Exp $ */ | 1 | /* $OpenBSD: cms_env.c,v 1.21 2019/08/11 11:04:18 jsing Exp $ */ |
2 | /* | 2 | /* |
3 | * Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL | 3 | * Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL |
4 | * project. | 4 | * project. |
@@ -79,7 +79,7 @@ static CMS_EnvelopedData * | |||
79 | cms_enveloped_data_init(CMS_ContentInfo *cms) | 79 | cms_enveloped_data_init(CMS_ContentInfo *cms) |
80 | { | 80 | { |
81 | if (cms->d.other == NULL) { | 81 | if (cms->d.other == NULL) { |
82 | cms->d.envelopedData = M_ASN1_new_of(CMS_EnvelopedData); | 82 | cms->d.envelopedData = (CMS_EnvelopedData *)ASN1_item_new(&CMS_EnvelopedData_it); |
83 | if (!cms->d.envelopedData) { | 83 | if (!cms->d.envelopedData) { |
84 | CMSerror(ERR_R_MALLOC_FAILURE); | 84 | CMSerror(ERR_R_MALLOC_FAILURE); |
85 | return NULL; | 85 | return NULL; |
@@ -190,7 +190,7 @@ cms_RecipientInfo_ktri_init(CMS_RecipientInfo *ri, X509 *recip, EVP_PKEY *pk, | |||
190 | CMS_KeyTransRecipientInfo *ktri; | 190 | CMS_KeyTransRecipientInfo *ktri; |
191 | int idtype; | 191 | int idtype; |
192 | 192 | ||
193 | ri->d.ktri = M_ASN1_new_of(CMS_KeyTransRecipientInfo); | 193 | ri->d.ktri = (CMS_KeyTransRecipientInfo *)ASN1_item_new(&CMS_KeyTransRecipientInfo_it); |
194 | if (!ri->d.ktri) | 194 | if (!ri->d.ktri) |
195 | return 0; | 195 | return 0; |
196 | ri->type = CMS_RECIPINFO_TRANS; | 196 | ri->type = CMS_RECIPINFO_TRANS; |
@@ -247,7 +247,7 @@ CMS_add1_recipient_cert(CMS_ContentInfo *cms, X509 *recip, unsigned int flags) | |||
247 | goto err; | 247 | goto err; |
248 | 248 | ||
249 | /* Initialize recipient info */ | 249 | /* Initialize recipient info */ |
250 | ri = M_ASN1_new_of(CMS_RecipientInfo); | 250 | ri = (CMS_RecipientInfo *)ASN1_item_new(&CMS_RecipientInfo_it); |
251 | if (!ri) | 251 | if (!ri) |
252 | goto merr; | 252 | goto merr; |
253 | 253 | ||
@@ -283,7 +283,7 @@ CMS_add1_recipient_cert(CMS_ContentInfo *cms, X509 *recip, unsigned int flags) | |||
283 | merr: | 283 | merr: |
284 | CMSerror(ERR_R_MALLOC_FAILURE); | 284 | CMSerror(ERR_R_MALLOC_FAILURE); |
285 | err: | 285 | err: |
286 | M_ASN1_free_of(ri, CMS_RecipientInfo); | 286 | ASN1_item_free((ASN1_VALUE *)ri, &CMS_RecipientInfo_it); |
287 | return NULL; | 287 | return NULL; |
288 | } | 288 | } |
289 | 289 | ||
@@ -573,11 +573,11 @@ CMS_add0_recipient_key(CMS_ContentInfo *cms, int nid, unsigned char *key, | |||
573 | } | 573 | } |
574 | 574 | ||
575 | /* Initialize recipient info */ | 575 | /* Initialize recipient info */ |
576 | ri = M_ASN1_new_of(CMS_RecipientInfo); | 576 | ri = (CMS_RecipientInfo *)ASN1_item_new(&CMS_RecipientInfo_it); |
577 | if (!ri) | 577 | if (!ri) |
578 | goto merr; | 578 | goto merr; |
579 | 579 | ||
580 | ri->d.kekri = M_ASN1_new_of(CMS_KEKRecipientInfo); | 580 | ri->d.kekri = (CMS_KEKRecipientInfo *)ASN1_item_new(&CMS_KEKRecipientInfo_it); |
581 | if (!ri->d.kekri) | 581 | if (!ri->d.kekri) |
582 | goto merr; | 582 | goto merr; |
583 | ri->type = CMS_RECIPINFO_KEK; | 583 | ri->type = CMS_RECIPINFO_KEK; |
@@ -585,7 +585,7 @@ CMS_add0_recipient_key(CMS_ContentInfo *cms, int nid, unsigned char *key, | |||
585 | kekri = ri->d.kekri; | 585 | kekri = ri->d.kekri; |
586 | 586 | ||
587 | if (otherTypeId) { | 587 | if (otherTypeId) { |
588 | kekri->kekid->other = M_ASN1_new_of(CMS_OtherKeyAttribute); | 588 | kekri->kekid->other = (CMS_OtherKeyAttribute *)ASN1_item_new(&CMS_OtherKeyAttribute_it); |
589 | if (kekri->kekid->other == NULL) | 589 | if (kekri->kekid->other == NULL) |
590 | goto merr; | 590 | goto merr; |
591 | } | 591 | } |
@@ -617,7 +617,7 @@ CMS_add0_recipient_key(CMS_ContentInfo *cms, int nid, unsigned char *key, | |||
617 | merr: | 617 | merr: |
618 | CMSerror(ERR_R_MALLOC_FAILURE); | 618 | CMSerror(ERR_R_MALLOC_FAILURE); |
619 | err: | 619 | err: |
620 | M_ASN1_free_of(ri, CMS_RecipientInfo); | 620 | ASN1_item_free((ASN1_VALUE *)ri, &CMS_RecipientInfo_it); |
621 | return NULL; | 621 | return NULL; |
622 | } | 622 | } |
623 | 623 | ||