Measure PEimage and ActionString data according to TPM requirement.

git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@4494 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
lgao4
2008-01-04 02:11:51 +00:00
parent fa7f89da6f
commit 822360ee34
5 changed files with 73 additions and 8 deletions

View File

@ -753,12 +753,37 @@ Returns:
--*/
{
EFI_STATUS Status;
EFI_STATUS StatusTemp;
EFI_TCG_PLATFORM_PROTOCOL *TcgPlatformProtocol;
//
// Measure invocation of ExitBootServices,
// which is defined by TCG_EFI_Platform_1_20_Final Specification
//
TcgPlatformProtocol = NULL;
Status = CoreLocateProtocol (
&gEfiTcgPlatformProtocolGuid,
NULL,
(VOID **) &TcgPlatformProtocol
);
if (!EFI_ERROR (Status)) {
Status = TcgPlatformProtocol->MeasureAction (EFI_EXIT_BOOT_SERVICES_INVOCATION);
ASSERT_EFI_ERROR (Status);
}
//
// Terminate memory services if the MapKey matches
//
Status = CoreTerminateMemoryMap (MapKey);
if (EFI_ERROR (Status)) {
//
// Measure failure of ExitBootServices
//
if (TcgPlatformProtocol != NULL) {
StatusTemp = TcgPlatformProtocol->MeasureAction (EFI_EXIT_BOOT_SERVICES_FAILED);
ASSERT_EFI_ERROR (StatusTemp);
}
return Status;
}
@ -811,6 +836,14 @@ Returns:
//
gRuntime->AtRuntime = TRUE;
//
// Measure success of ExitBootServices
//
if (TcgPlatformProtocol != NULL) {
StatusTemp = TcgPlatformProtocol->MeasureAction (EFI_EXIT_BOOT_SERVICES_SUCCEEDED);
ASSERT_EFI_ERROR (StatusTemp);
}
return Status;
}