Defines | |
#define | PERF_ID_TREE_DXE 0x3120 |
#define | EFI_TCG_LOG_AREA_SIZE 0x10000 |
#define | TREE_DEFAULT_MAX_COMMAND_SIZE 0x1000 |
#define | TREE_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 | InternalDumpHex (IN UINT8 *Data, IN UINTN Size) |
EFI_STATUS | GetProcessorsCpuLocation (OUT EFI_CPU_PHYSICAL_LOCATION **LocationBuf, OUT UINTN *Num) |
EFI_STATUS EFIAPI | TreeGetCapability (IN EFI_TREE_PROTOCOL *This, IN OUT TREE_BOOT_SERVICE_CAPABILITY *ProtocolCapability) |
VOID | DumpEventLog (IN TREE_EVENT_LOG_FORMAT EventLogFormat, IN EFI_PHYSICAL_ADDRESS EventLogLocation, IN EFI_PHYSICAL_ADDRESS EventLogLastEntry) |
EFI_STATUS EFIAPI | TreeGetEventLog (IN EFI_TREE_PROTOCOL *This, IN TREE_EVENT_LOG_FORMAT EventLogFormat, OUT EFI_PHYSICAL_ADDRESS *EventLogLocation, OUT EFI_PHYSICAL_ADDRESS *EventLogLastEntry, OUT BOOLEAN *EventLogTruncated) |
EFI_STATUS | TcgCommLogEvent (IN OUT UINT8 **EventLogPtr, IN OUT UINTN *LogSize, IN UINTN MaxSize, IN VOID *NewEventHdr, IN UINT32 NewEventHdrSize, IN UINT8 *NewEventData, IN UINT32 NewEventSize) |
EFI_STATUS | TcgDxeLogEvent (IN TREE_EVENT_LOG_FORMAT EventLogFormat, IN VOID *NewEventHdr, IN UINT32 NewEventHdrSize, IN UINT8 *NewEventData, IN UINT32 NewEventSize) |
EFI_STATUS | Tpm2GetDigestFromDigestList (IN TPMI_ALG_HASH HashAlg, IN TPML_DIGEST_VALUES *DigestList, IN VOID *Digest) |
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 | TreeHashLogExtendEvent (IN EFI_TREE_PROTOCOL *This, IN UINT64 Flags, IN EFI_PHYSICAL_ADDRESS DataToHash, IN UINT64 DataToHashLen, IN TrEE_EVENT *Event) |
EFI_STATUS EFIAPI | TreeSubmitCommand (IN EFI_TREE_PROTOCOL *This, IN UINT32 InputParameterBlockSize, IN UINT8 *InputParameterBlock, IN UINT32 OutputParameterBlockSize, IN UINT8 *OutputParameterBlock) |
EFI_STATUS | SetupEventLog (VOID) |
EFI_STATUS | TcgMeasureAction (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 | InstallAcpiTable (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) |
EFI_STATUS | InstallTrEE (VOID) |
EFI_STATUS EFIAPI | DriverEntry (IN EFI_HANDLE ImageHandle, IN EFI_SYSTEM_TABLE *SystemTable) |
Variables | |
TREE_EVENT_INFO_STRUCT | mTreeEventInfo [] |
EFI_TCG_CLIENT_ACPI_TABLE | mTcgClientAcpiTemplate |
EFI_TCG_SERVER_ACPI_TABLE | mTcgServerAcpiTemplate |
TCG_DXE_DATA | mTcgDxeData |
UINTN | mBootAttempts = 0 |
CHAR16 | mBootVarName [] = L"BootOrder" |
VARIABLE_TYPE | mVariableType [] |
EFI_HANDLE | mImageHandle |
EFI_TREE_PROTOCOL | mTreeProtocol |
Copyright (c) 2013 - 2015, Intel Corporation. All rights reserved.
This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD License which accompanies this distribution. The full text of the license may be found at http://opensource.org/licenses/bsd-license.php
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
#define COLUME_SIZE (16 * 2) |
#define EFI_TCG_LOG_AREA_SIZE 0x10000 |
#define PERF_ID_TREE_DXE 0x3120 |
Referenced by OnReadyToBoot().
#define TCG_EVENT_LOG_AREA_COUNT_MAX 2 |
#define TREE_DEFAULT_MAX_COMMAND_SIZE 0x1000 |
#define TREE_DEFAULT_MAX_RESPONSE_SIZE 0x1000 |
typedef struct _TCG_DXE_DATA TCG_DXE_DATA |
EFI_STATUS EFIAPI DriverEntry | ( | IN EFI_HANDLE | ImageHandle, | |
IN EFI_SYSTEM_TABLE * | SystemTable | |||
) |
The driver's entry point. It publishes EFI TrEE 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. |
References EFI_STATUS(), gEfiTpmDeviceInstanceNoneGuid, gEfiTpmDeviceInstanceTpm12Guid, gTpmErrorHobGuid, InstallAcpiTable(), InstallTrEE(), MeasureSecureBootPolicy(), OnExitBootServices(), OnExitBootServicesFailed(), OnReadyToBoot(), SetupEventLog(), Tpm2GetCapabilityFirmwareVersion(), Tpm2GetCapabilityManufactureID(), Tpm2GetCapabilityMaxCommandResponseSize(), Tpm2GetCapabilityPcrs(), Tpm2RequestUseTpm(), and UINTN().
VOID DumpEventLog | ( | IN TREE_EVENT_LOG_FORMAT | EventLogFormat, | |
IN EFI_PHYSICAL_ADDRESS | EventLogLocation, | |||
IN EFI_PHYSICAL_ADDRESS | EventLogLastEntry | |||
) |
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. |
References InternalDumpHex(), and UINTN().
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. |
References EFI_STATUS(), and UINTN().
VOID EFIAPI InstallAcpiTable | ( | IN EFI_EVENT | Event, | |
IN VOID * | Context | |||
) |
Install TCG ACPI Table when ACPI Table Protocol is available.
A system's firmware uses an ACPI table to identify the system's TCG capabilities to the Post-Boot environment. The information in this ACPI table is not guaranteed to be valid until the Host Platform transitions from pre-boot state to post-boot state.
[in] | Event | Event whose notification function is being invoked |
[in] | Context | Pointer to the notification function's context |
References EFI_STATUS(), mTcgClientAcpiTemplate, TCG_PLATFORM_TYPE_CLIENT, and UINTN().
EFI_STATUS InstallTrEE | ( | VOID | ) |
The function install TrEE protocol.
EFI_SUCCESS | TrEE protocol is installed. | |
other | Some error occurs. |
References EFI_STATUS().
Referenced by DriverEntry().
VOID InternalDumpData | ( | IN UINT8 * | Data, | |
IN UINTN | Size | |||
) |
VOID InternalDumpHex | ( | IN UINT8 * | Data, | |
IN UINTN | Size | |||
) |
This function dump raw data with colume format.
Data | raw data | |
Size | raw data size |
References COLUME_SIZE, InternalDumpData(), and UINTN().
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. |
References EFI_STATUS(), ReadAndMeasureBootVariable(), and UINTN().
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. |
References EFI_STATUS(), ReadAndMeasureSecureVariable(), and UINTN().
EFI_STATUS MeasureHandoffTables | ( | VOID | ) |
Measure and log EFI handoff tables, and extend the measurement result into PCR[1].
EFI_SUCCESS | Operation completed successfully. | |
EFI_DEVICE_ERROR | The operation was unsuccessful. |
References EFI_STATUS(), GetProcessorsCpuLocation(), TCG_PLATFORM_TYPE_SERVER, TcgDxeHashLogExtendEvent(), and UINTN().
EFI_STATUS MeasureLaunchOfFirmwareDebugger | ( | VOID | ) |
Measure and log launch of FirmwareDebugger, and extend the measurement result into a specific PCR.
EFI_SUCCESS | Operation completed successfully. | |
EFI_OUT_OF_RESOURCES | Out of memory. | |
EFI_DEVICE_ERROR | The operation was unsuccessful. |
References TcgDxeHashLogExtendEvent().
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.
[in] | PCRIndex | TPM PCR index |
[in] | ImageAddress | Start address of image buffer. |
[in] | ImageSize | Image size |
[out] | DigestList | Digeest list of this image. |
EFI_SUCCESS | Successfully measure image. | |
EFI_OUT_OF_RESOURCES | No enough resource to measure image. | |
other | error value |
References EFI_STATUS(), HashCompleteAndExtend(), HashStart(), HashUpdate(), and UINTN().
VOID EFIAPI MeasureSecureBootPolicy | ( | IN EFI_EVENT | Event, | |
IN VOID * | Context | |||
) |
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 |
References EFI_STATUS(), MeasureAllSecureVariables(), MeasureLaunchOfFirmwareDebugger(), and MeasureSeparatorEvent().
EFI_STATUS MeasureSeparatorEvent | ( | IN TPM_PCRINDEX | PCRIndex | ) |
Measure and log Separator event, and extend the measurement result into a specific PCR.
[in] | PCRIndex | PCR index. |
EFI_SUCCESS | Operation completed successfully. | |
EFI_DEVICE_ERROR | The operation was unsuccessful. |
References TcgDxeHashLogExtendEvent().
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. |
References EFI_STATUS(), TcgDxeHashLogExtendEvent(), and UINTN().
VOID EFIAPI OnExitBootServices | ( | IN EFI_EVENT | Event, | |
IN VOID * | Context | |||
) |
Exit Boot Services Event notification handler.
Measure invocation and success of ExitBootServices.
[in] | Event | Event whose notification function is being invoked |
[in] | Context | Pointer to the notification function's context |
References EFI_STATUS(), and TcgMeasureAction().
VOID EFIAPI OnExitBootServicesFailed | ( | IN EFI_EVENT | Event, | |
IN VOID * | Context | |||
) |
Exit Boot Services Failed Event notification handler.
Measure Failure of ExitBootServices.
[in] | Event | Event whose notification function is being invoked |
[in] | Context | Pointer to the notification function's context |
References EFI_STATUS(), and TcgMeasureAction().
VOID EFIAPI OnReadyToBoot | ( | IN EFI_EVENT | Event, | |
IN VOID * | Context | |||
) |
Ready to Boot Event notification handler.
Sequence of OS boot events is measured in this event notification handler.
[in] | Event | Event whose notification function is being invoked |
[in] | Context | Pointer to the notification function's context |
References EFI_STATUS(), MeasureAllBootVariables(), MeasureHandoffTables(), MeasureSeparatorEvent(), PERF_ID_TREE_DXE, and TcgMeasureAction().
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[5].
[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. |
References ReadAndMeasureVariable().
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. |
References ReadAndMeasureVariable().
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. |
References EFI_STATUS(), and MeasureVariable().
EFI_STATUS SetupEventLog | ( | VOID | ) |
Initialize the Event Log and log events passed from the PEI phase.
EFI_SUCCESS | Operation completed successfully. | |
EFI_OUT_OF_RESOURCES | Out of memory. |
References EFI_STATUS(), EFI_TCG_LOG_AREA_SIZE, mTcgClientAcpiTemplate, mTreeEventInfo, TCG_PLATFORM_TYPE_CLIENT, TcgDxeLogEvent(), and UINTN().
EFI_STATUS TcgCommLogEvent | ( | IN OUT UINT8 ** | EventLogPtr, | |
IN OUT UINTN * | LogSize, | |||
IN UINTN | MaxSize, | |||
IN VOID * | NewEventHdr, | |||
IN UINT32 | NewEventHdrSize, | |||
IN UINT8 * | NewEventData, | |||
IN UINT32 | NewEventSize | |||
) |
Add a new entry to the Event Log.
[in,out] | EventLogPtr | Pointer to the Event Log data. |
[in,out] | LogSize | Size of the Event Log. |
[in] | MaxSize | Maximum size of the Event Log. |
[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. |
References UINTN().
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. |
References EFI_STATUS(), HashAndExtend(), TcgDxeLogHashEvent(), and UINTN().
EFI_STATUS TcgDxeLogEvent | ( | IN TREE_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. |
References EFI_STATUS(), mTreeEventInfo, TcgCommLogEvent(), TRUE, and UINTN().
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. |
References EFI_STATUS(), mTreeEventInfo, TcgDxeLogEvent(), Tpm2GetDigestFromDigestList(), and UINTN().
EFI_STATUS TcgMeasureAction | ( | IN CHAR8 * | String | ) |
Measure and log an action string, and extend the measurement result into PCR[5].
[in] | String | A specific string that indicates an Action event. |
EFI_SUCCESS | Operation completed successfully. | |
EFI_DEVICE_ERROR | The operation was unsuccessful. |
References TcgDxeHashLogExtendEvent().
EFI_STATUS Tpm2GetDigestFromDigestList | ( | IN TPMI_ALG_HASH | HashAlg, | |
IN TPML_DIGEST_VALUES * | DigestList, | |||
IN VOID * | Digest | |||
) |
This function get digest from digest list.
HashAlg | digest algorithm | |
DigestList | digest list | |
Digest | digest |
EFI_SUCCESS | Sha1Digest is found and returned. | |
EFI_NOT_FOUND | Sha1Digest is not found. |
References GetHashSizeFromAlgo(), and UINTN().
EFI_STATUS EFIAPI TreeGetCapability | ( | IN EFI_TREE_PROTOCOL * | This, | |
IN OUT TREE_BOOT_SERVICE_CAPABILITY * | ProtocolCapability | |||
) |
The EFI_TREE_PROTOCOL GetCapability function call provides protocol capability information and state information about the TrEE.
[in] | This | Indicates the calling context |
[in,out] | ProtocolCapability | The caller allocates memory for a TREE_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 TrEE 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 TreeGetEventLog | ( | IN EFI_TREE_PROTOCOL * | This, | |
IN TREE_EVENT_LOG_FORMAT | EventLogFormat, | |||
OUT EFI_PHYSICAL_ADDRESS * | EventLogLocation, | |||
OUT EFI_PHYSICAL_ADDRESS * | EventLogLastEntry, | |||
OUT BOOLEAN * | EventLogTruncated | |||
) |
The EFI_TREE_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). |
References DumpEventLog(), mTreeEventInfo, and UINTN().
EFI_STATUS EFIAPI TreeHashLogExtendEvent | ( | IN EFI_TREE_PROTOCOL * | This, | |
IN UINT64 | Flags, | |||
IN EFI_PHYSICAL_ADDRESS | DataToHash, | |||
IN UINT64 | DataToHashLen, | |||
IN TrEE_EVENT * | Event | |||
) |
The EFI_TREE_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. |
References EFI_STATUS(), MeasurePeImageAndExtend(), TcgDxeHashLogExtendEvent(), TcgDxeLogHashEvent(), and UINTN().
EFI_STATUS EFIAPI TreeSubmitCommand | ( | IN EFI_TREE_PROTOCOL * | This, | |
IN UINT32 | InputParameterBlockSize, | |||
IN UINT8 * | InputParameterBlock, | |||
IN UINT32 | OutputParameterBlockSize, | |||
IN UINT8 * | OutputParameterBlock | |||
) |
This service enables the sending of commands to the TrEE.
[in] | This | Indicates the calling context |
[in] | InputParameterBlockSize | Size of the TrEE input parameter block. |
[in] | InputParameterBlock | Pointer to the TrEE input parameter block. |
[in] | OutputParameterBlockSize | Size of the TrEE output parameter block. |
[in] | OutputParameterBlock | Pointer to the TrEE 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. |
References EFI_STATUS(), and Tpm2SubmitCommand().
UINTN mBootAttempts = 0 |
CHAR16 mBootVarName[] = L"BootOrder" |
EFI_HANDLE mImageHandle |
EFI_TCG_CLIENT_ACPI_TABLE mTcgClientAcpiTemplate |
Initial value:
{ { EFI_ACPI_3_0_TRUSTED_COMPUTING_PLATFORM_ALLIANCE_CAPABILITIES_TABLE_SIGNATURE, sizeof (mTcgClientAcpiTemplate), 0x02 }, 0, 0, (EFI_PHYSICAL_ADDRESS) (SIZE_4GB - 1) }
Initial value:
{ { sizeof (TREE_BOOT_SERVICE_CAPABILITY_1_0), { 1, 0 }, { 1, 0 }, TREE_BOOT_HASH_ALG_SHA1, TREE_EVENT_LOG_FORMAT_TCG_1_2, TRUE, TREE_DEFAULT_MAX_COMMAND_SIZE, TREE_DEFAULT_MAX_RESPONSE_SIZE, 0 }, &mTcgClientAcpiTemplate, &mTcgServerAcpiTemplate, }
EFI_TCG_SERVER_ACPI_TABLE mTcgServerAcpiTemplate |
TREE_EVENT_INFO_STRUCT mTreeEventInfo[] |
Initial value:
{ {&gTcgEventEntryHobGuid, TREE_EVENT_LOG_FORMAT_TCG_1_2}, }
Referenced by LogHashEvent(), SetupEventLog(), TcgDxeLogEvent(), TcgDxeLogHashEvent(), and TreeGetEventLog().
EFI_TREE_PROTOCOL mTreeProtocol |
Initial value:
VARIABLE_TYPE mVariableType[] |
Initial value:
{ {EFI_SECURE_BOOT_MODE_NAME, &gEfiGlobalVariableGuid}, {EFI_PLATFORM_KEY_NAME, &gEfiGlobalVariableGuid}, {EFI_KEY_EXCHANGE_KEY_NAME, &gEfiGlobalVariableGuid}, {EFI_IMAGE_SECURITY_DATABASE, &gEfiImageSecurityDatabaseGuid}, {EFI_IMAGE_SECURITY_DATABASE1, &gEfiImageSecurityDatabaseGuid}, }