Standardize conditions in which hashes get extended to TPM PCRs

This change ensures that consistent APIs are called to
determine if a hash gets extended to TPM PCRs

Signed-off-by: Sean McGinn <sean.mcginn@intel.com>
This commit is contained in:
Sean McGinn 2023-04-24 16:40:51 -07:00 committed by Guo Dong
parent 6453595afb
commit 23fafd59b8
3 changed files with 7 additions and 4 deletions

View File

@ -28,7 +28,7 @@ LoadComponentCallback (
AddMeasurePoint (0x4080);
}
if (FeaturePcdGet (PcdMeasuredBootEnabled) && (GetFeatureCfg() & FEATURE_MEASURED_BOOT)) {
if (MEASURED_BOOT_ENABLED() && GetBootMode() != BOOT_ON_S3_RESUME) {
// Extend the OS component hash
ExtendStageHash (CbInfo);
}
@ -662,7 +662,7 @@ BeforeOSJump (
if (LoaderPlatformInfo == NULL) {
return ;
}
if (FeaturePcdGet (PcdMeasuredBootEnabled) && (LoaderPlatformInfo->LdrFeatures & FEATURE_MEASURED_BOOT)) {
if (MEASURED_BOOT_ENABLED() && GetBootMode() != BOOT_ON_S3_RESUME) {
PlatformDebugEnabled = PlatformDebugStateEnabled (LoaderPlatformInfo->HwState);
if(TpmIndicateReadyToBoot (PlatformDebugEnabled) != EFI_SUCCESS) {
DEBUG ((DEBUG_ERROR, "FAILED to complete TPM ReadyToBoot actions. \n"));

View File

@ -1,6 +1,6 @@
/** @file
Copyright (c) 2017 - 2022, Intel Corporation. All rights reserved.<BR>
Copyright (c) 2017 - 2023, Intel Corporation. All rights reserved.<BR>
SPDX-License-Identifier: BSD-2-Clause-Patent
**/
@ -66,6 +66,7 @@
#include <Register/Intel/Msr/ArchitecturalMsr.h>
#include <Library/StringSupportLib.h>
#include <PreOsHeader.h>
#include <Library/BootloaderCoreLib.h>
#define MKHI_BOOTLOADER_SEED_LEN 64

View File

@ -1,5 +1,5 @@
## @file
# Copyright (c) 2017 - 2019, Intel Corporation. All rights reserved.<BR>
# Copyright (c) 2017 - 2023, Intel Corporation. All rights reserved.<BR>
#
# SPDX-License-Identifier: BSD-2-Clause-Patent
#
@ -45,6 +45,7 @@
IntelFsp2Pkg/IntelFsp2Pkg.dec
PayloadPkg/PayloadPkg.dec
Platform/CommonBoardPkg/CommonBoardPkg.dec
BootloaderCorePkg/BootloaderCorePkg.dec
[LibraryClasses]
BaseLib
@ -85,6 +86,7 @@
LocalApicLib
SynchronizationLib
MpServiceLib
BootloaderCoreLib
[Guids]
gOsConfigDataGuid