Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[DO NOT MERGE] [PROTOTYPE] Stabilizing PCR4 Measurements #637

Draft
wants to merge 1 commit into
base: dev/202405
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
45 changes: 0 additions & 45 deletions TpmTestingPkg/Overrides/Tcg2Dxe/Tcg2Dxe.c
Original file line number Diff line number Diff line change
Expand Up @@ -2584,22 +2584,6 @@ OnReadyToBoot (
DEBUG ((DEBUG_ERROR, "Boot Variables not Measured. Error!\n"));
}

if (PcdGetBool (TcgMeasureBootStringsInPcr4)) {
// MsChange for some platform uefi compat
//
// 1. This is the first boot attempt.
//
Status = TcgMeasureAction (
4,
EFI_CALLING_EFI_APPLICATION
);
if (EFI_ERROR (Status)) {
DEBUG ((EFI_D_ERROR, "%a not Measured. Error!\n", EFI_CALLING_EFI_APPLICATION));
}
} else {
DEBUG ((DEBUG_WARN, "Tcg2Dxe PCD set to skip Measure Boot String in PCR4\n"));
}

//
// 2. Draw a line between pre-boot env and entering post-boot env.
// PCR[7] is already done.
Expand All @@ -2622,35 +2606,6 @@ OnReadyToBoot (
//
// 5. Read & Measure variable. BootOrder already measured.
//
} else {
if (PcdGetBool (TcgMeasureBootStringsInPcr4)) {
// MsChange for hyperv uefi compat
//
// 6. Not first attempt, meaning a return from last attempt
//
Status = TcgMeasureAction (
4,
EFI_RETURNING_FROM_EFI_APPLICATION
);
if (EFI_ERROR (Status)) {
DEBUG ((EFI_D_ERROR, "%a not Measured. Error!\n", EFI_RETURNING_FROM_EFI_APPLICATION));
}

//
// 7. Next boot attempt, measure "Calling EFI Application from Boot Option" again
// TCG PC Client PFP spec Section 2.4.4.5 Step 4
//
Status = TcgMeasureAction (
4,
EFI_CALLING_EFI_APPLICATION
);
if (EFI_ERROR (Status)) {
DEBUG ((EFI_D_ERROR, "%a not Measured. Error!\n", EFI_CALLING_EFI_APPLICATION));
}
} else {
// MS_CHANGE
DEBUG ((DEBUG_WARN, "Tcg2Dxe PCD set to skip Measure Boot String in PCR4\n"));
}
}

DEBUG ((EFI_D_INFO, "TPM2 Tcg2Dxe Measure Data when ReadyToBoot\n"));
Expand Down
1 change: 0 additions & 1 deletion TpmTestingPkg/Overrides/Tcg2Dxe/Tcg2Dxe.inf
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,6 @@
gEfiSecurityPkgTokenSpaceGuid.PcdTpm2AcpiTableLaml ## PRODUCES
gEfiSecurityPkgTokenSpaceGuid.PcdTpm2AcpiTableLasa ## PRODUCES
gEfiMdeModulePkgTokenSpaceGuid.PcdTcgPfpMeasurementRevision ## CONSUMES
gEfiSecurityPkgTokenSpaceGuid.TcgMeasureBootStringsInPcr4 ## CONSUMES # MU_CHANGE

[Depex]
# According to PcdTpm2AcpiTableRev definition in SecurityPkg.dec
Expand Down