X-Git-Url: https://git.proxmox.com/?p=mirror_edk2.git;a=blobdiff_plain;f=SecurityPkg%2FTcg%2FTcg2Dxe%2FTcg2Dxe.c;h=53de6668ad76b47ee1624cad3aa474d520f74ed0;hp=db8d662f80dc0b1b679cf59784ee036d8261c5ff;hb=400b0940c8295f4cba44da3fa3e589f663f60de2;hpb=07cdba18cd974d818556d752facfbf35a8d0f012 diff --git a/SecurityPkg/Tcg/Tcg2Dxe/Tcg2Dxe.c b/SecurityPkg/Tcg/Tcg2Dxe/Tcg2Dxe.c index db8d662f80..53de6668ad 100644 --- a/SecurityPkg/Tcg/Tcg2Dxe/Tcg2Dxe.c +++ b/SecurityPkg/Tcg/Tcg2Dxe/Tcg2Dxe.c @@ -1,7 +1,7 @@ /** @file This module implements Tcg2 Protocol. -Copyright (c) 2015 - 2016, Intel Corporation. All rights reserved.
+Copyright (c) 2015 - 2017, Intel Corporation. All rights reserved.
(C) Copyright 2016 Hewlett Packard Enterprise Development LP
This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD License @@ -166,6 +166,82 @@ InternalDumpData ( } } +/** + + This function initialize TCG_PCR_EVENT2_HDR for EV_NO_ACTION Event Type other than EFI Specification ID event + The behavior is defined by TCG PC Client PFP Spec. Section 9.3.4 EV_NO_ACTION Event Types + + @param[in, out] NoActionEvent Event Header of EV_NO_ACTION Event + @param[in] EventSize Event Size of the EV_NO_ACTION Event + +**/ +VOID +InitNoActionEvent ( + IN OUT TCG_PCR_EVENT2_HDR *NoActionEvent, + IN UINT32 EventSize + ) +{ + UINT32 DigestListCount; + TPMI_ALG_HASH HashAlgId; + UINT8 *DigestBuffer; + + DigestBuffer = (UINT8 *)NoActionEvent->Digests.digests; + DigestListCount = 0; + + NoActionEvent->PCRIndex = 0; + NoActionEvent->EventType = EV_NO_ACTION; + + // + // Set Hash count & hashAlg accordingly, while Digest.digests[n].digest to all 0 + // + ZeroMem (&NoActionEvent->Digests, sizeof(NoActionEvent->Digests)); + + if ((mTcgDxeData.BsCap.ActivePcrBanks & EFI_TCG2_BOOT_HASH_ALG_SHA1) != 0) { + HashAlgId = TPM_ALG_SHA1; + CopyMem (DigestBuffer, &HashAlgId, sizeof(TPMI_ALG_HASH)); + DigestBuffer += sizeof(TPMI_ALG_HASH) + GetHashSizeFromAlgo (HashAlgId); + DigestListCount++; + } + + if ((mTcgDxeData.BsCap.ActivePcrBanks & EFI_TCG2_BOOT_HASH_ALG_SHA256) != 0) { + HashAlgId = TPM_ALG_SHA256; + CopyMem (DigestBuffer, &HashAlgId, sizeof(TPMI_ALG_HASH)); + DigestBuffer += sizeof(TPMI_ALG_HASH) + GetHashSizeFromAlgo (HashAlgId); + DigestListCount++; + } + + if ((mTcgDxeData.BsCap.ActivePcrBanks & EFI_TCG2_BOOT_HASH_ALG_SHA384) != 0) { + HashAlgId = TPM_ALG_SHA384; + CopyMem (DigestBuffer, &HashAlgId, sizeof(TPMI_ALG_HASH)); + DigestBuffer += sizeof(TPMI_ALG_HASH) + GetHashSizeFromAlgo (HashAlgId); + DigestListCount++; + } + + if ((mTcgDxeData.BsCap.ActivePcrBanks & EFI_TCG2_BOOT_HASH_ALG_SHA512) != 0) { + HashAlgId = TPM_ALG_SHA512; + CopyMem (DigestBuffer, &HashAlgId, sizeof(TPMI_ALG_HASH)); + DigestBuffer += sizeof(TPMI_ALG_HASH) + GetHashSizeFromAlgo (HashAlgId); + DigestListCount++; + } + + if ((mTcgDxeData.BsCap.ActivePcrBanks & EFI_TCG2_BOOT_HASH_ALG_SM3_256) != 0) { + HashAlgId = TPM_ALG_SM3_256; + CopyMem (DigestBuffer, &HashAlgId, sizeof(TPMI_ALG_HASH)); + DigestBuffer += sizeof(TPMI_ALG_HASH) + GetHashSizeFromAlgo (HashAlgId); + DigestListCount++; + } + + // + // Set Digests Count + // + WriteUnaligned32 ((UINT32 *)&NoActionEvent->Digests.count, DigestListCount); + + // + // Set Event Size + // + WriteUnaligned32((UINT32 *)DigestBuffer, EventSize); +} + /** This function dump raw data with colume format. @@ -856,7 +932,7 @@ TcgDxeLogEvent ( // (mTcgDxeData.FinalEventsTable[Index])->NumberOfEvents ++; DEBUG ((EFI_D_INFO, "FinalEventsTable->NumberOfEvents - 0x%x\n", (mTcgDxeData.FinalEventsTable[Index])->NumberOfEvents)); - DEBUG ((EFI_D_INFO, " Size - 0x%x\n", (UINTN)EventLogAreaStruct->LastEvent - (UINTN)mTcgDxeData.FinalEventsTable[Index])); + DEBUG ((EFI_D_INFO, " Size - 0x%x\n", (UINTN)EventLogAreaStruct->EventLogSize)); } } @@ -897,6 +973,60 @@ GetDigestListBinSize ( return TotalSize; } +/** + Copy TPML_DIGEST_VALUES compact binary into a buffer + + @param[in,out] Buffer Buffer to hold copied TPML_DIGEST_VALUES compact binary. + @param[in] DigestListBin TPML_DIGEST_VALUES compact binary buffer. + @param[in] HashAlgorithmMask HASH bits corresponding to the desired digests to copy. + @param[out] HashAlgorithmMaskCopied Pointer to HASH bits corresponding to the digests copied. + + @return The end of buffer to hold TPML_DIGEST_VALUES compact binary. +**/ +VOID * +CopyDigestListBinToBuffer ( + IN OUT VOID *Buffer, + IN VOID *DigestListBin, + IN UINT32 HashAlgorithmMask, + OUT UINT32 *HashAlgorithmMaskCopied + ) +{ + UINTN Index; + UINT16 DigestSize; + UINT32 Count; + TPMI_ALG_HASH HashAlg; + UINT32 DigestListCount; + UINT32 *DigestListCountPtr; + + DigestListCountPtr = (UINT32 *) Buffer; + DigestListCount = 0; + (*HashAlgorithmMaskCopied) = 0; + + Count = ReadUnaligned32 (DigestListBin); + Buffer = (UINT8 *)Buffer + sizeof(Count); + DigestListBin = (UINT8 *)DigestListBin + sizeof(Count); + for (Index = 0; Index < Count; Index++) { + HashAlg = ReadUnaligned16 (DigestListBin); + DigestListBin = (UINT8 *)DigestListBin + sizeof(HashAlg); + DigestSize = GetHashSizeFromAlgo (HashAlg); + + if (IsHashAlgSupportedInHashAlgorithmMask(HashAlg, HashAlgorithmMask)) { + CopyMem (Buffer, &HashAlg, sizeof(HashAlg)); + Buffer = (UINT8 *)Buffer + sizeof(HashAlg); + CopyMem (Buffer, DigestListBin, DigestSize); + Buffer = (UINT8 *)Buffer + DigestSize; + DigestListCount++; + (*HashAlgorithmMaskCopied) |= GetHashMaskFromAlgo (HashAlg); + } else { + DEBUG ((DEBUG_ERROR, "WARNING: CopyDigestListBinToBuffer Event log has HashAlg unsupported by PCR bank (0x%x)\n", HashAlg)); + } + DigestListBin = (UINT8 *)DigestListBin + DigestSize; + } + WriteUnaligned32 (DigestListCountPtr, DigestListCount); + + return Buffer; +} + /** Add a new entry to the Event Log. @@ -920,6 +1050,7 @@ TcgDxeLogHashEvent ( EFI_STATUS RetStatus; TCG_PCR_EVENT2 TcgPcrEvent2; UINT8 *DigestBuffer; + UINT32 *EventSizePtr; DEBUG ((EFI_D_INFO, "SupportedEventLogs - 0x%08x\n", mTcgDxeData.BsCap.SupportedEventLogs)); @@ -956,9 +1087,8 @@ TcgDxeLogHashEvent ( TcgPcrEvent2.PCRIndex = NewEventHdr->PCRIndex; TcgPcrEvent2.EventType = NewEventHdr->EventType; DigestBuffer = (UINT8 *)&TcgPcrEvent2.Digest; - DigestBuffer = CopyDigestListToBuffer (DigestBuffer, DigestList, mTcgDxeData.BsCap.ActivePcrBanks); - CopyMem (DigestBuffer, &NewEventHdr->EventSize, sizeof(NewEventHdr->EventSize)); - DigestBuffer = DigestBuffer + sizeof(NewEventHdr->EventSize); + EventSizePtr = CopyDigestListToBuffer (DigestBuffer, DigestList, mTcgDxeData.BsCap.ActivePcrBanks); + CopyMem (EventSizePtr, &NewEventHdr->EventSize, sizeof(NewEventHdr->EventSize)); // // Enter critical region @@ -967,7 +1097,7 @@ TcgDxeLogHashEvent ( Status = TcgDxeLogEvent ( mTcg2EventInfo[Index].LogFormat, &TcgPcrEvent2, - sizeof(TcgPcrEvent2.PCRIndex) + sizeof(TcgPcrEvent2.EventType) + GetDigestListSize (DigestList) + sizeof(TcgPcrEvent2.EventSize), + sizeof(TcgPcrEvent2.PCRIndex) + sizeof(TcgPcrEvent2.EventType) + GetDigestListBinSize (DigestBuffer) + sizeof(TcgPcrEvent2.EventSize), NewEventData, NewEventHdr->EventSize ); @@ -1317,15 +1447,22 @@ SetupEventLog ( EFI_PEI_HOB_POINTERS GuidHob; EFI_PHYSICAL_ADDRESS Lasa; UINTN Index; + VOID *DigestListBin; + TPML_DIGEST_VALUES TempDigestListBin; UINT32 DigestListBinSize; + UINT8 *Event; UINT32 EventSize; + UINT32 *EventSizePtr; + UINT32 HashAlgorithmMaskCopied; TCG_EfiSpecIDEventStruct *TcgEfiSpecIdEventStruct; UINT8 TempBuf[sizeof(TCG_EfiSpecIDEventStruct) + sizeof(UINT32) + (HASH_COUNT * sizeof(TCG_EfiSpecIdEventAlgorithmSize)) + sizeof(UINT8)]; - TCG_PCR_EVENT_HDR FirstPcrEvent; + TCG_PCR_EVENT_HDR SpecIdEvent; + TCG_PCR_EVENT2_HDR NoActionEvent; TCG_EfiSpecIdEventAlgorithmSize *DigestSize; TCG_EfiSpecIdEventAlgorithmSize *TempDigestSize; UINT8 *VendorInfoSize; UINT32 NumberOfAlgorithms; + TCG_EfiStartupLocalityEvent StartupLocalityEvent; DEBUG ((EFI_D_INFO, "SetupEventLog\n")); @@ -1335,9 +1472,8 @@ SetupEventLog ( for (Index = 0; Index < sizeof(mTcg2EventInfo)/sizeof(mTcg2EventInfo[0]); Index++) { if ((mTcgDxeData.BsCap.SupportedEventLogs & mTcg2EventInfo[Index].LogFormat) != 0) { mTcgDxeData.EventLogAreaStruct[Index].EventLogFormat = mTcg2EventInfo[Index].LogFormat; - Lasa = (EFI_PHYSICAL_ADDRESS) (SIZE_4GB - 1); Status = gBS->AllocatePages ( - AllocateMaxAddress, + AllocateAnyPages, EfiBootServicesData, EFI_SIZE_TO_PAGES (PcdGet32 (PcdTcgLogAreaMinLen)), &Lasa @@ -1409,24 +1545,54 @@ SetupEventLog ( VendorInfoSize = (UINT8 *)TempDigestSize; *VendorInfoSize = 0; - // - // FirstPcrEvent - // - FirstPcrEvent.PCRIndex = 0; - FirstPcrEvent.EventType = EV_NO_ACTION; - ZeroMem (&FirstPcrEvent.Digest, sizeof(FirstPcrEvent.Digest)); - FirstPcrEvent.EventSize = (UINT32)GetTcgEfiSpecIdEventStructSize (TcgEfiSpecIdEventStruct); + SpecIdEvent.PCRIndex = 0; + SpecIdEvent.EventType = EV_NO_ACTION; + ZeroMem (&SpecIdEvent.Digest, sizeof(SpecIdEvent.Digest)); + SpecIdEvent.EventSize = (UINT32)GetTcgEfiSpecIdEventStructSize (TcgEfiSpecIdEventStruct); // - // Record + // Log TcgEfiSpecIdEventStruct as the first Event. Event format is TCG_PCR_EVENT. + // TCG EFI Protocol Spec. Section 5.3 Event Log Header + // TCG PC Client PFP spec. Section 9.2 Measurement Event Entries and Log // Status = TcgDxeLogEvent ( mTcg2EventInfo[Index].LogFormat, - &FirstPcrEvent, - sizeof(FirstPcrEvent), + &SpecIdEvent, + sizeof(SpecIdEvent), (UINT8 *)TcgEfiSpecIdEventStruct, - FirstPcrEvent.EventSize + SpecIdEvent.EventSize ); + + // + // EfiStartupLocalityEvent. Event format is TCG_PCR_EVENT2 + // + GuidHob.Guid = GetFirstGuidHob (&gTpm2StartupLocalityHobGuid); + if (GuidHob.Guid != NULL) { + // + // Get Locality Indicator from StartupLocality HOB + // + StartupLocalityEvent.StartupLocality = *(UINT8 *)(GET_GUID_HOB_DATA (GuidHob.Guid)); + CopyMem (StartupLocalityEvent.Signature, TCG_EfiStartupLocalityEvent_SIGNATURE, sizeof(StartupLocalityEvent.Signature)); + DEBUG ((DEBUG_INFO, "SetupEventLog: Set Locality from HOB into StartupLocalityEvent 0x%02x\n", StartupLocalityEvent.StartupLocality)); + + // + // Initialize StartupLocalityEvent + // + InitNoActionEvent(&NoActionEvent, sizeof(StartupLocalityEvent)); + + // + // Log EfiStartupLocalityEvent as the second Event + // TCG PC Client PFP spec. Section 9.3.4.3 Startup Locality Event + // + Status = TcgDxeLogEvent ( + mTcg2EventInfo[Index].LogFormat, + &NoActionEvent, + sizeof(NoActionEvent.PCRIndex) + sizeof(NoActionEvent.EventType) + GetDigestListBinSize (&NoActionEvent.Digests) + sizeof(NoActionEvent.EventSize), + (UINT8 *)&StartupLocalityEvent, + sizeof(StartupLocalityEvent) + ); + + } } } } @@ -1437,9 +1603,8 @@ SetupEventLog ( for (Index = 0; Index < sizeof(mTcg2EventInfo)/sizeof(mTcg2EventInfo[0]); Index++) { if ((mTcgDxeData.BsCap.SupportedEventLogs & mTcg2EventInfo[Index].LogFormat) != 0) { if (mTcg2EventInfo[Index].LogFormat == EFI_TCG2_EVENT_LOG_FORMAT_TCG_2) { - Lasa = (EFI_PHYSICAL_ADDRESS) (SIZE_4GB - 1); Status = gBS->AllocatePages ( - AllocateMaxAddress, + AllocateAnyPages, EfiACPIMemoryNVS, EFI_SIZE_TO_PAGES (PcdGet32 (PcdTcg2FinalLogAreaLen)), &Lasa @@ -1497,7 +1662,8 @@ SetupEventLog ( Status = EFI_SUCCESS; while (!EFI_ERROR (Status) && (GuidHob.Raw = GetNextGuidHob (mTcg2EventInfo[Index].EventGuid, GuidHob.Raw)) != NULL) { - TcgEvent = GET_GUID_HOB_DATA (GuidHob.Guid); + TcgEvent = AllocateCopyPool (GET_GUID_HOB_DATA_SIZE (GuidHob.Guid), GET_GUID_HOB_DATA (GuidHob.Guid)); + ASSERT (TcgEvent != NULL); GuidHob.Raw = GET_NEXT_HOB (GuidHob); switch (mTcg2EventInfo[Index].LogFormat) { case EFI_TCG2_EVENT_LOG_FORMAT_TCG_1_2: @@ -1510,17 +1676,47 @@ SetupEventLog ( ); break; case EFI_TCG2_EVENT_LOG_FORMAT_TCG_2: - DigestListBinSize = GetDigestListBinSize ((UINT8 *)TcgEvent + sizeof(TCG_PCRINDEX) + sizeof(TCG_EVENTTYPE)); - CopyMem (&EventSize, (UINT8 *)TcgEvent + sizeof(TCG_PCRINDEX) + sizeof(TCG_EVENTTYPE) + DigestListBinSize, sizeof(UINT32)); + DigestListBin = (UINT8 *)TcgEvent + sizeof(TCG_PCRINDEX) + sizeof(TCG_EVENTTYPE); + DigestListBinSize = GetDigestListBinSize (DigestListBin); + // + // Save event size. + // + CopyMem (&EventSize, (UINT8 *)DigestListBin + DigestListBinSize, sizeof(UINT32)); + Event = (UINT8 *)DigestListBin + DigestListBinSize + sizeof(UINT32); + // + // Filter inactive digest in the event2 log from PEI HOB. + // + CopyMem (&TempDigestListBin, DigestListBin, GetDigestListBinSize (DigestListBin)); + EventSizePtr = CopyDigestListBinToBuffer ( + DigestListBin, + &TempDigestListBin, + mTcgDxeData.BsCap.ActivePcrBanks, + &HashAlgorithmMaskCopied + ); + if (HashAlgorithmMaskCopied != mTcgDxeData.BsCap.ActivePcrBanks) { + DEBUG (( + DEBUG_ERROR, + "ERROR: The event2 log includes digest hash mask 0x%x, but required digest hash mask is 0x%x\n", + HashAlgorithmMaskCopied, + mTcgDxeData.BsCap.ActivePcrBanks + )); + } + // + // Restore event size. + // + CopyMem (EventSizePtr, &EventSize, sizeof(UINT32)); + DigestListBinSize = GetDigestListBinSize (DigestListBin); + Status = TcgDxeLogEvent ( mTcg2EventInfo[Index].LogFormat, TcgEvent, sizeof(TCG_PCRINDEX) + sizeof(TCG_EVENTTYPE) + DigestListBinSize + sizeof(UINT32), - (UINT8 *)TcgEvent + sizeof(TCG_PCRINDEX) + sizeof(TCG_EVENTTYPE) + DigestListBinSize + sizeof(UINT32), + Event, EventSize ); break; } + FreePool (TcgEvent); } } } @@ -1529,8 +1725,9 @@ SetupEventLog ( } /** - Measure and log an action string, and extend the measurement result into PCR[5]. + Measure and log an action string, and extend the measurement result into PCR[PCRIndex]. + @param[in] PCRIndex PCRIndex to extend @param[in] String A specific string that indicates an Action event. @retval EFI_SUCCESS Operation completed successfully. @@ -1539,12 +1736,13 @@ SetupEventLog ( **/ EFI_STATUS TcgMeasureAction ( - IN CHAR8 *String + IN TPM_PCRINDEX PCRIndex, + IN CHAR8 *String ) { TCG_PCR_EVENT_HDR TcgEvent; - TcgEvent.PCRIndex = 5; + TcgEvent.PCRIndex = PCRIndex; TcgEvent.EventType = EV_EFI_ACTION; TcgEvent.EventSize = (UINT32)AsciiStrLen (String); return TcgDxeHashLogExtendEvent ( @@ -1668,7 +1866,7 @@ MeasureVariable ( EFI_STATUS Status; TCG_PCR_EVENT_HDR TcgEvent; UINTN VarNameLength; - EFI_VARIABLE_DATA_TREE *VarLog; + UEFI_VARIABLE_DATA *VarLog; DEBUG ((EFI_D_INFO, "Tcg2Dxe: MeasureVariable (Pcr - %x, EventType - %x, ", (UINTN)PCRIndex, (UINTN)EventType)); DEBUG ((EFI_D_INFO, "VariableName - %s, VendorGuid - %g)\n", VarName, VendorGuid)); @@ -1680,7 +1878,7 @@ MeasureVariable ( TcgEvent.EventSize = (UINT32)(sizeof (*VarLog) + VarNameLength * sizeof (*VarName) + VarSize - sizeof (VarLog->UnicodeName) - sizeof (VarLog->VariableData)); - VarLog = (EFI_VARIABLE_DATA_TREE *)AllocatePool (TcgEvent.EventSize); + VarLog = (UEFI_VARIABLE_DATA *)AllocatePool (TcgEvent.EventSize); if (VarLog == NULL) { return EFI_OUT_OF_RESOURCES; } @@ -1703,7 +1901,7 @@ MeasureVariable ( if (EventType == EV_EFI_VARIABLE_DRIVER_CONFIG) { // - // Digest is the event data (EFI_VARIABLE_DATA) + // Digest is the event data (UEFI_VARIABLE_DATA) // Status = TcgDxeHashLogExtendEvent ( 0, @@ -1713,6 +1911,7 @@ MeasureVariable ( (UINT8*)VarLog ); } else { + ASSERT (VarData != NULL); Status = TcgDxeHashLogExtendEvent ( 0, (UINT8*)VarData, @@ -1782,7 +1981,8 @@ ReadAndMeasureVariable ( } /** - Read then Measure and log an EFI boot variable, and extend the measurement result into PCR[5]. + Read then Measure and log an EFI boot variable, and extend the measurement result into PCR[1]. +according to TCG PC Client PFP spec 0021 Section 2.4.4.2 @param[in] VarName A Null-terminated string that is the name of the vendor's variable. @param[in] VendorGuid A unique identifier for the vendor. @@ -1803,7 +2003,7 @@ ReadAndMeasureBootVariable ( ) { return ReadAndMeasureVariable ( - 5, + 1, EV_EFI_VARIABLE_BOOT, VarName, VendorGuid, @@ -1936,6 +2136,24 @@ MeasureAllSecureVariables ( } } + // + // Measure DBT if present and not empty + // + Status = GetVariable2 (EFI_IMAGE_SECURITY_DATABASE2, &gEfiImageSecurityDatabaseGuid, &Data, &DataSize); + if (!EFI_ERROR(Status)) { + Status = MeasureVariable ( + 7, + EV_EFI_VARIABLE_DRIVER_CONFIG, + EFI_IMAGE_SECURITY_DATABASE2, + &gEfiImageSecurityDatabaseGuid, + Data, + DataSize + ); + FreePool(Data); + } else { + DEBUG((DEBUG_INFO, "Skip measuring variable %s since it's deleted\n", EFI_IMAGE_SECURITY_DATABASE2)); + } + return EFI_SUCCESS; } @@ -2060,6 +2278,7 @@ OnReadyToBoot ( // 1. This is the first boot attempt. // Status = TcgMeasureAction ( + 4, EFI_CALLING_EFI_APPLICATION ); if (EFI_ERROR (Status)) { @@ -2073,7 +2292,7 @@ OnReadyToBoot ( for (PcrIndex = 0; PcrIndex < 7; PcrIndex++) { Status = MeasureSeparatorEvent (PcrIndex); if (EFI_ERROR (Status)) { - DEBUG ((EFI_D_ERROR, "Seperator Event not Measured. Error!\n")); + DEBUG ((DEBUG_ERROR, "Separator Event not Measured. Error!\n")); } } @@ -2093,11 +2312,24 @@ OnReadyToBoot ( // 6. Not first attempt, meaning a return from last attempt // Status = TcgMeasureAction ( + 4, EFI_RETURNING_FROM_EFI_APPLICATOIN ); if (EFI_ERROR (Status)) { DEBUG ((EFI_D_ERROR, "%a not Measured. Error!\n", EFI_RETURNING_FROM_EFI_APPLICATOIN)); } + + // + // 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)); + } } DEBUG ((EFI_D_INFO, "TPM2 Tcg2Dxe Measure Data when ReadyToBoot\n")); @@ -2130,6 +2362,7 @@ OnExitBootServices ( // Measure invocation of ExitBootServices, // Status = TcgMeasureAction ( + 5, EFI_EXIT_BOOT_SERVICES_INVOCATION ); if (EFI_ERROR (Status)) { @@ -2140,6 +2373,7 @@ OnExitBootServices ( // Measure success of ExitBootServices // Status = TcgMeasureAction ( + 5, EFI_EXIT_BOOT_SERVICES_SUCCEEDED ); if (EFI_ERROR (Status)) { @@ -2169,6 +2403,7 @@ OnExitBootServicesFailed ( // Measure Failure of ExitBootServices, // Status = TcgMeasureAction ( + 5, EFI_EXIT_BOOT_SERVICES_FAILED ); if (EFI_ERROR (Status)) {