From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: mx.groups.io; dkim=missing; spf=pass (domain: intel.com, ip: 192.55.52.136, mailfrom: jian.j.wang@intel.com) Received: from mga12.intel.com (mga12.intel.com [192.55.52.136]) by groups.io with SMTP; Tue, 30 Jul 2019 18:22:00 -0700 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by fmsmga106.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 30 Jul 2019 18:22:00 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.64,328,1559545200"; d="scan'208";a="196157533" Received: from fmsmsx108.amr.corp.intel.com ([10.18.124.206]) by fmsmga004.fm.intel.com with ESMTP; 30 Jul 2019 18:22:00 -0700 Received: from fmsmsx607.amr.corp.intel.com (10.18.126.87) by FMSMSX108.amr.corp.intel.com (10.18.124.206) with Microsoft SMTP Server (TLS) id 14.3.439.0; Tue, 30 Jul 2019 18:22:00 -0700 Received: from fmsmsx607.amr.corp.intel.com (10.18.126.87) by fmsmsx607.amr.corp.intel.com (10.18.126.87) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1713.5; Tue, 30 Jul 2019 18:21:59 -0700 Received: from shsmsx103.ccr.corp.intel.com (10.239.4.69) by fmsmsx607.amr.corp.intel.com (10.18.126.87) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.1.1713.5 via Frontend Transport; Tue, 30 Jul 2019 18:21:59 -0700 Received: from shsmsx107.ccr.corp.intel.com ([169.254.9.65]) by SHSMSX103.ccr.corp.intel.com ([169.254.4.139]) with mapi id 14.03.0439.000; Wed, 31 Jul 2019 09:21:58 +0800 From: "Wang, Jian J" To: "devel@edk2.groups.io" , "Wang, Jian J" , "Gao, Zhichao" CC: "Ye, Ting" Subject: Re: [edk2-devel] [PATCH] CryptoPkg/BaseCryptLib: Use cmp-operator for non-Boolean comparisons Thread-Topic: [edk2-devel] [PATCH] CryptoPkg/BaseCryptLib: Use cmp-operator for non-Boolean comparisons Thread-Index: AQHVRnjO0WSvCfjH5EujZ0XVRJTN9qbiZpmQgAGJGBA= Date: Wed, 31 Jul 2019 01:21:57 +0000 Message-ID: References: <20190730014745.20264-1-zhichao.gao@intel.com> <15B60C8E2C30DA7D.4832@groups.io> In-Reply-To: <15B60C8E2C30DA7D.4832@groups.io> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiNWJjM2ZhMzgtZTQwNi00NjhmLWExZmItMzI0MzUxZTVkZGYyIiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX05UIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE3LjEwLjE4MDQuNDkiLCJUcnVzdGVkTGFiZWxIYXNoIjoiZ1NlUmoxbit5ZnRKUzc2NFl0d2RRYkhwQ0JGRmFITVpXWTlBQmJCTjBsNm5ES2MwM3ZtTkxmaFN3V2taUFNoUCJ9 x-ctpclassification: CTP_NT dlp-product: dlpe-windows dlp-version: 11.0.600.7 dlp-reaction: no-action x-originating-ip: [10.239.127.40] MIME-Version: 1.0 Return-Path: jian.j.wang@intel.com Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Pushed at b3d00df69c78fa0e12986a7ff334689a76f4578a Regards, Jian > -----Original Message----- > From: devel@edk2.groups.io [mailto:devel@edk2.groups.io] On Behalf Of > Wang, Jian J > Sent: Tuesday, July 30, 2019 9:55 AM > To: Gao, Zhichao ; devel@edk2.groups.io > Cc: Ye, Ting > Subject: Re: [edk2-devel] [PATCH] CryptoPkg/BaseCryptLib: Use cmp- > operator for non-Boolean comparisons >=20 >=20 >=20 > Reviewed-by: Jian J Wang >=20 > > -----Original Message----- > > From: Gao, Zhichao > > Sent: Tuesday, July 30, 2019 9:48 AM > > To: devel@edk2.groups.io > > Cc: Wang, Jian J ; Ye, Ting > > Subject: [PATCH] CryptoPkg/BaseCryptLib: Use cmp-operator for non- > > Boolean comparisons > > > > 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 operat= or > > for the non-boolean comparisons. > > > > Cc: Jian Wang > > Cc: Ting Ye > > Signed-off-by: Zhichao Gao > > --- > > .../BaseCryptLib/Pk/CryptPkcs7VerifyEku.c | 16 ++++++++-------= - > > 1 file changed, 8 insertions(+), 8 deletions(-) > > > > diff --git a/CryptoPkg/Library/BaseCryptLib/Pk/CryptPkcs7VerifyEku.c > > b/CryptoPkg/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); > > } > > > > @@ -230,11 +230,11 @@ Exit: > > // > > // Release Resources > > // > > - if (ClonedCert) { > > + if (ClonedCert !=3D NULL) { > > X509_free (ClonedCert); > > } > > > > - if (Eku) { > > + if (Eku !=3D NULL) { > > sk_ASN1_OBJECT_pop_free (Eku, ASN1_OBJECT_free); > > } > > > > @@ -281,13 +281,13 @@ CheckEKUs( > > // > > // Finding required EKU in cert. > > // > > - if (Asn1ToFind) { > > + if (Asn1ToFind !=3D NULL) { > > ASN1_OBJECT_free(Asn1ToFind); > > Asn1ToFind =3D NULL; > > } > > > > 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( > > > > Exit: > > > > - if (Asn1ToFind) { > > + if (Asn1ToFind !=3D NULL) { > > ASN1_OBJECT_free(Asn1ToFind); > > } > > > > @@ -508,11 +508,11 @@ Exit: > > free (SignedData); > > } > > > > - if (SignerCert) { > > + if (SignerCert !=3D NULL) { > > X509_free (SignerCert); > > } > > > > - if (Pkcs7) { > > + if (Pkcs7 !=3D NULL) { > > PKCS7_free (Pkcs7); > > } > > > > -- > > 2.21.0.windows.1 >=20 >=20 >=20