iPXE
TcgService.h
Go to the documentation of this file.
1 /** @file
2  TCG Service Protocol as defined in TCG_EFI_Protocol_1_22_Final
3  See http://trustedcomputinggroup.org for the latest specification
4 
5 Copyright (c) 2007 - 2014, Intel Corporation. All rights reserved.<BR>
6 This program and the accompanying materials are licensed and made available under
7 the terms and conditions of the BSD License that accompanies this distribution.
8 The full text of the license may be found at
9 http://opensource.org/licenses/bsd-license.php.
10 
11 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
12 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
13 
14 **/
15 
16 #ifndef _TCG_SERVICE_PROTOCOL_H_
17 #define _TCG_SERVICE_PROTOCOL_H_
18 
19 FILE_LICENCE ( BSD3 );
20 
22 
23 #define EFI_TCG_PROTOCOL_GUID \
24  {0xf541796d, 0xa62e, 0x4954, { 0xa7, 0x75, 0x95, 0x84, 0xf6, 0x1b, 0x9c, 0xdd } }
25 
27 
28 typedef struct {
33 } TCG_VERSION;
34 
36  UINT8 Size; /// Size of this structure.
39  UINT8 HashAlgorithmBitmap; /// Hash algorithms .
40  /// This protocol is capable of : 01=SHA-1.
41  BOOLEAN TPMPresentFlag; /// 00h = TPM not present.
42  BOOLEAN TPMDeactivatedFlag; /// 01h = TPM currently deactivated.
44 
46 
47 /**
48  This service provides EFI protocol capability information, state information
49  about the TPM, and Event Log state information.
50 
51  @param This Indicates the calling context
52  @param ProtocolCapability The callee allocates memory for a TCG_BOOT_SERVICE_CAPABILITY
53  structure and fills in the fields with the EFI protocol
54  capability information and the current TPM state information.
55  @param TCGFeatureFlags This is a pointer to the feature flags. No feature
56  flags are currently defined so this parameter
57  MUST be set to 0. However, in the future,
58  feature flags may be defined that, for example,
59  enable hash algorithm agility.
60  @param EventLogLocation This is a pointer to the address of the event log in memory.
61  @param EventLogLastEntry If the Event Log contains more than one entry,
62  this is a pointer to the address of the start of
63  the last entry in the event log in memory.
64 
65  @retval EFI_SUCCESS The operation completed successfully.
66  @retval EFI_INVALID_PARAMETER ProtocolCapability does not match TCG capability.
67 **/
68 typedef
71  IN EFI_TCG_PROTOCOL *This,
73  *ProtocolCapability,
74  OUT UINT32 *TCGFeatureFlags,
75  OUT EFI_PHYSICAL_ADDRESS *EventLogLocation,
76  OUT EFI_PHYSICAL_ADDRESS *EventLogLastEntry
77  );
78 
79 /**
80  This service abstracts the capability to do a hash operation on a data buffer.
81 
82  @param This Indicates the calling context.
83  @param HashData The pointer to the data buffer to be hashed.
84  @param HashDataLen The length of the data buffer to be hashed.
85  @param AlgorithmId Identification of the Algorithm to use for the hashing operation.
86  @param HashedDataLen Resultant length of the hashed data.
87  @param HashedDataResult Resultant buffer of the hashed data.
88 
89  @retval EFI_SUCCESS The operation completed successfully.
90  @retval EFI_INVALID_PARAMETER HashDataLen is NULL.
91  @retval EFI_INVALID_PARAMETER HashDataLenResult is NULL.
92  @retval EFI_OUT_OF_RESOURCES Cannot allocate buffer of size *HashedDataLen.
93  @retval EFI_UNSUPPORTED AlgorithmId not supported.
94  @retval EFI_BUFFER_TOO_SMALL *HashedDataLen < sizeof (TCG_DIGEST).
95 **/
96 typedef
99  IN EFI_TCG_PROTOCOL *This,
100  IN UINT8 *HashData,
101  IN UINT64 HashDataLen,
102  IN TCG_ALGORITHM_ID AlgorithmId,
103  IN OUT UINT64 *HashedDataLen,
104  IN OUT UINT8 **HashedDataResult
105  );
106 
107 /**
108  This service abstracts the capability to add an entry to the Event Log.
109 
110  @param This Indicates the calling context
111  @param TCGLogData The pointer to the start of the data buffer containing
112  the TCG_PCR_EVENT data structure. All fields in
113  this structure are properly filled by the caller.
114  @param EventNumber The event number of the event just logged.
115  @param Flags Indicates additional flags. Only one flag has been
116  defined at this time, which is 0x01 and means the
117  extend operation should not be performed. All
118  other bits are reserved.
119 
120  @retval EFI_SUCCESS The operation completed successfully.
121  @retval EFI_OUT_OF_RESOURCES Insufficient memory in the event log to complete this action.
122 **/
123 typedef
126  IN EFI_TCG_PROTOCOL *This,
127  IN TCG_PCR_EVENT *TCGLogData,
128  IN OUT UINT32 *EventNumber,
129  IN UINT32 Flags
130  );
131 
132 /**
133  This service is a proxy for commands to the TPM.
134 
135  @param This Indicates the calling context.
136  @param TpmInputParameterBlockSize Size of the TPM input parameter block.
137  @param TpmInputParameterBlock The pointer to the TPM input parameter block.
138  @param TpmOutputParameterBlockSize Size of the TPM output parameter block.
139  @param TpmOutputParameterBlock The pointer to the TPM output parameter block.
140 
141  @retval EFI_SUCCESS The operation completed successfully.
142  @retval EFI_INVALID_PARAMETER Invalid ordinal.
143  @retval EFI_UNSUPPORTED Current Task Priority Level >= EFI_TPL_CALLBACK.
144  @retval EFI_TIMEOUT The TIS timed-out.
145 **/
146 typedef
149  IN EFI_TCG_PROTOCOL *This,
150  IN UINT32 TpmInputParameterBlockSize,
151  IN UINT8 *TpmInputParameterBlock,
152  IN UINT32 TpmOutputParameterBlockSize,
153  IN UINT8 *TpmOutputParameterBlock
154  );
155 
156 /**
157  This service abstracts the capability to 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
158 
159  @param This Indicates the calling context
160  @param HashData The physical address of the start of the data buffer
161  to be hashed, extended, and logged.
162  @param HashDataLen The length, in bytes, of the buffer referenced by HashData
163  @param AlgorithmId Identification of the Algorithm to use for the hashing operation
164  @param TCGLogData The physical address of the start of the data
165  buffer containing the TCG_PCR_EVENT data structure.
166  @param EventNumber The event number of the event just logged.
167  @param EventLogLastEntry The physical address of the first byte of the entry
168  just placed in the Event Log. If the Event Log was
169  empty when this function was called then this physical
170  address will be the same as the physical address of
171  the start of the Event Log.
172 
173  @retval EFI_SUCCESS The operation completed successfully.
174  @retval EFI_UNSUPPORTED AlgorithmId != TPM_ALG_SHA.
175  @retval EFI_UNSUPPORTED Current TPL >= EFI_TPL_CALLBACK.
176  @retval EFI_DEVICE_ERROR The command was unsuccessful.
177 **/
178 typedef
181  IN EFI_TCG_PROTOCOL *This,
182  IN EFI_PHYSICAL_ADDRESS HashData,
183  IN UINT64 HashDataLen,
184  IN TCG_ALGORITHM_ID AlgorithmId,
185  IN OUT TCG_PCR_EVENT *TCGLogData,
186  IN OUT UINT32 *EventNumber,
187  OUT EFI_PHYSICAL_ADDRESS *EventLogLastEntry
188  );
189 
190 ///
191 /// The EFI_TCG Protocol abstracts TCG activity.
192 ///
199 };
200 
202 
203 #endif
Event Log Entry Structure Definition.
EFI_TCG_STATUS_CHECK StatusCheck
Definition: TcgService.h:194
EFI_STATUS(EFIAPI * EFI_TCG_LOG_EVENT)(IN EFI_TCG_PROTOCOL *This, IN TCG_PCR_EVENT *TCGLogData, IN OUT UINT32 *EventNumber, IN UINT32 Flags)
This service abstracts the capability to add an entry to the Event Log.
Definition: TcgService.h:125
128 bit buffer containing a unique identifier value.
Definition: Base.h:263
UINT32 TCG_ALGORITHM_ID
Definition: TcgService.h:45
unsigned char BOOLEAN
Definition: ProcessorBind.h:61
EFI_TCG_LOG_EVENT LogEvent
Definition: TcgService.h:196
BOOLEAN TPMDeactivatedFlag
00h = TPM not present.
Definition: TcgService.h:42
unsigned int UINT32
Definition: ProcessorBind.h:56
EFI_TCG_HASH_LOG_EXTEND_EVENT HashLogExtendEvent
Definition: TcgService.h:198
unsigned char UINT8
Definition: ProcessorBind.h:62
UINT64 EFI_PHYSICAL_ADDRESS
64-bit physical memory address.
Definition: UefiBaseType.h:56
TCG_VERSION StructureVersion
Size of this structure.
Definition: TcgService.h:37
UINT16_t Flags
Flags.
Definition: pxe_api.h:87
UINT8 Major
Definition: TcgService.h:29
#define OUT
Definition: mlx_utils.h:29
UINT8 Minor
Definition: TcgService.h:30
FILE_LICENCE(BSD3)
UINT8 RevMajor
Definition: TcgService.h:31
#define EFIAPI
UINT8 RevMinor
Definition: TcgService.h:32
TCG EFI Platform Definition in TCG_EFI_Platform_1_20_Final.
EFI_GUID gEfiTcgProtocolGuid
EFI_STATUS(EFIAPI * EFI_TCG_HASH_LOG_EXTEND_EVENT)(IN EFI_TCG_PROTOCOL *This, IN EFI_PHYSICAL_ADDRESS HashData, IN UINT64 HashDataLen, IN TCG_ALGORITHM_ID AlgorithmId, IN OUT TCG_PCR_EVENT *TCGLogData, IN OUT UINT32 *EventNumber, OUT EFI_PHYSICAL_ADDRESS *EventLogLastEntry)
This service abstracts the capability to do a hash operation on a data buffer, extend a specific TPM ...
Definition: TcgService.h:180
EFI_STATUS(EFIAPI * EFI_TCG_STATUS_CHECK)(IN EFI_TCG_PROTOCOL *This, OUT TCG_EFI_BOOT_SERVICE_CAPABILITY *ProtocolCapability, OUT UINT32 *TCGFeatureFlags, OUT EFI_PHYSICAL_ADDRESS *EventLogLocation, OUT EFI_PHYSICAL_ADDRESS *EventLogLastEntry)
This service provides EFI protocol capability information, state information about the TPM,...
Definition: TcgService.h:70
unsigned long long UINT64
Definition: ProcessorBind.h:54
EFI_STATUS(EFIAPI * EFI_TCG_PASS_THROUGH_TO_TPM)(IN EFI_TCG_PROTOCOL *This, IN UINT32 TpmInputParameterBlockSize, IN UINT8 *TpmInputParameterBlock, IN UINT32 TpmOutputParameterBlockSize, IN UINT8 *TpmOutputParameterBlock)
This service is a proxy for commands to the TPM.
Definition: TcgService.h:148
#define IN
Definition: mlx_utils.h:28
struct _TCG_EFI_BOOT_SERVICE_CAPABILITY TCG_EFI_BOOT_SERVICE_CAPABILITY
EFI_TCG_PASS_THROUGH_TO_TPM PassThroughToTpm
Definition: TcgService.h:197
RETURN_STATUS EFI_STATUS
Function return status for EFI API.
Definition: UefiBaseType.h:35
BOOLEAN TPMPresentFlag
Hash algorithms .
Definition: TcgService.h:41
EFI_TCG_HASH_ALL HashAll
Definition: TcgService.h:195
The EFI_TCG Protocol abstracts TCG activity.
Definition: TcgService.h:193
EFI_STATUS(EFIAPI * EFI_TCG_HASH_ALL)(IN EFI_TCG_PROTOCOL *This, IN UINT8 *HashData, IN UINT64 HashDataLen, IN TCG_ALGORITHM_ID AlgorithmId, IN OUT UINT64 *HashedDataLen, IN OUT UINT8 **HashedDataResult)
This service abstracts the capability to do a hash operation on a data buffer.
Definition: TcgService.h:98