From nobody Sun May 5 16:17:58 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of groups.io designates 66.175.222.12 as permitted sender) client-ip=66.175.222.12; envelope-from=bounce+27952+44577+1787277+3901457@groups.io; helo=web01.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zoho.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+44577+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=intel.com ARC-Seal: i=1; a=rsa-sha256; t=1564451272; cv=none; d=zoho.com; s=zohoarc; b=ZiKC2VXouHncbRIb5aSsnGpTErf5OunfQ9lHPYMY2eHQSpGAWYVL08fW0eD8+fGUBtrCuMo8iCWC6orzXE/0xSlzDawlnsWkFjVAWH2dI1tzkg1/6v19lN0RPLDFoo3xE47zhRW4oCoq4W+y1jt9ZH+McZcfhmsFBd8LBo+ixQ0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1564451272; h=Content-Transfer-Encoding:Cc:Date:From:List-Id:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:Sender:Subject:To:ARC-Authentication-Results; bh=YXHNG5nwVXD00v1+27afRq6gEi8yVLn7bQgDxeEqXOQ=; b=F4U20FOI0JXI9Yuj4keIxxE/h1QXAExa91aXOnUK9TB2L8XsJBSf8G8z6wrYg4UjeJnDsMvt3NDAl6vwHyWYnwtoRlb4mQdw3uUPa7Nh9BEAU6Tr0r/qfyTDfg9A2Kfe6+iHYJDbLhizjmvx+Yds+qRrBQgtHP5hKSmEq/cgmOA= ARC-Authentication-Results: i=1; mx.zoho.com; dkim=pass; spf=pass (zoho.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+44577+1787277+3901457@groups.io; dmarc=fail header.from= (p=none dis=none) header.from= Received: from web01.groups.io (web01.groups.io [66.175.222.12]) by mx.zohomail.com with SMTPS id 1564451272872929.9456942171456; Mon, 29 Jul 2019 18:47:52 -0700 (PDT) Return-Path: X-Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by groups.io with SMTP; Mon, 29 Jul 2019 18:47:52 -0700 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False X-Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga104.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 29 Jul 2019 18:47:51 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.64,325,1559545200"; d="scan'208";a="190730238" X-Received: from fieedk001.ccr.corp.intel.com ([10.239.33.119]) by fmsmga001.fm.intel.com with ESMTP; 29 Jul 2019 18:47:50 -0700 From: "Gao, Zhichao" To: devel@edk2.groups.io Cc: Jian Wang , Ting Ye Subject: [edk2-devel] [PATCH] CryptoPkg/BaseCryptLib: Use cmp-operator for non-Boolean comparisons Date: Tue, 30 Jul 2019 09:47:45 +0800 Message-Id: <20190730014745.20264-1-zhichao.gao@intel.com> MIME-Version: 1.0 Precedence: Bulk List-Unsubscribe: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,zhichao.gao@intel.com Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1564451272; bh=kdngAhdTHrmf2WZ9aJCq5CHrfMv8J1wY8mxZcIdWhh0=; h=Cc:Date:From:Reply-To:Subject:To; b=AZ5FcehDdulSwiCFcK0H+anMNWbLYsBMl+yZxJ468YTSJ+xGd7xTUZGrLSUNXPPX0dC eJT+V9a2zQr3n0YyAeGEiMgU+MOlrFqL+NWhSfzC3LauAkAWCQzmHTm0Q5iQN2wuV82n6 TFQ5NY53J2FHR65HqIIU437/uzhzAhlJXHE= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Type: text/plain; charset="utf-8" REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3D2027 Refer to CSS_2_1 5.7.2.1 "Non-Boolean comparisons must use a compare operator (=3D=3D, !=3D, >, < >=3D, <=3D).", use compare operator for the non-boolean comparisons. Cc: Jian Wang Cc: Ting Ye Signed-off-by: Zhichao Gao Reviewed-by: Jian J Wang --- .../BaseCryptLib/Pk/CryptPkcs7VerifyEku.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/CryptoPkg/Library/BaseCryptLib/Pk/CryptPkcs7VerifyEku.c b/Cryp= toPkg/Library/BaseCryptLib/Pk/CryptPkcs7VerifyEku.c index a0ea3f85eb..229c244b26 100644 --- a/CryptoPkg/Library/BaseCryptLib/Pk/CryptPkcs7VerifyEku.c +++ b/CryptoPkg/Library/BaseCryptLib/Pk/CryptPkcs7VerifyEku.c @@ -111,7 +111,7 @@ Exit: // // Release Resources // - if (Signers) { + if (Signers !=3D NULL) { sk_X509_free (Signers); } =20 @@ -230,11 +230,11 @@ Exit: // // Release Resources // - if (ClonedCert) { + if (ClonedCert !=3D NULL) { X509_free (ClonedCert); } =20 - if (Eku) { + if (Eku !=3D NULL) { sk_ASN1_OBJECT_pop_free (Eku, ASN1_OBJECT_free); } =20 @@ -281,13 +281,13 @@ CheckEKUs( // // Finding required EKU in cert. // - if (Asn1ToFind) { + if (Asn1ToFind !=3D NULL) { ASN1_OBJECT_free(Asn1ToFind); Asn1ToFind =3D NULL; } =20 Asn1ToFind =3D OBJ_txt2obj (RequiredEKUs[Index], 0); - if (!Asn1ToFind) { + if (Asn1ToFind =3D=3D NULL) { // // Fail to convert required EKU to ASN1. // @@ -313,7 +313,7 @@ CheckEKUs( =20 Exit: =20 - if (Asn1ToFind) { + if (Asn1ToFind !=3D NULL) { ASN1_OBJECT_free(Asn1ToFind); } =20 @@ -508,11 +508,11 @@ Exit: free (SignedData); } =20 - if (SignerCert) { + if (SignerCert !=3D NULL) { X509_free (SignerCert); } =20 - if (Pkcs7) { + if (Pkcs7 !=3D NULL) { PKCS7_free (Pkcs7); } =20 --=20 2.21.0.windows.1 -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#44577): https://edk2.groups.io/g/devel/message/44577 Mute This Topic: https://groups.io/mt/32649746/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-