From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) (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 77C60817E2 for ; Fri, 6 Jan 2017 00:55:35 -0800 (PST) Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by fmsmga105.fm.intel.com with ESMTP; 06 Jan 2017 00:55:35 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.33,323,1477983600"; d="scan'208";a="50164917" Received: from shwdeopenpsi014.ccr.corp.intel.com ([10.239.9.13]) by fmsmga005.fm.intel.com with ESMTP; 06 Jan 2017 00:55:34 -0800 From: Hao Wu To: edk2-devel@lists.01.org Cc: Hao Wu , Chao Zhang , Jiewen Yao Date: Fri, 6 Jan 2017 16:55:32 +0800 Message-Id: <1483692932-29232-1-git-send-email-hao.a.wu@intel.com> X-Mailer: git-send-email 1.9.5.msysgit.0 Subject: [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: Fri, 06 Jan 2017 08:55:35 -0000 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(-) 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. - 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/FmpAuthenticationLibRsa2048Sha256.c b/SecurityPkg/Library/FmpAuthenticationLibRsa2048Sha256/FmpAuthenticationLibRsa2048Sha256.c index 4b2556c..b40993f 100644 --- a/SecurityPkg/Library/FmpAuthenticationLibRsa2048Sha256/FmpAuthenticationLibRsa2048Sha256.c +++ b/SecurityPkg/Library/FmpAuthenticationLibRsa2048Sha256/FmpAuthenticationLibRsa2048Sha256.c @@ -10,7 +10,7 @@ FmpAuthenticatedHandlerRsa2048Sha256(), AuthenticateFmpImage() will receive untrusted input and do basic validation. - 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