summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorTheo Buehler <tb@cvs.openbsd.org>2023-05-02 09:56:13 +0000
committerTheo Buehler <tb@cvs.openbsd.org>2023-05-02 09:56:13 +0000
commit37227b176ebc63eb3871a4ae8c56c2fedd028cb3 (patch)
tree03aa58788bf19acd6256bd3bf844f009731c817c /lib
parentd03704a2acbfa4f7fc3f8f1ea055277503b5a806 (diff)
Style tweaks for SMIME_write_PKCS7()
Initialize the mdalgs stack at the top and test and assign for ctype_nid. Use an empty line to separate variable declarations from the actual code and zap an extra empty line. ok jsing
Diffstat (limited to 'lib')
-rw-r--r--lib/libcrypto/pkcs7/pk7_mime.c12
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);
}