From 0c9a455bf4c526d2398614c517c5ba0d27ceb2e6 Mon Sep 17 00:00:00 2001 From: tb Date: Mon, 11 Sep 2023 09:29:30 +0000 Subject: [PATCH] Small cleanups in cms_sd_asn1_ctrl(): Compare explicitly against NULL and use ret instead of i. --- lib/libcrypto/cms/cms_sd.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/lib/libcrypto/cms/cms_sd.c b/lib/libcrypto/cms/cms_sd.c index 73f67ce4c32..245822971bf 100644 --- a/lib/libcrypto/cms/cms_sd.c +++ b/lib/libcrypto/cms/cms_sd.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cms_sd.c,v 1.27 2023/09/11 09:24:14 tb Exp $ */ +/* $OpenBSD: cms_sd.c,v 1.28 2023/09/11 09:29:30 tb Exp $ */ /* * Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL * project. @@ -256,16 +256,16 @@ static int cms_sd_asn1_ctrl(CMS_SignerInfo *si, int cmd) { EVP_PKEY *pkey = si->pkey; - int i; + int ret; - if (!pkey->ameth || !pkey->ameth->pkey_ctrl) + if (pkey->ameth == NULL || pkey->ameth->pkey_ctrl == NULL) return 1; - i = pkey->ameth->pkey_ctrl(pkey, ASN1_PKEY_CTRL_CMS_SIGN, cmd, si); - if (i == -2) { + ret = pkey->ameth->pkey_ctrl(pkey, ASN1_PKEY_CTRL_CMS_SIGN, cmd, si); + if (ret == -2) { CMSerror(CMS_R_NOT_SUPPORTED_FOR_THIS_KEY_TYPE); return 0; } - if (i <= 0) { + if (ret <= 0) { CMSerror(CMS_R_CTRL_FAILURE); return 0; } -- 2.20.1