]> git.proxmox.com Git - mirror_edk2.git/commitdiff
SecurityPkg/FvReportPei: Remove the ASSERT to allow neither M nor V
authorGuomin Jiang <guomin.jiang@intel.com>
Fri, 15 Oct 2021 03:54:14 +0000 (11:54 +0800)
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
Sun, 31 Oct 2021 16:52:12 +0000 (16:52 +0000)
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=2673

M mean that Measured Boot, V mean that Verified Boot.

The FvReport do below:
1. Do nothing if neither M nor V
2. Allocate pages to save the firmware volume and use it to install
   firmware info Ppi
3. Install PreHashFv Ppi if the FV need measurement.
4. Verify the Hash if the FV need verification

Notes:
1. The component is used to verify the FV or measure the FV
2. Copy action is just for security purpose but not main purpose.
3. If you use this component, Doesn't need to copy in other compoent
   which result time consumption.

Signed-off-by: Guomin Jiang <guomin.jiang@intel.com>
Reviewed-by: Jian J Wang <jian.j.wang@intel.com>
SecurityPkg/FvReportPei/FvReportPei.c

index 9f3ebd8ed174ce05ec857919c46c7b4e93834632..6dce3298e3a23046414ae5f604ada8553c582af9 100644 (file)
@@ -150,10 +150,12 @@ VerifyHashedFv (
   FvHashValue = HashValue;\r
   for (FvIndex = 0; FvIndex < FvNumber; ++FvIndex) {\r
     //\r
-    // FV must be meant for verified boot and/or measured boot.\r
+    // Not meant for verified boot and/or measured boot?\r
     //\r
-    ASSERT ((FvInfo[FvIndex].Flag & HASHED_FV_FLAG_VERIFIED_BOOT) != 0 ||\r
-            (FvInfo[FvIndex].Flag & HASHED_FV_FLAG_MEASURED_BOOT) != 0);\r
+    if ((FvInfo[FvIndex].Flag & HASHED_FV_FLAG_VERIFIED_BOOT) == 0 &&\r
+          (FvInfo[FvIndex].Flag & HASHED_FV_FLAG_MEASURED_BOOT) == 0) {\r
+      continue;\r
+    }\r
 \r
     //\r
     // Skip any FV not meant for current boot mode.\r