diff options
author | tb <> | 2023-04-21 20:30:53 +0000 |
---|---|---|
committer | tb <> | 2023-04-21 20:30:53 +0000 |
commit | 0f30a4517cb2ece4a9a563e33c6c7c33f846f015 (patch) | |
tree | 3fd572259c60c9fe367470c0ad4da5b1a9e50fbb /src/lib | |
parent | ddf965524bebe7c3b50fc0b434dd1680129d4ef2 (diff) | |
download | openbsd-0f30a4517cb2ece4a9a563e33c6c7c33f846f015.tar.gz openbsd-0f30a4517cb2ece4a9a563e33c6c7c33f846f015.tar.bz2 openbsd-0f30a4517cb2ece4a9a563e33c6c7c33f846f015.zip |
cms_io: Remove a stupid else branch
If you can initialize with functions, you can also initialize with
constants...
Diffstat (limited to 'src/lib')
-rw-r--r-- | src/lib/libcrypto/cms/cms_io.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/src/lib/libcrypto/cms/cms_io.c b/src/lib/libcrypto/cms/cms_io.c index c8c4791d28..c45e4a03dd 100644 --- a/src/lib/libcrypto/cms/cms_io.c +++ b/src/lib/libcrypto/cms/cms_io.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: cms_io.c,v 1.14 2023/04/21 20:08:23 tb Exp $ */ | 1 | /* $OpenBSD: cms_io.c,v 1.15 2023/04/21 20:30:53 tb 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. |
@@ -144,14 +144,12 @@ PEM_write_bio_CMS_stream(BIO *out, CMS_ContentInfo *cms, BIO *in, int flags) | |||
144 | int | 144 | int |
145 | SMIME_write_CMS(BIO *bio, CMS_ContentInfo *cms, BIO *data, int flags) | 145 | SMIME_write_CMS(BIO *bio, CMS_ContentInfo *cms, BIO *data, int flags) |
146 | { | 146 | { |
147 | STACK_OF(X509_ALGOR) *mdalgs; | 147 | STACK_OF(X509_ALGOR) *mdalgs = NULL; |
148 | int ctype_nid = OBJ_obj2nid(cms->contentType); | 148 | int ctype_nid = OBJ_obj2nid(cms->contentType); |
149 | int econt_nid = OBJ_obj2nid(CMS_get0_eContentType(cms)); | 149 | int econt_nid = OBJ_obj2nid(CMS_get0_eContentType(cms)); |
150 | 150 | ||
151 | if (ctype_nid == NID_pkcs7_signed) | 151 | if (ctype_nid == NID_pkcs7_signed) |
152 | mdalgs = cms->d.signedData->digestAlgorithms; | 152 | mdalgs = cms->d.signedData->digestAlgorithms; |
153 | else | ||
154 | mdalgs = NULL; | ||
155 | 153 | ||
156 | return SMIME_write_ASN1(bio, (ASN1_VALUE *)cms, data, flags, ctype_nid, | 154 | return SMIME_write_ASN1(bio, (ASN1_VALUE *)cms, data, flags, ctype_nid, |
157 | econt_nid, mdalgs, &CMS_ContentInfo_it); | 155 | econt_nid, mdalgs, &CMS_ContentInfo_it); |