From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga06.intel.com (mga06.intel.com [134.134.136.31]) (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 B25AB1A1DFE for ; Fri, 26 Aug 2016 02:36:43 -0700 (PDT) Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga104.jf.intel.com with ESMTP; 26 Aug 2016 02:36:43 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.28,580,1464678000"; d="scan'208";a="1020661526" Received: from shwdeopenpsi168.ccr.corp.intel.com ([10.239.158.144]) by orsmga001.jf.intel.com with ESMTP; 26 Aug 2016 02:36:42 -0700 From: Yonghong Zhu To: edk2-devel@lists.01.org Cc: Liming Gao Date: Fri, 26 Aug 2016 17:36:39 +0800 Message-Id: <1472204199-111224-1-git-send-email-yonghong.zhu@intel.com> X-Mailer: git-send-email 2.6.1.windows.1 Subject: [Patch] BaseTools: UpdateImageSize include Image auth info for FMP Auth capsule 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, 26 Aug 2016 09:36:43 -0000 Per UEFI spec UpdateImageSize may or may not include Firmware Image Authentication information. so for FMP auth capsule, UpdateImageSize should include the Image auth info. Cc: Liming Gao Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Yonghong Zhu --- BaseTools/Source/Python/GenFds/Capsule.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/BaseTools/Source/Python/GenFds/Capsule.py b/BaseTools/Source/Python/GenFds/Capsule.py index 93ecee1..c9fddf6 100644 --- a/BaseTools/Source/Python/GenFds/Capsule.py +++ b/BaseTools/Source/Python/GenFds/Capsule.py @@ -139,11 +139,10 @@ class Capsule (CapsuleClassObject) : PreSize += os.path.getsize(FileName) File = open(FileName, 'rb') Content.write(File.read()) File.close() for fmp in self.FmpPayloadList: - Buffer = fmp.GenCapsuleSubItem() if fmp.Certificate_Guid: ExternalTool, ExternalOption = FindExtendTool([], GenFdsGlobalVariable.ArchList, fmp.Certificate_Guid) CmdOption = '' CapInputFile = fmp.ImageFile if not os.path.isabs(fmp.ImageFile): @@ -160,10 +159,12 @@ class Capsule (CapsuleClassObject) : GenFdsGlobalVariable.CallExternalTool(CmdList, "Failed to generate FMP auth capsule") if uuid.UUID(fmp.Certificate_Guid) == EFI_CERT_TYPE_PKCS7_GUID: dwLength = 4 + 2 + 2 + 16 + os.path.getsize(CapOutputTmp) - os.path.getsize(CapInputFile) else: dwLength = 4 + 2 + 2 + 16 + 16 + 256 + 256 + fmp.ImageFile = CapOutputTmp + Buffer = fmp.GenCapsuleSubItem() Buffer += pack('Q', fmp.MonotonicCount) Buffer += pack('I', dwLength) Buffer += pack('H', WIN_CERT_REVISION) Buffer += pack('H', WIN_CERT_TYPE_EFI_GUID) Buffer += uuid.UUID(fmp.Certificate_Guid).get_bytes_le() @@ -177,10 +178,11 @@ class Capsule (CapsuleClassObject) : VendorFile.close() FwMgrHdr.write(pack('=Q', PreSize)) PreSize += len(Buffer) Content.write(Buffer) else: + Buffer = fmp.GenCapsuleSubItem() ImageFile = open(fmp.ImageFile, 'rb') Buffer += ImageFile.read() ImageFile.close() if fmp.VendorCodeFile: VendorFile = open(fmp.VendorCodeFile, 'rb') -- 2.6.1.windows.1