+ if (Tpm2HashMask == 0) {\r
+ //\r
+ // FV pre-hash algos comply with current TPM hash requirement\r
+ // Skip hashing step in measure, only extend DigestList to PCR and log event\r
+ //\r
+ Status = Tpm2PcrExtend(\r
+ 0,\r
+ &DigestList\r
+ );\r
+\r
+ if (!EFI_ERROR(Status)) {\r
+ Status = LogHashEvent (&DigestList, &TcgEventHdr, (UINT8*) &FvBlob);\r
+ DEBUG ((DEBUG_INFO, "The pre-hashed FV which is extended & logged by Tcg2Pei starts at: 0x%x\n", FvBlob.BlobBase));\r
+ DEBUG ((DEBUG_INFO, "The pre-hashed FV which is extended & logged by Tcg2Pei has the size: 0x%x\n", FvBlob.BlobLength));\r
+ } else if (Status == EFI_DEVICE_ERROR) {\r
+ BuildGuidHob (&gTpmErrorHobGuid,0);\r
+ REPORT_STATUS_CODE (\r
+ EFI_ERROR_CODE | EFI_ERROR_MINOR,\r
+ (PcdGet32 (PcdStatusCodeSubClassTpmDevice) | EFI_P_EC_INTERFACE_ERROR)\r
+ );\r
+ }\r
+ } else {\r
+ //\r
+ // Hash the FV, extend digest to the TPM and log TCG event\r
+ //\r
+ Status = HashLogExtendEvent (\r
+ 0,\r
+ (UINT8*) (UINTN) FvBlob.BlobBase,\r
+ (UINTN) FvBlob.BlobLength,\r
+ &TcgEventHdr,\r
+ (UINT8*) &FvBlob\r
+ );\r
+ DEBUG ((DEBUG_INFO, "The FV which is measured by Tcg2Pei starts at: 0x%x\n", FvBlob.BlobBase));\r
+ DEBUG ((DEBUG_INFO, "The FV which is measured by Tcg2Pei has the size: 0x%x\n", FvBlob.BlobLength));\r
+ }\r
+\r
+ if (EFI_ERROR(Status)) {\r
+ DEBUG ((DEBUG_ERROR, "The FV which failed to be measured starts at: 0x%x\n", FvBase));\r
+ return Status;\r
+ }\r