From 8a1a7774d23297891bd4efc2e9bceebdcff1679a Mon Sep 17 00:00:00 2001 From: Liming Gao Date: Mon, 14 Jan 2019 10:31:27 +0800 Subject: [PATCH] MdeModulePkg DxeCapsuleLibFmp: Update SupportCapsuleImage() for Fake Capsule 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 Reviewed-by: 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 @@ -1421,6 +1421,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 //