Reviewed-by: Jian J Wang <jian.j.w...@intel.com>

> -----Original Message-----
> From: Gao, Liming
> Sent: Monday, January 14, 2019 10:31 AM
> To: edk2-devel@lists.01.org
> Cc: Zeng, Star <star.z...@intel.com>; Wang, Jian J <jian.j.w...@intel.com>
> 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 <liming....@intel.com>
> Cc: Star Zeng <star.z...@intel.com>
> Cc: Jian J Wang <jian.j.w...@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

_______________________________________________
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel

Reply via email to