From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: 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 0C92981C06 for ; Wed, 11 Jan 2017 21:25:43 -0800 (PST) Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by fmsmga103.fm.intel.com with ESMTP; 11 Jan 2017 21:25:42 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.33,348,1477983600"; d="scan'208";a="52304342" Received: from fmsmsx104.amr.corp.intel.com ([10.18.124.202]) by fmsmga005.fm.intel.com with ESMTP; 11 Jan 2017 21:25:43 -0800 Received: from shsmsx104.ccr.corp.intel.com (10.239.4.70) by fmsmsx104.amr.corp.intel.com (10.18.124.202) with Microsoft SMTP Server (TLS) id 14.3.248.2; Wed, 11 Jan 2017 21:25:42 -0800 Received: from shsmsx102.ccr.corp.intel.com ([169.254.2.88]) by SHSMSX104.ccr.corp.intel.com ([10.239.4.70]) with mapi id 14.03.0248.002; Thu, 12 Jan 2017 13:25:40 +0800 From: "Yao, Jiewen" To: "Wu, Hao A" , "edk2-devel@lists.01.org" CC: "Zhang, Chao B" Thread-Topic: [PATCH] SecurityPkg/FmpAuthenticationLib: Refine to compare with same type Thread-Index: AQHSZ/qpfKWn+SHUQ0m+w1NAvxDVyaE0WJ4w Date: Thu, 12 Jan 2017 05:25:39 +0000 Message-ID: <74D8A39837DF1E4DA445A8C0B3885C503A8DF0C2@shsmsx102.ccr.corp.intel.com> References: <1483692932-29232-1-git-send-email-hao.a.wu@intel.com> In-Reply-To: <1483692932-29232-1-git-send-email-hao.a.wu@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] SecurityPkg/FmpAuthenticationLib: Refine to compare with same type X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Jan 2017 05:25:43 -0000 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Reviewed-by: Jiewen.yao@intel.com > -----Original Message----- > From: Wu, Hao A > Sent: Friday, January 6, 2017 4:56 PM > To: edk2-devel@lists.01.org > Cc: Wu, Hao A ; Zhang, Chao B ; > Yao, Jiewen > Subject: [PATCH] SecurityPkg/FmpAuthenticationLib: Refine to compare with > same type >=20 > Cc: Chao Zhang > Cc: Jiewen Yao > Contributed-under: TianoCore Contribution Agreement 1.0 > Signed-off-by: Hao Wu > --- > .../Library/FmpAuthenticationLibPkcs7/FmpAuthenticationLibPkcs7.c | = 4 > ++-- > .../FmpAuthenticationLibRsa2048Sha256.c | > 4 ++-- > 2 files changed, 4 insertions(+), 4 deletions(-) >=20 > diff --git > a/SecurityPkg/Library/FmpAuthenticationLibPkcs7/FmpAuthenticationLibPkcs7= .c > b/SecurityPkg/Library/FmpAuthenticationLibPkcs7/FmpAuthenticationLibPkcs7= .c > index d79f270..69c637c 100644 > --- > a/SecurityPkg/Library/FmpAuthenticationLibPkcs7/FmpAuthenticationLibPkcs7= .c > +++ > b/SecurityPkg/Library/FmpAuthenticationLibPkcs7/FmpAuthenticationLibPkcs7= .c > @@ -10,7 +10,7 @@ > FmpAuthenticatedHandlerPkcs7(), AuthenticateFmpImage() will receive > untrusted input and do basic validation. >=20 > - Copyright (c) 2016, Intel Corporation. All rights reserved.
> + Copyright (c) 2016 - 2017, Intel Corporation. All rights reserved.
> This program and the accompanying materials > are licensed and made available under the terms and conditions of the = BSD > License > which accompanies this distribution. The full text of the license may= be > found at > @@ -181,7 +181,7 @@ AuthenticateFmpImage ( > DEBUG((DEBUG_ERROR, "AuthenticateFmpImage - dwLength too > small\n")); > return RETURN_INVALID_PARAMETER; > } > - if (Image->AuthInfo.Hdr.dwLength > MAX_UINTN - sizeof(UINT64)) { > + if ((UINTN) Image->AuthInfo.Hdr.dwLength > MAX_UINTN - sizeof(UINT64))= { > DEBUG((DEBUG_ERROR, "AuthenticateFmpImage - dwLength too big\n")); > return RETURN_INVALID_PARAMETER; > } > diff --git > a/SecurityPkg/Library/FmpAuthenticationLibRsa2048Sha256/FmpAuthentication= L > ibRsa2048Sha256.c > b/SecurityPkg/Library/FmpAuthenticationLibRsa2048Sha256/FmpAuthentication > LibRsa2048Sha256.c > index 4b2556c..b40993f 100644 > --- > a/SecurityPkg/Library/FmpAuthenticationLibRsa2048Sha256/FmpAuthentication= L > ibRsa2048Sha256.c > +++ > b/SecurityPkg/Library/FmpAuthenticationLibRsa2048Sha256/FmpAuthentication > LibRsa2048Sha256.c > @@ -10,7 +10,7 @@ > FmpAuthenticatedHandlerRsa2048Sha256(), AuthenticateFmpImage() will > receive > untrusted input and do basic validation. >=20 > - Copyright (c) 2016, Intel Corporation. All rights reserved.
> + Copyright (c) 2016 - 2017, Intel Corporation. All rights reserved.
> This program and the accompanying materials > are licensed and made available under the terms and conditions of the = BSD > License > which accompanies this distribution. The full text of the license may= be > found at > @@ -319,7 +319,7 @@ AuthenticateFmpImage ( > DEBUG((DEBUG_ERROR, "AuthenticateFmpImage - dwLength too > small\n")); > return RETURN_INVALID_PARAMETER; > } > - if (Image->AuthInfo.Hdr.dwLength > MAX_UINTN - sizeof(UINT64)) { > + if ((UINTN) Image->AuthInfo.Hdr.dwLength > MAX_UINTN - sizeof(UINT64))= { > DEBUG((DEBUG_ERROR, "AuthenticateFmpImage - dwLength too big\n")); > return RETURN_INVALID_PARAMETER; > } > -- > 1.9.5.msysgit.0