summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/lib/libcrypto/cms/cms_pwri.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/lib/libcrypto/cms/cms_pwri.c b/src/lib/libcrypto/cms/cms_pwri.c
index ef38a3f0f4..cf28dfc8dd 100644
--- a/src/lib/libcrypto/cms/cms_pwri.c
+++ b/src/lib/libcrypto/cms/cms_pwri.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: cms_pwri.c,v 1.25 2019/08/11 11:04:18 jsing Exp $ */ 1/* $OpenBSD: cms_pwri.c,v 1.26 2019/08/12 18:04:57 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.
@@ -347,8 +347,11 @@ cms_RecipientInfo_pwri_crypt(CMS_ContentInfo *cms, CMS_RecipientInfo *ri,
347 return 0; 347 return 0;
348 } 348 }
349 349
350 kekalg = ASN1_TYPE_unpack_sequence(&X509_ALGOR_it, 350 if (algtmp->parameter != NULL &&
351 algtmp->parameter); 351 algtmp->parameter->type == V_ASN1_SEQUENCE &&
352 algtmp->parameter->value.sequence != NULL)
353 kekalg = ASN1_item_unpack(algtmp->parameter->value.sequence,
354 &X509_ALGOR_it);
352 355
353 if (kekalg == NULL) { 356 if (kekalg == NULL) {
354 CMSerror(CMS_R_INVALID_KEY_ENCRYPTION_PARAMETER); 357 CMSerror(CMS_R_INVALID_KEY_ENCRYPTION_PARAMETER);