diff options
| author | tb <> | 2023-05-02 09:56:12 +0000 |
|---|---|---|
| committer | tb <> | 2023-05-02 09:56:12 +0000 |
| commit | 1a9695cb54834ca3da0b7428227de4eafbb0b307 (patch) | |
| tree | 9b60ad78359811fbd45de9f8216d214b64f98390 /src/lib/libcrypto | |
| parent | e5bd7ef5a9364394735d48fa47d57d5c17a9b937 (diff) | |
| download | openbsd-1a9695cb54834ca3da0b7428227de4eafbb0b307.tar.gz openbsd-1a9695cb54834ca3da0b7428227de4eafbb0b307.tar.bz2 openbsd-1a9695cb54834ca3da0b7428227de4eafbb0b307.zip | |
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 'src/lib/libcrypto')
| -rw-r--r-- | src/lib/libcrypto/pkcs7/pk7_mime.c | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/src/lib/libcrypto/pkcs7/pk7_mime.c b/src/lib/libcrypto/pkcs7/pk7_mime.c index 48fa79979d..f00e18c7ef 100644 --- a/src/lib/libcrypto/pkcs7/pk7_mime.c +++ b/src/lib/libcrypto/pkcs7/pk7_mime.c | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | /* $OpenBSD: pk7_mime.c,v 1.18 2023/05/02 09:38:33 tb Exp $ */ | 1 | /* $OpenBSD: pk7_mime.c,v 1.19 2023/05/02 09:56:12 tb Exp $ */ |
| 2 | /* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL | 2 | /* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL |
| 3 | * project. | 3 | * project. |
| 4 | */ | 4 | */ |
| @@ -86,16 +86,14 @@ LCRYPTO_ALIAS(PEM_write_bio_PKCS7_stream); | |||
| 86 | int | 86 | int |
| 87 | SMIME_write_PKCS7(BIO *bio, PKCS7 *p7, BIO *data, int flags) | 87 | SMIME_write_PKCS7(BIO *bio, PKCS7 *p7, BIO *data, int flags) |
| 88 | { | 88 | { |
| 89 | STACK_OF(X509_ALGOR) *mdalgs; | 89 | STACK_OF(X509_ALGOR) *mdalgs = NULL; |
| 90 | int ctype_nid = OBJ_obj2nid(p7->type); | 90 | int ctype_nid; |
| 91 | if (ctype_nid == NID_pkcs7_signed) | 91 | |
| 92 | if ((ctype_nid = OBJ_obj2nid(p7->type)) == NID_pkcs7_signed) | ||
| 92 | mdalgs = p7->d.sign->md_algs; | 93 | mdalgs = p7->d.sign->md_algs; |
| 93 | else | ||
| 94 | mdalgs = NULL; | ||
| 95 | 94 | ||
| 96 | flags ^= SMIME_OLDMIME; | 95 | flags ^= SMIME_OLDMIME; |
| 97 | 96 | ||
| 98 | |||
| 99 | return SMIME_write_ASN1(bio, (ASN1_VALUE *)p7, data, flags, | 97 | return SMIME_write_ASN1(bio, (ASN1_VALUE *)p7, data, flags, |
| 100 | ctype_nid, NID_undef, mdalgs, &PKCS7_it); | 98 | ctype_nid, NID_undef, mdalgs, &PKCS7_it); |
| 101 | } | 99 | } |
