iPXE
UefiTcgPlatform.h
Go to the documentation of this file.
1 /** @file
2  TCG EFI Platform Definition in TCG_EFI_Platform_1_20_Final and
3  TCG PC Client Platform Firmware Profile Specification, Revision 1.06
4 
5  Copyright (c) 2006 - 2024, Intel Corporation. All rights reserved.<BR>
6  SPDX-License-Identifier: BSD-2-Clause-Patent
7 
8 **/
9 
10 #ifndef __UEFI_TCG_PLATFORM_H__
11 #define __UEFI_TCG_PLATFORM_H__
12 
13 FILE_LICENCE ( BSD2_PATENT );
14 FILE_SECBOOT ( PERMITTED );
15 
18 #include <ipxe/efi/Uefi.h>
19 
20 //
21 // Standard event types
22 //
23 #define EV_PREBOOT_CERT ((TCG_EVENTTYPE) 0x00000000)
24 #define EV_POST_CODE ((TCG_EVENTTYPE) 0x00000001)
25 #define EV_NO_ACTION ((TCG_EVENTTYPE) 0x00000003)
26 #define EV_SEPARATOR ((TCG_EVENTTYPE) 0x00000004)
27 #define EV_ACTION ((TCG_EVENTTYPE) 0x00000005)
28 #define EV_EVENT_TAG ((TCG_EVENTTYPE) 0x00000006)
29 #define EV_S_CRTM_CONTENTS ((TCG_EVENTTYPE) 0x00000007)
30 #define EV_S_CRTM_VERSION ((TCG_EVENTTYPE) 0x00000008)
31 #define EV_CPU_MICROCODE ((TCG_EVENTTYPE) 0x00000009)
32 #define EV_PLATFORM_CONFIG_FLAGS ((TCG_EVENTTYPE) 0x0000000A)
33 #define EV_TABLE_OF_DEVICES ((TCG_EVENTTYPE) 0x0000000B)
34 #define EV_COMPACT_HASH ((TCG_EVENTTYPE) 0x0000000C)
35 #define EV_NONHOST_CODE ((TCG_EVENTTYPE) 0x0000000F)
36 #define EV_NONHOST_CONFIG ((TCG_EVENTTYPE) 0x00000010)
37 #define EV_NONHOST_INFO ((TCG_EVENTTYPE) 0x00000011)
38 #define EV_OMIT_BOOT_DEVICE_EVENTS ((TCG_EVENTTYPE) 0x00000012)
39 
40 //
41 // EFI specific event types
42 //
43 #define EV_EFI_EVENT_BASE ((TCG_EVENTTYPE) 0x80000000)
44 #define EV_EFI_VARIABLE_DRIVER_CONFIG (EV_EFI_EVENT_BASE + 1)
45 #define EV_EFI_VARIABLE_BOOT (EV_EFI_EVENT_BASE + 2)
46 #define EV_EFI_BOOT_SERVICES_APPLICATION (EV_EFI_EVENT_BASE + 3)
47 #define EV_EFI_BOOT_SERVICES_DRIVER (EV_EFI_EVENT_BASE + 4)
48 #define EV_EFI_RUNTIME_SERVICES_DRIVER (EV_EFI_EVENT_BASE + 5)
49 #define EV_EFI_GPT_EVENT (EV_EFI_EVENT_BASE + 6)
50 #define EV_EFI_ACTION (EV_EFI_EVENT_BASE + 7)
51 #define EV_EFI_PLATFORM_FIRMWARE_BLOB (EV_EFI_EVENT_BASE + 8)
52 #define EV_EFI_HANDOFF_TABLES (EV_EFI_EVENT_BASE + 9)
53 #define EV_EFI_PLATFORM_FIRMWARE_BLOB2 (EV_EFI_EVENT_BASE + 0xA)
54 #define EV_EFI_HANDOFF_TABLES2 (EV_EFI_EVENT_BASE + 0xB)
55 #define EV_EFI_HCRTM_EVENT (EV_EFI_EVENT_BASE + 0x10)
56 #define EV_EFI_VARIABLE_AUTHORITY (EV_EFI_EVENT_BASE + 0xE0)
57 #define EV_EFI_SPDM_FIRMWARE_BLOB (EV_EFI_EVENT_BASE + 0xE1)
58 #define EV_EFI_SPDM_FIRMWARE_CONFIG (EV_EFI_EVENT_BASE + 0xE2)
59 #define EV_EFI_SPDM_DEVICE_BLOB EV_EFI_SPDM_FIRMWARE_BLOB
60 #define EV_EFI_SPDM_DEVICE_CONFIG EV_EFI_SPDM_FIRMWARE_CONFIG
61 //
62 // The SPDM policy database for SPDM verification.
63 // It goes to PCR7
64 //
65 #define EV_EFI_SPDM_DEVICE_POLICY (EV_EFI_EVENT_BASE + 0xE3)
66 //
67 // The SPDM policy authority for SPDM verification for the signature
68 // of GET_MEASUREMENT or CHALLENGE_AUTH. It goes to PCR7.
69 //
70 #define EV_EFI_SPDM_DEVICE_AUTHORITY (EV_EFI_EVENT_BASE + 0xE4)
71 
72 #define EFI_CALLING_EFI_APPLICATION \
73  "Calling EFI Application from Boot Option"
74 #define EFI_RETURNING_FROM_EFI_APPLICATION \
75  "Returning from EFI Application from Boot Option"
76 #define EFI_EXIT_BOOT_SERVICES_INVOCATION \
77  "Exit Boot Services Invocation"
78 #define EFI_EXIT_BOOT_SERVICES_FAILED \
79  "Exit Boot Services Returned with Failure"
80 #define EFI_EXIT_BOOT_SERVICES_SUCCEEDED \
81  "Exit Boot Services Returned with Success"
82 
83 #define EV_POSTCODE_INFO_POST_CODE "POST CODE"
84 #define POST_CODE_STR_LEN (sizeof(EV_POSTCODE_INFO_POST_CODE) - 1)
85 
86 #define EV_POSTCODE_INFO_SMM_CODE "SMM CODE"
87 #define SMM_CODE_STR_LEN (sizeof(EV_POSTCODE_INFO_SMM_CODE) - 1)
88 
89 #define EV_POSTCODE_INFO_ACPI_DATA "ACPI DATA"
90 #define ACPI_DATA_LEN (sizeof(EV_POSTCODE_INFO_ACPI_DATA) - 1)
91 
92 #define EV_POSTCODE_INFO_BIS_CODE "BIS CODE"
93 #define BIS_CODE_LEN (sizeof(EV_POSTCODE_INFO_BIS_CODE) - 1)
94 
95 #define EV_POSTCODE_INFO_UEFI_PI "UEFI PI"
96 #define UEFI_PI_LEN (sizeof(EV_POSTCODE_INFO_UEFI_PI) - 1)
97 
98 #define EV_POSTCODE_INFO_OPROM "Embedded Option ROM"
99 #define OPROM_LEN (sizeof(EV_POSTCODE_INFO_OPROM) - 1)
100 
101 #define EV_POSTCODE_INFO_EMBEDDED_UEFI_DRIVER "Embedded UEFI Driver"
102 #define EMBEDDED_UEFI_DRIVER_LEN (sizeof(EV_POSTCODE_INFO_EMBEDDED_UEFI_DRIVER) - 1)
103 
104 #define FIRMWARE_DEBUGGER_EVENT_STRING "UEFI Debug Mode"
105 #define FIRMWARE_DEBUGGER_EVENT_STRING_LEN (sizeof(FIRMWARE_DEBUGGER_EVENT_STRING) - 1)
106 
107 //
108 // Set structure alignment to 1-byte
109 //
110 #pragma pack (1)
111 
115 ///
116 /// Event Log Entry Structure Definition
117 ///
118 typedef struct tdTCG_PCR_EVENT {
119  TCG_PCRINDEX PCRIndex; ///< PCRIndex event extended to
120  TCG_EVENTTYPE EventType; ///< TCG EFI event type
121  TCG_DIGEST Digest; ///< Value extended into PCRIndex
122  UINT32 EventSize; ///< Size of the event data
123  UINT8 Event[1]; ///< The event data
124 } TCG_PCR_EVENT;
125 
126 #define TSS_EVENT_DATA_MAX_SIZE 256
127 
128 ///
129 /// TCG_PCR_EVENT_HDR
130 ///
131 typedef struct tdTCG_PCR_EVENT_HDR {
137 
138 ///
139 /// EFI_PLATFORM_FIRMWARE_BLOB
140 ///
141 /// BlobLength should be of type UINTN but we use UINT64 here
142 /// because PEI is 32-bit while DXE is 64-bit on x64 platforms
143 ///
148 
149 ///
150 /// UEFI_PLATFORM_FIRMWARE_BLOB
151 ///
152 /// This structure is used in EV_EFI_PLATFORM_FIRMWARE_BLOB
153 /// event to facilitate the measurement of firmware volume.
154 ///
159 
160 ///
161 /// UEFI_PLATFORM_FIRMWARE_BLOB2
162 ///
163 /// This structure is used in EV_EFI_PLATFORM_FIRMWARE_BLOB2
164 /// event to facilitate the measurement of firmware volume.
165 ///
168  // UINT8 BlobDescription[BlobDescriptionSize];
169  // EFI_PHYSICAL_ADDRESS BlobBase;
170  // UINT64 BlobLength;
172 
173 ///
174 /// EFI_IMAGE_LOAD_EVENT
175 ///
176 /// This structure is used in EV_EFI_BOOT_SERVICES_APPLICATION,
177 /// EV_EFI_BOOT_SERVICES_DRIVER and EV_EFI_RUNTIME_SERVICES_DRIVER
178 ///
179 typedef struct tdEFI_IMAGE_LOAD_EVENT {
186 
187 ///
188 /// UEFI_IMAGE_LOAD_EVENT
189 ///
190 /// This structure is used in EV_EFI_BOOT_SERVICES_APPLICATION,
191 /// EV_EFI_BOOT_SERVICES_DRIVER and EV_EFI_RUNTIME_SERVICES_DRIVER
192 ///
193 typedef struct tdUEFI_IMAGE_LOAD_EVENT {
200 
201 ///
202 /// EFI_HANDOFF_TABLE_POINTERS
203 ///
204 /// This structure is used in EV_EFI_HANDOFF_TABLES event to facilitate
205 /// the measurement of given configuration tables.
206 ///
211 
212 ///
213 /// UEFI_HANDOFF_TABLE_POINTERS
214 ///
215 /// This structure is used in EV_EFI_HANDOFF_TABLES event to facilitate
216 /// the measurement of given configuration tables.
217 ///
222 
223 ///
224 /// UEFI_HANDOFF_TABLE_POINTERS2
225 ///
226 /// This structure is used in EV_EFI_HANDOFF_TABLES2 event to facilitate
227 /// the measurement of given configuration tables.
228 ///
231  // UINT8 TableDescription[TableDescriptionSize];
232  // UINT64 NumberOfTables;
233  // EFI_CONFIGURATION_TABLE TableEntry[1];
235 
236 ///
237 /// EFI_VARIABLE_DATA
238 ///
239 /// This structure serves as the header for measuring variables. The name of the
240 /// variable (in Unicode format) should immediately follow, then the variable
241 /// data.
242 /// This is defined in TCG EFI Platform Spec for TPM1.1 or 1.2 V1.22
243 ///
244 typedef struct tdEFI_VARIABLE_DATA {
249  INT8 VariableData[1]; ///< Driver or platform-specific data
251 
252 ///
253 /// UEFI_VARIABLE_DATA
254 ///
255 /// This structure serves as the header for measuring variables. The name of the
256 /// variable (in Unicode format) should immediately follow, then the variable
257 /// data.
258 /// This is defined in TCG PC Client Firmware Profile Spec 00.21
259 ///
260 typedef struct tdUEFI_VARIABLE_DATA {
265  INT8 VariableData[1]; ///< Driver or platform-specific data
267 
268 //
269 // For TrEE1.0 compatibility
270 //
271 typedef struct {
273  UINT64 UnicodeNameLength; // The TCG Definition used UINTN
274  UINT64 VariableDataLength; // The TCG Definition used UINTN
275  CHAR16 UnicodeName[1];
276  INT8 VariableData[1];
278 
279 typedef struct tdEFI_GPT_DATA {
283 } EFI_GPT_DATA;
284 
285 typedef struct tdUEFI_GPT_DATA {
289 } UEFI_GPT_DATA;
290 
291 #define TCG_DEVICE_SECURITY_EVENT_DATA_SIGNATURE "SPDM Device Sec"
292 #define TCG_DEVICE_SECURITY_EVENT_DATA_VERSION 1
293 
294 #define TCG_DEVICE_SECURITY_EVENT_DATA_DEVICE_TYPE_NULL 0
295 #define TCG_DEVICE_SECURITY_EVENT_DATA_DEVICE_TYPE_PCI 1
296 #define TCG_DEVICE_SECURITY_EVENT_DATA_DEVICE_TYPE_USB 2
297 
298 ///
299 /// TCG_DEVICE_SECURITY_EVENT_DATA_HEADER
300 /// This is the header of TCG_DEVICE_SECURITY_EVENT_DATA, which is
301 /// used in EV_EFI_SPDM_FIRMWARE_BLOB and EV_EFI_SPDM_FIRMWARE_CONFIG.
302 ///
303 typedef struct {
309  // SPDM_MEASUREMENT_BLOCK SpdmMeasurementBlock;
311 
312 #define TCG_DEVICE_SECURITY_EVENT_DATA_PCI_CONTEXT_VERSION 0
313 
314 ///
315 /// TCG_DEVICE_SECURITY_EVENT_DATA_PCI_CONTEXT
316 /// This is the PCI context data of TCG_DEVICE_SECURITY_EVENT_DATA, which is
317 /// used in EV_EFI_SPDM_FIRMWARE_BLOB and EV_EFI_SPDM_FIRMWARE_CONFIG.
318 ///
319 typedef struct {
325  UINT8 ClassCode[3];
329 
330 #define TCG_DEVICE_SECURITY_EVENT_DATA_USB_CONTEXT_VERSION 0
331 
332 ///
333 /// TCG_DEVICE_SECURITY_EVENT_DATA_USB_CONTEXT
334 /// This is the USB context data of TCG_DEVICE_SECURITY_EVENT_DATA, which is
335 /// used in EV_EFI_SPDM_FIRMWARE_BLOB and EV_EFI_SPDM_FIRMWARE_CONFIG.
336 ///
337 typedef struct {
340  // UINT8 DeviceDescriptor[DescLen];
341  // UINT8 BodDescriptor[DescLen];
342  // UINT8 ConfigurationDescriptor[DescLen][NumOfConfiguration];
344 
345 //
346 // Crypto Agile Log Entry Format
347 //
348 typedef struct tdTCG_PCR_EVENT2 {
355 
356 //
357 // TCG PCR Event2 Header
358 // Follow TCG EFI Protocol Spec 5.2 Crypto Agile Log Entry Format
359 //
360 typedef struct tdTCG_PCR_EVENT2_HDR {
366 
367 //
368 // Log Header Entry Data
369 //
370 typedef struct {
371  //
372  // TCG defined hashing algorithm ID.
373  //
375  //
376  // The size of the digest for the respective hashing algorithm.
377  //
380 
381 #define TCG_EfiSpecIDEventStruct_SIGNATURE_02 "Spec ID Event02"
382 #define TCG_EfiSpecIDEventStruct_SIGNATURE_03 "Spec ID Event03"
383 
384 #define TCG_EfiSpecIDEventStruct_SPEC_VERSION_MAJOR_TPM12 1
385 #define TCG_EfiSpecIDEventStruct_SPEC_VERSION_MINOR_TPM12 2
386 #define TCG_EfiSpecIDEventStruct_SPEC_ERRATA_TPM12 2
387 
388 #define TCG_EfiSpecIDEventStruct_SPEC_VERSION_MAJOR_TPM2 2
389 #define TCG_EfiSpecIDEventStruct_SPEC_VERSION_MINOR_TPM2 0
390 #define TCG_EfiSpecIDEventStruct_SPEC_ERRATA_TPM2 0
391 #define TCG_EfiSpecIDEventStruct_SPEC_ERRATA_TPM2_REV_105 105
392 #define TCG_EfiSpecIDEventStruct_SPEC_ERRATA_TPM2_REV_106 106
393 
394 typedef struct {
396  //
397  // The value for the Platform Class.
398  // The enumeration is defined in the TCG ACPI Specification Client Common Header.
399  //
401  //
402  // The TCG EFI Platform Specification minor version number this BIOS supports.
403  // Any BIOS supporting version (1.22) MUST set this value to 02h.
404  // Any BIOS supporting version (2.0) SHALL set this value to 0x00.
405  //
407  //
408  // The TCG EFI Platform Specification major version number this BIOS supports.
409  // Any BIOS supporting version (1.22) MUST set this value to 01h.
410  // Any BIOS supporting version (2.0) SHALL set this value to 0x02.
411  //
413  //
414  // The TCG EFI Platform Specification errata for this specification this BIOS supports.
415  // Any BIOS supporting version and errata (1.22) MUST set this value to 02h.
416  // Any BIOS supporting version and errata (2.0) SHALL set this value to 0x00.
417  //
419  //
420  // Specifies the size of the UINTN fields used in various data structures used in this specification.
421  // 0x01 indicates UINT32 and 0x02 indicates UINT64.
422  //
424  //
425  // This field is added in "Spec ID Event03".
426  // The number of hashing algorithms used in this event log (except the first event).
427  // All events in this event log use all hashing algorithms defined here.
428  //
429  // UINT32 numberOfAlgorithms;
430  //
431  // This field is added in "Spec ID Event03".
432  // An array of size numberOfAlgorithms of value pairs.
433  //
434  // TCG_EfiSpecIdEventAlgorithmSize digestSize[numberOfAlgorithms];
435  //
436  // Size in bytes of the VendorInfo field.
437  // Maximum value SHALL be FFh bytes.
438  //
439  // UINT8 vendorInfoSize;
440  //
441  // Provided for use by the BIOS implementer.
442  // The value might be used, for example, to provide more detailed information about the specific BIOS such as BIOS revision numbers, etc.
443  // The values within this field are not standardized and are implementer-specific.
444  // Platform-specific or -unique information SHALL NOT be provided in this field.
445  //
446  // UINT8 vendorInfo[vendorInfoSize];
448 
452  // UINT8 taggedEventData[taggedEventDataSize];
454 
455 #define TCG_Sp800_155_PlatformId_Event_SIGNATURE "SP800-155 Event"
456 #define TCG_Sp800_155_PlatformId_Event2_SIGNATURE "SP800-155 Event2"
457 #define TCG_Sp800_155_PlatformId_Event3_SIGNATURE "SP800-155 Event3"
458 
461  //
462  // Where Vendor ID is an integer defined
463  // at http://www.iana.org/assignments/enterprisenumbers
464  //
466  //
467  // 16-byte identifier of a given platform's static configuration of code
468  //
470  //
471  // Below structure is newly added in TCG_Sp800_155_PlatformId_Event2.
472  //
473  // UINT8 PlatformManufacturerStrSize;
474  // UINT8 PlatformManufacturerStr[PlatformManufacturerStrSize];
475  // UINT8 PlatformModelSize;
476  // UINT8 PlatformModel[PlatformModelSize];
477  // UINT8 PlatformVersionSize;
478  // UINT8 PlatformVersion[PlatformVersionSize];
479  // UINT8 FirmwareManufacturerStrSize;
480  // UINT8 FirmwareManufacturerStr[FirmwareManufacturerStrSize];
481  // UINT32 FirmwareManufacturerId;
482  // UINT8 FirmwareVersion;
483  // UINT8 FirmwareVersion[FirmwareVersionSize];
485 
488  //
489  // Where Vendor ID is an integer defined
490  // at http://www.iana.org/assignments/enterprisenumbers
491  //
493  //
494  // 16-byte identifier of a given platform's static configuration of code
495  //
497  // UINT8 PlatformManufacturerStrSize;
498  // UINT8 PlatformManufacturerStr[PlatformManufacturerStrSize];
499  // UINT8 PlatformModelSize;
500  // UINT8 PlatformModel[PlatformModelSize];
501  // UINT8 PlatformVersionSize;
502  // UINT8 PlatformVersion[PlatformVersionSize];
503  // UINT8 FirmwareManufacturerStrSize;
504  // UINT8 FirmwareManufacturerStr[FirmwareManufacturerStrSize];
505  // UINT32 FirmwareManufacturerId;
506  // UINT8 FirmwareVersion;
507  // UINT8 FirmwareVersion[FirmwareVersionSize];
508  //
509  // Below structure is newly added in TCG_Sp800_155_PlatformId_Event3
510  //
511  // UINT32 RimLocatorType;
512  // UINT32 RimLocatorLength;
513  // UINT8 RimLocator[RimLocatorLength];
514  // UINT32 PlatformCertLocatorType;
515  // UINT32 PlatformCertLocatorLength;
516  // UINT8 PlatformCertLocator[PlatformCertLocatorLength];
518 
519 /**
520  * TCG specifies a locator type with the following values
521  * 0 - Raw data in the locator itself.
522  * 1 - URI in rtf2396 format.
523  * 2 - local device path in EFI_DEVICE_PATH_PROTOCOL format.
524  * 3 - UEFI variable (16 byte EFI_GUID, then 00-terminated UCS2 string)
525 **/
526 #define TCG_LOCATOR_TYPE_RAW_DATA 0
527 #define TCG_LOCATOR_TYPE_URI 1
528 #define TCG_LOCATOR_TYPE_DEVICE_PATH 2
529 #define TCG_LOCATOR_TYPE_UEFI_VARIABLE 3
530 
531 #define TCG_EfiStartupLocalityEvent_SIGNATURE "StartupLocality"
532 
533 //
534 // The Locality Indicator which sent the TPM2_Startup command
535 //
536 #define LOCALITY_0_INDICATOR 0x00
537 #define LOCALITY_3_INDICATOR 0x03
538 
539 //
540 // Startup Locality Event
541 //
544  //
545  // The Locality Indicator which sent the TPM2_Startup command
546  //
549 
550 //
551 // Restore original structure alignment
552 //
553 #pragma pack ()
554 
555 //
556 // ======================================================================================================================
557 // Event Type PCR Event Log Usage
558 // ======================================================================================================================
559 // EV_EFI_SPDM_DEVICE_BLOB 2 SPDM_MEASUREMENT_BLOCK (subtype) MEASUREMENT from device
560 // EV_EFI_SPDM_DEVICE_CONFIG 3 SPDM_MEASUREMENT_BLOCK (subtype) MEASUREMENT from device
561 // EV_EFI_SPDM_DEVICE_BLOB 2 SPDM_MEASUREMENT_SUMMARY_HASH.TCB (subtype) SUMMARY_HASH from device
562 
563 // EV_EFI_SPDM_DEVICE_POLICY 7 UEFI_VARIABLE_DATA with EFI_SIGNATURE_LIST Provisioned device public cert.
564 // EV_EFI_SPDM_DEVICE_AUTHORITY 7 UEFI_VARIABLE_DATA with EFI_SIGNATURE_DATA CHALLENGE_AUTH signature verification
565 // ======================================================================================================================
566 //
567 
568 #define PCR_INDEX_FOR_SIGNATURE_DB 7
569 
570 #pragma pack(1)
571 
572 #define TCG_DEVICE_SECURITY_EVENT_DATA_VERSION_1 1
573 #define TCG_DEVICE_SECURITY_EVENT_DATA_VERSION_2 2
574 #define TCG_DEVICE_SECURITY_EVENT_DATA_SIGNATURE_2 "SPDM Device Sec2"
575 
576 typedef struct {
581  UINT32 Length; // Length in bytes for all following structures.
584  UINT32 SubHeaderLength; // Length in bytes of the sub header followed by.
585  UINT64 SubHeaderUID; // Universal identifier assigned by the event log creator. It can be used to bind two sub header structure together.
586  // UINT64 DevicePathLength;
587  // UINT8 DevicePath[DevicePathLength];
589 
590 #define TCG_DEVICE_SECURITY_EVENT_DATA_DEVICE_AUTH_STATE_SUCCESS 0
591 #define TCG_DEVICE_SECURITY_EVENT_DATA_DEVICE_AUTH_STATE_NO_AUTH 1
592 #define TCG_DEVICE_SECURITY_EVENT_DATA_DEVICE_AUTH_STATE_NO_BINDING 2
593 #define TCG_DEVICE_SECURITY_EVENT_DATA_DEVICE_AUTH_STATE_FAIL_NO_SIG 3
594 #define TCG_DEVICE_SECURITY_EVENT_DATA_DEVICE_AUTH_STATE_FAIL_INVALID 4
595 #define TCG_DEVICE_SECURITY_EVENT_DATA_DEVICE_AUTH_STATE_NO_SPDM 0xFF
596 
597 #define TCG_DEVICE_SECURITY_EVENT_DATA_DEVICE_SUB_HEADER_TYPE_SPDM_MEASUREMENT_BLOCK 0
598 #define TCG_DEVICE_SECURITY_EVENT_DATA_DEVICE_SUB_HEADER_TYPE_SPDM_CERT_CHAIN 1
599 
600 typedef struct {
605  // SPDM_MEASUREMENT_BLOCK SpdmMeasurementBlock;
607 
608 typedef struct {
613  // SPDM_CERT_CHAIN SpdmCertChain;
615 
616 typedef struct {
619  UINT8 Value[1];
621 
622 typedef union {
627 
628 typedef union {
632 
633 typedef struct {
638 
639 #pragma pack()
640 
641 //
642 // EventType:EV_NO_ACTION
643 // ======================================================================================================================
644 // NVIndex Name PCR/NvIndex Event Log Usage
645 // ======================================================================================================================
646 // NV_EXTEND_INDEX_FOR_INSTANCE 0x01C40200 NV_INDEX_INSTANCE_EVENT_LOG_STRUCT NV Extend Record for instance data (CertChain)
647 // NV_EXTEND_INDEX_FOR_DYNAMIC 0x01C40201 NV_INDEX_DYNAMIC_EVENT_LOG_STRUCT NV Extend Record for dynamic data (Nonce)
648 
649 // EVENT_LOG_INTEGRITY_NV_INDEX_EXIT_PM_AUTH 0x01C40202 EVENT_LOG_INTEGRITY_NV_INDEX_STRUCT Event Log Integrity for ExitPmAuth
650 // EVENT_LOG_INTEGRITY_NV_INDEX_READY_TO_BOOT 0x01C40203 EVENT_LOG_INTEGRITY_NV_INDEX_STRUCT Event Log Integrity for ReadyToBoot
651 // ======================================================================================================================
652 //
653 
654 #define TCG_NV_EXTEND_INDEX_FOR_INSTANCE 0x01C40200
655 #define TCG_NV_EXTEND_INDEX_FOR_DYNAMIC 0x01C40201
656 #define TCG_EVENT_LOG_INTEGRITY_NV_INDEX_EXIT_PM_AUTH 0x01C40202
657 #define TCG_EVENT_LOG_INTEGRITY_NV_INDEX_READY_TO_BOOT 0x01C40203
658 
659 #pragma pack(1)
660 
661 #define TCG_NV_EXTEND_INDEX_FOR_INSTANCE_SIGNATURE "NvIndexInstance"
662 #define TCG_NV_INDEX_INSTANCE_EVENT_LOG_STRUCT_VERSION 1
663 
664 typedef struct {
668  // TCG_DEVICE_SECURITY_EVENT_DATA2 Data;
670 
671 #define TCG_NV_EXTEND_INDEX_FOR_DYNAMIC_SIGNATURE "NvIndexDynamic "
672 #define TCG_NV_INDEX_DYNAMIC_EVENT_LOG_STRUCT_VERSION 1
673 
674 #define TCG_SPDM_CHALLENGE_DESCRIPTION "SPDM CHALLENGE"
675 #define TCG_SPDM_CHALLENGE_AUTH_DESCRIPTION "SPDM CHALLENGE_AUTH"
676 #define TCG_SPDM_GET_MEASUREMENTS_DESCRIPTION "SPDM GET_MEASUREMENTS"
677 #define TCG_SPDM_MEASUREMENTS_DESCRIPTION "SPDM MEASUREMENTS"
678 
679 typedef struct {
684  // UINT16 DescriptionSize;
685  // UINT8 Description[DescriptionSize];
686  // UINT16 DataSize;
687  // UINT8 Data[DataSize];
689 
690 typedef struct {
693  UINT8 Description[sizeof (TCG_SPDM_CHALLENGE_DESCRIPTION)];
695  UINT8 Data[32];
697 
698 typedef struct {
703  UINT8 Data[32];
705 
706 typedef struct {
711  UINT8 Data[32];
713 
714 typedef struct {
719  UINT8 Data[32];
721 
722 #pragma pack()
723 
724 #endif
EFI_CONFIGURATION_TABLE TableEntry[1]
Event Log Entry Structure Definition.
EFI_PHYSICAL_ADDRESS ImageLocationInMemory
struct tdUEFI_HANDOFF_TABLE_POINTERS2 UEFI_HANDOFF_TABLE_POINTERS2
UEFI_HANDOFF_TABLE_POINTERS2.
TCG_NV_INDEX_DYNAMIC_EVENT_LOG_STRUCT Header
EFI_PHYSICAL_ADDRESS BlobBase
EFI_CONFIGURATION_TABLE TableEntry[1]
EFI_DEVICE_PATH_PROTOCOL DevicePath[1]
UINT32_t Reserved[2]
Must be zero.
Definition: pxe_api.h:76
FILE_LICENCE(BSD2_PATENT)
128 bit buffer containing a unique identifier value.
Definition: Base.h:216
INT8 VariableData[1]
Driver or platform-specific data.
UEFI_VARIABLE_DATA.
FILE_SECBOOT(PERMITTED)
struct tdTCG_PCR_EVENT2 TCG_PCR_EVENT2
EFI_IMAGE_LOAD_EVENT.
TCG_DEVICE_SECURITY_EVENT_DATA_SUB_HEADER_OEM_MEASUREMENT OemMeasurement
GPT Partition Entry.
Definition: UefiGpt.h:89
unsigned int UINT32
Definition: ProcessorBind.h:99
#define TCG_SPDM_MEASUREMENTS_DESCRIPTION
EFI_PHYSICAL_ADDRESS BlobBase
unsigned short CHAR16
EFI_PLATFORM_FIRMWARE_BLOB.
TCG_DEVICE_SECURITY_EVENT_DATA_SUB_HEADER EventDataSubHeader
This protocol can be used on any device handle to obtain generic path/location information concerning...
Definition: DevicePath.h:46
EFI_PARTITION_TABLE_HEADER EfiPartitionHeader
UEFI_HANDOFF_TABLE_POINTERS.
unsigned char UINT8
UINT64 EFI_PHYSICAL_ADDRESS
64-bit physical memory address.
Definition: UefiBaseType.h:53
TCG_DEVICE_SECURITY_EVENT_DATA_USB_CONTEXT This is the USB context data of TCG_DEVICE_SECURITY_EVENT_...
struct tdEFI_IMAGE_LOAD_EVENT EFI_IMAGE_LOAD_EVENT
EFI_IMAGE_LOAD_EVENT.
struct tdEFI_PLATFORM_FIRMWARE_BLOB EFI_PLATFORM_FIRMWARE_BLOB
EFI_PLATFORM_FIRMWARE_BLOB.
GPT Partition Table Header.
Definition: UefiGpt.h:34
struct tdEFI_HANDOFF_TABLE_POINTERS EFI_HANDOFF_TABLE_POINTERS
EFI_HANDOFF_TABLE_POINTERS.
UINT32 EventSize
Size of the event data.
TCG_NV_INDEX_DYNAMIC_EVENT_LOG_STRUCT Header
TCG_EVENTTYPE EventType
TPM_PCRINDEX TCG_PCRINDEX
#define TCG_SPDM_CHALLENGE_DESCRIPTION
TCG_EVENTTYPE EventType
TCG_PCRINDEX PCRIndex
PCRIndex event extended to.
TCG_DEVICE_SECURITY_EVENT_DATA_PCI_CONTEXT Pci
UEFI_PLATFORM_FIRMWARE_BLOB2.
UEFI_PLATFORM_FIRMWARE_BLOB.
TCG_DEVICE_SECURITY_EVENT_DATA_SUB_HEADER_SPDM_MEASUREMENT_BLOCK SpdmMeasurementBlock
TCG_DIGEST Digest
Value extended into PCRIndex.
struct tdUEFI_HANDOFF_TABLE_POINTERS UEFI_HANDOFF_TABLE_POINTERS
UEFI_HANDOFF_TABLE_POINTERS.
struct tdTCG_PCClientTaggedEvent TCG_PCClientTaggedEvent
TCG_EVENTTYPE EventType
TCG EFI event type.
EFI_PARTITION_ENTRY Partitions[1]
EFI_DEVICE_PATH_PROTOCOL DevicePath[1]
TPM_DIGEST TCG_DIGEST
struct tdEFI_GPT_DATA EFI_GPT_DATA
unsigned short UINT16
struct tdUEFI_VARIABLE_DATA UEFI_VARIABLE_DATA
UEFI_VARIABLE_DATA.
TCG_PCRINDEX PCRIndex
TCG_DEVICE_SECURITY_EVENT_DATA_PCI_CONTEXT This is the PCI context data of TCG_DEVICE_SECURITY_EVENT_...
struct tdTCG_EfiStartupLocalityEvent TCG_EfiStartupLocalityEvent
struct tdUEFI_GPT_DATA UEFI_GPT_DATA
TCG_DEVICE_SECURITY_EVENT_DATA_USB_CONTEXT Usb
EFI_VARIABLE_DATA.
UINT8_t Signature[6]
Signature.
Definition: pxe_api.h:61
TCG_DEVICE_SECURITY_EVENT_DATA_HEADER2 EventDataHeader
TPML_DIGEST_VALUES Digest
TPM2.0 Specification data structures (Trusted Platform Module Library Specification,...
UEFI_IMAGE_LOAD_EVENT.
EFI_PARTITION_ENTRY Partitions[1]
Root include file for Mde Package UEFI, UEFI_APPLICATION type modules.
UINT64 UINTN
Unsigned value of native width.
#define TCG_SPDM_GET_MEASUREMENTS_DESCRIPTION
TCG_DEVICE_SECURITY_EVENT_DATA_DEVICE_CONTEXT DeviceContext
unsigned long long UINT64
Definition: ProcessorBind.h:97
struct tdTCG_Sp800_155_PlatformId_Event2 TCG_Sp800_155_PlatformId_Event2
TCG_DEVICE_SECURITY_EVENT_DATA_SUB_HEADER_SPDM_CERT_CHAIN SpdmCertChain
TPML_DIGEST_VALUES Digests
Part 2, section 5.4: TPM_DIGEST.
Definition: Tpm12.h:442
TCG_PCR_EVENT_HDR.
TPM Specification data structures (TCG TPM Specification Version 1.2 Revision 103) See http://trusted...
UINT32 TCG_EVENTTYPE
EFI_HANDOFF_TABLE_POINTERS.
struct tdTCG_PCR_EVENT2_HDR TCG_PCR_EVENT2_HDR
struct tdEFI_VARIABLE_DATA EFI_VARIABLE_DATA
EFI_VARIABLE_DATA.
INT8 VariableData[1]
Driver or platform-specific data.
struct tdTCG_PCR_EVENT_HDR TCG_PCR_EVENT_HDR
TCG_PCR_EVENT_HDR.
Contains a set of GUID/pointer pairs comprised of the ConfigurationTable field in the EFI System Tabl...
Definition: UefiSpec.h:2030
TCG_DEVICE_SECURITY_EVENT_DATA_HEADER This is the header of TCG_DEVICE_SECURITY_EVENT_DATA,...
EFI_PARTITION_TABLE_HEADER EfiPartitionHeader
EFI_PHYSICAL_ADDRESS ImageLocationInMemory
UINT32 TPM_PCRINDEX
Index to a PCR register.
Definition: Tpm12.h:136
#define TCG_SPDM_CHALLENGE_AUTH_DESCRIPTION
struct tdUEFI_IMAGE_LOAD_EVENT UEFI_IMAGE_LOAD_EVENT
UEFI_IMAGE_LOAD_EVENT.
struct tdTCG_Sp800_155_PlatformId_Event3 TCG_Sp800_155_PlatformId_Event3
UINT8 Event[1]
The event data.
u8 signature
CPU signature.
Definition: CIB_PRM.h:35
struct tdUEFI_PLATFORM_FIRMWARE_BLOB2 UEFI_PLATFORM_FIRMWARE_BLOB2
UEFI_PLATFORM_FIRMWARE_BLOB2.
struct tdUEFI_PLATFORM_FIRMWARE_BLOB UEFI_PLATFORM_FIRMWARE_BLOB
UEFI_PLATFORM_FIRMWARE_BLOB.
signed char INT8
UEFI_HANDOFF_TABLE_POINTERS2.
struct tdTCG_PCR_EVENT TCG_PCR_EVENT
Event Log Entry Structure Definition.
TCG_EVENTTYPE EventType