10#ifndef __UEFI_TCG_PLATFORM_H__
11#define __UEFI_TCG_PLATFORM_H__
20#define EV_PREBOOT_CERT ((TCG_EVENTTYPE) 0x00000000)
21#define EV_POST_CODE ((TCG_EVENTTYPE) 0x00000001)
22#define EV_NO_ACTION ((TCG_EVENTTYPE) 0x00000003)
23#define EV_SEPARATOR ((TCG_EVENTTYPE) 0x00000004)
24#define EV_ACTION ((TCG_EVENTTYPE) 0x00000005)
25#define EV_EVENT_TAG ((TCG_EVENTTYPE) 0x00000006)
26#define EV_S_CRTM_CONTENTS ((TCG_EVENTTYPE) 0x00000007)
27#define EV_S_CRTM_VERSION ((TCG_EVENTTYPE) 0x00000008)
28#define EV_CPU_MICROCODE ((TCG_EVENTTYPE) 0x00000009)
29#define EV_PLATFORM_CONFIG_FLAGS ((TCG_EVENTTYPE) 0x0000000A)
30#define EV_TABLE_OF_DEVICES ((TCG_EVENTTYPE) 0x0000000B)
31#define EV_COMPACT_HASH ((TCG_EVENTTYPE) 0x0000000C)
32#define EV_NONHOST_CODE ((TCG_EVENTTYPE) 0x0000000F)
33#define EV_NONHOST_CONFIG ((TCG_EVENTTYPE) 0x00000010)
34#define EV_NONHOST_INFO ((TCG_EVENTTYPE) 0x00000011)
35#define EV_OMIT_BOOT_DEVICE_EVENTS ((TCG_EVENTTYPE) 0x00000012)
40#define EV_EFI_EVENT_BASE ((TCG_EVENTTYPE) 0x80000000)
41#define EV_EFI_VARIABLE_DRIVER_CONFIG (EV_EFI_EVENT_BASE + 1)
42#define EV_EFI_VARIABLE_BOOT (EV_EFI_EVENT_BASE + 2)
43#define EV_EFI_BOOT_SERVICES_APPLICATION (EV_EFI_EVENT_BASE + 3)
44#define EV_EFI_BOOT_SERVICES_DRIVER (EV_EFI_EVENT_BASE + 4)
45#define EV_EFI_RUNTIME_SERVICES_DRIVER (EV_EFI_EVENT_BASE + 5)
46#define EV_EFI_GPT_EVENT (EV_EFI_EVENT_BASE + 6)
47#define EV_EFI_ACTION (EV_EFI_EVENT_BASE + 7)
48#define EV_EFI_PLATFORM_FIRMWARE_BLOB (EV_EFI_EVENT_BASE + 8)
49#define EV_EFI_HANDOFF_TABLES (EV_EFI_EVENT_BASE + 9)
50#define EV_EFI_PLATFORM_FIRMWARE_BLOB2 (EV_EFI_EVENT_BASE + 0xA)
51#define EV_EFI_HANDOFF_TABLES2 (EV_EFI_EVENT_BASE + 0xB)
52#define EV_EFI_HCRTM_EVENT (EV_EFI_EVENT_BASE + 0x10)
53#define EV_EFI_VARIABLE_AUTHORITY (EV_EFI_EVENT_BASE + 0xE0)
54#define EV_EFI_SPDM_FIRMWARE_BLOB (EV_EFI_EVENT_BASE + 0xE1)
55#define EV_EFI_SPDM_FIRMWARE_CONFIG (EV_EFI_EVENT_BASE + 0xE2)
56#define EV_EFI_SPDM_DEVICE_BLOB EV_EFI_SPDM_FIRMWARE_BLOB
57#define EV_EFI_SPDM_DEVICE_CONFIG EV_EFI_SPDM_FIRMWARE_CONFIG
62#define EV_EFI_SPDM_DEVICE_POLICY (EV_EFI_EVENT_BASE + 0xE3)
67#define EV_EFI_SPDM_DEVICE_AUTHORITY (EV_EFI_EVENT_BASE + 0xE4)
69#define EFI_CALLING_EFI_APPLICATION \
70 "Calling EFI Application from Boot Option"
71#define EFI_RETURNING_FROM_EFI_APPLICATION \
72 "Returning from EFI Application from Boot Option"
73#define EFI_EXIT_BOOT_SERVICES_INVOCATION \
74 "Exit Boot Services Invocation"
75#define EFI_EXIT_BOOT_SERVICES_FAILED \
76 "Exit Boot Services Returned with Failure"
77#define EFI_EXIT_BOOT_SERVICES_SUCCEEDED \
78 "Exit Boot Services Returned with Success"
80#define EV_POSTCODE_INFO_POST_CODE "POST CODE"
81#define POST_CODE_STR_LEN (sizeof(EV_POSTCODE_INFO_POST_CODE) - 1)
83#define EV_POSTCODE_INFO_SMM_CODE "SMM CODE"
84#define SMM_CODE_STR_LEN (sizeof(EV_POSTCODE_INFO_SMM_CODE) - 1)
86#define EV_POSTCODE_INFO_ACPI_DATA "ACPI DATA"
87#define ACPI_DATA_LEN (sizeof(EV_POSTCODE_INFO_ACPI_DATA) - 1)
89#define EV_POSTCODE_INFO_BIS_CODE "BIS CODE"
90#define BIS_CODE_LEN (sizeof(EV_POSTCODE_INFO_BIS_CODE) - 1)
92#define EV_POSTCODE_INFO_UEFI_PI "UEFI PI"
93#define UEFI_PI_LEN (sizeof(EV_POSTCODE_INFO_UEFI_PI) - 1)
95#define EV_POSTCODE_INFO_OPROM "Embedded Option ROM"
96#define OPROM_LEN (sizeof(EV_POSTCODE_INFO_OPROM) - 1)
98#define EV_POSTCODE_INFO_EMBEDDED_UEFI_DRIVER "Embedded UEFI Driver"
99#define EMBEDDED_UEFI_DRIVER_LEN (sizeof(EV_POSTCODE_INFO_EMBEDDED_UEFI_DRIVER) - 1)
101#define FIRMWARE_DEBUGGER_EVENT_STRING "UEFI Debug Mode"
102#define FIRMWARE_DEBUGGER_EVENT_STRING_LEN (sizeof(FIRMWARE_DEBUGGER_EVENT_STRING) - 1)
109typedef UINT32 TCG_EVENTTYPE;
123#define TSS_EVENT_DATA_MAX_SIZE 256
129 TCG_PCRINDEX PCRIndex;
130 TCG_EVENTTYPE EventType;
164 UINT8 BlobDescriptionSize;
178 UINTN ImageLengthInMemory;
179 UINTN ImageLinkTimeAddress;
180 UINTN LengthOfDevicePath;
192 UINT64 ImageLengthInMemory;
193 UINT64 ImageLinkTimeAddress;
194 UINT64 LengthOfDevicePath;
205 UINTN NumberOfTables;
216 UINT64 NumberOfTables;
227 UINT8 TableDescriptionSize;
243 UINTN UnicodeNameLength;
244 UINTN VariableDataLength;
245 CHAR16 UnicodeName[1];
259 UINT64 UnicodeNameLength;
260 UINT64 VariableDataLength;
261 CHAR16 UnicodeName[1];
270 UINT64 UnicodeNameLength;
271 UINT64 VariableDataLength;
272 CHAR16 UnicodeName[1];
273 INT8 VariableData[1];
278 UINTN NumberOfPartitions;
284 UINT64 NumberOfPartitions;
288#define TCG_DEVICE_SECURITY_EVENT_DATA_SIGNATURE "SPDM Device Sec"
289#define TCG_DEVICE_SECURITY_EVENT_DATA_VERSION 1
291#define TCG_DEVICE_SECURITY_EVENT_DATA_DEVICE_TYPE_NULL 0
292#define TCG_DEVICE_SECURITY_EVENT_DATA_DEVICE_TYPE_PCI 1
293#define TCG_DEVICE_SECURITY_EVENT_DATA_DEVICE_TYPE_USB 2
309#define TCG_DEVICE_SECURITY_EVENT_DATA_PCI_CONTEXT_VERSION 0
323 UINT16 SubsystemVendorID;
327#define TCG_DEVICE_SECURITY_EVENT_DATA_USB_CONTEXT_VERSION 0
346 TCG_PCRINDEX PCRIndex;
347 TCG_EVENTTYPE EventType;
358 TCG_PCRINDEX PCRIndex;
359 TCG_EVENTTYPE EventType;
378#define TCG_EfiSpecIDEventStruct_SIGNATURE_02 "Spec ID Event02"
379#define TCG_EfiSpecIDEventStruct_SIGNATURE_03 "Spec ID Event03"
381#define TCG_EfiSpecIDEventStruct_SPEC_VERSION_MAJOR_TPM12 1
382#define TCG_EfiSpecIDEventStruct_SPEC_VERSION_MINOR_TPM12 2
383#define TCG_EfiSpecIDEventStruct_SPEC_ERRATA_TPM12 2
385#define TCG_EfiSpecIDEventStruct_SPEC_VERSION_MAJOR_TPM2 2
386#define TCG_EfiSpecIDEventStruct_SPEC_VERSION_MINOR_TPM2 0
387#define TCG_EfiSpecIDEventStruct_SPEC_ERRATA_TPM2 0
388#define TCG_EfiSpecIDEventStruct_SPEC_ERRATA_TPM2_REV_105 105
389#define TCG_EfiSpecIDEventStruct_SPEC_ERRATA_TPM2_REV_106 106
397 UINT32 platformClass;
403 UINT8 specVersionMinor;
409 UINT8 specVersionMajor;
447 UINT32 taggedEventID;
448 UINT32 taggedEventDataSize;
452#define TCG_Sp800_155_PlatformId_Event_SIGNATURE "SP800-155 Event"
453#define TCG_Sp800_155_PlatformId_Event2_SIGNATURE "SP800-155 Event2"
454#define TCG_Sp800_155_PlatformId_Event3_SIGNATURE "SP800-155 Event3"
523#define TCG_LOCATOR_TYPE_RAW_DATA 0
524#define TCG_LOCATOR_TYPE_URI 1
525#define TCG_LOCATOR_TYPE_DEVICE_PATH 2
526#define TCG_LOCATOR_TYPE_UEFI_VARIABLE 3
528#define TCG_EfiStartupLocalityEvent_SIGNATURE "StartupLocality"
533#define LOCALITY_0_INDICATOR 0x00
534#define LOCALITY_3_INDICATOR 0x03
544 UINT8 StartupLocality;
565#define PCR_INDEX_FOR_SIGNATURE_DB 7
569#define TCG_DEVICE_SECURITY_EVENT_DATA_VERSION_1 1
570#define TCG_DEVICE_SECURITY_EVENT_DATA_VERSION_2 2
571#define TCG_DEVICE_SECURITY_EVENT_DATA_SIGNATURE_2 "SPDM Device Sec2"
580 UINT32 SubHeaderType;
581 UINT32 SubHeaderLength;
587#define TCG_DEVICE_SECURITY_EVENT_DATA_DEVICE_AUTH_STATE_SUCCESS 0
588#define TCG_DEVICE_SECURITY_EVENT_DATA_DEVICE_AUTH_STATE_NO_AUTH 1
589#define TCG_DEVICE_SECURITY_EVENT_DATA_DEVICE_AUTH_STATE_NO_BINDING 2
590#define TCG_DEVICE_SECURITY_EVENT_DATA_DEVICE_AUTH_STATE_FAIL_NO_SIG 3
591#define TCG_DEVICE_SECURITY_EVENT_DATA_DEVICE_AUTH_STATE_FAIL_INVALID 4
592#define TCG_DEVICE_SECURITY_EVENT_DATA_DEVICE_AUTH_STATE_NO_SPDM 0xFF
594#define TCG_DEVICE_SECURITY_EVENT_DATA_DEVICE_SUB_HEADER_TYPE_SPDM_MEASUREMENT_BLOCK 0
595#define TCG_DEVICE_SECURITY_EVENT_DATA_DEVICE_SUB_HEADER_TYPE_SPDM_CERT_CHAIN 1
599 UINT8 SpdmMeasurementBlockCount;
601 UINT32 SpdmMeasurementHashAlgo;
651#define TCG_NV_EXTEND_INDEX_FOR_INSTANCE 0x01C40200
652#define TCG_NV_EXTEND_INDEX_FOR_DYNAMIC 0x01C40201
653#define TCG_EVENT_LOG_INTEGRITY_NV_INDEX_EXIT_PM_AUTH 0x01C40202
654#define TCG_EVENT_LOG_INTEGRITY_NV_INDEX_READY_TO_BOOT 0x01C40203
658#define TCG_NV_EXTEND_INDEX_FOR_INSTANCE_SIGNATURE "NvIndexInstance"
659#define TCG_NV_INDEX_INSTANCE_EVENT_LOG_STRUCT_VERSION 1
668#define TCG_NV_EXTEND_INDEX_FOR_DYNAMIC_SIGNATURE "NvIndexDynamic "
669#define TCG_NV_INDEX_DYNAMIC_EVENT_LOG_STRUCT_VERSION 1
671#define TCG_SPDM_CHALLENGE_DESCRIPTION "SPDM CHALLENGE"
672#define TCG_SPDM_CHALLENGE_AUTH_DESCRIPTION "SPDM CHALLENGE_AUTH"
673#define TCG_SPDM_GET_MEASUREMENTS_DESCRIPTION "SPDM GET_MEASUREMENTS"
674#define TCG_SPDM_MEASUREMENTS_DESCRIPTION "SPDM MEASUREMENTS"
689 UINT16 DescriptionSize;
690 UINT8 Description[
sizeof (TCG_SPDM_CHALLENGE_DESCRIPTION)];
697 UINT16 DescriptionSize;
698 UINT8 Description[
sizeof (TCG_SPDM_CHALLENGE_AUTH_DESCRIPTION)];
705 UINT16 DescriptionSize;
706 UINT8 Description[
sizeof (TCG_SPDM_GET_MEASUREMENTS_DESCRIPTION)];
713 UINT16 DescriptionSize;
714 UINT8 Description[
sizeof (TCG_SPDM_MEASUREMENTS_DESCRIPTION)];
UINT64 EFI_PHYSICAL_ADDRESS
INT8 VariableData[1]
Driver or platform-specific data.
UINT8 Event[1]
The event data.
UINT32 EventSize
Size of the event data.
TCG_DIGEST Digest
Value extended into PCRIndex.
TCG_EVENTTYPE EventType
TCG EFI event type.
TCG_PCRINDEX PCRIndex
PCRIndex event extended to.
INT8 VariableData[1]
Driver or platform-specific data.