diff options
-rw-r--r-- | lib/libcrypto/pkcs7/pk7_mime.c | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/lib/libcrypto/pkcs7/pk7_mime.c b/lib/libcrypto/pkcs7/pk7_mime.c index 48fa79979d4..f00e18c7ef9 100644 --- a/lib/libcrypto/pkcs7/pk7_mime.c +++ b/lib/libcrypto/pkcs7/pk7_mime.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pk7_mime.c,v 1.18 2023/05/02 09:38:33 tb Exp $ */ +/* $OpenBSD: pk7_mime.c,v 1.19 2023/05/02 09:56:12 tb Exp $ */ /* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL * project. */ @@ -86,16 +86,14 @@ LCRYPTO_ALIAS(PEM_write_bio_PKCS7_stream); int SMIME_write_PKCS7(BIO *bio, PKCS7 *p7, BIO *data, int flags) { - STACK_OF(X509_ALGOR) *mdalgs; - int ctype_nid = OBJ_obj2nid(p7->type); - if (ctype_nid == NID_pkcs7_signed) + STACK_OF(X509_ALGOR) *mdalgs = NULL; + int ctype_nid; + + if ((ctype_nid = OBJ_obj2nid(p7->type)) == NID_pkcs7_signed) mdalgs = p7->d.sign->md_algs; - else - mdalgs = NULL; flags ^= SMIME_OLDMIME; - return SMIME_write_ASN1(bio, (ASN1_VALUE *)p7, data, flags, ctype_nid, NID_undef, mdalgs, &PKCS7_it); } |