From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=134.134.136.126; helo=mga18.intel.com; envelope-from=liming.gao@intel.com; receiver=edk2-devel@lists.01.org Received: from mga18.intel.com (mga18.intel.com [134.134.136.126]) (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 95641211982F4 for ; Sun, 13 Jan 2019 18:31:32 -0800 (PST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga007.jf.intel.com ([10.7.209.58]) by orsmga106.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 13 Jan 2019 18:31:31 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.56,475,1539673200"; d="scan'208";a="106352847" Received: from shwde7172.ccr.corp.intel.com ([10.239.158.23]) by orsmga007.jf.intel.com with ESMTP; 13 Jan 2019 18:31:30 -0800 From: Liming Gao To: edk2-devel@lists.01.org Cc: Star Zeng , Jian J Wang Date: Mon, 14 Jan 2019 10:31:27 +0800 Message-Id: <1547433087-764-1-git-send-email-liming.gao@intel.com> X-Mailer: git-send-email 2.8.0.windows.1 Subject: [Patch] MdeModulePkg DxeCapsuleLibFmp: Update SupportCapsuleImage() for Fake Capsule X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Jan 2019 02:31:32 -0000 BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=1088 Per UEFI spec, the fake capsule image with the header only is a valid case in QueryCapsuleCpapbilities(). So, SupportCapsuleImage() is updated to support this case. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Liming Gao Cc: Star Zeng Cc: Jian J Wang --- MdeModulePkg/Library/DxeCapsuleLibFmp/DxeCapsuleLib.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/MdeModulePkg/Library/DxeCapsuleLibFmp/DxeCapsuleLib.c b/MdeModulePkg/Library/DxeCapsuleLibFmp/DxeCapsuleLib.c index fa557b61ae..f56809bb70 100644 --- a/MdeModulePkg/Library/DxeCapsuleLibFmp/DxeCapsuleLib.c +++ b/MdeModulePkg/Library/DxeCapsuleLibFmp/DxeCapsuleLib.c @@ -1422,6 +1422,12 @@ SupportCapsuleImage ( if (IsFmpCapsule(CapsuleHeader)) { // + // Fake capsule header is valid case in QueryCapsuleCpapbilities(). + // + if (CapsuleHeader->HeaderSize == CapsuleHeader->CapsuleImageSize) { + return EFI_SUCCESS; + } + // // Check layout of FMP capsule // return ValidateFmpCapsule(CapsuleHeader, NULL); -- 2.13.0.windows.1