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 
17 #include <ipxe/efi/Uefi.h>
18 
19 //
20 // Standard event types
21 //
22 #define EV_PREBOOT_CERT ((TCG_EVENTTYPE) 0x00000000)
23 #define EV_POST_CODE ((TCG_EVENTTYPE) 0x00000001)
24 #define EV_NO_ACTION ((TCG_EVENTTYPE) 0x00000003)
25 #define EV_SEPARATOR ((TCG_EVENTTYPE) 0x00000004)
26 #define EV_ACTION ((TCG_EVENTTYPE) 0x00000005)
27 #define EV_EVENT_TAG ((TCG_EVENTTYPE) 0x00000006)
28 #define EV_S_CRTM_CONTENTS ((TCG_EVENTTYPE) 0x00000007)
29 #define EV_S_CRTM_VERSION ((TCG_EVENTTYPE) 0x00000008)
30 #define EV_CPU_MICROCODE ((TCG_EVENTTYPE) 0x00000009)
31 #define EV_PLATFORM_CONFIG_FLAGS ((TCG_EVENTTYPE) 0x0000000A)
32 #define EV_TABLE_OF_DEVICES ((TCG_EVENTTYPE) 0x0000000B)
33 #define EV_COMPACT_HASH ((TCG_EVENTTYPE) 0x0000000C)
34 #define EV_NONHOST_CODE ((TCG_EVENTTYPE) 0x0000000F)
35 #define EV_NONHOST_CONFIG ((TCG_EVENTTYPE) 0x00000010)
36 #define EV_NONHOST_INFO ((TCG_EVENTTYPE) 0x00000011)
37 #define EV_OMIT_BOOT_DEVICE_EVENTS ((TCG_EVENTTYPE) 0x00000012)
38 
39 //
40 // EFI specific event types
41 //
42 #define EV_EFI_EVENT_BASE ((TCG_EVENTTYPE) 0x80000000)
43 #define EV_EFI_VARIABLE_DRIVER_CONFIG (EV_EFI_EVENT_BASE + 1)
44 #define EV_EFI_VARIABLE_BOOT (EV_EFI_EVENT_BASE + 2)
45 #define EV_EFI_BOOT_SERVICES_APPLICATION (EV_EFI_EVENT_BASE + 3)
46 #define EV_EFI_BOOT_SERVICES_DRIVER (EV_EFI_EVENT_BASE + 4)
47 #define EV_EFI_RUNTIME_SERVICES_DRIVER (EV_EFI_EVENT_BASE + 5)
48 #define EV_EFI_GPT_EVENT (EV_EFI_EVENT_BASE + 6)
49 #define EV_EFI_ACTION (EV_EFI_EVENT_BASE + 7)
50 #define EV_EFI_PLATFORM_FIRMWARE_BLOB (EV_EFI_EVENT_BASE + 8)
51 #define EV_EFI_HANDOFF_TABLES (EV_EFI_EVENT_BASE + 9)
52 #define EV_EFI_PLATFORM_FIRMWARE_BLOB2 (EV_EFI_EVENT_BASE + 0xA)
53 #define EV_EFI_HANDOFF_TABLES2 (EV_EFI_EVENT_BASE + 0xB)
54 #define EV_EFI_HCRTM_EVENT (EV_EFI_EVENT_BASE + 0x10)
55 #define EV_EFI_VARIABLE_AUTHORITY (EV_EFI_EVENT_BASE + 0xE0)
56 #define EV_EFI_SPDM_FIRMWARE_BLOB (EV_EFI_EVENT_BASE + 0xE1)
57 #define EV_EFI_SPDM_FIRMWARE_CONFIG (EV_EFI_EVENT_BASE + 0xE2)
58 #define EV_EFI_SPDM_DEVICE_BLOB EV_EFI_SPDM_FIRMWARE_BLOB
59 #define EV_EFI_SPDM_DEVICE_CONFIG EV_EFI_SPDM_FIRMWARE_CONFIG
60 //
61 // The SPDM policy database for SPDM verification.
62 // It goes to PCR7
63 //
64 #define EV_EFI_SPDM_DEVICE_POLICY (EV_EFI_EVENT_BASE + 0xE3)
65 //
66 // The SPDM policy authority for SPDM verification for the signature
67 // of GET_MEASUREMENT or CHALLENGE_AUTH. It goes to PCR7.
68 //
69 #define EV_EFI_SPDM_DEVICE_AUTHORITY (EV_EFI_EVENT_BASE + 0xE4)
70 
71 #define EFI_CALLING_EFI_APPLICATION \
72  "Calling EFI Application from Boot Option"
73 #define EFI_RETURNING_FROM_EFI_APPLICATION \
74  "Returning from EFI Application from Boot Option"
75 #define EFI_EXIT_BOOT_SERVICES_INVOCATION \
76  "Exit Boot Services Invocation"
77 #define EFI_EXIT_BOOT_SERVICES_FAILED \
78  "Exit Boot Services Returned with Failure"
79 #define EFI_EXIT_BOOT_SERVICES_SUCCEEDED \
80  "Exit Boot Services Returned with Success"
81 
82 #define EV_POSTCODE_INFO_POST_CODE "POST CODE"
83 #define POST_CODE_STR_LEN (sizeof(EV_POSTCODE_INFO_POST_CODE) - 1)
84 
85 #define EV_POSTCODE_INFO_SMM_CODE "SMM CODE"
86 #define SMM_CODE_STR_LEN (sizeof(EV_POSTCODE_INFO_SMM_CODE) - 1)
87 
88 #define EV_POSTCODE_INFO_ACPI_DATA "ACPI DATA"
89 #define ACPI_DATA_LEN (sizeof(EV_POSTCODE_INFO_ACPI_DATA) - 1)
90 
91 #define EV_POSTCODE_INFO_BIS_CODE "BIS CODE"
92 #define BIS_CODE_LEN (sizeof(EV_POSTCODE_INFO_BIS_CODE) - 1)
93 
94 #define EV_POSTCODE_INFO_UEFI_PI "UEFI PI"
95 #define UEFI_PI_LEN (sizeof(EV_POSTCODE_INFO_UEFI_PI) - 1)
96 
97 #define EV_POSTCODE_INFO_OPROM "Embedded Option ROM"
98 #define OPROM_LEN (sizeof(EV_POSTCODE_INFO_OPROM) - 1)
99 
100 #define EV_POSTCODE_INFO_EMBEDDED_UEFI_DRIVER "Embedded UEFI Driver"
101 #define EMBEDDED_UEFI_DRIVER_LEN (sizeof(EV_POSTCODE_INFO_EMBEDDED_UEFI_DRIVER) - 1)
102 
103 #define FIRMWARE_DEBUGGER_EVENT_STRING "UEFI Debug Mode"
104 #define FIRMWARE_DEBUGGER_EVENT_STRING_LEN (sizeof(FIRMWARE_DEBUGGER_EVENT_STRING) - 1)
105 
106 //
107 // Set structure alignment to 1-byte
108 //
109 #pragma pack (1)
110 
114 ///
115 /// Event Log Entry Structure Definition
116 ///
117 typedef struct tdTCG_PCR_EVENT {
118  TCG_PCRINDEX PCRIndex; ///< PCRIndex event extended to
119  TCG_EVENTTYPE EventType; ///< TCG EFI event type
120  TCG_DIGEST Digest; ///< Value extended into PCRIndex
121  UINT32 EventSize; ///< Size of the event data
122  UINT8 Event[1]; ///< The event data
123 } TCG_PCR_EVENT;
124 
125 #define TSS_EVENT_DATA_MAX_SIZE 256
126 
127 ///
128 /// TCG_PCR_EVENT_HDR
129 ///
130 typedef struct tdTCG_PCR_EVENT_HDR {
136 
137 ///
138 /// EFI_PLATFORM_FIRMWARE_BLOB
139 ///
140 /// BlobLength should be of type UINTN but we use UINT64 here
141 /// because PEI is 32-bit while DXE is 64-bit on x64 platforms
142 ///
147 
148 ///
149 /// UEFI_PLATFORM_FIRMWARE_BLOB
150 ///
151 /// This structure is used in EV_EFI_PLATFORM_FIRMWARE_BLOB
152 /// event to facilitate the measurement of firmware volume.
153 ///
158 
159 ///
160 /// UEFI_PLATFORM_FIRMWARE_BLOB2
161 ///
162 /// This structure is used in EV_EFI_PLATFORM_FIRMWARE_BLOB2
163 /// event to facilitate the measurement of firmware volume.
164 ///
167  // UINT8 BlobDescription[BlobDescriptionSize];
168  // EFI_PHYSICAL_ADDRESS BlobBase;
169  // UINT64 BlobLength;
171 
172 ///
173 /// EFI_IMAGE_LOAD_EVENT
174 ///
175 /// This structure is used in EV_EFI_BOOT_SERVICES_APPLICATION,
176 /// EV_EFI_BOOT_SERVICES_DRIVER and EV_EFI_RUNTIME_SERVICES_DRIVER
177 ///
178 typedef struct tdEFI_IMAGE_LOAD_EVENT {
185 
186 ///
187 /// UEFI_IMAGE_LOAD_EVENT
188 ///
189 /// This structure is used in EV_EFI_BOOT_SERVICES_APPLICATION,
190 /// EV_EFI_BOOT_SERVICES_DRIVER and EV_EFI_RUNTIME_SERVICES_DRIVER
191 ///
192 typedef struct tdUEFI_IMAGE_LOAD_EVENT {
199 
200 ///
201 /// EFI_HANDOFF_TABLE_POINTERS
202 ///
203 /// This structure is used in EV_EFI_HANDOFF_TABLES event to facilitate
204 /// the measurement of given configuration tables.
205 ///
210 
211 ///
212 /// UEFI_HANDOFF_TABLE_POINTERS
213 ///
214 /// This structure is used in EV_EFI_HANDOFF_TABLES event to facilitate
215 /// the measurement of given configuration tables.
216 ///
221 
222 ///
223 /// UEFI_HANDOFF_TABLE_POINTERS2
224 ///
225 /// This structure is used in EV_EFI_HANDOFF_TABLES2 event to facilitate
226 /// the measurement of given configuration tables.
227 ///
230  // UINT8 TableDescription[TableDescriptionSize];
231  // UINT64 NumberOfTables;
232  // EFI_CONFIGURATION_TABLE TableEntry[1];
234 
235 ///
236 /// EFI_VARIABLE_DATA
237 ///
238 /// This structure serves as the header for measuring variables. The name of the
239 /// variable (in Unicode format) should immediately follow, then the variable
240 /// data.
241 /// This is defined in TCG EFI Platform Spec for TPM1.1 or 1.2 V1.22
242 ///
243 typedef struct tdEFI_VARIABLE_DATA {
248  INT8 VariableData[1]; ///< Driver or platform-specific data
250 
251 ///
252 /// UEFI_VARIABLE_DATA
253 ///
254 /// This structure serves as the header for measuring variables. The name of the
255 /// variable (in Unicode format) should immediately follow, then the variable
256 /// data.
257 /// This is defined in TCG PC Client Firmware Profile Spec 00.21
258 ///
259 typedef struct tdUEFI_VARIABLE_DATA {
264  INT8 VariableData[1]; ///< Driver or platform-specific data
266 
267 //
268 // For TrEE1.0 compatibility
269 //
270 typedef struct {
272  UINT64 UnicodeNameLength; // The TCG Definition used UINTN
273  UINT64 VariableDataLength; // The TCG Definition used UINTN
274  CHAR16 UnicodeName[1];
275  INT8 VariableData[1];
277 
278 typedef struct tdEFI_GPT_DATA {
282 } EFI_GPT_DATA;
283 
284 typedef struct tdUEFI_GPT_DATA {
288 } UEFI_GPT_DATA;
289 
290 #define TCG_DEVICE_SECURITY_EVENT_DATA_SIGNATURE "SPDM Device Sec"
291 #define TCG_DEVICE_SECURITY_EVENT_DATA_VERSION 1
292 
293 #define TCG_DEVICE_SECURITY_EVENT_DATA_DEVICE_TYPE_NULL 0
294 #define TCG_DEVICE_SECURITY_EVENT_DATA_DEVICE_TYPE_PCI 1
295 #define TCG_DEVICE_SECURITY_EVENT_DATA_DEVICE_TYPE_USB 2
296 
297 ///
298 /// TCG_DEVICE_SECURITY_EVENT_DATA_HEADER
299 /// This is the header of TCG_DEVICE_SECURITY_EVENT_DATA, which is
300 /// used in EV_EFI_SPDM_FIRMWARE_BLOB and EV_EFI_SPDM_FIRMWARE_CONFIG.
301 ///
302 typedef struct {
308  // SPDM_MEASUREMENT_BLOCK SpdmMeasurementBlock;
310 
311 #define TCG_DEVICE_SECURITY_EVENT_DATA_PCI_CONTEXT_VERSION 0
312 
313 ///
314 /// TCG_DEVICE_SECURITY_EVENT_DATA_PCI_CONTEXT
315 /// This is the PCI context data of TCG_DEVICE_SECURITY_EVENT_DATA, which is
316 /// used in EV_EFI_SPDM_FIRMWARE_BLOB and EV_EFI_SPDM_FIRMWARE_CONFIG.
317 ///
318 typedef struct {
324  UINT8 ClassCode[3];
328 
329 #define TCG_DEVICE_SECURITY_EVENT_DATA_USB_CONTEXT_VERSION 0
330 
331 ///
332 /// TCG_DEVICE_SECURITY_EVENT_DATA_USB_CONTEXT
333 /// This is the USB context data of TCG_DEVICE_SECURITY_EVENT_DATA, which is
334 /// used in EV_EFI_SPDM_FIRMWARE_BLOB and EV_EFI_SPDM_FIRMWARE_CONFIG.
335 ///
336 typedef struct {
339  // UINT8 DeviceDescriptor[DescLen];
340  // UINT8 BodDescriptor[DescLen];
341  // UINT8 ConfigurationDescriptor[DescLen][NumOfConfiguration];
343 
344 //
345 // Crypto Agile Log Entry Format
346 //
347 typedef struct tdTCG_PCR_EVENT2 {
354 
355 //
356 // TCG PCR Event2 Header
357 // Follow TCG EFI Protocol Spec 5.2 Crypto Agile Log Entry Format
358 //
359 typedef struct tdTCG_PCR_EVENT2_HDR {
365 
366 //
367 // Log Header Entry Data
368 //
369 typedef struct {
370  //
371  // TCG defined hashing algorithm ID.
372  //
374  //
375  // The size of the digest for the respective hashing algorithm.
376  //
379 
380 #define TCG_EfiSpecIDEventStruct_SIGNATURE_02 "Spec ID Event02"
381 #define TCG_EfiSpecIDEventStruct_SIGNATURE_03 "Spec ID Event03"
382 
383 #define TCG_EfiSpecIDEventStruct_SPEC_VERSION_MAJOR_TPM12 1
384 #define TCG_EfiSpecIDEventStruct_SPEC_VERSION_MINOR_TPM12 2
385 #define TCG_EfiSpecIDEventStruct_SPEC_ERRATA_TPM12 2
386 
387 #define TCG_EfiSpecIDEventStruct_SPEC_VERSION_MAJOR_TPM2 2
388 #define TCG_EfiSpecIDEventStruct_SPEC_VERSION_MINOR_TPM2 0
389 #define TCG_EfiSpecIDEventStruct_SPEC_ERRATA_TPM2 0
390 #define TCG_EfiSpecIDEventStruct_SPEC_ERRATA_TPM2_REV_105 105
391 #define TCG_EfiSpecIDEventStruct_SPEC_ERRATA_TPM2_REV_106 106
392 
393 typedef struct {
395  //
396  // The value for the Platform Class.
397  // The enumeration is defined in the TCG ACPI Specification Client Common Header.
398  //
400  //
401  // The TCG EFI Platform Specification minor version number this BIOS supports.
402  // Any BIOS supporting version (1.22) MUST set this value to 02h.
403  // Any BIOS supporting version (2.0) SHALL set this value to 0x00.
404  //
406  //
407  // The TCG EFI Platform Specification major version number this BIOS supports.
408  // Any BIOS supporting version (1.22) MUST set this value to 01h.
409  // Any BIOS supporting version (2.0) SHALL set this value to 0x02.
410  //
412  //
413  // The TCG EFI Platform Specification errata for this specification this BIOS supports.
414  // Any BIOS supporting version and errata (1.22) MUST set this value to 02h.
415  // Any BIOS supporting version and errata (2.0) SHALL set this value to 0x00.
416  //
418  //
419  // Specifies the size of the UINTN fields used in various data structures used in this specification.
420  // 0x01 indicates UINT32 and 0x02 indicates UINT64.
421  //
423  //
424  // This field is added in "Spec ID Event03".
425  // The number of hashing algorithms used in this event log (except the first event).
426  // All events in this event log use all hashing algorithms defined here.
427  //
428  // UINT32 numberOfAlgorithms;
429  //
430  // This field is added in "Spec ID Event03".
431  // An array of size numberOfAlgorithms of value pairs.
432  //
433  // TCG_EfiSpecIdEventAlgorithmSize digestSize[numberOfAlgorithms];
434  //
435  // Size in bytes of the VendorInfo field.
436  // Maximum value SHALL be FFh bytes.
437  //
438  // UINT8 vendorInfoSize;
439  //
440  // Provided for use by the BIOS implementer.
441  // The value might be used, for example, to provide more detailed information about the specific BIOS such as BIOS revision numbers, etc.
442  // The values within this field are not standardized and are implementer-specific.
443  // Platform-specific or -unique information SHALL NOT be provided in this field.
444  //
445  // UINT8 vendorInfo[vendorInfoSize];
447 
451  // UINT8 taggedEventData[taggedEventDataSize];
453 
454 #define TCG_Sp800_155_PlatformId_Event_SIGNATURE "SP800-155 Event"
455 #define TCG_Sp800_155_PlatformId_Event2_SIGNATURE "SP800-155 Event2"
456 #define TCG_Sp800_155_PlatformId_Event3_SIGNATURE "SP800-155 Event3"
457 
460  //
461  // Where Vendor ID is an integer defined
462  // at http://www.iana.org/assignments/enterprisenumbers
463  //
465  //
466  // 16-byte identifier of a given platform's static configuration of code
467  //
469  //
470  // Below structure is newly added in TCG_Sp800_155_PlatformId_Event2.
471  //
472  // UINT8 PlatformManufacturerStrSize;
473  // UINT8 PlatformManufacturerStr[PlatformManufacturerStrSize];
474  // UINT8 PlatformModelSize;
475  // UINT8 PlatformModel[PlatformModelSize];
476  // UINT8 PlatformVersionSize;
477  // UINT8 PlatformVersion[PlatformVersionSize];
478  // UINT8 FirmwareManufacturerStrSize;
479  // UINT8 FirmwareManufacturerStr[FirmwareManufacturerStrSize];
480  // UINT32 FirmwareManufacturerId;
481  // UINT8 FirmwareVersion;
482  // UINT8 FirmwareVersion[FirmwareVersionSize];
484 
487  //
488  // Where Vendor ID is an integer defined
489  // at http://www.iana.org/assignments/enterprisenumbers
490  //
492  //
493  // 16-byte identifier of a given platform's static configuration of code
494  //
496  // UINT8 PlatformManufacturerStrSize;
497  // UINT8 PlatformManufacturerStr[PlatformManufacturerStrSize];
498  // UINT8 PlatformModelSize;
499  // UINT8 PlatformModel[PlatformModelSize];
500  // UINT8 PlatformVersionSize;
501  // UINT8 PlatformVersion[PlatformVersionSize];
502  // UINT8 FirmwareManufacturerStrSize;
503  // UINT8 FirmwareManufacturerStr[FirmwareManufacturerStrSize];
504  // UINT32 FirmwareManufacturerId;
505  // UINT8 FirmwareVersion;
506  // UINT8 FirmwareVersion[FirmwareVersionSize];
507  //
508  // Below structure is newly added in TCG_Sp800_155_PlatformId_Event3
509  //
510  // UINT32 RimLocatorType;
511  // UINT32 RimLocatorLength;
512  // UINT8 RimLocator[RimLocatorLength];
513  // UINT32 PlatformCertLocatorType;
514  // UINT32 PlatformCertLocatorLength;
515  // UINT8 PlatformCertLocator[PlatformCertLocatorLength];
517 
518 /**
519  * TCG specifies a locator type with the following values
520  * 0 - Raw data in the locator itself.
521  * 1 - URI in rtf2396 format.
522  * 2 - local device path in EFI_DEVICE_PATH_PROTOCOL format.
523  * 3 - UEFI variable (16 byte EFI_GUID, then 00-terminated UCS2 string)
524 **/
525 #define TCG_LOCATOR_TYPE_RAW_DATA 0
526 #define TCG_LOCATOR_TYPE_URI 1
527 #define TCG_LOCATOR_TYPE_DEVICE_PATH 2
528 #define TCG_LOCATOR_TYPE_UEFI_VARIABLE 3
529 
530 #define TCG_EfiStartupLocalityEvent_SIGNATURE "StartupLocality"
531 
532 //
533 // The Locality Indicator which sent the TPM2_Startup command
534 //
535 #define LOCALITY_0_INDICATOR 0x00
536 #define LOCALITY_3_INDICATOR 0x03
537 
538 //
539 // Startup Locality Event
540 //
543  //
544  // The Locality Indicator which sent the TPM2_Startup command
545  //
548 
549 //
550 // Restore original structure alignment
551 //
552 #pragma pack ()
553 
554 //
555 // ======================================================================================================================
556 // Event Type PCR Event Log Usage
557 // ======================================================================================================================
558 // EV_EFI_SPDM_DEVICE_BLOB 2 SPDM_MEASUREMENT_BLOCK (subtype) MEASUREMENT from device
559 // EV_EFI_SPDM_DEVICE_CONFIG 3 SPDM_MEASUREMENT_BLOCK (subtype) MEASUREMENT from device
560 // EV_EFI_SPDM_DEVICE_BLOB 2 SPDM_MEASUREMENT_SUMMARY_HASH.TCB (subtype) SUMMARY_HASH from device
561 
562 // EV_EFI_SPDM_DEVICE_POLICY 7 UEFI_VARIABLE_DATA with EFI_SIGNATURE_LIST Provisioned device public cert.
563 // EV_EFI_SPDM_DEVICE_AUTHORITY 7 UEFI_VARIABLE_DATA with EFI_SIGNATURE_DATA CHALLENGE_AUTH signature verification
564 // ======================================================================================================================
565 //
566 
567 #define PCR_INDEX_FOR_SIGNATURE_DB 7
568 
569 #pragma pack(1)
570 
571 #define TCG_DEVICE_SECURITY_EVENT_DATA_VERSION_1 1
572 #define TCG_DEVICE_SECURITY_EVENT_DATA_VERSION_2 2
573 #define TCG_DEVICE_SECURITY_EVENT_DATA_SIGNATURE_2 "SPDM Device Sec2"
574 
575 typedef struct {
580  UINT32 Length; // Length in bytes for all following structures.
583  UINT32 SubHeaderLength; // Length in bytes of the sub header followed by.
584  UINT64 SubHeaderUID; // Universal identifier assigned by the event log creator. It can be used to bind two sub header structure together.
585  // UINT64 DevicePathLength;
586  // UINT8 DevicePath[DevicePathLength];
588 
589 #define TCG_DEVICE_SECURITY_EVENT_DATA_DEVICE_AUTH_STATE_SUCCESS 0
590 #define TCG_DEVICE_SECURITY_EVENT_DATA_DEVICE_AUTH_STATE_NO_AUTH 1
591 #define TCG_DEVICE_SECURITY_EVENT_DATA_DEVICE_AUTH_STATE_NO_BINDING 2
592 #define TCG_DEVICE_SECURITY_EVENT_DATA_DEVICE_AUTH_STATE_FAIL_NO_SIG 3
593 #define TCG_DEVICE_SECURITY_EVENT_DATA_DEVICE_AUTH_STATE_FAIL_INVALID 4
594 #define TCG_DEVICE_SECURITY_EVENT_DATA_DEVICE_AUTH_STATE_NO_SPDM 0xFF
595 
596 #define TCG_DEVICE_SECURITY_EVENT_DATA_DEVICE_SUB_HEADER_TYPE_SPDM_MEASUREMENT_BLOCK 0
597 #define TCG_DEVICE_SECURITY_EVENT_DATA_DEVICE_SUB_HEADER_TYPE_SPDM_CERT_CHAIN 1
598 
599 typedef struct {
604  // SPDM_MEASUREMENT_BLOCK SpdmMeasurementBlock;
606 
607 typedef struct {
612  // SPDM_CERT_CHAIN SpdmCertChain;
614 
615 typedef struct {
618  UINT8 Value[1];
620 
621 typedef union {
626 
627 typedef union {
631 
632 typedef struct {
637 
638 #pragma pack()
639 
640 //
641 // EventType:EV_NO_ACTION
642 // ======================================================================================================================
643 // NVIndex Name PCR/NvIndex Event Log Usage
644 // ======================================================================================================================
645 // NV_EXTEND_INDEX_FOR_INSTANCE 0x01C40200 NV_INDEX_INSTANCE_EVENT_LOG_STRUCT NV Extend Record for instance data (CertChain)
646 // NV_EXTEND_INDEX_FOR_DYNAMIC 0x01C40201 NV_INDEX_DYNAMIC_EVENT_LOG_STRUCT NV Extend Record for dynamic data (Nonce)
647 
648 // EVENT_LOG_INTEGRITY_NV_INDEX_EXIT_PM_AUTH 0x01C40202 EVENT_LOG_INTEGRITY_NV_INDEX_STRUCT Event Log Integrity for ExitPmAuth
649 // EVENT_LOG_INTEGRITY_NV_INDEX_READY_TO_BOOT 0x01C40203 EVENT_LOG_INTEGRITY_NV_INDEX_STRUCT Event Log Integrity for ReadyToBoot
650 // ======================================================================================================================
651 //
652 
653 #define TCG_NV_EXTEND_INDEX_FOR_INSTANCE 0x01C40200
654 #define TCG_NV_EXTEND_INDEX_FOR_DYNAMIC 0x01C40201
655 #define TCG_EVENT_LOG_INTEGRITY_NV_INDEX_EXIT_PM_AUTH 0x01C40202
656 #define TCG_EVENT_LOG_INTEGRITY_NV_INDEX_READY_TO_BOOT 0x01C40203
657 
658 #pragma pack(1)
659 
660 #define TCG_NV_EXTEND_INDEX_FOR_INSTANCE_SIGNATURE "NvIndexInstance"
661 #define TCG_NV_INDEX_INSTANCE_EVENT_LOG_STRUCT_VERSION 1
662 
663 typedef struct {
667  // TCG_DEVICE_SECURITY_EVENT_DATA2 Data;
669 
670 #define TCG_NV_EXTEND_INDEX_FOR_DYNAMIC_SIGNATURE "NvIndexDynamic "
671 #define TCG_NV_INDEX_DYNAMIC_EVENT_LOG_STRUCT_VERSION 1
672 
673 #define TCG_SPDM_CHALLENGE_DESCRIPTION "SPDM CHALLENGE"
674 #define TCG_SPDM_CHALLENGE_AUTH_DESCRIPTION "SPDM CHALLENGE_AUTH"
675 #define TCG_SPDM_GET_MEASUREMENTS_DESCRIPTION "SPDM GET_MEASUREMENTS"
676 #define TCG_SPDM_MEASUREMENTS_DESCRIPTION "SPDM MEASUREMENTS"
677 
678 typedef struct {
683  // UINT16 DescriptionSize;
684  // UINT8 Description[DescriptionSize];
685  // UINT16 DataSize;
686  // UINT8 Data[DataSize];
688 
689 typedef struct {
692  UINT8 Description[sizeof (TCG_SPDM_CHALLENGE_DESCRIPTION)];
694  UINT8 Data[32];
696 
697 typedef struct {
702  UINT8 Data[32];
704 
705 typedef struct {
710  UINT8 Data[32];
712 
713 typedef struct {
718  UINT8 Data[32];
720 
721 #pragma pack()
722 
723 #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:215
INT8 VariableData[1]
Driver or platform-specific data.
UEFI_VARIABLE_DATA.
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:88
unsigned int UINT32
Definition: ProcessorBind.h:98
#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:45
EFI_PARTITION_TABLE_HEADER EfiPartitionHeader
UEFI_HANDOFF_TABLE_POINTERS.
unsigned char UINT8
UINT64 EFI_PHYSICAL_ADDRESS
64-bit physical memory address.
Definition: UefiBaseType.h:52
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:33
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:96
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:441
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:2029
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:135
#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