TianoCore EDK2 master
|
#include <PiDxe.h>
#include <IndustryStandard/Acpi.h>
#include <IndustryStandard/PeImage.h>
#include <IndustryStandard/TcpaAcpi.h>
#include <Guid/GlobalVariable.h>
#include <Guid/HobList.h>
#include <Guid/TcgEventHob.h>
#include <Guid/EventGroup.h>
#include <Guid/EventExitBootServiceFailed.h>
#include <Guid/ImageAuthentication.h>
#include <Guid/TpmInstance.h>
#include <Guid/DeviceAuthentication.h>
#include <Protocol/DevicePath.h>
#include <Protocol/MpService.h>
#include <Protocol/VariableWrite.h>
#include <Protocol/Tcg2Protocol.h>
#include <Protocol/TrEEProtocol.h>
#include <Protocol/ResetNotification.h>
#include <Library/DebugLib.h>
#include <Library/BaseMemoryLib.h>
#include <Library/UefiRuntimeServicesTableLib.h>
#include <Library/UefiDriverEntryPoint.h>
#include <Library/HobLib.h>
#include <Library/UefiBootServicesTableLib.h>
#include <Library/BaseLib.h>
#include <Library/MemoryAllocationLib.h>
#include <Library/PrintLib.h>
#include <Library/Tpm2CommandLib.h>
#include <Library/PcdLib.h>
#include <Library/UefiLib.h>
#include <Library/Tpm2DeviceLib.h>
#include <Library/HashLib.h>
#include <Library/PerformanceLib.h>
#include <Library/ReportStatusCodeLib.h>
#include <Library/Tcg2PhysicalPresenceLib.h>
Go to the source code of this file.
Data Structures | |
struct | VARIABLE_TYPE |
struct | TCG2_EVENT_INFO_STRUCT |
struct | TCG_EVENT_LOG_AREA_STRUCT |
struct | _TCG_DXE_DATA |
Macros | |
#define | PERF_ID_TCG2_DXE 0x3120 |
#define | TCG2_DEFAULT_MAX_COMMAND_SIZE 0x1000 |
#define | TCG2_DEFAULT_MAX_RESPONSE_SIZE 0x1000 |
#define | TCG_EVENT_LOG_AREA_COUNT_MAX 2 |
#define | COLUME_SIZE (16 * 2) |
Typedefs | |
typedef struct _TCG_DXE_DATA | TCG_DXE_DATA |
Functions | |
EFI_STATUS | MeasurePeImageAndExtend (IN UINT32 PCRIndex, IN EFI_PHYSICAL_ADDRESS ImageAddress, IN UINTN ImageSize, OUT TPML_DIGEST_VALUES *DigestList) |
VOID | InternalDumpData (IN UINT8 *Data, IN UINTN Size) |
VOID | InitNoActionEvent (IN OUT TCG_PCR_EVENT2_HDR *NoActionEvent, IN UINT32 EventSize) |
VOID | InternalDumpHex (IN UINT8 *Data, IN UINTN Size) |
EFI_STATUS | GetProcessorsCpuLocation (OUT EFI_CPU_PHYSICAL_LOCATION **LocationBuf, OUT UINTN *Num) |
EFI_STATUS EFIAPI | Tcg2GetCapability (IN EFI_TCG2_PROTOCOL *This, IN OUT EFI_TCG2_BOOT_SERVICE_CAPABILITY *ProtocolCapability) |
VOID | DumpEvent (IN TCG_PCR_EVENT_HDR *EventHdr) |
VOID | DumpTcgEfiSpecIdEventStruct (IN TCG_EfiSpecIDEventStruct *TcgEfiSpecIdEventStruct) |
UINTN | GetTcgEfiSpecIdEventStructSize (IN TCG_EfiSpecIDEventStruct *TcgEfiSpecIdEventStruct) |
VOID | DumpEvent2 (IN TCG_PCR_EVENT2 *TcgPcrEvent2) |
UINTN | GetPcrEvent2Size (IN TCG_PCR_EVENT2 *TcgPcrEvent2) |
VOID | DumpEventLog (IN EFI_TCG2_EVENT_LOG_FORMAT EventLogFormat, IN EFI_PHYSICAL_ADDRESS EventLogLocation, IN EFI_PHYSICAL_ADDRESS EventLogLastEntry, IN EFI_TCG2_FINAL_EVENTS_TABLE *FinalEventsTable) |
EFI_STATUS EFIAPI | Tcg2GetEventLog (IN EFI_TCG2_PROTOCOL *This, IN EFI_TCG2_EVENT_LOG_FORMAT EventLogFormat, OUT EFI_PHYSICAL_ADDRESS *EventLogLocation, OUT EFI_PHYSICAL_ADDRESS *EventLogLastEntry, OUT BOOLEAN *EventLogTruncated) |
BOOLEAN | Is800155Event (IN VOID *NewEventHdr, IN UINT32 NewEventHdrSize, IN UINT8 *NewEventData, IN UINT32 NewEventSize) |
EFI_STATUS | TcgCommLogEvent (IN OUT TCG_EVENT_LOG_AREA_STRUCT *EventLogAreaStruct, IN VOID *NewEventHdr, IN UINT32 NewEventHdrSize, IN UINT8 *NewEventData, IN UINT32 NewEventSize) |
EFI_STATUS | TcgDxeLogEvent (IN EFI_TCG2_EVENT_LOG_FORMAT EventLogFormat, IN VOID *NewEventHdr, IN UINT32 NewEventHdrSize, IN UINT8 *NewEventData, IN UINT32 NewEventSize) |
UINT32 | GetDigestListBinSize (IN VOID *DigestListBin) |
VOID * | CopyDigestListBinToBuffer (IN OUT VOID *Buffer, IN VOID *DigestListBin, IN UINT32 HashAlgorithmMask, OUT UINT32 *HashAlgorithmMaskCopied) |
EFI_STATUS | TcgDxeLogHashEvent (IN TPML_DIGEST_VALUES *DigestList, IN OUT TCG_PCR_EVENT_HDR *NewEventHdr, IN UINT8 *NewEventData) |
EFI_STATUS | TcgDxeHashLogExtendEvent (IN UINT64 Flags, IN UINT8 *HashData, IN UINT64 HashDataLen, IN OUT TCG_PCR_EVENT_HDR *NewEventHdr, IN UINT8 *NewEventData) |
EFI_STATUS EFIAPI | Tcg2HashLogExtendEvent (IN EFI_TCG2_PROTOCOL *This, IN UINT64 Flags, IN EFI_PHYSICAL_ADDRESS DataToHash, IN UINT64 DataToHashLen, IN EFI_TCG2_EVENT *Event) |
EFI_STATUS EFIAPI | Tcg2SubmitCommand (IN EFI_TCG2_PROTOCOL *This, IN UINT32 InputParameterBlockSize, IN UINT8 *InputParameterBlock, IN UINT32 OutputParameterBlockSize, IN UINT8 *OutputParameterBlock) |
EFI_STATUS EFIAPI | Tcg2GetActivePCRBanks (IN EFI_TCG2_PROTOCOL *This, OUT UINT32 *ActivePcrBanks) |
EFI_STATUS EFIAPI | Tcg2SetActivePCRBanks (IN EFI_TCG2_PROTOCOL *This, IN UINT32 ActivePcrBanks) |
EFI_STATUS EFIAPI | Tcg2GetResultOfSetActivePcrBanks (IN EFI_TCG2_PROTOCOL *This, OUT UINT32 *OperationPresent, OUT UINT32 *Response) |
EFI_STATUS | SetupEventLog (VOID) |
EFI_STATUS | TcgMeasureAction (IN TPM_PCRINDEX PCRIndex, IN CHAR8 *String) |
EFI_STATUS | MeasureHandoffTables (VOID) |
EFI_STATUS | MeasureSeparatorEvent (IN TPM_PCRINDEX PCRIndex) |
EFI_STATUS | MeasureVariable (IN TPM_PCRINDEX PCRIndex, IN TCG_EVENTTYPE EventType, IN CHAR16 *VarName, IN EFI_GUID *VendorGuid, IN VOID *VarData, IN UINTN VarSize) |
EFI_STATUS | ReadAndMeasureVariable (IN TPM_PCRINDEX PCRIndex, IN TCG_EVENTTYPE EventType, IN CHAR16 *VarName, IN EFI_GUID *VendorGuid, OUT UINTN *VarSize, OUT VOID **VarData) |
EFI_STATUS | ReadAndMeasureBootVariable (IN CHAR16 *VarName, IN EFI_GUID *VendorGuid, OUT UINTN *VarSize, OUT VOID **VarData) |
EFI_STATUS | ReadAndMeasureSecureVariable (IN CHAR16 *VarName, IN EFI_GUID *VendorGuid, OUT UINTN *VarSize, OUT VOID **VarData) |
EFI_STATUS | MeasureAllBootVariables (VOID) |
EFI_STATUS | MeasureAllSecureVariables (VOID) |
EFI_STATUS | MeasureLaunchOfFirmwareDebugger (VOID) |
VOID EFIAPI | MeasureSecureBootPolicy (IN EFI_EVENT Event, IN VOID *Context) |
VOID EFIAPI | OnReadyToBoot (IN EFI_EVENT Event, IN VOID *Context) |
VOID EFIAPI | OnExitBootServices (IN EFI_EVENT Event, IN VOID *Context) |
VOID EFIAPI | OnExitBootServicesFailed (IN EFI_EVENT Event, IN VOID *Context) |
VOID EFIAPI | ShutdownTpmOnReset (IN EFI_RESET_TYPE ResetType, IN EFI_STATUS ResetStatus, IN UINTN DataSize, IN VOID *ResetData OPTIONAL) |
VOID EFIAPI | OnResetNotificationInstall (IN EFI_EVENT Event, IN VOID *Context) |
EFI_STATUS | InstallTcg2 (VOID) |
EFI_STATUS EFIAPI | DriverEntry (IN EFI_HANDLE ImageHandle, IN EFI_SYSTEM_TABLE *SystemTable) |
Variables | |
TCG2_EVENT_INFO_STRUCT | mTcg2EventInfo [] |
TCG_DXE_DATA | mTcgDxeData |
UINTN | mBootAttempts = 0 |
CHAR16 | mBootVarName [] = L"BootOrder" |
VARIABLE_TYPE | mVariableType [] |
EFI_HANDLE | mImageHandle |
EFI_TCG2_PROTOCOL | mTcg2Protocol |
This module implements Tcg2 Protocol.
Copyright (c) 2015 - 2024, Intel Corporation. All rights reserved.
(C) Copyright 2016 Hewlett Packard Enterprise Development LP
SPDX-License-Identifier: BSD-2-Clause-Patent
Definition in file Tcg2Dxe.c.
VOID * CopyDigestListBinToBuffer | ( | IN OUT VOID * | Buffer, |
IN VOID * | DigestListBin, | ||
IN UINT32 | HashAlgorithmMask, | ||
OUT UINT32 * | HashAlgorithmMaskCopied | ||
) |
Copy TPML_DIGEST_VALUES compact binary into a buffer
[in,out] | Buffer | Buffer to hold copied TPML_DIGEST_VALUES compact binary. |
[in] | DigestListBin | TPML_DIGEST_VALUES compact binary buffer. |
[in] | HashAlgorithmMask | HASH bits corresponding to the desired digests to copy. |
[out] | HashAlgorithmMaskCopied | Pointer to HASH bits corresponding to the digests copied. |
EFI_STATUS EFIAPI DriverEntry | ( | IN EFI_HANDLE | ImageHandle, |
IN EFI_SYSTEM_TABLE * | SystemTable | ||
) |
The driver's entry point. It publishes EFI Tcg2 Protocol.
[in] | ImageHandle | The firmware allocated handle for the EFI image. |
[in] | SystemTable | A pointer to the EFI System Table. |
EFI_SUCCESS | The entry point is executed successfully. |
other | Some error occurs when executing this entry point. |
VOID DumpEvent | ( | IN TCG_PCR_EVENT_HDR * | EventHdr | ) |
VOID DumpEvent2 | ( | IN TCG_PCR_EVENT2 * | TcgPcrEvent2 | ) |
VOID DumpEventLog | ( | IN EFI_TCG2_EVENT_LOG_FORMAT | EventLogFormat, |
IN EFI_PHYSICAL_ADDRESS | EventLogLocation, | ||
IN EFI_PHYSICAL_ADDRESS | EventLogLastEntry, | ||
IN EFI_TCG2_FINAL_EVENTS_TABLE * | FinalEventsTable | ||
) |
This function dump event log.
[in] | EventLogFormat | The type of the event log for which the information is requested. |
[in] | EventLogLocation | A pointer to the memory address of the event log. |
[in] | EventLogLastEntry | If the Event Log contains more than one entry, this is a pointer to the address of the start of the last entry in the event log in memory. |
[in] | FinalEventsTable | A pointer to the memory address of the final event table. |
VOID DumpTcgEfiSpecIdEventStruct | ( | IN TCG_EfiSpecIDEventStruct * | TcgEfiSpecIdEventStruct | ) |
This function dump TCG_EfiSpecIDEventStruct.
[in] | TcgEfiSpecIdEventStruct | A pointer to TCG_EfiSpecIDEventStruct. |
UINT32 GetDigestListBinSize | ( | IN VOID * | DigestListBin | ) |
Get TPML_DIGEST_VALUES compact binary buffer size.
[in] | DigestListBin | TPML_DIGEST_VALUES compact binary buffer. |
UINTN GetPcrEvent2Size | ( | IN TCG_PCR_EVENT2 * | TcgPcrEvent2 | ) |
EFI_STATUS GetProcessorsCpuLocation | ( | OUT EFI_CPU_PHYSICAL_LOCATION ** | LocationBuf, |
OUT UINTN * | Num | ||
) |
Get All processors EFI_CPU_LOCATION in system. LocationBuf is allocated inside the function Caller is responsible to free LocationBuf.
[out] | LocationBuf | Returns Processor Location Buffer. |
[out] | Num | Returns processor number. |
EFI_SUCCESS | Operation completed successfully. |
EFI_UNSUPPORTED | MpService protocol not found. |
UINTN GetTcgEfiSpecIdEventStructSize | ( | IN TCG_EfiSpecIDEventStruct * | TcgEfiSpecIdEventStruct | ) |
This function get size of TCG_EfiSpecIDEventStruct.
[in] | TcgEfiSpecIdEventStruct | A pointer to TCG_EfiSpecIDEventStruct. |
VOID InitNoActionEvent | ( | IN OUT TCG_PCR_EVENT2_HDR * | NoActionEvent, |
IN UINT32 | EventSize | ||
) |
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
[in,out] | NoActionEvent | Event Header of EV_NO_ACTION Event |
[in] | EventSize | Event Size of the EV_NO_ACTION Event |
EFI_STATUS InstallTcg2 | ( | VOID | ) |
BOOLEAN Is800155Event | ( | IN VOID * | NewEventHdr, |
IN UINT32 | NewEventHdrSize, | ||
IN UINT8 * | NewEventData, | ||
IN UINT32 | NewEventSize | ||
) |
Return if this is a Tcg800155PlatformIdEvent.
[in] | NewEventHdr | Pointer to a TCG_PCR_EVENT_HDR/TCG_PCR_EVENT_EX data structure. |
[in] | NewEventHdrSize | New event header size. |
[in] | NewEventData | Pointer to the new event data. |
[in] | NewEventSize | New event data size. |
TRUE | This is a Tcg800155PlatformIdEvent. |
FALSE | This is NOT a Tcg800155PlatformIdEvent. |
EFI_STATUS MeasureAllBootVariables | ( | VOID | ) |
Measure and log all EFI boot variables, and extend the measurement result into a specific PCR.
The EFI boot variables are BootOrder and Boot#### variables.
EFI_SUCCESS | Operation completed successfully. |
EFI_OUT_OF_RESOURCES | Out of memory. |
EFI_DEVICE_ERROR | The operation was unsuccessful. |
EFI_STATUS MeasureAllSecureVariables | ( | VOID | ) |
Measure and log all EFI Secure variables, and extend the measurement result into a specific PCR.
The EFI boot variables are BootOrder and Boot#### variables.
EFI_SUCCESS | Operation completed successfully. |
EFI_OUT_OF_RESOURCES | Out of memory. |
EFI_DEVICE_ERROR | The operation was unsuccessful. |
EFI_STATUS MeasureHandoffTables | ( | VOID | ) |
EFI_STATUS MeasureLaunchOfFirmwareDebugger | ( | VOID | ) |
EFI_STATUS MeasurePeImageAndExtend | ( | IN UINT32 | PCRIndex, |
IN EFI_PHYSICAL_ADDRESS | ImageAddress, | ||
IN UINTN | ImageSize, | ||
OUT TPML_DIGEST_VALUES * | DigestList | ||
) |
Measure PE image into TPM log based on the authenticode image hashing in PE/COFF Specification 8.0 Appendix A.
Caution: This function may receive untrusted input. PE/COFF image is external input, so this function will validate its data structure within this image buffer before use.
Notes: PE/COFF image is checked by BasePeCoffLib PeCoffLoaderGetImageInfo().
[in] | PCRIndex | TPM PCR index |
[in] | ImageAddress | Start address of image buffer. |
[in] | ImageSize | Image size |
[out] | DigestList | Digest list of this image. |
EFI_SUCCESS | Successfully measure image. |
EFI_OUT_OF_RESOURCES | No enough resource to measure image. |
other | error value |
Measure PE image into TPM log based on the authenticode image hashing in PE/COFF Specification 8.0 Appendix A.
Caution: This function may receive untrusted input. PE/COFF image is external input, so this function will validate its data structure within this image buffer before use.
Notes: PE/COFF image is checked by BasePeCoffLib PeCoffLoaderGetImageInfo().
[in] | RtmrIndex | Rtmr index |
[in] | ImageAddress | Start address of image buffer. |
[in] | ImageSize | Image size |
[out] | DigestList | Digest list of this image. |
EFI_SUCCESS | Successfully measure image. |
EFI_OUT_OF_RESOURCES | No enough resource to measure image. |
other | error value |
Definition at line 95 of file MeasureBootPeCoff.c.
Measure and log all Secure Boot Policy, and extend the measurement result into a specific PCR.
Platform firmware adhering to the policy must therefore measure the following values into PCR[7]: (in order listed)
NOTE: Because of the above, UEFI variables PK, KEK, EFI_IMAGE_SECURITY_DATABASE, EFI_IMAGE_SECURITY_DATABASE1 and SecureBoot SHALL NOT be measured into PCR[3].
[in] | Event | Event whose notification function is being invoked |
[in] | Context | Pointer to the notification function's context |
EFI_STATUS MeasureSeparatorEvent | ( | IN TPM_PCRINDEX | PCRIndex | ) |
EFI_STATUS MeasureVariable | ( | IN TPM_PCRINDEX | PCRIndex, |
IN TCG_EVENTTYPE | EventType, | ||
IN CHAR16 * | VarName, | ||
IN EFI_GUID * | VendorGuid, | ||
IN VOID * | VarData, | ||
IN UINTN | VarSize | ||
) |
Measure and log an EFI variable, and extend the measurement result into a specific PCR.
[in] | PCRIndex | PCR Index. |
[in] | EventType | Event type. |
[in] | VarName | A Null-terminated string that is the name of the vendor's variable. |
[in] | VendorGuid | A unique identifier for the vendor. |
[in] | VarData | The content of the variable data. |
[in] | VarSize | The size of the variable data. |
EFI_SUCCESS | Operation completed successfully. |
EFI_OUT_OF_RESOURCES | Out of memory. |
EFI_DEVICE_ERROR | The operation was unsuccessful. |
Hook the system reset to properly shutdown TPM. It follow chapter "12.2.3 Startup State" in Trusted Platform Module Library Part 1: Architecture, Revision 01.16.
[in] | Event | Event whose notification function is being invoked |
[in] | Context | Pointer to the notification function's context |
EFI_STATUS ReadAndMeasureBootVariable | ( | IN CHAR16 * | VarName, |
IN EFI_GUID * | VendorGuid, | ||
OUT UINTN * | VarSize, | ||
OUT VOID ** | VarData | ||
) |
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
[in] | VarName | A Null-terminated string that is the name of the vendor's variable. |
[in] | VendorGuid | A unique identifier for the vendor. |
[out] | VarSize | The size of the variable data. |
[out] | VarData | Pointer to the content of the variable. |
EFI_SUCCESS | Operation completed successfully. |
EFI_OUT_OF_RESOURCES | Out of memory. |
EFI_DEVICE_ERROR | The operation was unsuccessful. |
EFI_STATUS ReadAndMeasureSecureVariable | ( | IN CHAR16 * | VarName, |
IN EFI_GUID * | VendorGuid, | ||
OUT UINTN * | VarSize, | ||
OUT VOID ** | VarData | ||
) |
Read then Measure and log an EFI Secure variable, and extend the measurement result into PCR[7].
[in] | VarName | A Null-terminated string that is the name of the vendor's variable. |
[in] | VendorGuid | A unique identifier for the vendor. |
[out] | VarSize | The size of the variable data. |
[out] | VarData | Pointer to the content of the variable. |
EFI_SUCCESS | Operation completed successfully. |
EFI_OUT_OF_RESOURCES | Out of memory. |
EFI_DEVICE_ERROR | The operation was unsuccessful. |
EFI_STATUS ReadAndMeasureVariable | ( | IN TPM_PCRINDEX | PCRIndex, |
IN TCG_EVENTTYPE | EventType, | ||
IN CHAR16 * | VarName, | ||
IN EFI_GUID * | VendorGuid, | ||
OUT UINTN * | VarSize, | ||
OUT VOID ** | VarData | ||
) |
Read then Measure and log an EFI variable, and extend the measurement result into a specific PCR.
[in] | PCRIndex | PCR Index. |
[in] | EventType | Event type. |
[in] | VarName | A Null-terminated string that is the name of the vendor's variable. |
[in] | VendorGuid | A unique identifier for the vendor. |
[out] | VarSize | The size of the variable data. |
[out] | VarData | Pointer to the content of the variable. |
EFI_SUCCESS | Operation completed successfully. |
EFI_OUT_OF_RESOURCES | Out of memory. |
EFI_DEVICE_ERROR | The operation was unsuccessful. |
EFI_STATUS SetupEventLog | ( | VOID | ) |
VOID EFIAPI ShutdownTpmOnReset | ( | IN EFI_RESET_TYPE | ResetType, |
IN EFI_STATUS | ResetStatus, | ||
IN UINTN | DataSize, | ||
IN VOID *ResetData | OPTIONAL | ||
) |
This routine is called to properly shutdown the TPM before system reset. It follow chapter "12.2.3 Startup State" in Trusted Platform Module Library Part 1: Architecture, Revision 01.16.
[in] | ResetType | The type of reset to perform. |
[in] | ResetStatus | The status code for the reset. |
[in] | DataSize | The size, in bytes, of ResetData. |
[in] | ResetData | For a ResetType of EfiResetCold, EfiResetWarm, or EfiResetShutdown the data buffer starts with a Null-terminated string, optionally followed by additional binary data. The string is a description that the caller may use to further indicate the reason for the system reset. For a ResetType of EfiResetPlatformSpecific the data buffer also starts with a Null-terminated string that is followed by an EFI_GUID that describes the specific type of reset to perform. |
EFI_STATUS EFIAPI Tcg2GetActivePCRBanks | ( | IN EFI_TCG2_PROTOCOL * | This, |
OUT UINT32 * | ActivePcrBanks | ||
) |
This service returns the currently active PCR banks.
[in] | This | Indicates the calling context |
[out] | ActivePcrBanks | Pointer to the variable receiving the bitmap of currently active PCR banks. |
EFI_SUCCESS | The bitmap of active PCR banks was stored in the ActivePcrBanks parameter. |
EFI_INVALID_PARAMETER | One or more of the parameters are incorrect. |
EFI_STATUS EFIAPI Tcg2GetCapability | ( | IN EFI_TCG2_PROTOCOL * | This, |
IN OUT EFI_TCG2_BOOT_SERVICE_CAPABILITY * | ProtocolCapability | ||
) |
The EFI_TCG2_PROTOCOL GetCapability function call provides protocol capability information and state information.
[in] | This | Indicates the calling context |
[in,out] | ProtocolCapability | The caller allocates memory for a EFI_TCG2_BOOT_SERVICE_CAPABILITY structure and sets the size field to the size of the structure allocated. The callee fills in the fields with the EFI protocol capability information and the current EFI TCG2 state information up to the number of fields which fit within the size of the structure passed in. |
EFI_SUCCESS | Operation completed successfully. |
EFI_DEVICE_ERROR | The command was unsuccessful. The ProtocolCapability variable will not be populated. |
EFI_INVALID_PARAMETER | One or more of the parameters are incorrect. The ProtocolCapability variable will not be populated. |
EFI_BUFFER_TOO_SMALL | The ProtocolCapability variable is too small to hold the full response. It will be partially populated (required Size field will be set). |
EFI_STATUS EFIAPI Tcg2GetEventLog | ( | IN EFI_TCG2_PROTOCOL * | This, |
IN EFI_TCG2_EVENT_LOG_FORMAT | EventLogFormat, | ||
OUT EFI_PHYSICAL_ADDRESS * | EventLogLocation, | ||
OUT EFI_PHYSICAL_ADDRESS * | EventLogLastEntry, | ||
OUT BOOLEAN * | EventLogTruncated | ||
) |
The EFI_TCG2_PROTOCOL Get Event Log function call allows a caller to retrieve the address of a given event log and its last entry.
[in] | This | Indicates the calling context |
[in] | EventLogFormat | The type of the event log for which the information is requested. |
[out] | EventLogLocation | A pointer to the memory address of the event log. |
[out] | EventLogLastEntry | If the Event Log contains more than one entry, this is a pointer to the address of the start of the last entry in the event log in memory. |
[out] | EventLogTruncated | If the Event Log is missing at least one entry because an event would have exceeded the area allocated for events, this value is set to TRUE. Otherwise, the value will be FALSE and the Event Log will be complete. |
EFI_SUCCESS | Operation completed successfully. |
EFI_INVALID_PARAMETER | One or more of the parameters are incorrect (e.g. asking for an event log whose format is not supported). |
EFI_STATUS EFIAPI Tcg2GetResultOfSetActivePcrBanks | ( | IN EFI_TCG2_PROTOCOL * | This, |
OUT UINT32 * | OperationPresent, | ||
OUT UINT32 * | Response | ||
) |
This service retrieves the result of a previous invocation of SetActivePcrBanks.
[in] | This | Indicates the calling context |
[out] | OperationPresent | Non-zero value to indicate a SetActivePcrBank operation was invoked during the last boot. |
[out] | Response | The response from the SetActivePcrBank request. |
EFI_SUCCESS | The result value could be returned. |
EFI_INVALID_PARAMETER | One or more of the parameters are incorrect. |
EFI_STATUS EFIAPI Tcg2HashLogExtendEvent | ( | IN EFI_TCG2_PROTOCOL * | This, |
IN UINT64 | Flags, | ||
IN EFI_PHYSICAL_ADDRESS | DataToHash, | ||
IN UINT64 | DataToHashLen, | ||
IN EFI_TCG2_EVENT * | Event | ||
) |
The EFI_TCG2_PROTOCOL HashLogExtendEvent function call provides callers with an opportunity to extend and optionally log events without requiring knowledge of actual TPM commands. The extend operation will occur even if this function cannot create an event log entry (e.g. due to the event log being full).
[in] | This | Indicates the calling context |
[in] | Flags | Bitmap providing additional information. |
[in] | DataToHash | Physical address of the start of the data buffer to be hashed. |
[in] | DataToHashLen | The length in bytes of the buffer referenced by DataToHash. |
[in] | Event | Pointer to data buffer containing information about the event. |
EFI_SUCCESS | Operation completed successfully. |
EFI_DEVICE_ERROR | The command was unsuccessful. |
EFI_VOLUME_FULL | The extend operation occurred, but the event could not be written to one or more event logs. |
EFI_INVALID_PARAMETER | One or more of the parameters are incorrect. |
EFI_UNSUPPORTED | The PE/COFF image type is not supported. |
EFI_STATUS EFIAPI Tcg2SetActivePCRBanks | ( | IN EFI_TCG2_PROTOCOL * | This, |
IN UINT32 | ActivePcrBanks | ||
) |
This service sets the currently active PCR banks.
[in] | This | Indicates the calling context |
[in] | ActivePcrBanks | Bitmap of the requested active PCR banks. At least one bit SHALL be set. |
EFI_SUCCESS | The bitmap in ActivePcrBank parameter is already active. |
EFI_INVALID_PARAMETER | One or more of the parameters are incorrect. |
EFI_STATUS EFIAPI Tcg2SubmitCommand | ( | IN EFI_TCG2_PROTOCOL * | This, |
IN UINT32 | InputParameterBlockSize, | ||
IN UINT8 * | InputParameterBlock, | ||
IN UINT32 | OutputParameterBlockSize, | ||
IN UINT8 * | OutputParameterBlock | ||
) |
This service enables the sending of commands to the TPM.
[in] | This | Indicates the calling context |
[in] | InputParameterBlockSize | Size of the TPM input parameter block. |
[in] | InputParameterBlock | Pointer to the TPM input parameter block. |
[in] | OutputParameterBlockSize | Size of the TPM output parameter block. |
[in] | OutputParameterBlock | Pointer to the TPM output parameter block. |
EFI_SUCCESS | The command byte stream was successfully sent to the device and a response was successfully received. |
EFI_DEVICE_ERROR | The command was not successfully sent to the device or a response was not successfully received from the device. |
EFI_INVALID_PARAMETER | One or more of the parameters are incorrect. |
EFI_BUFFER_TOO_SMALL | The output parameter block is too small. |
EFI_STATUS TcgCommLogEvent | ( | IN OUT TCG_EVENT_LOG_AREA_STRUCT * | EventLogAreaStruct, |
IN VOID * | NewEventHdr, | ||
IN UINT32 | NewEventHdrSize, | ||
IN UINT8 * | NewEventData, | ||
IN UINT32 | NewEventSize | ||
) |
Add a new entry to the Event Log.
[in,out] | EventLogAreaStruct | The event log area data structure |
[in] | NewEventHdr | Pointer to a TCG_PCR_EVENT_HDR/TCG_PCR_EVENT_EX data structure. |
[in] | NewEventHdrSize | New event header size. |
[in] | NewEventData | Pointer to the new event data. |
[in] | NewEventSize | New event data size. |
EFI_SUCCESS | The new event log entry was added. |
EFI_OUT_OF_RESOURCES | No enough memory to log the new event. |
EFI_STATUS TcgDxeHashLogExtendEvent | ( | IN UINT64 | Flags, |
IN UINT8 * | HashData, | ||
IN UINT64 | HashDataLen, | ||
IN OUT TCG_PCR_EVENT_HDR * | NewEventHdr, | ||
IN UINT8 * | NewEventData | ||
) |
Do a hash operation on a data buffer, extend a specific TPM PCR with the hash result, and add an entry to the Event Log.
[in] | Flags | Bitmap providing additional information. |
[in] | HashData | Physical address of the start of the data buffer to be hashed, extended, and logged. |
[in] | HashDataLen | The length, in bytes, of the buffer referenced by HashData |
[in,out] | NewEventHdr | Pointer to a TCG_PCR_EVENT_HDR data structure. |
[in] | NewEventData | Pointer to the new event data. |
EFI_SUCCESS | Operation completed successfully. |
EFI_OUT_OF_RESOURCES | No enough memory to log the new event. |
EFI_DEVICE_ERROR | The command was unsuccessful. |
EFI_STATUS TcgDxeLogEvent | ( | IN EFI_TCG2_EVENT_LOG_FORMAT | EventLogFormat, |
IN VOID * | NewEventHdr, | ||
IN UINT32 | NewEventHdrSize, | ||
IN UINT8 * | NewEventData, | ||
IN UINT32 | NewEventSize | ||
) |
Add a new entry to the Event Log.
[in] | EventLogFormat | The type of the event log for which the information is requested. |
[in] | NewEventHdr | Pointer to a TCG_PCR_EVENT_HDR/TCG_PCR_EVENT_EX data structure. |
[in] | NewEventHdrSize | New event header size. |
[in] | NewEventData | Pointer to the new event data. |
[in] | NewEventSize | New event data size. |
EFI_SUCCESS | The new event log entry was added. |
EFI_OUT_OF_RESOURCES | No enough memory to log the new event. |
EFI_STATUS TcgDxeLogHashEvent | ( | IN TPML_DIGEST_VALUES * | DigestList, |
IN OUT TCG_PCR_EVENT_HDR * | NewEventHdr, | ||
IN UINT8 * | NewEventData | ||
) |
Add a new entry to the Event Log.
[in] | DigestList | A list of digest. |
[in,out] | NewEventHdr | Pointer to a TCG_PCR_EVENT_HDR data structure. |
[in] | NewEventData | Pointer to the new event data. |
EFI_SUCCESS | The new event log entry was added. |
EFI_OUT_OF_RESOURCES | No enough memory to log the new event. |
EFI_STATUS TcgMeasureAction | ( | IN TPM_PCRINDEX | PCRIndex, |
IN CHAR8 * | String | ||
) |
Measure and log an action string, and extend the measurement result into PCR[PCRIndex].
[in] | PCRIndex | PCRIndex to extend |
[in] | String | A specific string that indicates an Action event. |
EFI_SUCCESS | Operation completed successfully. |
EFI_DEVICE_ERROR | The operation was unsuccessful. |
EFI_HANDLE mImageHandle |
TCG2_EVENT_INFO_STRUCT mTcg2EventInfo[] |
EFI_TCG2_PROTOCOL mTcg2Protocol |
TCG_DXE_DATA mTcgDxeData |
VARIABLE_TYPE mVariableType[] |