From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Permerror (SPF Permanent Error: Void lookup limit of 2 exceeded) identity=mailfrom; client-ip=192.55.52.93; helo=mga11.intel.com; envelope-from=chao.b.zhang@intel.com; receiver=edk2-devel@lists.01.org Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 61406222DDC08 for ; Sun, 14 Jan 2018 23:24:04 -0800 (PST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by fmsmga102.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 14 Jan 2018 23:29:21 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.46,362,1511856000"; d="scan'208";a="195386836" Received: from fmsmsx103.amr.corp.intel.com ([10.18.124.201]) by fmsmga005.fm.intel.com with ESMTP; 14 Jan 2018 23:29:21 -0800 Received: from fmsmsx156.amr.corp.intel.com (10.18.116.74) by FMSMSX103.amr.corp.intel.com (10.18.124.201) with Microsoft SMTP Server (TLS) id 14.3.319.2; Sun, 14 Jan 2018 23:29:21 -0800 Received: from shsmsx104.ccr.corp.intel.com (10.239.4.70) by fmsmsx156.amr.corp.intel.com (10.18.116.74) with Microsoft SMTP Server (TLS) id 14.3.319.2; Sun, 14 Jan 2018 23:29:20 -0800 Received: from shsmsx102.ccr.corp.intel.com ([169.254.2.189]) by SHSMSX104.ccr.corp.intel.com ([169.254.5.152]) with mapi id 14.03.0319.002; Mon, 15 Jan 2018 15:29:19 +0800 From: "Zhang, Chao B" To: "Long, Qin" , "edk2-devel@lists.01.org" Thread-Topic: [PATCH] CrptoPkg/BaseCryptLib: Fix type mismatch when calling OpenSSL function Thread-Index: AQHTjaSRI0FcvqiJikiMkg3nXOTwMKNz68gAgACd2IA= Date: Mon, 15 Jan 2018 07:29:18 +0000 Message-ID: References: <20180115015959.255912-1-chao.b.zhang@intel.com> In-Reply-To: Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ctpclassification: CTP_NT x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiNmQxMzcxOTktODgyMS00Yzc4LWI3YmMtOWIwODcyYmYyNjIxIiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX05UIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE3LjIuNS4xOCIsIlRydXN0ZWRMYWJlbEhhc2giOiJRWW9LXC9Md1ZNeFNvdVwvOHhVN25TbjFZTkVjMnpaZGlGc2hqSENyWmNLVUVVaWE3OE11WE56aGgwR3NYNFhjV1IifQ== dlp-product: dlpe-windows dlp-version: 11.0.0.116 dlp-reaction: no-action x-originating-ip: [10.239.127.40] MIME-Version: 1.0 Subject: Re: [PATCH] CrptoPkg/BaseCryptLib: Fix type mismatch when calling OpenSSL function X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 Jan 2018 07:24:04 -0000 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Qin: That makes sense to me. Thanks for the comment. -----Original Message----- From: Long, Qin=20 Sent: Monday, January 15, 2018 2:04 PM To: Zhang, Chao B ; edk2-devel@lists.01.org Cc: Chen, Chen A Subject: RE: [PATCH] CrptoPkg/BaseCryptLib: Fix type mismatch when calling = OpenSSL function Chao, Could you leverage the EFI type instead of C type here for consistence?=20 We can use "INT32" type for Asn1Tag and ObjClass, and one "UINTN" Length sh= ould be OK with one extra zeroing here. Best Regards & Thanks, LONG, Qin -----Original Message----- From: Zhang, Chao B=20 Sent: Monday, January 15, 2018 10:00 AM To: edk2-devel@lists.01.org Cc: Long, Qin ; Chen, Chen A ; Z= hang, Chao B Subject: [PATCH] CrptoPkg/BaseCryptLib: Fix type mismatch when calling Open= SSL function Type definition in UEFI & OpeenSSL is different. Sometime it could cause wr= ite overflow. Should use same data type when accessing the same region Cc: Long Qin Cc: Chen Chen Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Chao Zhang --- CryptoPkg/Library/BaseCryptLib/Pk/CryptX509.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/CryptoPkg/Library/BaseCryptLib/Pk/CryptX509.c b/CryptoPkg/Libr= ary/BaseCryptLib/Pk/CryptX509.c index bf7c4cc..a3c9d12 100644 --- a/CryptoPkg/Library/BaseCryptLib/Pk/CryptX509.c +++ b/CryptoPkg/Library/BaseCryptLib/Pk/CryptX509.c @@ -644,9 +644,9 @@ X509GetTBSCert ( ) { CONST UINT8 *Temp; - INTN Asn1Tag; - INTN ObjClass; - UINTN Length; + int Asn1Tag; + int ObjClass; + long Length; =20 // // Check input parameters. -- 1.9.5.msysgit.1