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.115; helo=mga14.intel.com; envelope-from=qin.long@intel.com; receiver=edk2-devel@lists.01.org Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) (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 9C050222DDBE7 for ; Sun, 14 Jan 2018 21:58:27 -0800 (PST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga103.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 14 Jan 2018 22:03:44 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.46,362,1511856000"; d="scan'208";a="22109955" Received: from fmsmsx107.amr.corp.intel.com ([10.18.124.205]) by fmsmga001.fm.intel.com with ESMTP; 14 Jan 2018 22:03:44 -0800 Received: from fmsmsx125.amr.corp.intel.com (10.18.125.40) by fmsmsx107.amr.corp.intel.com (10.18.124.205) with Microsoft SMTP Server (TLS) id 14.3.319.2; Sun, 14 Jan 2018 22:03:44 -0800 Received: from shsmsx152.ccr.corp.intel.com (10.239.6.52) by FMSMSX125.amr.corp.intel.com (10.18.125.40) with Microsoft SMTP Server (TLS) id 14.3.319.2; Sun, 14 Jan 2018 22:03:43 -0800 Received: from shsmsx103.ccr.corp.intel.com ([169.254.4.213]) by SHSMSX152.ccr.corp.intel.com ([169.254.6.93]) with mapi id 14.03.0319.002; Mon, 15 Jan 2018 14:03:41 +0800 From: "Long, Qin" To: "Zhang, Chao B" , "edk2-devel@lists.01.org" Thread-Topic: [PATCH] CrptoPkg/BaseCryptLib: Fix type mismatch when calling OpenSSL function Thread-Index: AQHTjaSRmSnYYeCs1Ua04oL/dIlUJ6N0bpwg Date: Mon, 15 Jan 2018 06:03:40 +0000 Message-ID: References: <20180115015959.255912-1-chao.b.zhang@intel.com> In-Reply-To: <20180115015959.255912-1-chao.b.zhang@intel.com> Accept-Language: zh-CN, en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: 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 05:58:28 -0000 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable 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