diff options
| author | tb <> | 2023-09-11 09:29:30 +0000 |
|---|---|---|
| committer | tb <> | 2023-09-11 09:29:30 +0000 |
| commit | 7b9ac939ddc743eb500e57c6326c5f8fde2eda31 (patch) | |
| tree | 0f8fe56e28df901be13d038d9f2edab23f7e3037 /src | |
| parent | a85fbcce5ef459e11c27d544f9823aee7b0c441d (diff) | |
| download | openbsd-7b9ac939ddc743eb500e57c6326c5f8fde2eda31.tar.gz openbsd-7b9ac939ddc743eb500e57c6326c5f8fde2eda31.tar.bz2 openbsd-7b9ac939ddc743eb500e57c6326c5f8fde2eda31.zip | |
Small cleanups in cms_sd_asn1_ctrl():
Compare explicitly against NULL and use ret instead of i.
Diffstat (limited to 'src')
| -rw-r--r-- | src/lib/libcrypto/cms/cms_sd.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/lib/libcrypto/cms/cms_sd.c b/src/lib/libcrypto/cms/cms_sd.c index 73f67ce4c3..245822971b 100644 --- a/src/lib/libcrypto/cms/cms_sd.c +++ b/src/lib/libcrypto/cms/cms_sd.c | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | /* $OpenBSD: cms_sd.c,v 1.27 2023/09/11 09:24:14 tb Exp $ */ | 1 | /* $OpenBSD: cms_sd.c,v 1.28 2023/09/11 09:29:30 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. |
| @@ -256,16 +256,16 @@ static int | |||
| 256 | cms_sd_asn1_ctrl(CMS_SignerInfo *si, int cmd) | 256 | cms_sd_asn1_ctrl(CMS_SignerInfo *si, int cmd) |
| 257 | { | 257 | { |
| 258 | EVP_PKEY *pkey = si->pkey; | 258 | EVP_PKEY *pkey = si->pkey; |
| 259 | int i; | 259 | int ret; |
| 260 | 260 | ||
| 261 | if (!pkey->ameth || !pkey->ameth->pkey_ctrl) | 261 | if (pkey->ameth == NULL || pkey->ameth->pkey_ctrl == NULL) |
| 262 | return 1; | 262 | return 1; |
| 263 | i = pkey->ameth->pkey_ctrl(pkey, ASN1_PKEY_CTRL_CMS_SIGN, cmd, si); | 263 | ret = pkey->ameth->pkey_ctrl(pkey, ASN1_PKEY_CTRL_CMS_SIGN, cmd, si); |
| 264 | if (i == -2) { | 264 | if (ret == -2) { |
| 265 | CMSerror(CMS_R_NOT_SUPPORTED_FOR_THIS_KEY_TYPE); | 265 | CMSerror(CMS_R_NOT_SUPPORTED_FOR_THIS_KEY_TYPE); |
| 266 | return 0; | 266 | return 0; |
| 267 | } | 267 | } |
| 268 | if (i <= 0) { | 268 | if (ret <= 0) { |
| 269 | CMSerror(CMS_R_CTRL_FAILURE); | 269 | CMSerror(CMS_R_CTRL_FAILURE); |
| 270 | return 0; | 270 | return 0; |
| 271 | } | 271 | } |
