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