diff options
author | tb <> | 2023-08-24 04:46:56 +0000 |
---|---|---|
committer | tb <> | 2023-08-24 04:46:56 +0000 |
commit | ff06075c8a18fb49a87131a9f6671dd8933d4016 (patch) | |
tree | 7991a8a0e0632ec88f592a0317d3e5e84206dd59 | |
parent | 14e26ad5d225e7e7a8fdad4bd07c1850bb8669af (diff) | |
download | openbsd-ff06075c8a18fb49a87131a9f6671dd8933d4016.tar.gz openbsd-ff06075c8a18fb49a87131a9f6671dd8933d4016.tar.bz2 openbsd-ff06075c8a18fb49a87131a9f6671dd8933d4016.zip |
Better names for the BIOs in CMS_dataInit()
Rename cmsbio into cms_bio and use {,in_}content_bio for {,i}cont.
ok jsing
-rw-r--r-- | src/lib/libcrypto/cms/cms_lib.c | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/src/lib/libcrypto/cms/cms_lib.c b/src/lib/libcrypto/cms/cms_lib.c index fc899437ab..950d8764ad 100644 --- a/src/lib/libcrypto/cms/cms_lib.c +++ b/src/lib/libcrypto/cms/cms_lib.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: cms_lib.c,v 1.21 2023/08/22 08:59:44 tb Exp $ */ | 1 | /* $OpenBSD: cms_lib.c,v 1.22 2023/08/24 04:46:56 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. |
@@ -142,34 +142,34 @@ cms_content_bio(CMS_ContentInfo *cms) | |||
142 | } | 142 | } |
143 | 143 | ||
144 | BIO * | 144 | BIO * |
145 | CMS_dataInit(CMS_ContentInfo *cms, BIO *icont) | 145 | CMS_dataInit(CMS_ContentInfo *cms, BIO *in_content_bio) |
146 | { | 146 | { |
147 | BIO *cmsbio = NULL, *cont = NULL; | 147 | BIO *cms_bio = NULL, *content_bio = NULL; |
148 | 148 | ||
149 | if ((cont = icont) == NULL) | 149 | if ((content_bio = in_content_bio) == NULL) |
150 | cont = cms_content_bio(cms); | 150 | content_bio = cms_content_bio(cms); |
151 | if (cont == NULL) { | 151 | if (content_bio == NULL) { |
152 | CMSerror(CMS_R_NO_CONTENT); | 152 | CMSerror(CMS_R_NO_CONTENT); |
153 | goto err; | 153 | goto err; |
154 | } | 154 | } |
155 | 155 | ||
156 | switch (OBJ_obj2nid(cms->contentType)) { | 156 | switch (OBJ_obj2nid(cms->contentType)) { |
157 | case NID_pkcs7_data: | 157 | case NID_pkcs7_data: |
158 | return cont; | 158 | return content_bio; |
159 | case NID_pkcs7_signed: | 159 | case NID_pkcs7_signed: |
160 | if ((cmsbio = cms_SignedData_init_bio(cms)) == NULL) | 160 | if ((cms_bio = cms_SignedData_init_bio(cms)) == NULL) |
161 | goto err; | 161 | goto err; |
162 | break; | 162 | break; |
163 | case NID_pkcs7_digest: | 163 | case NID_pkcs7_digest: |
164 | if ((cmsbio = cms_DigestedData_init_bio(cms)) == NULL) | 164 | if ((cms_bio = cms_DigestedData_init_bio(cms)) == NULL) |
165 | goto err; | 165 | goto err; |
166 | break; | 166 | break; |
167 | case NID_pkcs7_encrypted: | 167 | case NID_pkcs7_encrypted: |
168 | if ((cmsbio = cms_EncryptedData_init_bio(cms)) == NULL) | 168 | if ((cms_bio = cms_EncryptedData_init_bio(cms)) == NULL) |
169 | goto err; | 169 | goto err; |
170 | break; | 170 | break; |
171 | case NID_pkcs7_enveloped: | 171 | case NID_pkcs7_enveloped: |
172 | if ((cmsbio = cms_EnvelopedData_init_bio(cms)) == NULL) | 172 | if ((cms_bio = cms_EnvelopedData_init_bio(cms)) == NULL) |
173 | goto err; | 173 | goto err; |
174 | break; | 174 | break; |
175 | default: | 175 | default: |
@@ -177,11 +177,11 @@ CMS_dataInit(CMS_ContentInfo *cms, BIO *icont) | |||
177 | goto err; | 177 | goto err; |
178 | } | 178 | } |
179 | 179 | ||
180 | return BIO_push(cmsbio, cont); | 180 | return BIO_push(cms_bio, content_bio); |
181 | 181 | ||
182 | err: | 182 | err: |
183 | if (cont != icont) | 183 | if (content_bio != in_content_bio) |
184 | BIO_free(cont); | 184 | BIO_free(content_bio); |
185 | 185 | ||
186 | return NULL; | 186 | return NULL; |
187 | } | 187 | } |