From: Dr. Stephen Henson Date: Fri, 10 Apr 2015 01:33:44 +0000 (+0100) Subject: Fix ECDH key identifier support. X-Git-Tag: OpenSSL_1_0_2b~135 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=07395b7a6dfdbe263677e58519f1d11d51d31da5;p=oweals%2Fopenssl.git Fix ECDH key identifier support. PR#3789 Reviewed-by: Rich Salz (cherry picked from commit 7a317fa07cf3d9952c574e7d214d371798fee42a) --- diff --git a/crypto/cms/cms_kari.c b/crypto/cms/cms_kari.c index f8a6cbadb0..2cfcdb29cd 100644 --- a/crypto/cms/cms_kari.c +++ b/crypto/cms/cms_kari.c @@ -66,6 +66,7 @@ DECLARE_ASN1_ITEM(CMS_KeyAgreeRecipientInfo) DECLARE_ASN1_ITEM(CMS_RecipientEncryptedKey) DECLARE_ASN1_ITEM(CMS_OriginatorPublicKey) +DECLARE_ASN1_ITEM(CMS_RecipientKeyIdentifier) /* Key Agreement Recipient Info (KARI) routines */ @@ -362,6 +363,9 @@ int cms_RecipientInfo_kari_init(CMS_RecipientInfo *ri, X509 *recip, if (flags & CMS_USE_KEYID) { rek->rid->type = CMS_REK_KEYIDENTIFIER; + rek->rid->d.rKeyId = M_ASN1_new_of(CMS_RecipientKeyIdentifier); + if (rek->rid->d.rKeyId == NULL) + return 0; if (!cms_set1_keyid(&rek->rid->d.rKeyId->subjectKeyIdentifier, recip)) return 0; } else {