Skip to content

Commit f28f6e2

Browse files
fixup! Fix empty AKID/SKID handling
1 parent 922242b commit f28f6e2

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

crypto/cmp/cmp_msg.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -331,16 +331,15 @@ OSSL_CRMF_MSG *OSSL_CMP_CTX_setup_CRM(OSSL_CMP_CTX *ctx, int for_KUR, int rid)
331331
if (ctx->p10CSR != NULL
332332
&& (exts = X509_REQ_get_extensions(ctx->p10CSR)) == NULL)
333333
goto err;
334-
if (exts == NULL && (exts = sk_X509_EXTENSION_new_null()) == NULL)
335-
goto err;
336334
if (!ctx->SubjectAltName_nodefault && !HAS_SAN(ctx) && refcert != NULL
337335
&& (default_sans = X509V3_get_d2i(X509_get0_extensions(refcert),
338336
NID_subject_alt_name, NULL, NULL))
339337
!= NULL
340338
&& !add1_extension(&exts, NID_subject_alt_name, crit, default_sans))
341339
goto err;
342340
if (sk_X509_EXTENSION_num(ctx->reqExtensions) > 0 /* augment/override existing ones */
343-
&& X509v3_add_extensions(&exts, ctx->reqExtensions) == NULL)
341+
&& ((exts == NULL && (exts = sk_X509_EXTENSION_new_null()) == NULL)
342+
|| X509v3_add_extensions(&exts, ctx->reqExtensions) == NULL))
344343
goto err;
345344
if (sk_GENERAL_NAME_num(ctx->subjectAltNames) > 0
346345
&& !add1_extension(&exts, NID_subject_alt_name,

0 commit comments

Comments
 (0)