public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* [Patch] MdeModulePkg DxeCapsuleLibFmp: Update SupportCapsuleImage() for Fake Capsule
@ 2019-01-14  2:31 Liming Gao
  0 siblings, 0 replies; only message in thread
From: Liming Gao @ 2019-01-14  2:31 UTC (permalink / raw)
  To: edk2-devel; +Cc: Star Zeng, Jian J Wang

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 <liming.gao@intel.com>
Cc: Star Zeng <star.zeng@intel.com>
Cc: Jian J Wang <jian.j.wang@intel.com>
---
 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



^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2019-01-14  2:31 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-01-14  2:31 [Patch] MdeModulePkg DxeCapsuleLibFmp: Update SupportCapsuleImage() for Fake Capsule Liming Gao

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox