]>
Commit | Line | Data |
---|---|---|
76336e4e SZ |
1 | /** @file\r |
2 | The Key Management Service (KMS) protocol as defined in the UEFI 2.3.1 specification is to\r | |
3 | provides services to generate, store, retrieve, and manage cryptographic keys.\r | |
4 | The intention is to specify a simple generic protocol that could be used for many implementations.\r | |
5 | \r | |
6 | A driver implementing the protocol may need to provide basic key service that consists of a\r | |
7 | key store and cryptographic key generation capability. It may connect to an external key\r | |
8 | server over the network, or to a Hardware Security Module (HSM) attached to the system it\r | |
9 | runs on, or anything else that is capable of providing the key management service.\r | |
10 | \r | |
9095d37b | 11 | Copyright (c) 2011 - 2018, Intel Corporation. All rights reserved.<BR>\r |
9344f092 | 12 | SPDX-License-Identifier: BSD-2-Clause-Patent\r |
76336e4e SZ |
13 | \r |
14 | **/\r | |
15 | \r | |
16 | #ifndef __KMS_H__\r | |
17 | #define __KMS_H__\r | |
18 | \r | |
19 | #define EFI_KMS_PROTOCOL_GUID \\r | |
20 | { \\r | |
21 | 0xEC3A978D, 0x7C4E, 0x48FA, {0x9A, 0xBE, 0x6A, 0xD9, 0x1C, 0xC8, 0xF8, 0x11 } \\r | |
22 | }\r | |
23 | \r | |
24 | typedef struct _EFI_KMS_PROTOCOL EFI_KMS_PROTOCOL;\r | |
25 | \r | |
26 | //\r | |
27 | // Where appropriate, EFI_KMS_DATA_TYPE values may be combined using a bitwise 'OR'\r | |
28 | // operation to indicate support for multiple data types.\r | |
29 | //\r | |
30 | #define EFI_KMS_DATA_TYPE_NONE 0\r | |
31 | #define EFI_KMS_DATA_TYPE_BINARY 1\r | |
32 | #define EFI_KMS_DATA_TYPE_ASCII 2\r | |
33 | #define EFI_KMS_DATA_TYPE_UNICODE 4\r | |
34 | #define EFI_KMS_DATA_TYPE_UTF8 8\r | |
35 | \r | |
36 | \r | |
37 | //\r | |
38 | // The key formats recognized by the KMS protocol are defined by an EFI_GUID which specifies\r | |
39 | // a (key-algorithm, key-size) pair. The names of these GUIDs are in the format\r | |
40 | // EFI_KMS_KEY_(key-algorithm)_(key-size)_GUID, where the key-size is expressed in bits.\r | |
41 | // The key formats recognized fall into three categories, generic (no algorithm), hash algorithms,\r | |
42 | // and encrypted algorithms.\r | |
43 | //\r | |
44 | \r | |
45 | ///\r | |
46 | /// The following GUIDs define formats that contain generic key data of a specific size in bits,\r | |
47 | /// but which is not associated with any specific key algorithm(s).\r | |
48 | ///@{\r | |
49 | #define EFI_KMS_FORMAT_GENERIC_128_GUID \\r | |
50 | { \\r | |
51 | 0xec8a3d69, 0x6ddf, 0x4108, {0x94, 0x76, 0x73, 0x37, 0xfc, 0x52, 0x21, 0x36 } \\r | |
52 | }\r | |
53 | #define EFI_KMS_FORMAT_GENERIC_160_GUID \\r | |
54 | { \\r | |
55 | 0xa3b3e6f8, 0xefca, 0x4bc1, {0x88, 0xfb, 0xcb, 0x87, 0x33, 0x9b, 0x25, 0x79 } \\r | |
56 | }\r | |
57 | #define EFI_KMS_FORMAT_GENERIC_256_GUID \\r | |
58 | { \\r | |
59 | 0x70f64793, 0xc323, 0x4261, {0xac, 0x2c, 0xd8, 0x76, 0xf2, 0x7c, 0x53, 0x45 } \\r | |
60 | }\r | |
61 | #define EFI_KMS_FORMAT_GENERIC_512_GUID \\r | |
62 | { \\r | |
63 | 0x978fe043, 0xd7af, 0x422e, {0x8a, 0x92, 0x2b, 0x48, 0xe4, 0x63, 0xbd, 0xe6 } \\r | |
64 | }\r | |
65 | #define EFI_KMS_FORMAT_GENERIC_1024_GUID \\r | |
66 | { \\r | |
67 | 0x43be0b44, 0x874b, 0x4ead, {0xb0, 0x9c, 0x24, 0x1a, 0x4f, 0xbd, 0x7e, 0xb3 } \\r | |
68 | }\r | |
69 | #define EFI_KMS_FORMAT_GENERIC_2048_GUID \\r | |
70 | { \\r | |
71 | 0x40093f23, 0x630c, 0x4626, {0x9c, 0x48, 0x40, 0x37, 0x3b, 0x19, 0xcb, 0xbe } \\r | |
72 | }\r | |
73 | #define EFI_KMS_FORMAT_GENERIC_3072_GUID \\r | |
74 | { \\r | |
75 | 0xb9237513, 0x6c44, 0x4411, {0xa9, 0x90, 0x21, 0xe5, 0x56, 0xe0, 0x5a, 0xde } \\r | |
76 | }\r | |
ac79ee29 FS |
77 | #define EFI_KMS_FORMAT_GENERIC_DYNAMIC_GUID \\r |
78 | { \\r | |
79 | 0x2156e996, 0x66de, 0x4b27, {0x9c, 0xc9, 0xb0, 0x9f, 0xac, 0x4d, 0x2, 0xbe } \\r | |
80 | }\r | |
76336e4e SZ |
81 | ///@}\r |
82 | \r | |
83 | ///\r | |
84 | /// These GUIDS define key data formats that contain data generated by basic hash algorithms\r | |
85 | /// with no cryptographic properties.\r | |
86 | ///@{\r | |
87 | #define EFI_KMS_FORMAT_MD2_128_GUID \\r | |
88 | { \\r | |
89 | 0x78be11c4, 0xee44, 0x4a22, {0x9f, 0x05, 0x03, 0x85, 0x2e, 0xc5, 0xc9, 0x78 } \\r | |
90 | }\r | |
91 | #define EFI_KMS_FORMAT_MDC2_128_GUID \\r | |
92 | { \\r | |
93 | 0xf7ad60f8, 0xefa8, 0x44a3, {0x91, 0x13, 0x23, 0x1f, 0x39, 0x9e, 0xb4, 0xc7 } \\r | |
94 | }\r | |
95 | #define EFI_KMS_FORMAT_MD4_128_GUID \\r | |
96 | { \\r | |
97 | 0xd1c17aa1, 0xcac5, 0x400f, {0xbe, 0x17, 0xe2, 0xa2, 0xae, 0x06, 0x67, 0x7c } \\r | |
98 | }\r | |
99 | #define EFI_KMS_FORMAT_MDC4_128_GUID \\r | |
100 | { \\r | |
101 | 0x3fa4f847, 0xd8eb, 0x4df4, {0xbd, 0x49, 0x10, 0x3a, 0x0a, 0x84, 0x7b, 0xbc } \\r | |
102 | }\r | |
103 | #define EFI_KMS_FORMAT_MD5_128_GUID \\r | |
104 | { \\r | |
105 | 0xdcbc3662, 0x9cda, 0x4b52, {0xa0, 0x4c, 0x82, 0xeb, 0x1d, 0x23, 0x48, 0xc7 } \\r | |
106 | }\r | |
107 | #define EFI_KMS_FORMAT_MD5SHA_128_GUID \\r | |
108 | { \\r | |
109 | 0x1c178237, 0x6897, 0x459e, {0x9d, 0x36, 0x67, 0xce, 0x8e, 0xf9, 0x4f, 0x76 } \\r | |
110 | }\r | |
111 | #define EFI_KMS_FORMAT_SHA1_160_GUID \\r | |
112 | { \\r | |
113 | 0x453c5e5a, 0x482d, 0x43f0, {0x87, 0xc9, 0x59, 0x41, 0xf3, 0xa3, 0x8a, 0xc2 } \\r | |
114 | }\r | |
115 | #define EFI_KMS_FORMAT_SHA256_256_GUID \\r | |
116 | { \\r | |
117 | 0x6bb4f5cd, 0x8022, 0x448d, {0xbc, 0x6d, 0x77, 0x1b, 0xae, 0x93, 0x5f, 0xc6 } \\r | |
118 | }\r | |
119 | #define EFI_KMS_FORMAT_SHA512_512_GUID \\r | |
120 | { \\r | |
121 | 0x2f240e12, 0xe14d, 0x475c, {0x83, 0xb0, 0xef, 0xff, 0x22, 0xd7, 0x7b, 0xe7 } \\r | |
122 | }\r | |
123 | ///@}\r | |
124 | \r | |
125 | ///\r | |
126 | /// These GUIDs define key data formats that contain data generated by cryptographic key algorithms.\r | |
127 | /// There may or may not be a separate data hashing algorithm associated with the key algorithm.\r | |
128 | ///@{\r | |
129 | #define EFI_KMS_FORMAT_AESXTS_128_GUID \\r | |
130 | { \\r | |
131 | 0x4776e33f, 0xdb47, 0x479a, {0xa2, 0x5f, 0xa1, 0xcd, 0x0a, 0xfa, 0xb3, 0x8b } \\r | |
132 | }\r | |
133 | #define EFI_KMS_FORMAT_AESXTS_256_GUID \\r | |
134 | { \\r | |
135 | 0xdc7e8613, 0xc4bb, 0x4db0, {0x84, 0x62, 0x13, 0x51, 0x13, 0x57, 0xab, 0xe2 } \\r | |
136 | }\r | |
137 | #define EFI_KMS_FORMAT_AESCBC_128_GUID \\r | |
138 | { \\r | |
139 | 0xa0e8ee6a, 0x0e92, 0x44d4, {0x86, 0x1b, 0x0e, 0xaa, 0x4a, 0xca, 0x44, 0xa2 } \\r | |
140 | }\r | |
141 | #define EFI_KMS_FORMAT_AESCBC_256_GUID \\r | |
142 | { \\r | |
143 | 0xd7e69789, 0x1f68, 0x45e8, {0x96, 0xef, 0x3b, 0x64, 0x07, 0xa5, 0xb2, 0xdc } \\r | |
144 | }\r | |
145 | #define EFI_KMS_FORMAT_RSASHA1_1024_GUID \\r | |
146 | { \\r | |
147 | 0x56417bed, 0x6bbe, 0x4882, {0x86, 0xa0, 0x3a, 0xe8, 0xbb, 0x17, 0xf8, 0xf9 } \\r | |
148 | }\r | |
149 | #define EFI_KMS_FORMAT_RSASHA1_2048_GUID \\r | |
150 | { \\r | |
151 | 0xf66447d4, 0x75a6, 0x463e, {0xa8, 0x19, 0x07, 0x7f, 0x2d, 0xda, 0x05, 0xe9 } \\r | |
152 | }\r | |
153 | #define EFI_KMS_FORMAT_RSASHA256_2048_GUID \\r | |
154 | { \\r | |
155 | 0xa477af13, 0x877d, 0x4060, {0xba, 0xa1, 0x25, 0xd1, 0xbe, 0xa0, 0x8a, 0xd3 } \\r | |
156 | }\r | |
157 | #define EFI_KMS_FORMAT_RSASHA256_3072_GUID \\r | |
158 | { \\r | |
159 | 0x4e1356c2, 0xeed, 0x463f, {0x81, 0x47, 0x99, 0x33, 0xab, 0xdb, 0xc7, 0xd5 } \\r | |
160 | }\r | |
161 | ///@}\r | |
162 | \r | |
163 | #define EFI_KMS_ATTRIBUTE_TYPE_NONE 0x00\r | |
164 | #define EFI_KMS_ATTRIBUTE_TYPE_INTEGER 0x01\r | |
165 | #define EFI_KMS_ATTRIBUTE_TYPE_LONG_INTEGER 0x02\r | |
166 | #define EFI_KMS_ATTRIBUTE_TYPE_BIG_INTEGER 0x03\r | |
167 | #define EFI_KMS_ATTRIBUTE_TYPE_ENUMERATION 0x04\r | |
168 | #define EFI_KMS_ATTRIBUTE_TYPE_BOOLEAN 0x05\r | |
169 | #define EFI_KMS_ATTRIBUTE_TYPE_BYTE_STRING 0x06\r | |
170 | #define EFI_KMS_ATTRIBUTE_TYPE_TEXT_STRING 0x07\r | |
171 | #define EFI_KMS_ATTRIBUTE_TYPE_DATE_TIME 0x08\r | |
172 | #define EFI_KMS_ATTRIBUTE_TYPE_INTERVAL 0x09\r | |
173 | #define EFI_KMS_ATTRIBUTE_TYPE_STRUCTURE 0x0A\r | |
174 | #define EFI_KMS_ATTRIBUTE_TYPE_DYNAMIC 0x0B\r | |
175 | \r | |
ac79ee29 FS |
176 | typedef struct {\r |
177 | ///\r | |
178 | /// Length in bytes of the KeyData.\r | |
179 | ///\r | |
180 | UINT32 KeySize;\r | |
181 | ///\r | |
182 | /// The data of the key.\r | |
183 | ///\r | |
184 | UINT8 KeyData[1];\r | |
185 | } EFI_KMS_FORMAT_GENERIC_DYNAMIC;\r | |
186 | \r | |
76336e4e SZ |
187 | typedef struct {\r |
188 | ///\r | |
189 | /// The size in bytes for the client identifier.\r | |
190 | ///\r | |
191 | UINT16 ClientIdSize;\r | |
192 | ///\r | |
193 | /// Pointer to a valid client identifier.\r | |
194 | ///\r | |
195 | VOID *ClientId;\r | |
196 | ///\r | |
197 | /// The client name string type used by this client. The string type set here must be one of\r | |
198 | /// the string types reported in the ClientNameStringTypes field of the KMS protocol. If the\r | |
199 | /// KMS does not support client names, this field should be set to EFI_KMS_DATA_TYPE_NONE.\r | |
200 | ///\r | |
201 | UINT8 ClientNameType;\r | |
202 | ///\r | |
203 | /// The size in characters for the client name. This field will be ignored if\r | |
204 | /// ClientNameStringType is set to EFI_KMS_DATA_TYPE_NONE. Otherwise, it must contain\r | |
205 | /// number of characters contained in the ClientName field.\r | |
206 | ///\r | |
207 | UINT8 ClientNameCount;\r | |
208 | ///\r | |
209 | /// Pointer to a client name. This field will be ignored if ClientNameStringType is set to\r | |
210 | /// EFI_KMS_DATA_TYPE_NONE. Otherwise, it must point to a valid string of the specified type.\r | |
211 | ///\r | |
212 | VOID *ClientName;\r | |
213 | } EFI_KMS_CLIENT_INFO;\r | |
214 | \r | |
215 | typedef struct {\r | |
216 | ///\r | |
217 | /// The size of the KeyIdentifier field in bytes. This field is limited to the range 0 to 255.\r | |
218 | ///\r | |
219 | UINT8 KeyIdentifierSize;\r | |
220 | ///\r | |
221 | /// Pointer to an array of KeyIdentifierType elements.\r | |
222 | ///\r | |
223 | VOID *KeyIdentifier;\r | |
224 | ///\r | |
225 | /// An EFI_GUID which specifies the algorithm and key value size for this key.\r | |
226 | ///\r | |
227 | EFI_GUID KeyFormat;\r | |
228 | ///\r | |
229 | /// Pointer to a key value for a key specified by the KeyFormat field. A NULL value for this\r | |
230 | /// field indicates that no key is available.\r | |
231 | ///\r | |
232 | VOID *KeyValue;\r | |
233 | ///\r | |
234 | /// Specifies the results of KMS operations performed with this descriptor. This field is used\r | |
235 | /// to indicate the status of individual operations when a KMS function is called with multiple\r | |
236 | /// EFI_KMS_KEY_DESCRIPTOR structures.\r | |
237 | /// KeyStatus codes returned for the individual key requests are:\r | |
238 | /// EFI_SUCCESS Successfully processed this key.\r | |
239 | /// EFI_WARN_STALE_DATA Successfully processed this key, however, the key's parameters\r | |
240 | /// exceed internal policies/limits and should be replaced.\r | |
241 | /// EFI_COMPROMISED_DATA Successfully processed this key, but the key may have been\r | |
242 | /// compromised and must be replaced.\r | |
243 | /// EFI_UNSUPPORTED Key format is not supported by the service.\r | |
244 | /// EFI_OUT_OF_RESOURCES Could not allocate resources for the key processing.\r | |
245 | /// EFI_TIMEOUT Timed out waiting for device or key server.\r | |
246 | /// EFI_DEVICE_ERROR Device or key server error.\r | |
247 | /// EFI_INVALID_PARAMETER KeyFormat is invalid.\r | |
248 | /// EFI_NOT_FOUND The key does not exist on the KMS.\r | |
249 | ///\r | |
250 | EFI_STATUS KeyStatus;\r | |
251 | } EFI_KMS_KEY_DESCRIPTOR;\r | |
252 | \r | |
253 | typedef struct {\r | |
254 | ///\r | |
255 | /// Part of a tag-type-length triplet that identifies the KeyAttributeData formatting. The\r | |
256 | /// definition of the value is outside the scope of this standard and may be defined by the KMS.\r | |
257 | ///\r | |
258 | UINT16 Tag;\r | |
259 | ///\r | |
260 | /// Part of a tag-type-length triplet that identifies the KeyAttributeData formatting. The\r | |
261 | /// definition of the value is outside the scope of this standard and may be defined by the KMS.\r | |
262 | ///\r | |
263 | UINT16 Type;\r | |
264 | ///\r | |
265 | /// Length in bytes of the KeyAttributeData.\r | |
266 | ///\r | |
267 | UINT32 Length;\r | |
268 | ///\r | |
269 | /// An array of bytes to hold the attribute data associated with the KeyAttributeIdentifier.\r | |
270 | ///\r | |
271 | UINT8 KeyAttributeData[1];\r | |
272 | } EFI_KMS_DYNAMIC_FIELD;\r | |
273 | \r | |
274 | typedef struct {\r | |
275 | ///\r | |
276 | /// The number of members in the EFI_KMS_DYNAMIC_ATTRIBUTE structure.\r | |
277 | ///\r | |
278 | UINT32 FieldCount;\r | |
279 | ///\r | |
280 | /// An array of EFI_KMS_DYNAMIC_FIELD structures.\r | |
281 | ///\r | |
282 | EFI_KMS_DYNAMIC_FIELD Field[1];\r | |
283 | } EFI_KMS_DYNAMIC_ATTRIBUTE;\r | |
284 | \r | |
285 | typedef struct {\r | |
286 | ///\r | |
287 | /// The data type used for the KeyAttributeIdentifier field. Values for this field are defined\r | |
288 | /// by the EFI_KMS_DATA_TYPE constants, except that EFI_KMS_DATA_TYPE_BINARY is not\r | |
289 | /// valid for this field.\r | |
290 | ///\r | |
291 | UINT8 KeyAttributeIdentifierType;\r | |
292 | ///\r | |
293 | /// The length of the KeyAttributeIdentifier field in units defined by KeyAttributeIdentifierType\r | |
294 | /// field. This field is limited to the range 0 to 255.\r | |
295 | ///\r | |
296 | UINT8 KeyAttributeIdentifierCount;\r | |
297 | ///\r | |
298 | /// Pointer to an array of KeyAttributeIdentifierType elements. For string types, there must\r | |
299 | /// not be a null-termination element at the end of the array.\r | |
300 | ///\r | |
301 | VOID *KeyAttributeIdentifier;\r | |
302 | ///\r | |
303 | /// The instance number of this attribute. If there is only one instance, the value is set to\r | |
304 | /// one. If this value is set to 0xFFFF (all binary 1's) then this field should be ignored if an\r | |
305 | /// output or treated as a wild card matching any value if it is an input. If the attribute is\r | |
306 | /// stored with this field, it will match any attribute request regardless of the setting of the\r | |
307 | /// field in the request. If set to 0xFFFF in the request, it will match any attribute with the\r | |
308 | /// same KeyAttributeIdentifier.\r | |
309 | ///\r | |
310 | UINT16 KeyAttributeInstance;\r | |
311 | ///\r | |
312 | /// The data type of the KeyAttributeValue (e.g. struct, bool, etc.). See the list of\r | |
313 | /// KeyAttributeType definitions.\r | |
314 | ///\r | |
315 | UINT16 KeyAttributeType;\r | |
316 | ///\r | |
317 | /// The size in bytes of the KeyAttribute field. A value of zero for this field indicates that no\r | |
318 | /// key attribute value is available.\r | |
319 | ///\r | |
320 | UINT16 KeyAttributeValueSize;\r | |
321 | ///\r | |
322 | /// Pointer to a key attribute value for the attribute specified by the KeyAttributeIdentifier\r | |
323 | /// field. If the KeyAttributeValueSize field is zero, then this field must be NULL.\r | |
324 | ///\r | |
325 | VOID *KeyAttributeValue;\r | |
326 | ///\r | |
327 | /// KeyAttributeStatusSpecifies the results of KMS operations performed with this attribute.\r | |
328 | /// This field is used to indicate the status of individual operations when a KMS function is\r | |
329 | /// called with multiple EFI_KMS_KEY_ATTRIBUTE structures.\r | |
330 | /// KeyAttributeStatus codes returned for the individual key attribute requests are:\r | |
331 | /// EFI_SUCCESS Successfully processed this request.\r | |
332 | /// EFI_WARN_STALE_DATA Successfully processed this request, however, the key's\r | |
333 | /// parameters exceed internal policies/limits and should be replaced.\r | |
334 | /// EFI_COMPROMISED_DATA Successfully processed this request, but the key may have been\r | |
335 | /// compromised and must be replaced.\r | |
336 | /// EFI_UNSUPPORTED Key attribute format is not supported by the service.\r | |
337 | /// EFI_OUT_OF_RESOURCES Could not allocate resources for the request processing.\r | |
338 | /// EFI_TIMEOUT Timed out waiting for device or key server.\r | |
339 | /// EFI_DEVICE_ERROR Device or key server error.\r | |
340 | /// EFI_INVALID_PARAMETER A field in the EFI_KMS_KEY_ATTRIBUTE structure is invalid.\r | |
341 | /// EFI_NOT_FOUND The key attribute does not exist on the KMS.\r | |
342 | ///\r | |
343 | EFI_STATUS KeyAttributeStatus;\r | |
344 | } EFI_KMS_KEY_ATTRIBUTE;\r | |
345 | \r | |
346 | /**\r | |
347 | Get the current status of the key management service.\r | |
348 | \r | |
349 | @param[in] This Pointer to the EFI_KMS_PROTOCOL instance.\r | |
350 | \r | |
351 | @retval EFI_SUCCESS The KMS is ready for use.\r | |
352 | @retval EFI_NOT_READY No connection to the KMS is available.\r | |
353 | @retval EFI_NO_MAPPING No valid connection configuration exists for the KMS.\r | |
354 | @retval EFI_NO_RESPONSE No response was received from the KMS.\r | |
355 | @retval EFI_DEVICE_ERROR An error occurred when attempting to access the KMS.\r | |
356 | @retval EFI_INVALID_PARAMETER This is NULL.\r | |
357 | \r | |
358 | **/\r | |
359 | typedef\r | |
360 | EFI_STATUS\r | |
361 | (EFIAPI *EFI_KMS_GET_SERVICE_STATUS) (\r | |
362 | IN EFI_KMS_PROTOCOL *This\r | |
363 | );\r | |
364 | \r | |
365 | /**\r | |
366 | Register client information with the supported KMS.\r | |
367 | \r | |
368 | @param[in] This Pointer to the EFI_KMS_PROTOCOL instance.\r | |
369 | @param[in] Client Pointer to a valid EFI_KMS_CLIENT_INFO structure.\r | |
9095d37b | 370 | @param[in, out] ClientDataSize Pointer to the size, in bytes, of an arbitrary block of\r |
76336e4e SZ |
371 | data specified by the ClientData parameter. This\r |
372 | parameter may be NULL, in which case the ClientData\r | |
373 | parameter will be ignored and no data will be\r | |
374 | transferred to or from the KMS. If the parameter is\r | |
375 | not NULL, then ClientData must be a valid pointer.\r | |
376 | If the value pointed to is 0, no data will be transferred\r | |
377 | to the KMS, but data may be returned by the KMS.\r | |
378 | For all non-zero values *ClientData will be transferred\r | |
379 | to the KMS, which may also return data to the caller.\r | |
380 | In all cases, the value upon return to the caller will\r | |
381 | be the size of the data block returned to the caller,\r | |
382 | which will be zero if no data is returned from the KMS.\r | |
383 | @param[in, out] ClientData Pointer to a pointer to an arbitrary block of data of\r | |
384 | *ClientDataSize that is to be passed directly to the\r | |
9095d37b LG |
385 | KMS if it supports the use of client data. This\r |
386 | parameter may be NULL if and only if the\r | |
76336e4e | 387 | ClientDataSize parameter is also NULL. Upon return to\r |
9095d37b LG |
388 | the caller, *ClientData points to a block of data of\r |
389 | *ClientDataSize that was returned from the KMS.\r | |
76336e4e SZ |
390 | If the returned value for *ClientDataSize is zero,\r |
391 | then the returned value for *ClientData must be NULL\r | |
392 | and should be ignored by the caller. The KMS protocol\r | |
393 | consumer is responsible for freeing all valid buffers\r | |
394 | used for client data regardless of whether they are\r | |
395 | allocated by the caller for input to the function or by\r | |
396 | the implementation for output back to the caller.\r | |
397 | \r | |
398 | @retval EFI_SUCCESS The client information has been accepted by the KMS.\r | |
399 | @retval EFI_NOT_READY No connection to the KMS is available.\r | |
400 | @retval EFI_NO_RESPONSE There was no response from the device or the key server.\r | |
401 | @retval EFI_ACCESS_DENIED Access was denied by the device or the key server.\r | |
402 | @retval EFI_DEVICE_ERROR An error occurred when attempting to access the KMS.\r | |
403 | @retval EFI_OUT_OF_RESOURCES Required resources were not available to perform the function.\r | |
404 | @retval EFI_INVALID_PARAMETER This is NULL.\r | |
405 | @retval EFI_UNSUPPORTED The KMS does not support the use of client identifiers.\r | |
406 | \r | |
407 | **/\r | |
408 | typedef\r | |
409 | EFI_STATUS\r | |
410 | (EFIAPI *EFI_KMS_REGISTER_CLIENT) (\r | |
411 | IN EFI_KMS_PROTOCOL *This,\r | |
412 | IN EFI_KMS_CLIENT_INFO *Client,\r | |
413 | IN OUT UINTN *ClientDataSize OPTIONAL,\r | |
414 | IN OUT VOID **ClientData OPTIONAL\r | |
9095d37b | 415 | );\r |
76336e4e SZ |
416 | \r |
417 | /**\r | |
418 | Request that the KMS generate one or more new keys and associate them with key identifiers.\r | |
419 | The key value(s) is returned to the caller.\r | |
420 | \r | |
421 | @param[in] This Pointer to the EFI_KMS_PROTOCOL instance.\r | |
422 | @param[in] Client Pointer to a valid EFI_KMS_CLIENT_INFO structure.\r | |
423 | @param[in, out] KeyDescriptorCount Pointer to a count of the number of key descriptors to be\r | |
424 | processed by this operation. On return, this number\r | |
425 | will be updated with the number of key descriptors\r | |
426 | successfully processed.\r | |
427 | @param[in, out] KeyDescriptors Pointer to an array of EFI_KMS_KEY_DESCRIPTOR\r | |
428 | structures which describe the keys to be generated.\r | |
429 | On input, the KeyIdentifierSize and the KeyIdentifier\r | |
430 | may specify an identifier to be used for the key,\r | |
431 | but this is not required. The KeyFormat field must\r | |
432 | specify a key format GUID reported as supported by\r | |
433 | the KeyFormats field of the EFI_KMS_PROTOCOL.\r | |
434 | The value for this field in the first key descriptor will\r | |
435 | be considered the default value for subsequent key\r | |
436 | descriptors requested in this operation if those key\r | |
437 | descriptors have a NULL GUID in the key format field.\r | |
438 | On output, the KeyIdentifierSize and KeyIdentifier fields\r | |
439 | will specify an identifier for the key which will be either\r | |
440 | the original identifier if one was provided, or an identifier\r | |
441 | generated either by the KMS or the KMS protocol\r | |
442 | implementation. The KeyFormat field will be updated\r | |
443 | with the GUID used to generate the key if it was a\r | |
444 | NULL GUID, and the KeyValue field will contain a pointer\r | |
445 | to memory containing the key value for the generated\r | |
446 | key. Memory for both the KeyIdentifier and the KeyValue\r | |
447 | fields will be allocated with the BOOT_SERVICES_DATA\r | |
448 | type and must be freed by the caller when it is no longer\r | |
449 | needed. Also, the KeyStatus field must reflect the result\r | |
450 | of the request relative to that key.\r | |
9095d37b | 451 | @param[in, out] ClientDataSize Pointer to the size, in bytes, of an arbitrary block of\r |
76336e4e SZ |
452 | data specified by the ClientData parameter. This\r |
453 | parameter may be NULL, in which case the ClientData\r | |
454 | parameter will be ignored and no data will be\r | |
455 | transferred to or from the KMS. If the parameter is\r | |
456 | not NULL, then ClientData must be a valid pointer.\r | |
457 | If the value pointed to is 0, no data will be transferred\r | |
458 | to the KMS, but data may be returned by the KMS.\r | |
459 | For all non-zero values *ClientData will be transferred\r | |
460 | to the KMS, which may also return data to the caller.\r | |
461 | In all cases, the value upon return to the caller will\r | |
462 | be the size of the data block returned to the caller,\r | |
463 | which will be zero if no data is returned from the KMS.\r | |
464 | @param[in, out] ClientData Pointer to a pointer to an arbitrary block of data of\r | |
465 | *ClientDataSize that is to be passed directly to the\r | |
9095d37b LG |
466 | KMS if it supports the use of client data. This\r |
467 | parameter may be NULL if and only if the\r | |
76336e4e | 468 | ClientDataSize parameter is also NULL. Upon return to\r |
9095d37b LG |
469 | the caller, *ClientData points to a block of data of\r |
470 | *ClientDataSize that was returned from the KMS.\r | |
76336e4e SZ |
471 | If the returned value for *ClientDataSize is zero,\r |
472 | then the returned value for *ClientData must be NULL\r | |
473 | and should be ignored by the caller. The KMS protocol\r | |
474 | consumer is responsible for freeing all valid buffers\r | |
475 | used for client data regardless of whether they are\r | |
476 | allocated by the caller for input to the function or by\r | |
477 | the implementation for output back to the caller.\r | |
478 | \r | |
479 | @retval EFI_SUCCESS Successfully generated and retrieved all requested keys.\r | |
480 | @retval EFI_UNSUPPORTED This function is not supported by the KMS. --OR--\r | |
481 | One (or more) of the key requests submitted is not supported by\r | |
482 | the KMS. Check individual key request(s) to see which ones\r | |
483 | may have been processed.\r | |
484 | @retval EFI_OUT_OF_RESOURCES Required resources were not available to perform the function.\r | |
485 | @retval EFI_TIMEOUT Timed out waiting for device or key server. Check individual key\r | |
486 | request(s) to see which ones may have been processed.\r | |
487 | @retval EFI_ACCESS_DENIED Access was denied by the device or the key server; OR a\r | |
488 | ClientId is required by the server and either no id was\r | |
489 | provided or an invalid id was provided.\r | |
490 | @retval EFI_DEVICE_ERROR An error occurred when attempting to access the KMS. Check\r | |
491 | individual key request(s) to see which ones may have been\r | |
492 | processed.\r | |
493 | @retval EFI_INVALID_PARAMETER This is NULL, ClientId is required but it is NULL,\r | |
494 | KeyDescriptorCount is NULL, or Keys is NULL.\r | |
495 | @retval EFI_NOT_FOUND One or more EFI_KMS_KEY_DESCRIPTOR structures\r | |
496 | could not be processed properly. KeyDescriptorCount\r | |
497 | contains the number of structures which were successfully\r | |
498 | processed. Individual structures will reflect the status of the\r | |
499 | processing for that structure.\r | |
500 | \r | |
501 | **/\r | |
502 | typedef\r | |
503 | EFI_STATUS\r | |
504 | (EFIAPI *EFI_KMS_CREATE_KEY) (\r | |
505 | IN EFI_KMS_PROTOCOL *This,\r | |
506 | IN EFI_KMS_CLIENT_INFO *Client,\r | |
507 | IN OUT UINT16 *KeyDescriptorCount,\r | |
508 | IN OUT EFI_KMS_KEY_DESCRIPTOR *KeyDescriptors,\r | |
509 | IN OUT UINTN *ClientDataSize OPTIONAL,\r | |
510 | IN OUT VOID **ClientData OPTIONAL\r | |
511 | );\r | |
512 | \r | |
513 | /**\r | |
514 | Retrieve an existing key.\r | |
515 | \r | |
516 | @param[in] This Pointer to the EFI_KMS_PROTOCOL instance.\r | |
517 | @param[in] Client Pointer to a valid EFI_KMS_CLIENT_INFO structure.\r | |
518 | @param[in, out] KeyDescriptorCount Pointer to a count of the number of key descriptors to be\r | |
519 | processed by this operation. On return, this number\r | |
520 | will be updated with the number of key descriptors\r | |
521 | successfully processed.\r | |
522 | @param[in, out] KeyDescriptors Pointer to an array of EFI_KMS_KEY_DESCRIPTOR\r | |
523 | structures which describe the keys to be retrieved\r | |
524 | from the KMS.\r | |
525 | On input, the KeyIdentifierSize and the KeyIdentifier\r | |
526 | must specify an identifier to be used to retrieve a\r | |
527 | specific key. All other fields in the descriptor should\r | |
528 | be NULL.\r | |
529 | On output, the KeyIdentifierSize and KeyIdentifier fields\r | |
530 | will be unchanged, while the KeyFormat and KeyValue\r | |
531 | fields will be updated values associated with this key\r | |
9095d37b | 532 | identifier. Memory for the KeyValue field will be\r |
76336e4e SZ |
533 | allocated with the BOOT_SERVICES_DATA type and\r |
534 | must be freed by the caller when it is no longer needed.\r | |
535 | Also, the KeyStatus field will reflect the result of the\r | |
536 | request relative to the individual key descriptor.\r | |
9095d37b | 537 | @param[in, out] ClientDataSize Pointer to the size, in bytes, of an arbitrary block of\r |
76336e4e SZ |
538 | data specified by the ClientData parameter. This\r |
539 | parameter may be NULL, in which case the ClientData\r | |
540 | parameter will be ignored and no data will be\r | |
541 | transferred to or from the KMS. If the parameter is\r | |
542 | not NULL, then ClientData must be a valid pointer.\r | |
543 | If the value pointed to is 0, no data will be transferred\r | |
544 | to the KMS, but data may be returned by the KMS.\r | |
545 | For all non-zero values *ClientData will be transferred\r | |
546 | to the KMS, which may also return data to the caller.\r | |
547 | In all cases, the value upon return to the caller will\r | |
548 | be the size of the data block returned to the caller,\r | |
549 | which will be zero if no data is returned from the KMS.\r | |
550 | @param[in, out] ClientData Pointer to a pointer to an arbitrary block of data of\r | |
551 | *ClientDataSize that is to be passed directly to the\r | |
9095d37b LG |
552 | KMS if it supports the use of client data. This\r |
553 | parameter may be NULL if and only if the\r | |
76336e4e | 554 | ClientDataSize parameter is also NULL. Upon return to\r |
9095d37b LG |
555 | the caller, *ClientData points to a block of data of\r |
556 | *ClientDataSize that was returned from the KMS.\r | |
76336e4e SZ |
557 | If the returned value for *ClientDataSize is zero,\r |
558 | then the returned value for *ClientData must be NULL\r | |
559 | and should be ignored by the caller. The KMS protocol\r | |
560 | consumer is responsible for freeing all valid buffers\r | |
561 | used for client data regardless of whether they are\r | |
562 | allocated by the caller for input to the function or by\r | |
563 | the implementation for output back to the caller.\r | |
564 | \r | |
565 | @retval EFI_SUCCESS Successfully retrieved all requested keys.\r | |
566 | @retval EFI_OUT_OF_RESOURCES Could not allocate resources for the method processing.\r | |
567 | @retval EFI_TIMEOUT Timed out waiting for device or key server. Check individual key\r | |
568 | request(s) to see which ones may have been processed.\r | |
569 | @retval EFI_BUFFER_TOO_SMALL If multiple keys are associated with a single identifier, and the\r | |
570 | KeyValue buffer does not contain enough structures\r | |
571 | (KeyDescriptorCount) to contain all the key data, then\r | |
572 | the available structures will be filled and\r | |
573 | KeyDescriptorCount will be updated to indicate the\r | |
574 | number of keys which could not be processed.\r | |
575 | @retval EFI_ACCESS_DENIED Access was denied by the device or the key server; OR a\r | |
576 | ClientId is required by the server and either none or an\r | |
577 | invalid id was provided.\r | |
578 | @retval EFI_DEVICE_ERROR Device or key server error. Check individual key request(s) to\r | |
579 | see which ones may have been processed.\r | |
580 | @retval EFI_INVALID_PARAMETER This is NULL, ClientId is required but it is NULL,\r | |
581 | KeyDescriptorCount is NULL, or Keys is NULL.\r | |
582 | @retval EFI_NOT_FOUND One or more EFI_KMS_KEY_DESCRIPTOR structures\r | |
583 | could not be processed properly. KeyDescriptorCount\r | |
584 | contains the number of structures which were successfully\r | |
585 | processed. Individual structures will reflect the status of the\r | |
586 | processing for that structure.\r | |
587 | @retval EFI_UNSUPPORTED The implementation/KMS does not support this function.\r | |
588 | \r | |
589 | **/\r | |
590 | typedef\r | |
591 | EFI_STATUS\r | |
592 | (EFIAPI *EFI_KMS_GET_KEY) (\r | |
593 | IN EFI_KMS_PROTOCOL *This,\r | |
594 | IN EFI_KMS_CLIENT_INFO *Client,\r | |
595 | IN OUT UINT16 *KeyDescriptorCount,\r | |
596 | IN OUT EFI_KMS_KEY_DESCRIPTOR *KeyDescriptors,\r | |
597 | IN OUT UINTN *ClientDataSize OPTIONAL,\r | |
598 | IN OUT VOID **ClientData OPTIONAL\r | |
599 | );\r | |
600 | \r | |
601 | /**\r | |
602 | Add a new key.\r | |
603 | \r | |
604 | @param[in] This Pointer to the EFI_KMS_PROTOCOL instance.\r | |
605 | @param[in] Client Pointer to a valid EFI_KMS_CLIENT_INFO structure.\r | |
606 | @param[in, out] KeyDescriptorCount Pointer to a count of the number of key descriptors to be\r | |
607 | processed by this operation. On normal return, this\r | |
608 | number will be updated with the number of key\r | |
609 | descriptors successfully processed.\r | |
610 | @param[in, out] KeyDescriptors Pointer to an array of EFI_KMS_KEY_DESCRIPTOR\r | |
611 | structures which describe the keys to be added.\r | |
612 | On input, the KeyId field for first key must contain\r | |
613 | valid identifier data to be used for adding a key to\r | |
614 | the KMS. The values for these fields in this key\r | |
615 | definition will be considered default values for\r | |
616 | subsequent keys requested in this operation. A value\r | |
617 | of 0 in any subsequent KeyId field will be replaced\r | |
618 | with the current default value. The KeyFormat and\r | |
619 | KeyValue fields for each key to be added must contain\r | |
620 | consistent values to be associated with the given KeyId.\r | |
621 | On return, the KeyStatus field will reflect the result\r | |
622 | of the operation for each key request.\r | |
9095d37b | 623 | @param[in, out] ClientDataSize Pointer to the size, in bytes, of an arbitrary block of\r |
76336e4e SZ |
624 | data specified by the ClientData parameter. This\r |
625 | parameter may be NULL, in which case the ClientData\r | |
626 | parameter will be ignored and no data will be\r | |
627 | transferred to or from the KMS. If the parameter is\r | |
628 | not NULL, then ClientData must be a valid pointer.\r | |
629 | If the value pointed to is 0, no data will be transferred\r | |
630 | to the KMS, but data may be returned by the KMS.\r | |
631 | For all non-zero values *ClientData will be transferred\r | |
632 | to the KMS, which may also return data to the caller.\r | |
633 | In all cases, the value upon return to the caller will\r | |
634 | be the size of the data block returned to the caller,\r | |
635 | which will be zero if no data is returned from the KMS.\r | |
636 | @param[in, out] ClientData Pointer to a pointer to an arbitrary block of data of\r | |
637 | *ClientDataSize that is to be passed directly to the\r | |
9095d37b LG |
638 | KMS if it supports the use of client data. This\r |
639 | parameter may be NULL if and only if the\r | |
76336e4e | 640 | ClientDataSize parameter is also NULL. Upon return to\r |
9095d37b LG |
641 | the caller, *ClientData points to a block of data of\r |
642 | *ClientDataSize that was returned from the KMS.\r | |
76336e4e SZ |
643 | If the returned value for *ClientDataSize is zero,\r |
644 | then the returned value for *ClientData must be NULL\r | |
645 | and should be ignored by the caller. The KMS protocol\r | |
646 | consumer is responsible for freeing all valid buffers\r | |
647 | used for client data regardless of whether they are\r | |
648 | allocated by the caller for input to the function or by\r | |
649 | the implementation for output back to the caller.\r | |
650 | \r | |
651 | @retval EFI_SUCCESS Successfully added all requested keys.\r | |
652 | @retval EFI_OUT_OF_RESOURCES Could not allocate required resources.\r | |
653 | @retval EFI_TIMEOUT Timed out waiting for device or key server. Check individual key\r | |
654 | request(s) to see which ones may have been processed.\r | |
655 | @retval EFI_BUFFER_TOO_SMALL If multiple keys are associated with a single identifier, and the\r | |
656 | KeyValue buffer does not contain enough structures\r | |
657 | (KeyDescriptorCount) to contain all the key data, then\r | |
658 | the available structures will be filled and\r | |
659 | KeyDescriptorCount will be updated to indicate the\r | |
660 | number of keys which could not be processed\r | |
661 | @retval EFI_ACCESS_DENIED Access was denied by the device or the key server; OR a\r | |
662 | ClientId is required by the server and either none or an\r | |
663 | invalid id was provided.\r | |
664 | @retval EFI_DEVICE_ERROR Device or key server error. Check individual key request(s) to\r | |
665 | see which ones may have been processed.\r | |
666 | @retval EFI_INVALID_PARAMETER This is NULL, ClientId is required but it is NULL,\r | |
667 | KeyDescriptorCount is NULL, or Keys is NULL.\r | |
668 | @retval EFI_NOT_FOUND One or more EFI_KMS_KEY_DESCRIPTOR structures\r | |
669 | could not be processed properly. KeyDescriptorCount\r | |
670 | contains the number of structures which were successfully\r | |
671 | processed. Individual structures will reflect the status of the\r | |
672 | processing for that structure.\r | |
673 | @retval EFI_UNSUPPORTED The implementation/KMS does not support this function.\r | |
674 | \r | |
675 | **/\r | |
676 | typedef\r | |
677 | EFI_STATUS\r | |
678 | (EFIAPI *EFI_KMS_ADD_KEY) (\r | |
679 | IN EFI_KMS_PROTOCOL *This,\r | |
680 | IN EFI_KMS_CLIENT_INFO *Client,\r | |
681 | IN OUT UINT16 *KeyDescriptorCount,\r | |
682 | IN OUT EFI_KMS_KEY_DESCRIPTOR *KeyDescriptors,\r | |
683 | IN OUT UINTN *ClientDataSize OPTIONAL,\r | |
684 | IN OUT VOID **ClientData OPTIONAL\r | |
685 | );\r | |
686 | \r | |
687 | /**\r | |
688 | Delete an existing key from the KMS database.\r | |
689 | \r | |
690 | @param[in] This Pointer to the EFI_KMS_PROTOCOL instance.\r | |
691 | @param[in] Client Pointer to a valid EFI_KMS_CLIENT_INFO structure.\r | |
692 | @param[in, out] KeyDescriptorCount Pointer to a count of the number of key descriptors to be\r | |
693 | processed by this operation. On normal return, this\r | |
694 | number will be updated with the number of key\r | |
695 | descriptors successfully processed.\r | |
696 | @param[in, out] KeyDescriptors Pointer to an array of EFI_KMS_KEY_DESCRIPTOR\r | |
697 | structures which describe the keys to be deleted.\r | |
698 | On input, the KeyId field for first key must contain\r | |
699 | valid identifier data to be used for adding a key to\r | |
700 | the KMS. The values for these fields in this key\r | |
701 | definition will be considered default values for\r | |
702 | subsequent keys requested in this operation. A value\r | |
703 | of 0 in any subsequent KeyId field will be replaced\r | |
704 | with the current default value. The KeyFormat and\r | |
705 | KeyValue fields are ignored, but should be 0.\r | |
706 | On return, the KeyStatus field will reflect the result\r | |
707 | of the operation for each key request.\r | |
9095d37b | 708 | @param[in, out] ClientDataSize Pointer to the size, in bytes, of an arbitrary block of\r |
76336e4e SZ |
709 | data specified by the ClientData parameter. This\r |
710 | parameter may be NULL, in which case the ClientData\r | |
711 | parameter will be ignored and no data will be\r | |
712 | transferred to or from the KMS. If the parameter is\r | |
713 | not NULL, then ClientData must be a valid pointer.\r | |
714 | If the value pointed to is 0, no data will be transferred\r | |
715 | to the KMS, but data may be returned by the KMS.\r | |
716 | For all non-zero values *ClientData will be transferred\r | |
717 | to the KMS, which may also return data to the caller.\r | |
718 | In all cases, the value upon return to the caller will\r | |
719 | be the size of the data block returned to the caller,\r | |
720 | which will be zero if no data is returned from the KMS.\r | |
721 | @param[in, out] ClientData Pointer to a pointer to an arbitrary block of data of\r | |
722 | *ClientDataSize that is to be passed directly to the\r | |
9095d37b LG |
723 | KMS if it supports the use of client data. This\r |
724 | parameter may be NULL if and only if the\r | |
76336e4e | 725 | ClientDataSize parameter is also NULL. Upon return to\r |
9095d37b LG |
726 | the caller, *ClientData points to a block of data of\r |
727 | *ClientDataSize that was returned from the KMS.\r | |
76336e4e SZ |
728 | If the returned value for *ClientDataSize is zero,\r |
729 | then the returned value for *ClientData must be NULL\r | |
730 | and should be ignored by the caller. The KMS protocol\r | |
731 | consumer is responsible for freeing all valid buffers\r | |
732 | used for client data regardless of whether they are\r | |
733 | allocated by the caller for input to the function or by\r | |
734 | the implementation for output back to the caller.\r | |
735 | \r | |
736 | @retval EFI_SUCCESS Successfully deleted all requested keys.\r | |
737 | @retval EFI_OUT_OF_RESOURCES Could not allocate required resources.\r | |
738 | @retval EFI_TIMEOUT Timed out waiting for device or key server. Check individual key\r | |
739 | request(s) to see which ones may have been processed.\r | |
740 | @retval EFI_ACCESS_DENIED Access was denied by the device or the key server; OR a\r | |
741 | ClientId is required by the server and either none or an\r | |
742 | invalid id was provided.\r | |
743 | @retval EFI_DEVICE_ERROR Device or key server error. Check individual key request(s) to\r | |
744 | see which ones may have been processed.\r | |
745 | @retval EFI_INVALID_PARAMETER This is NULL, ClientId is required but it is NULL,\r | |
746 | KeyDescriptorCount is NULL, or Keys is NULL.\r | |
747 | @retval EFI_NOT_FOUND One or more EFI_KMS_KEY_DESCRIPTOR structures\r | |
748 | could not be processed properly. KeyDescriptorCount\r | |
749 | contains the number of structures which were successfully\r | |
750 | processed. Individual structures will reflect the status of the\r | |
751 | processing for that structure.\r | |
752 | @retval EFI_UNSUPPORTED The implementation/KMS does not support this function.\r | |
753 | \r | |
754 | **/\r | |
755 | typedef\r | |
756 | EFI_STATUS\r | |
757 | (EFIAPI *EFI_KMS_DELETE_KEY) (\r | |
758 | IN EFI_KMS_PROTOCOL *This,\r | |
759 | IN EFI_KMS_CLIENT_INFO *Client,\r | |
760 | IN OUT UINT16 *KeyDescriptorCount,\r | |
761 | IN OUT EFI_KMS_KEY_DESCRIPTOR *KeyDescriptors,\r | |
762 | IN OUT UINTN *ClientDataSize OPTIONAL,\r | |
763 | IN OUT VOID **ClientData OPTIONAL\r | |
764 | );\r | |
765 | \r | |
766 | /**\r | |
767 | Get one or more attributes associated with a specified key identifier.\r | |
768 | If none are found, the returned attributes count contains a value of zero.\r | |
769 | \r | |
770 | @param[in] This Pointer to the EFI_KMS_PROTOCOL instance.\r | |
771 | @param[in] Client Pointer to a valid EFI_KMS_CLIENT_INFO structure.\r | |
772 | @param[in] KeyIdentifierSize Pointer to the size in bytes of the KeyIdentifier variable.\r | |
773 | @param[in] KeyIdentifier Pointer to the key identifier associated with this key.\r | |
774 | @param[in, out] KeyAttributesCount Pointer to the number of EFI_KMS_KEY_ATTRIBUTE\r | |
775 | structures associated with the Key identifier. If none\r | |
776 | are found, the count value is zero on return.\r | |
777 | On input this value reflects the number of KeyAttributes\r | |
778 | that may be returned.\r | |
779 | On output, the value reflects the number of completed\r | |
780 | KeyAttributes structures found.\r | |
781 | @param[in, out] KeyAttributes Pointer to an array of EFI_KMS_KEY_ATTRIBUTE\r | |
782 | structures associated with the Key Identifier.\r | |
783 | On input, the fields in the structure should be NULL.\r | |
784 | On output, the attribute fields will have updated values\r | |
785 | for attributes associated with this key identifier.\r | |
9095d37b | 786 | @param[in, out] ClientDataSize Pointer to the size, in bytes, of an arbitrary block of\r |
76336e4e SZ |
787 | data specified by the ClientData parameter. This\r |
788 | parameter may be NULL, in which case the ClientData\r | |
789 | parameter will be ignored and no data will be\r | |
790 | transferred to or from the KMS. If the parameter is\r | |
791 | not NULL, then ClientData must be a valid pointer.\r | |
792 | If the value pointed to is 0, no data will be transferred\r | |
793 | to the KMS, but data may be returned by the KMS.\r | |
794 | For all non-zero values *ClientData will be transferred\r | |
795 | to the KMS, which may also return data to the caller.\r | |
796 | In all cases, the value upon return to the caller will\r | |
797 | be the size of the data block returned to the caller,\r | |
798 | which will be zero if no data is returned from the KMS.\r | |
799 | @param[in, out] ClientData Pointer to a pointer to an arbitrary block of data of\r | |
800 | *ClientDataSize that is to be passed directly to the\r | |
9095d37b LG |
801 | KMS if it supports the use of client data. This\r |
802 | parameter may be NULL if and only if the\r | |
76336e4e | 803 | ClientDataSize parameter is also NULL. Upon return to\r |
9095d37b LG |
804 | the caller, *ClientData points to a block of data of\r |
805 | *ClientDataSize that was returned from the KMS.\r | |
76336e4e SZ |
806 | If the returned value for *ClientDataSize is zero,\r |
807 | then the returned value for *ClientData must be NULL\r | |
808 | and should be ignored by the caller. The KMS protocol\r | |
809 | consumer is responsible for freeing all valid buffers\r | |
810 | used for client data regardless of whether they are\r | |
811 | allocated by the caller for input to the function or by\r | |
812 | the implementation for output back to the caller.\r | |
813 | \r | |
814 | @retval EFI_SUCCESS Successfully retrieved all key attributes.\r | |
815 | @retval EFI_OUT_OF_RESOURCES Could not allocate resources for the method processing.\r | |
816 | @retval EFI_TIMEOUT Timed out waiting for device or key server. Check individual key\r | |
817 | attribute request(s) to see which ones may have been\r | |
818 | processed.\r | |
819 | @retval EFI_BUFFER_TOO_SMALL If multiple key attributes are associated with a single identifier,\r | |
820 | and the KeyAttributes buffer does not contain enough\r | |
821 | structures (KeyAttributesCount) to contain all the key\r | |
822 | attributes data, then the available structures will be filled and\r | |
823 | KeyAttributesCount will be updated to indicate the\r | |
824 | number of key attributes which could not be processed.\r | |
825 | @retval EFI_ACCESS_DENIED Access was denied by the device or the key server; OR a\r | |
826 | ClientId is required by the server and either none or an\r | |
827 | invalid id was provided.\r | |
828 | @retval EFI_DEVICE_ERROR Device or key server error. Check individual key attribute\r | |
829 | request(s) (i.e. key attribute status for each) to see which ones\r | |
830 | may have been processed.\r | |
831 | @retval EFI_INVALID_PARAMETER This is NULL, ClientId is required but it is NULL,\r | |
832 | KeyIdentifierSize is NULL , or KeyIdentifier\r | |
833 | is NULL, or KeyAttributes is NULL, or\r | |
834 | KeyAttributesSize is NULL.\r | |
835 | @retval EFI_NOT_FOUND The KeyIdentifier could not be found.\r | |
836 | KeyAttributesCount contains zero. Individual\r | |
837 | structures will reflect the status of the processing for that\r | |
838 | structure.\r | |
839 | @retval EFI_UNSUPPORTED The implementation/KMS does not support this function.\r | |
840 | \r | |
841 | **/\r | |
842 | typedef\r | |
843 | EFI_STATUS\r | |
844 | (EFIAPI *EFI_KMS_GET_KEY_ATTRIBUTES) (\r | |
845 | IN EFI_KMS_PROTOCOL *This,\r | |
846 | IN EFI_KMS_CLIENT_INFO *Client,\r | |
847 | IN UINT8 *KeyIdentifierSize,\r | |
848 | IN CONST VOID *KeyIdentifier,\r | |
849 | IN OUT UINT16 *KeyAttributesCount,\r | |
850 | IN OUT EFI_KMS_KEY_ATTRIBUTE *KeyAttributes,\r | |
851 | IN OUT UINTN *ClientDataSize OPTIONAL,\r | |
852 | IN OUT VOID **ClientData OPTIONAL\r | |
853 | );\r | |
854 | \r | |
855 | /**\r | |
856 | Add one or more attributes to a key specified by a key identifier.\r | |
857 | \r | |
858 | @param[in] This Pointer to the EFI_KMS_PROTOCOL instance.\r | |
859 | @param[in] Client Pointer to a valid EFI_KMS_CLIENT_INFO structure.\r | |
860 | @param[in] KeyIdentifierSize Pointer to the size in bytes of the KeyIdentifier variable.\r | |
861 | @param[in] KeyIdentifier Pointer to the key identifier associated with this key.\r | |
862 | @param[in, out] KeyAttributesCount Pointer to the number of EFI_KMS_KEY_ATTRIBUTE\r | |
863 | structures to associate with the Key. On normal returns,\r | |
864 | this number will be updated with the number of key\r | |
865 | attributes successfully processed.\r | |
866 | @param[in, out] KeyAttributes Pointer to an array of EFI_KMS_KEY_ATTRIBUTE\r | |
867 | structures providing the attribute information to\r | |
868 | associate with the key.\r | |
869 | On input, the values for the fields in the structure\r | |
870 | are completely filled in.\r | |
871 | On return the KeyAttributeStatus field will reflect the\r | |
872 | result of the operation for each key attribute request.\r | |
9095d37b | 873 | @param[in, out] ClientDataSize Pointer to the size, in bytes, of an arbitrary block of\r |
76336e4e SZ |
874 | data specified by the ClientData parameter. This\r |
875 | parameter may be NULL, in which case the ClientData\r | |
876 | parameter will be ignored and no data will be\r | |
877 | transferred to or from the KMS. If the parameter is\r | |
878 | not NULL, then ClientData must be a valid pointer.\r | |
879 | If the value pointed to is 0, no data will be transferred\r | |
880 | to the KMS, but data may be returned by the KMS.\r | |
881 | For all non-zero values *ClientData will be transferred\r | |
882 | to the KMS, which may also return data to the caller.\r | |
883 | In all cases, the value upon return to the caller will\r | |
884 | be the size of the data block returned to the caller,\r | |
885 | which will be zero if no data is returned from the KMS.\r | |
886 | @param[in, out] ClientData Pointer to a pointer to an arbitrary block of data of\r | |
887 | *ClientDataSize that is to be passed directly to the\r | |
9095d37b LG |
888 | KMS if it supports the use of client data. This\r |
889 | parameter may be NULL if and only if the\r | |
76336e4e | 890 | ClientDataSize parameter is also NULL. Upon return to\r |
9095d37b LG |
891 | the caller, *ClientData points to a block of data of\r |
892 | *ClientDataSize that was returned from the KMS.\r | |
76336e4e SZ |
893 | If the returned value for *ClientDataSize is zero,\r |
894 | then the returned value for *ClientData must be NULL\r | |
895 | and should be ignored by the caller. The KMS protocol\r | |
896 | consumer is responsible for freeing all valid buffers\r | |
897 | used for client data regardless of whether they are\r | |
898 | allocated by the caller for input to the function or by\r | |
899 | the implementation for output back to the caller.\r | |
900 | \r | |
901 | @retval EFI_SUCCESS Successfully added all requested key attributes.\r | |
902 | @retval EFI_OUT_OF_RESOURCES Could not allocate required resources.\r | |
903 | @retval EFI_TIMEOUT Timed out waiting for device or key server. Check individual key\r | |
904 | attribute request(s) to see which ones may have been\r | |
905 | processed.\r | |
906 | @retval EFI_BUFFER_TOO_SMALL If multiple keys attributes are associated with a single key\r | |
907 | identifier, and the attributes buffer does not contain\r | |
908 | enough structures (KeyAttributesCount) to contain all\r | |
909 | the data, then the available structures will be filled and\r | |
910 | KeyAttributesCount will be updated to indicate the\r | |
911 | number of key attributes which could not be processed. The\r | |
912 | status of each key attribute is also updated indicating success or\r | |
913 | failure for that attribute in case there are other errors for those\r | |
914 | attributes that could be processed.\r | |
915 | @retval EFI_ACCESS_DENIED Access was denied by the device or the key server; OR a\r | |
916 | ClientId is required by the server and either none or an\r | |
917 | invalid id was provided.\r | |
918 | @retval EFI_DEVICE_ERROR Device or key server error. Check individual key attribute\r | |
919 | request(s) (i.e. key attribute status for each) to see which ones\r | |
920 | may have been processed.\r | |
921 | @retval EFI_INVALID_PARAMETER This is NULL, ClientId is required but it is NULL,\r | |
922 | KeyAttributesCount is NULL, or KeyAttributes\r | |
923 | is NULL, or KeyIdentifierSize is NULL, or\r | |
924 | KeyIdentifer is NULL.\r | |
925 | @retval EFI_NOT_FOUND The KeyIdentifier could not be found. On return the\r | |
926 | KeyAttributesCount contains the number of attributes\r | |
927 | processed. Individual structures will reflect the status of the\r | |
928 | processing for that structure.\r | |
929 | @retval EFI_UNSUPPORTED The implementation/KMS does not support this function.\r | |
930 | \r | |
931 | **/\r | |
932 | typedef\r | |
933 | EFI_STATUS\r | |
934 | (EFIAPI *EFI_KMS_ADD_KEY_ATTRIBUTES) (\r | |
935 | IN EFI_KMS_PROTOCOL *This,\r | |
936 | IN EFI_KMS_CLIENT_INFO *Client,\r | |
937 | IN UINT8 *KeyIdentifierSize,\r | |
938 | IN CONST VOID *KeyIdentifier,\r | |
939 | IN OUT UINT16 *KeyAttributesCount,\r | |
940 | IN OUT EFI_KMS_KEY_ATTRIBUTE *KeyAttributes,\r | |
941 | IN OUT UINTN *ClientDataSize OPTIONAL,\r | |
942 | IN OUT VOID **ClientData OPTIONAL\r | |
943 | );\r | |
944 | \r | |
945 | /**\r | |
946 | Delete attributes to a key specified by a key identifier.\r | |
947 | \r | |
948 | @param[in] This Pointer to the EFI_KMS_PROTOCOL instance.\r | |
949 | @param[in] Client Pointer to a valid EFI_KMS_CLIENT_INFO structure.\r | |
950 | @param[in] KeyIdentifierSize Pointer to the size in bytes of the KeyIdentifier variable.\r | |
951 | @param[in] KeyIdentifier Pointer to the key identifier associated with this key.\r | |
952 | @param[in, out] KeyAttributesCount Pointer to the number of EFI_KMS_KEY_ATTRIBUTE\r | |
953 | structures to associate with the Key.\r | |
954 | On input, the count value is one or more.\r | |
955 | On normal returns, this number will be updated with\r | |
956 | the number of key attributes successfully processed.\r | |
957 | @param[in, out] KeyAttributes Pointer to an array of EFI_KMS_KEY_ATTRIBUTE\r | |
958 | structures providing the attribute information to\r | |
959 | associate with the key.\r | |
960 | On input, the values for the fields in the structure\r | |
961 | are completely filled in.\r | |
962 | On return the KeyAttributeStatus field will reflect the\r | |
963 | result of the operation for each key attribute request.\r | |
9095d37b | 964 | @param[in, out] ClientDataSize Pointer to the size, in bytes, of an arbitrary block of\r |
76336e4e SZ |
965 | data specified by the ClientData parameter. This\r |
966 | parameter may be NULL, in which case the ClientData\r | |
967 | parameter will be ignored and no data will be\r | |
968 | transferred to or from the KMS. If the parameter is\r | |
969 | not NULL, then ClientData must be a valid pointer.\r | |
970 | If the value pointed to is 0, no data will be transferred\r | |
971 | to the KMS, but data may be returned by the KMS.\r | |
972 | For all non-zero values *ClientData will be transferred\r | |
973 | to the KMS, which may also return data to the caller.\r | |
974 | In all cases, the value upon return to the caller will\r | |
975 | be the size of the data block returned to the caller,\r | |
976 | which will be zero if no data is returned from the KMS.\r | |
977 | @param[in, out] ClientData Pointer to a pointer to an arbitrary block of data of\r | |
978 | *ClientDataSize that is to be passed directly to the\r | |
9095d37b LG |
979 | KMS if it supports the use of client data. This\r |
980 | parameter may be NULL if and only if the\r | |
76336e4e | 981 | ClientDataSize parameter is also NULL. Upon return to\r |
9095d37b LG |
982 | the caller, *ClientData points to a block of data of\r |
983 | *ClientDataSize that was returned from the KMS.\r | |
76336e4e SZ |
984 | If the returned value for *ClientDataSize is zero,\r |
985 | then the returned value for *ClientData must be NULL\r | |
986 | and should be ignored by the caller. The KMS protocol\r | |
987 | consumer is responsible for freeing all valid buffers\r | |
988 | used for client data regardless of whether they are\r | |
989 | allocated by the caller for input to the function or by\r | |
990 | the implementation for output back to the caller.\r | |
991 | \r | |
992 | @retval EFI_SUCCESS Successfully deleted all requested key attributes.\r | |
993 | @retval EFI_OUT_OF_RESOURCES Could not allocate required resources.\r | |
994 | @retval EFI_TIMEOUT Timed out waiting for device or key server. Check individual key\r | |
995 | attribute request(s) to see which ones may have been\r | |
996 | processed.\r | |
997 | @retval EFI_ACCESS_DENIED Access was denied by the device or the key server; OR a\r | |
998 | ClientId is required by the server and either none or an\r | |
999 | invalid id was provided.\r | |
1000 | @retval EFI_DEVICE_ERROR Device or key server error. Check individual key attribute\r | |
1001 | request(s) (i.e. key attribute status for each) to see which ones\r | |
1002 | may have been processed.\r | |
1003 | @retval EFI_INVALID_PARAMETER This is NULL, ClientId is required but it is NULL,\r | |
1004 | KeyAttributesCount is NULL, or\r | |
1005 | KeyAttributes is NULL, or KeyIdentifierSize\r | |
1006 | is NULL, or KeyIdentifer is NULL.\r | |
1007 | @retval EFI_NOT_FOUND The KeyIdentifier could not be found or the attribute\r | |
1008 | could not be found. On return the KeyAttributesCount\r | |
1009 | contains the number of attributes processed. Individual\r | |
1010 | structures will reflect the status of the processing for that\r | |
1011 | structure.\r | |
1012 | @retval EFI_UNSUPPORTED The implementation/KMS does not support this function.\r | |
1013 | \r | |
1014 | **/\r | |
1015 | typedef\r | |
1016 | EFI_STATUS\r | |
1017 | (EFIAPI *EFI_KMS_DELETE_KEY_ATTRIBUTES) (\r | |
1018 | IN EFI_KMS_PROTOCOL *This,\r | |
1019 | IN EFI_KMS_CLIENT_INFO *Client,\r | |
1020 | IN UINT8 *KeyIdentifierSize,\r | |
1021 | IN CONST VOID *KeyIdentifier,\r | |
1022 | IN OUT UINT16 *KeyAttributesCount,\r | |
1023 | IN OUT EFI_KMS_KEY_ATTRIBUTE *KeyAttributes,\r | |
1024 | IN OUT UINTN *ClientDataSize OPTIONAL,\r | |
1025 | IN OUT VOID **ClientData OPTIONAL\r | |
1026 | );\r | |
1027 | \r | |
1028 | /**\r | |
1029 | Retrieve one or more key that has matched all of the specified key attributes.\r | |
1030 | \r | |
1031 | @param[in] This Pointer to the EFI_KMS_PROTOCOL instance.\r | |
1032 | @param[in] Client Pointer to a valid EFI_KMS_CLIENT_INFO structure.\r | |
1033 | @param[in, out] KeyAttributesCount Pointer to a count of the number of key attribute structures\r | |
1034 | that must be matched for each returned key descriptor.\r | |
1035 | On input the count value is one or more.\r | |
1036 | On normal returns, this number will be updated with\r | |
1037 | the number of key attributes successfully processed.\r | |
1038 | @param[in, out] KeyAttributes Pointer to an array of EFI_KMS_KEY_ATTRIBUTE\r | |
1039 | structure to search for.\r | |
1040 | On input, the values for the fields in the structure are\r | |
1041 | completely filled in.\r | |
1042 | On return the KeyAttributeStatus field will reflect the\r | |
1043 | result of the operation for each key attribute request.\r | |
1044 | @param[in, out] KeyDescriptorCount Pointer to a count of the number of key descriptors matched\r | |
1045 | by this operation.\r | |
1046 | On entry, this number will be zero.\r | |
1047 | On return, this number will be updated to the number\r | |
1048 | of key descriptors successfully found.\r | |
1049 | @param[in, out] KeyDescriptors Pointer to an array of EFI_KMS_KEY_DESCRIPTOR\r | |
1050 | structures which describe the keys from the KMS\r | |
1051 | having the KeyAttribute(s) specified.\r | |
1052 | On input, this pointer will be NULL.\r | |
1053 | On output, the array will contain an\r | |
1054 | EFI_KMS_KEY_DESCRIPTOR structure for each key\r | |
1055 | meeting the search criteria. Memory for the array\r | |
1056 | and all KeyValue fields will be allocated with the\r | |
1057 | EfiBootServicesData type and must be freed by the\r | |
1058 | caller when it is no longer needed. Also, the KeyStatus\r | |
1059 | field of each descriptor will reflect the result of the\r | |
1060 | request relative to that key descriptor.\r | |
9095d37b | 1061 | @param[in, out] ClientDataSize Pointer to the size, in bytes, of an arbitrary block of\r |
76336e4e SZ |
1062 | data specified by the ClientData parameter. This\r |
1063 | parameter may be NULL, in which case the ClientData\r | |
1064 | parameter will be ignored and no data will be\r | |
1065 | transferred to or from the KMS. If the parameter is\r | |
1066 | not NULL, then ClientData must be a valid pointer.\r | |
1067 | If the value pointed to is 0, no data will be transferred\r | |
1068 | to the KMS, but data may be returned by the KMS.\r | |
1069 | For all non-zero values *ClientData will be transferred\r | |
1070 | to the KMS, which may also return data to the caller.\r | |
1071 | In all cases, the value upon return to the caller will\r | |
1072 | be the size of the data block returned to the caller,\r | |
1073 | which will be zero if no data is returned from the KMS.\r | |
1074 | @param[in, out] ClientData Pointer to a pointer to an arbitrary block of data of\r | |
1075 | *ClientDataSize that is to be passed directly to the\r | |
9095d37b LG |
1076 | KMS if it supports the use of client data. This\r |
1077 | parameter may be NULL if and only if the\r | |
76336e4e | 1078 | ClientDataSize parameter is also NULL. Upon return to\r |
9095d37b LG |
1079 | the caller, *ClientData points to a block of data of\r |
1080 | *ClientDataSize that was returned from the KMS.\r | |
76336e4e SZ |
1081 | If the returned value for *ClientDataSize is zero,\r |
1082 | then the returned value for *ClientData must be NULL\r | |
1083 | and should be ignored by the caller. The KMS protocol\r | |
1084 | consumer is responsible for freeing all valid buffers\r | |
1085 | used for client data regardless of whether they are\r | |
1086 | allocated by the caller for input to the function or by\r | |
1087 | the implementation for output back to the caller.\r | |
1088 | \r | |
1089 | @retval EFI_SUCCESS Successfully retrieved all requested keys.\r | |
1090 | @retval EFI_OUT_OF_RESOURCES Could not allocate required resources.\r | |
1091 | @retval EFI_TIMEOUT Timed out waiting for device or key server. Check individual key\r | |
1092 | attribute request(s) to see which ones may have been\r | |
1093 | processed.\r | |
1094 | @retval EFI_BUFFER_TOO_SMALL If multiple keys are associated with the attribute(s), and the\r | |
1095 | KeyValue buffer does not contain enough structures\r | |
1096 | (KeyDescriptorCount) to contain all the key data, then\r | |
1097 | the available structures will be filled and\r | |
1098 | KeyDescriptorCount will be updated to indicate the\r | |
1099 | number of keys which could not be processed.\r | |
1100 | @retval EFI_ACCESS_DENIED Access was denied by the device or the key server; OR a\r | |
1101 | ClientId is required by the server and either none or an\r | |
1102 | invalid id was provided.\r | |
1103 | @retval EFI_DEVICE_ERROR Device or key server error. Check individual key attribute\r | |
1104 | request(s) (i.e. key attribute status for each) to see which ones\r | |
1105 | may have been processed.\r | |
1106 | @retval EFI_INVALID_PARAMETER This is NULL, ClientId is required but it is NULL,\r | |
1107 | KeyDescriptorCount is NULL, or\r | |
1108 | KeyDescriptors is NULL or KeyAttributes is\r | |
1109 | NULL, or KeyAttributesCount is NULL.\r | |
1110 | @retval EFI_NOT_FOUND One or more EFI_KMS_KEY_ATTRIBUTE structures could\r | |
1111 | not be processed properly. KeyAttributeCount contains\r | |
1112 | the number of structures which were successfully processed.\r | |
1113 | Individual structures will reflect the status of the processing for\r | |
1114 | that structure.\r | |
1115 | @retval EFI_UNSUPPORTED The implementation/KMS does not support this function.\r | |
1116 | \r | |
1117 | **/\r | |
1118 | typedef\r | |
1119 | EFI_STATUS\r | |
1120 | (EFIAPI *EFI_KMS_GET_KEY_BY_ATTRIBUTES) (\r | |
1121 | IN EFI_KMS_PROTOCOL *This,\r | |
1122 | IN EFI_KMS_CLIENT_INFO *Client,\r | |
1123 | IN OUT UINTN *KeyAttributeCount,\r | |
1124 | IN OUT EFI_KMS_KEY_ATTRIBUTE *KeyAttributes,\r | |
1125 | IN OUT UINTN *KeyDescriptorCount,\r | |
1126 | IN OUT EFI_KMS_KEY_DESCRIPTOR *KeyDescriptors,\r | |
1127 | IN OUT UINTN *ClientDataSize OPTIONAL,\r | |
1128 | IN OUT VOID **ClientData OPTIONAL\r | |
1129 | );\r | |
1130 | \r | |
1131 | ///\r | |
1132 | /// The Key Management Service (KMS) protocol provides services to generate, store, retrieve,\r | |
1133 | /// and manage cryptographic keys.\r | |
1134 | ///\r | |
1135 | struct _EFI_KMS_PROTOCOL {\r | |
1136 | ///\r | |
1137 | /// Get the current status of the key management service. If the implementation has not yet\r | |
1138 | /// connected to the KMS, then a call to this function will initiate a connection. This is the\r | |
1139 | /// only function that is valid for use prior to the service being marked available.\r | |
1140 | ///\r | |
1141 | EFI_KMS_GET_SERVICE_STATUS GetServiceStatus;\r | |
1142 | ///\r | |
1143 | /// Register a specific client with the KMS.\r | |
1144 | ///\r | |
1145 | EFI_KMS_REGISTER_CLIENT RegisterClient;\r | |
1146 | ///\r | |
1147 | /// Request the generation of a new key and retrieve it.\r | |
1148 | ///\r | |
1149 | EFI_KMS_CREATE_KEY CreateKey;\r | |
1150 | ///\r | |
1151 | /// Retrieve an existing key.\r | |
1152 | ///\r | |
1153 | EFI_KMS_GET_KEY GetKey;\r | |
1154 | ///\r | |
1155 | /// Add a local key to KMS database. If there is an existing key with this key identifier in the\r | |
1156 | /// KMS database, it will be replaced with the new key.\r | |
1157 | ///\r | |
1158 | EFI_KMS_ADD_KEY AddKey;\r | |
1159 | ///\r | |
1160 | /// Delete an existing key from the KMS database.\r | |
1161 | ///\r | |
1162 | EFI_KMS_DELETE_KEY DeleteKey;\r | |
1163 | ///\r | |
1164 | /// Get attributes for an existing key in the KMS database.\r | |
1165 | ///\r | |
1166 | EFI_KMS_GET_KEY_ATTRIBUTES GetKeyAttributes;\r | |
1167 | ///\r | |
1168 | /// Add attributes to an existing key in the KMS database.\r | |
1169 | ///\r | |
1170 | EFI_KMS_ADD_KEY_ATTRIBUTES AddKeyAttributes;\r | |
1171 | ///\r | |
1172 | /// Delete attributes for an existing key in the KMS database.\r | |
1173 | ///\r | |
1174 | EFI_KMS_DELETE_KEY_ATTRIBUTES DeleteKeyAttributes;\r | |
1175 | ///\r | |
1176 | /// Get existing key(s) with the specified attributes.\r | |
1177 | ///\r | |
1178 | EFI_KMS_GET_KEY_BY_ATTRIBUTES GetKeyByAttributes;\r | |
1179 | ///\r | |
1180 | /// The version of this EFI_KMS_PROTOCOL structure. This must be set to 0x00020040 for\r | |
1181 | /// the initial version of this protocol.\r | |
1182 | ///\r | |
1183 | UINT32 ProtocolVersion;\r | |
1184 | ///\r | |
1185 | /// Optional GUID used to identify a specific KMS. This GUID may be supplied by the provider,\r | |
1186 | /// by the implementation, or may be null. If is null, then the ServiceName must not be null.\r | |
1187 | ///\r | |
1188 | EFI_GUID ServiceId;\r | |
1189 | ///\r | |
1190 | /// Optional pointer to a unicode string which may be used to identify the KMS or provide\r | |
1191 | /// other information about the supplier.\r | |
1192 | ///\r | |
1193 | CHAR16 *ServiceName;\r | |
1194 | ///\r | |
1195 | /// Optional 32-bit value which may be used to indicate the version of the KMS provided by\r | |
1196 | /// the supplier.\r | |
1197 | ///\r | |
1198 | UINT32 ServiceVersion;\r | |
1199 | ///\r | |
1200 | /// TRUE if and only if the service is active and available for use. To avoid unnecessary\r | |
1201 | /// delays in POST, this protocol may be installed without connecting to the service. In this\r | |
1202 | /// case, the first call to the GetServiceStatus () function will cause the implementation to\r | |
1203 | /// connect to the supported service and mark it as available. The capabilities of this service\r | |
1204 | /// as defined in the reminder of this protocol are not guaranteed to be valid until the service\r | |
1205 | /// has been marked available.\r | |
1206 | ///\r | |
1207 | BOOLEAN ServiceAvailable;\r | |
1208 | ///\r | |
a750b4ae | 1209 | /// TRUE if and only if the service supports client identifiers. Client identifiers may be used\r |
76336e4e SZ |
1210 | /// for auditing, access control or any other purpose specific to the implementation.\r |
1211 | ///\r | |
1212 | BOOLEAN ClientIdSupported;\r | |
1213 | ///\r | |
a750b4ae | 1214 | /// TRUE if and only if the service requires a client identifier in order to process key requests.\r |
76336e4e SZ |
1215 | /// FALSE otherwise.\r |
1216 | ///\r | |
1217 | BOOLEAN ClientIdRequired;\r | |
1218 | ///\r | |
1219 | /// The maximum size in bytes for the client identifier.\r | |
1220 | ///\r | |
1221 | UINT16 ClientIdMaxSize;\r | |
1222 | ///\r | |
1223 | /// The client name string type(s) supported by the KMS service. If client names are not\r | |
1224 | /// supported, this field will be set the EFI_KMS_DATA_TYPE_NONE. Otherwise, it will be set\r | |
1225 | /// to the inclusive 'OR' of all client name formats supported. Client names may be used for\r | |
1226 | /// auditing, access control or any other purpose specific to the implementation.\r | |
1227 | ///\r | |
1228 | UINT8 ClientNameStringTypes;\r | |
1229 | ///\r | |
a750b4ae | 1230 | /// TRUE if only if the KMS requires a client name to be supplied to the service.\r |
76336e4e SZ |
1231 | /// FALSE otherwise.\r |
1232 | ///\r | |
1233 | BOOLEAN ClientNameRequired;\r | |
1234 | ///\r | |
1235 | /// The maximum number of characters allowed for the client name.\r | |
1236 | ///\r | |
1237 | UINT16 ClientNameMaxCount;\r | |
1238 | ///\r | |
a750b4ae | 1239 | /// TRUE if and only if the service supports arbitrary client data requests. The use of client\r |
76336e4e SZ |
1240 | /// data requires the caller to have specific knowledge of the individual KMS service and\r |
1241 | /// should be used only if absolutely necessary.\r | |
1242 | /// FALSE otherwise.\r | |
1243 | ///\r | |
1244 | BOOLEAN ClientDataSupported;\r | |
1245 | ///\r | |
1246 | /// The maximum size in bytes for the client data. If the maximum data size is not specified\r | |
1247 | /// by the KMS or it is not known, then this field must be filled with all ones.\r | |
1248 | ///\r | |
1249 | UINTN ClientDataMaxSize;\r | |
1250 | ///\r | |
a750b4ae | 1251 | /// TRUE if variable length key identifiers are supported.\r |
76336e4e SZ |
1252 | /// FALSE if a fixed length key identifier is supported.\r |
1253 | ///\r | |
1254 | BOOLEAN KeyIdVariableLenSupported;\r | |
1255 | ///\r | |
1256 | /// If KeyIdVariableLenSupported is TRUE, this is the maximum supported key identifier length\r | |
1257 | /// in bytes. Otherwise this is the fixed length of key identifier supported. Key ids shorter\r | |
1258 | /// than the fixed length will be padded on the right with blanks.\r | |
1259 | ///\r | |
1260 | UINTN KeyIdMaxSize;\r | |
1261 | ///\r | |
1262 | /// The number of key format/size GUIDs returned in the KeyFormats field.\r | |
1263 | ///\r | |
1264 | UINTN KeyFormatsCount;\r | |
1265 | ///\r | |
1266 | /// A pointer to an array of EFI_GUID values which specify key formats/sizes supported by\r | |
1267 | /// this KMS. Each format/size pair will be specified by a separate EFI_GUID. At least one\r | |
1268 | /// key format/size must be supported. All formats/sizes with the same hashing algorithm\r | |
1269 | /// must be contiguous in the array, and for each hashing algorithm, the key sizes must be in\r | |
1270 | /// ascending order. See "Related Definitions" for GUIDs which identify supported key formats/sizes.\r | |
1271 | /// This list of GUIDs supported by the KMS is not required to be exhaustive, and the KMS\r | |
1272 | /// may provide support for additional key formats/sizes. Users may request key information\r | |
1273 | /// using an arbitrary GUID, but any GUID not recognized by the implementation or not\r | |
1274 | /// supported by the KMS will return an error code of EFI_UNSUPPORTED\r | |
1275 | ///\r | |
1276 | EFI_GUID *KeyFormats;\r | |
1277 | ///\r | |
1278 | /// TRUE if key attributes are supported.\r | |
1279 | /// FALSE if key attributes are not supported.\r | |
1280 | ///\r | |
1281 | BOOLEAN KeyAttributesSupported;\r | |
1282 | ///\r | |
1283 | /// The key attribute identifier string type(s) supported by the KMS service. If key attributes\r | |
1284 | /// are not supported, this field will be set to EFI_KMS_DATA_TYPE_NONE. Otherwise, it will\r | |
1285 | /// be set to the inclusive 'OR' of all key attribute identifier string types supported.\r | |
1286 | /// EFI_KMS_DATA_TYPE_BINARY is not valid for this field.\r | |
1287 | ///\r | |
1288 | UINT8 KeyAttributeIdStringTypes;\r | |
1289 | UINT16 KeyAttributeIdMaxCount;\r | |
1290 | ///\r | |
1291 | /// The number of predefined KeyAttributes structures returned in the KeyAttributes\r | |
1292 | /// parameter. If the KMS does not support predefined key attributes, or if it does not\r | |
1293 | /// provide a method to obtain predefined key attributes data, then this field must be zero.\r | |
1294 | ///\r | |
1295 | UINTN KeyAttributesCount;\r | |
1296 | ///\r | |
1297 | /// A pointer to an array of KeyAttributes structures which contains the predefined\r | |
1298 | /// attributes supported by this KMS. Each structure must contain a valid key attribute\r | |
1299 | /// identifier and should provide any other information as appropriate for the attribute,\r | |
1300 | /// including a default value if one exists. This variable must be set to NULL if the\r | |
1301 | /// KeyAttributesCount variable is zero. It must point to a valid buffer if the\r | |
1302 | /// KeyAttributesCount variable is non-zero.\r | |
1303 | /// This list of predefined attributes is not required to be exhaustive, and the KMS may\r | |
1304 | /// provide additional predefined attributes not enumerated in this list. The implementation\r | |
1305 | /// does not distinguish between predefined and used defined attributes, and therefore,\r | |
1306 | /// predefined attributes not enumerated will still be processed to the KMS.\r | |
1307 | ///\r | |
1308 | EFI_KMS_KEY_ATTRIBUTE *KeyAttributes;\r | |
1309 | };\r | |
1310 | \r | |
1311 | extern EFI_GUID gEfiKmsFormatGeneric128Guid;\r | |
1312 | extern EFI_GUID gEfiKmsFormatGeneric160Guid;\r | |
1313 | extern EFI_GUID gEfiKmsFormatGeneric256Guid;\r | |
1314 | extern EFI_GUID gEfiKmsFormatGeneric512Guid;\r | |
1315 | extern EFI_GUID gEfiKmsFormatGeneric1024Guid;\r | |
1316 | extern EFI_GUID gEfiKmsFormatGeneric2048Guid;\r | |
1317 | extern EFI_GUID gEfiKmsFormatGeneric3072Guid;\r | |
1318 | extern EFI_GUID gEfiKmsFormatMd2128Guid;\r | |
1319 | extern EFI_GUID gEfiKmsFormatMdc2128Guid;\r | |
1320 | extern EFI_GUID gEfiKmsFormatMd4128Guid;\r | |
1321 | extern EFI_GUID gEfiKmsFormatMdc4128Guid;\r | |
1322 | extern EFI_GUID gEfiKmsFormatMd5128Guid;\r | |
1323 | extern EFI_GUID gEfiKmsFormatMd5sha128Guid;\r | |
1324 | extern EFI_GUID gEfiKmsFormatSha1160Guid;\r | |
1325 | extern EFI_GUID gEfiKmsFormatSha256256Guid;\r | |
1326 | extern EFI_GUID gEfiKmsFormatSha512512Guid;\r | |
1327 | extern EFI_GUID gEfiKmsFormatAesxts128Guid;\r | |
1328 | extern EFI_GUID gEfiKmsFormatAesxts256Guid;\r | |
1329 | extern EFI_GUID gEfiKmsFormatAescbc128Guid;\r | |
1330 | extern EFI_GUID gEfiKmsFormatAescbc256Guid;\r | |
1331 | extern EFI_GUID gEfiKmsFormatRsasha11024Guid;\r | |
1332 | extern EFI_GUID gEfiKmsFormatRsasha12048Guid;\r | |
1333 | extern EFI_GUID gEfiKmsFormatRsasha2562048Guid;\r | |
1334 | extern EFI_GUID gEfiKmsFormatRsasha2563072Guid;\r | |
1335 | extern EFI_GUID gEfiKmsProtocolGuid;\r | |
1336 | \r | |
1337 | #endif\r |