Skip to content

Commit

Permalink
SecurityPkg: Make TPM2_Startup() return an error
Browse files Browse the repository at this point in the history
The TPM2_Startup() function is called in the Tcg2Pei driver to start the
TPM. The function is expected to return an error if the TPM is not in
the correct state.
  • Loading branch information
Flickdm committed Aug 1, 2024
1 parent b37b19a commit 75503d9
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions SecurityPkg/Tcg/Tcg2Pei/Tcg2Pei.c
Original file line number Diff line number Diff line change
Expand Up @@ -1204,6 +1204,11 @@ PeimEntryMA (
}

if (EFI_ERROR (Status)) {
// MU_CHANGE_58957
// MU_CHANGE [BEGIN] - Make sure that TPM2_Startup() can report an error.
DEBUG ((DEBUG_ERROR, "Tcg2Pei::%a - TPM failed Startup!\n", __func__));
ASSERT_EFI_ERROR (Status);
// MU_CHANGE [END]
goto Done;
}
}
Expand Down Expand Up @@ -1236,6 +1241,10 @@ PeimEntryMA (
if (PcdGet8 (PcdTpm2SelfTestPolicy) == 1) {
Status = Tpm2SelfTest (NO);
if (EFI_ERROR (Status)) {
// MU_CHANGE_58957
// MU_CHANGE [BEGIN] - Make sure that TPM2_Startup() can report an error.
DEBUG ((DEBUG_ERROR, "Tcg2Pei::%a - TPM failed Startup!\n", __func__));
// MU_CHANGE [END]
goto Done;
}
}
Expand Down

0 comments on commit 75503d9

Please sign in to comment.