XenevaOS
Loading...
Searching...
No Matches
Tcg2Protocol.h
Go to the documentation of this file.
1
16#ifndef __TCG2_PROTOCOL_H__
17#define __TCG2_PROTOCOL_H__
18
21
22#define EFI_TCG2_PROTOCOL_GUID \
23 {0x607f766c, 0x7455, 0x42be, { 0x93, 0x0b, 0xe4, 0xd7, 0x6d, 0xb2, 0x72, 0x0f }}
24
26
31
35
36#define EFI_TCG2_EVENT_LOG_FORMAT_TCG_1_2 0x00000001
37#define EFI_TCG2_EVENT_LOG_FORMAT_TCG_2 0x00000002
38
40 //
41 // Allocated size of the structure
42 //
44 //
45 // Version of the EFI_TCG2_BOOT_SERVICE_CAPABILITY structure itself.
46 // For this version of the protocol, the Major version shall be set to 1
47 // and the Minor version shall be set to 1.
48 //
50 //
51 // Version of the EFI TCG2 protocol.
52 // For this version of the protocol, the Major version shall be set to 1
53 // and the Minor version shall be set to 1.
54 //
56 //
57 // Supported hash algorithms (this bitmap is determined by the supported PCR
58 // banks in the TPM and the hashing algorithms supported by the firmware)
59 //
61 //
62 // Bitmap of supported event log formats
63 //
65 //
66 // False = TPM not present
67 //
69 //
70 // Max size (in bytes) of a command that can be sent to the TPM
71 //
73 //
74 // Max size (in bytes) of a response that can be provided by the TPM
75 //
77 //
78 // 4-byte Vendor ID
79 // (see TCG Vendor ID registry, Section "TPM Capabilities Vendor ID")
80 //
82 //
83 // Maximum number of PCR banks (hashing algorithms) supported.
84 // No granularity is provided to support a specific set of algorithms.
85 // Minimum value is 1.
86 //
88 //
89 // A bitmap of currently active PCR banks (hashing algorithms).
90 // This is a subset of the supported hashing algorithms reported in HashAlgorithmBitMap.
91 // NumberOfPcrBanks defines the number of bits that are set.
92 //
95
96#define EFI_TCG2_BOOT_HASH_ALG_SHA1 0x00000001
97#define EFI_TCG2_BOOT_HASH_ALG_SHA256 0x00000002
98#define EFI_TCG2_BOOT_HASH_ALG_SHA384 0x00000004
99#define EFI_TCG2_BOOT_HASH_ALG_SHA512 0x00000008
100#define EFI_TCG2_BOOT_HASH_ALG_SM3_256 0x00000010
101
102//
103// This bit is shall be set when an event shall be extended but not logged.
104//
105#define EFI_TCG2_EXTEND_ONLY 0x0000000000000001
106//
107// This bit shall be set when the intent is to measure a PE/COFF image.
108//
109#define PE_COFF_IMAGE 0x0000000000000010
110
111#define MAX_PCR_INDEX 23
112
113#pragma pack(1)
114
115#define EFI_TCG2_EVENT_HEADER_VERSION 1
116
117typedef struct {
118 //
119 // Size of the event header itself (sizeof(EFI_TCG2_EVENT_HEADER)).
120 //
122 //
123 // Header version. For this version of this specification, the value shall be 1.
124 //
126 //
127 // Index of the PCR that shall be extended (0 - 23).
128 //
130 //
131 // Type of the event that shall be extended (and optionally logged).
132 //
135
136typedef struct tdEFI_TCG2_EVENT {
137 //
138 // Total size of the event including the Size component, the header and the Event data.
139 //
144
145#pragma pack()
146
166typedef
169 IN EFI_TCG2_PROTOCOL *This,
170 IN OUT EFI_TCG2_BOOT_SERVICE_CAPABILITY *ProtocolCapability
171 );
172
190typedef
193 IN EFI_TCG2_PROTOCOL *This,
194 IN EFI_TCG2_EVENT_LOG_FORMAT EventLogFormat,
195 OUT EFI_PHYSICAL_ADDRESS *EventLogLocation,
196 OUT EFI_PHYSICAL_ADDRESS *EventLogLastEntry,
197 OUT BOOLEAN *EventLogTruncated
198 );
199
219typedef
222 IN EFI_TCG2_PROTOCOL *This,
224 IN EFI_PHYSICAL_ADDRESS DataToHash,
225 IN UINT64 DataToHashLen,
226 IN EFI_TCG2_EVENT *EfiTcgEvent
227 );
228
243typedef
246 IN EFI_TCG2_PROTOCOL *This,
247 IN UINT32 InputParameterBlockSize,
248 IN UINT8 *InputParameterBlock,
249 IN UINT32 OutputParameterBlockSize,
250 IN UINT8 *OutputParameterBlock
251 );
252
262typedef
265 IN EFI_TCG2_PROTOCOL *This,
266 OUT UINT32 *ActivePcrBanks
267 );
268
278typedef
281 IN EFI_TCG2_PROTOCOL *This,
282 IN UINT32 ActivePcrBanks
283 );
284
295typedef
298 IN EFI_TCG2_PROTOCOL *This,
299 OUT UINT32 *OperationPresent,
300 OUT UINT32 *Response
301 );
302
312
314
315//
316// Log entries after Get Event Log service
317//
318
319#define EFI_TCG2_FINAL_EVENTS_TABLE_GUID \
320 {0x1e2ed096, 0x30e2, 0x4254, { 0xbd, 0x89, 0x86, 0x3b, 0xbe, 0xf8, 0x23, 0x25 }}
321
323
325 //
326 // The version of this structure.
327 //
329 //
330 // Number of events recorded after invocation of GetEventLog API
331 //
333 //
334 // List of events of type TCG_PCR_EVENT2.
335 //
336//TCG_PCR_EVENT2 Event[1];
338
339#define EFI_TCG2_FINAL_EVENTS_TABLE_VERSION 1
340
341#endif
#define EFIAPI
Definition ProcessorBind.h:172
unsigned int UINT32
Definition ProcessorBind.h:102
#define IN
Definition Base.h:347
#define OUT
Definition Base.h:352
struct tdEFI_TCG2_VERSION EFI_TCG2_VERSION
UINT32 EFI_TCG2_EVENT_ALGORITHM_BITMAP
Definition Tcg2Protocol.h:34
EFI_STATUS(EFIAPI * EFI_TCG2_GET_EVENT_LOG)(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)
Definition Tcg2Protocol.h:192
EFI_STATUS(EFIAPI * EFI_TCG2_GET_RESULT_OF_SET_ACTIVE_PCR_BANKS)(IN EFI_TCG2_PROTOCOL *This, OUT UINT32 *OperationPresent, OUT UINT32 *Response)
Definition Tcg2Protocol.h:297
EFI_STATUS(EFIAPI * EFI_TCG2_GET_CAPABILITY)(IN EFI_TCG2_PROTOCOL *This, IN OUT EFI_TCG2_BOOT_SERVICE_CAPABILITY *ProtocolCapability)
Definition Tcg2Protocol.h:168
EFI_STATUS(EFIAPI * EFI_TCG2_SET_ACTIVE_PCR_BANKS)(IN EFI_TCG2_PROTOCOL *This, IN UINT32 ActivePcrBanks)
Definition Tcg2Protocol.h:280
EFI_STATUS(EFIAPI * EFI_TCG2_SUBMIT_COMMAND)(IN EFI_TCG2_PROTOCOL *This, IN UINT32 InputParameterBlockSize, IN UINT8 *InputParameterBlock, IN UINT32 OutputParameterBlockSize, IN UINT8 *OutputParameterBlock)
Definition Tcg2Protocol.h:245
EFI_GUID gEfiTcg2ProtocolGuid
EFI_STATUS(EFIAPI * EFI_TCG2_HASH_LOG_EXTEND_EVENT)(IN EFI_TCG2_PROTOCOL *This, IN UINT64 Flags, IN EFI_PHYSICAL_ADDRESS DataToHash, IN UINT64 DataToHashLen, IN EFI_TCG2_EVENT *EfiTcgEvent)
Definition Tcg2Protocol.h:221
EFI_STATUS(EFIAPI * EFI_TCG2_GET_ACTIVE_PCR_BANKS)(IN EFI_TCG2_PROTOCOL *This, OUT UINT32 *ActivePcrBanks)
Definition Tcg2Protocol.h:264
struct tdEFI_TCG2_EVENT EFI_TCG2_EVENT
UINT32 EFI_TCG2_EVENT_LOG_FORMAT
Definition Tcg2Protocol.h:33
struct tdEFI_TCG2_BOOT_SERVICE_CAPABILITY EFI_TCG2_BOOT_SERVICE_CAPABILITY
UINT32 EFI_TCG2_EVENT_LOG_BITMAP
Definition Tcg2Protocol.h:32
EFI_GUID gEfiTcg2FinalEventsTableGuid
struct tdEFI_TCG2_FINAL_EVENTS_TABLE EFI_TCG2_FINAL_EVENTS_TABLE
UINT64 EFI_PHYSICAL_ADDRESS
Definition UefiBaseType.h:54
RETURN_STATUS EFI_STATUS
Definition UefiBaseType.h:33
UINT32 TCG_EVENTTYPE
Definition UefiTcgPlatform.h:86
TPM_PCRINDEX TCG_PCRINDEX
Definition UefiTcgPlatform.h:87
char ACPI_OBJECT_TYPE UINT32 Flags
Definition acdebug.h:453
unsigned short UINT16
Definition actypes.h:237
unsigned char BOOLEAN
Definition actypes.h:235
unsigned char UINT8
Definition actypes.h:236
COMPILER_DEPENDENT_UINT64 UINT64
Definition actypes.h:239
Definition Tcg2Protocol.h:117
UINT32 HeaderSize
Definition Tcg2Protocol.h:121
UINT16 HeaderVersion
Definition Tcg2Protocol.h:125
TCG_PCRINDEX PCRIndex
Definition Tcg2Protocol.h:129
TCG_EVENTTYPE EventType
Definition Tcg2Protocol.h:133
Definition Base.h:281
Definition Tcg2Protocol.h:39
EFI_TCG2_EVENT_LOG_BITMAP SupportedEventLogs
Definition Tcg2Protocol.h:64
UINT16 MaxCommandSize
Definition Tcg2Protocol.h:72
EFI_TCG2_VERSION ProtocolVersion
Definition Tcg2Protocol.h:55
EFI_TCG2_EVENT_ALGORITHM_BITMAP ActivePcrBanks
Definition Tcg2Protocol.h:93
UINT16 MaxResponseSize
Definition Tcg2Protocol.h:76
EFI_TCG2_EVENT_ALGORITHM_BITMAP HashAlgorithmBitmap
Definition Tcg2Protocol.h:60
EFI_TCG2_VERSION StructureVersion
Definition Tcg2Protocol.h:49
UINT8 Size
Definition Tcg2Protocol.h:43
BOOLEAN TPMPresentFlag
Definition Tcg2Protocol.h:68
UINT32 NumberOfPCRBanks
Definition Tcg2Protocol.h:87
UINT32 ManufacturerID
Definition Tcg2Protocol.h:81
Definition Tcg2Protocol.h:136
EFI_TCG2_EVENT_HEADER Header
Definition Tcg2Protocol.h:141
UINT8 Event[1]
Definition Tcg2Protocol.h:142
UINT32 Size
Definition Tcg2Protocol.h:140
Definition Tcg2Protocol.h:324
UINT64 Version
Definition Tcg2Protocol.h:328
UINT64 NumberOfEvents
Definition Tcg2Protocol.h:332
Definition Tcg2Protocol.h:303
EFI_TCG2_GET_RESULT_OF_SET_ACTIVE_PCR_BANKS GetResultOfSetActivePcrBanks
Definition Tcg2Protocol.h:310
EFI_TCG2_SUBMIT_COMMAND SubmitCommand
Definition Tcg2Protocol.h:307
EFI_TCG2_GET_CAPABILITY GetCapability
Definition Tcg2Protocol.h:304
EFI_TCG2_GET_EVENT_LOG GetEventLog
Definition Tcg2Protocol.h:305
EFI_TCG2_SET_ACTIVE_PCR_BANKS SetActivePcrBanks
Definition Tcg2Protocol.h:309
EFI_TCG2_GET_ACTIVE_PCR_BANKS GetActivePcrBanks
Definition Tcg2Protocol.h:308
EFI_TCG2_HASH_LOG_EXTEND_EVENT HashLogExtendEvent
Definition Tcg2Protocol.h:306
Definition Tcg2Protocol.h:27
UINT8 Major
Definition Tcg2Protocol.h:28
UINT8 Minor
Definition Tcg2Protocol.h:29