iPXE
Supplicant.h
Go to the documentation of this file.
1 /** @file
2  This file defines the EFI Supplicant Protocol.
3 
4  Copyright (c) 2016 - 2017, Intel Corporation. All rights reserved.<BR>
5  SPDX-License-Identifier: BSD-2-Clause-Patent
6 
7  @par Revision Reference:
8  This Protocol is introduced in UEFI Specification 2.6
9 
10 **/
11 
12 #ifndef __EFI_SUPPLICANT_PROTOCOL_H__
13 #define __EFI_SUPPLICANT_PROTOCOL_H__
14 
15 FILE_LICENCE ( BSD2_PATENT );
16 
18 
19 ///
20 /// The EFI Supplicant Service Binding Protocol is used to locate EFI
21 /// Supplicant Protocol drivers to create and destroy child of the driver to
22 /// communicate with other host using Supplicant protocol.
23 ///
24 #define EFI_SUPPLICANT_SERVICE_BINDING_PROTOCOL_GUID \
25  { \
26  0x45bcd98e, 0x59ad, 0x4174, { 0x95, 0x46, 0x34, 0x4a, 0x7, 0x48, 0x58, 0x98 } \
27  }
28 
29 ///
30 /// The EFI Supplicant protocol provides services to process authentication and
31 /// data encryption/decryption for security management.
32 ///
33 #define EFI_SUPPLICANT_PROTOCOL_GUID \
34  { \
35  0x54fcc43e, 0xaa89, 0x4333, { 0x9a, 0x85, 0xcd, 0xea, 0x24, 0x5, 0x1e, 0x9e } \
36  }
37 
39 
40 ///
41 /// EFI_SUPPLICANT_CRYPT_MODE
42 ///
43 typedef enum {
44  //
45  // Encrypt data provided in the fragment buffers.
46  //
48  //
49  // Decrypt data provided in the fragment buffers.
50  //
53 
54 ///
55 /// EFI_SUPPLICANT_DATA_TYPE
56 ///
57 typedef enum {
58  //
59  // Session Configuration
60  //
61 
62  //
63  // Current authentication type in use. The corresponding Data is of type
64  // EFI_80211_AKM_SUITE_SELECTOR.
65  //
67  //
68  // Group data encryption type in use. The corresponding Data is of type
69  // EFI_SUPPLICANT_CIPHER_SUITE_SELECTOR.
70  //
72  //
73  // Pairwise encryption type in use. The corresponding Data is of type
74  // EFI_80211_CIPHER_SUITE_SELECTOR.
75  //
77  //
78  // PSK password. The corresponding Data is a NULL-terminated ASCII string.
79  //
81  //
82  // Target SSID name. The corresponding Data is of type EFI_80211_SSID.
83  //
85  //
86  // Station MAC address. The corresponding Data is of type
87  // EFI_80211_MAC_ADDRESS.
88  //
90  //
91  // Target SSID MAC address. The corresponding Data is 6 bytes MAC address.
92  //
94 
95  //
96  // Session Information
97  //
98 
99  //
100  // 802.11 PTK. The corresponding Data is of type EFI_SUPPLICANT_KEY.
101  //
103  //
104  // 802.11 GTK. The corresponding Data is of type EFI_SUPPLICANT_GTK_LIST.
105  //
107  //
108  // Supplicant state. The corresponding Data is
109  // EFI_EAPOL_SUPPLICANT_PAE_STATE.
110  //
112  //
113  // 802.11 link state. The corresponding Data is EFI_80211_LINK_STATE.
114  //
116  //
117  // Flag indicates key is refreshed. The corresponding Data is
118  // EFI_SUPPLICANT_KEY_REFRESH.
119  //
121 
122  //
123  // Session Configuration
124  //
125 
126  //
127  // Supported authentication types. The corresponding Data is of type
128  // EFI_80211_AKM_SUITE_SELECTOR.
129  //
131  //
132  // Supported software encryption types provided by supplicant driver. The
133  // corresponding Data is of type EFI_80211_CIPHER_SUITE_SELECTOR.
134  //
136  //
137  // Supported hardware encryption types provided by wireless UNDI driver. The
138  // corresponding Data is of type EFI_80211_CIPHER_SUITE_SELECTOR.
139  //
141 
142  //
143  // Session Information
144  //
145 
146  //
147  // 802.11 Integrity GTK. The corresponding Data is of type
148  // EFI_SUPPLICANT_GTK_LIST.
149  //
151  //
152  // 802.11 PMK. The corresponding Data is 32 bytes pairwise master key.
153  //
157 
158 ///
159 /// EFI_80211_LINK_STATE
160 ///
161 typedef enum {
162  //
163  // Indicates initial start state, unauthenticated, unassociated.
164  //
166  //
167  // Indicates authenticated, unassociated.
168  //
170  //
171  // Indicates authenticated and associated, but pending RSN authentication.
172  //
174  //
175  // Indicates authenticated and associated.
176  //
179 
180 ///
181 /// EFI_SUPPLICANT_KEY_TYPE (IEEE Std 802.11 Section 6.3.19.1.2)
182 ///
183 typedef enum {
189 
190 ///
191 /// EFI_SUPPLICANT_KEY_DIRECTION (IEEE Std 802.11 Section 6.3.19.1.2)
192 ///
193 typedef enum {
194  //
195  // Indicates that the keys are being installed for the receive direction.
196  //
198  //
199  // Indicates that the keys are being installed for the transmit direction.
200  //
202  //
203  // Indicates that the keys are being installed for both the receive and
204  // transmit directions.
205  //
208 
209 ///
210 /// EFI_SUPPLICANT_KEY_REFRESH
211 ///
212 typedef struct {
213  //
214  // If TRUE, indicates GTK is just refreshed after a successful call to
215  // EFI_SUPPLICANT_PROTOCOL.BuildResponsePacket().
216  //
219 
220 #define EFI_MAX_KEY_LEN 64
221 
222 ///
223 /// EFI_SUPPLICANT_KEY
224 ///
225 typedef struct {
226  //
227  // The key value.
228  //
230  //
231  // Length in bytes of the Key. Should be up to EFI_MAX_KEY_LEN.
232  //
234  //
235  // The key identifier.
236  //
238  //
239  // Defines whether this key is a group key, pairwise key, PeerKey, or
240  // Integrity Group.
241  //
243  //
244  // The value is set according to the KeyType.
245  //
247  //
248  // The Receive Sequence Count value.
249  //
250  UINT8 Rsc[8];
251  //
252  // Length in bytes of the Rsc. Should be up to 8.
253  //
255  //
256  // Indicates whether the key is configured by the Authenticator or
257  // Supplicant. The value true indicates Authenticator.
258  //
260  //
261  // The cipher suite required for this association.
262  //
264  //
265  // Indicates the direction for which the keys are to be installed.
266  //
269 
270 ///
271 /// EFI_SUPPLICANT_GTK_LIST
272 ///
273 typedef struct {
274  //
275  // Indicates the number of GTKs that are contained in GTKList.
276  //
278  //
279  // A variable-length array of GTKs of type EFI_SUPPLICANT_KEY. The number of
280  // entries is specified by GTKCount.
281  //
282  EFI_SUPPLICANT_KEY GTKList[1];
284 
285 ///
286 /// EFI_SUPPLICANT_FRAGMENT_DATA
287 ///
288 typedef struct {
289  //
290  // Length of data buffer in the fragment.
291  //
293  //
294  // Pointer to the data buffer in the fragment.
295  //
298 
299 /**
300  BuildResponsePacket() is called during STA and AP authentication is in
301  progress. Supplicant derives the PTK or session keys depend on type of
302  authentication is being employed.
303 
304  @param[in] This Pointer to the EFI_SUPPLICANT_PROTOCOL
305  instance.
306  @param[in] RequestBuffer Pointer to the most recently received EAPOL
307  packet. NULL means the supplicant need
308  initiate the EAP authentication session and
309  send EAPOL-Start message.
310  @param[in] RequestBufferSize
311  Packet size in bytes for the most recently
312  received EAPOL packet. 0 is only valid when
313  RequestBuffer is NULL.
314  @param[out] Buffer Pointer to the buffer to hold the built
315  packet.
316  @param[in, out] BufferSize Pointer to the buffer size in bytes. On
317  input, it is the buffer size provided by the
318  caller. On output, it is the buffer size in
319  fact needed to contain the packet.
320 
321  @retval EFI_SUCCESS The required EAPOL packet is built
322  successfully.
323  @retval EFI_INVALID_PARAMETER One or more of the following conditions is
324  TRUE:
325  RequestBuffer is NULL, but RequestSize is
326  NOT 0.
327  RequestBufferSize is 0.
328  Buffer is NULL, but RequestBuffer is NOT 0.
329  BufferSize is NULL.
330  @retval EFI_BUFFER_TOO_SMALL BufferSize is too small to hold the response
331  packet.
332  @retval EFI_NOT_READY Current EAPOL session state is NOT ready to
333  build ResponsePacket.
334 
335 **/
336 typedef
340  IN UINT8 *RequestBuffer OPTIONAL,
341  IN UINTN RequestBufferSize OPTIONAL,
342  OUT UINT8 *Buffer,
344  );
345 
346 /**
347  ProcessPacket() is called to Supplicant driver to encrypt or decrypt the data
348  depending type of authentication type.
349 
350  @param[in] This Pointer to the EFI_SUPPLICANT_PROTOCOL
351  instance.
352  @param[in, out] FragmentTable Pointer to a list of fragment. The caller
353  will take responsible to handle the original
354  FragmentTable while it may be reallocated in
355  Supplicant driver.
356  @param[in] FragmentCount Number of fragment.
357  @param[in] CryptMode Crypt mode.
358 
359  @retval EFI_SUCCESS The operation completed successfully.
360  @retval EFI_INVALID_PARAMETER One or more of the following conditions is
361  TRUE:
362  FragmentTable is NULL.
363  FragmentCount is NULL.
364  CryptMode is invalid.
365  @retval EFI_NOT_READY Current supplicant state is NOT Authenticated.
366  @retval EFI_ABORTED Something wrong decryption the message.
367  @retval EFI_UNSUPPORTED This API is not supported.
368 
369 **/
370 typedef
374  IN OUT EFI_SUPPLICANT_FRAGMENT_DATA **FragmentTable,
375  IN UINT32 *FragmentCount,
376  IN EFI_SUPPLICANT_CRYPT_MODE CryptMode
377  );
378 
379 /**
380  Set Supplicant configuration data.
381 
382  @param[in] This Pointer to the EFI_SUPPLICANT_PROTOCOL
383  instance.
384  @param[in] DataType The type of data.
385  @param[in] Data Pointer to the buffer to hold the data.
386  @param[in] DataSize Pointer to the buffer size in bytes.
387 
388  @retval EFI_SUCCESS The Supplicant configuration data is set
389  successfully.
390  @retval EFI_INVALID_PARAMETER One or more of the following conditions is
391  TRUE:
392  Data is NULL.
393  DataSize is 0.
394  @retval EFI_UNSUPPORTED The DataType is unsupported.
395  @retval EFI_OUT_OF_RESOURCES Required system resources could not be allocated.
396 
397 **/
398 typedef
402  IN EFI_SUPPLICANT_DATA_TYPE DataType,
403  IN VOID *Data,
404  IN UINTN DataSize
405  );
406 
407 /**
408  Get Supplicant configuration data.
409 
410  @param[in] This Pointer to the EFI_SUPPLICANT_PROTOCOL
411  instance.
412  @param[in] DataType The type of data.
413  @param[out] Data Pointer to the buffer to hold the data.
414  Ignored if DataSize is 0.
415  @param[in, out] DataSize Pointer to the buffer size in bytes. On
416  input, it is the buffer size provided by the
417  caller. On output, it is the buffer size in
418  fact needed to contain the packet.
419 
420  @retval EFI_SUCCESS The Supplicant configuration data is got
421  successfully.
422  @retval EFI_INVALID_PARAMETER One or more of the following conditions is
423  TRUE:
424  This is NULL.
425  DataSize is NULL.
426  Data is NULL if *DataSize is not zero.
427  @retval EFI_UNSUPPORTED The DataType is unsupported.
428  @retval EFI_NOT_FOUND The Supplicant configuration data is not
429  found.
430  @retval EFI_BUFFER_TOO_SMALL The size of Data is too small for the
431  specified configuration data and the required
432  size is returned in DataSize.
433 
434 **/
435 typedef
439  IN EFI_SUPPLICANT_DATA_TYPE DataType,
440  OUT UINT8 *Data OPTIONAL,
441  IN OUT UINTN *DataSize
442  );
443 
444 ///
445 /// The EFI_SUPPLICANT_PROTOCOL is designed to provide unified place for WIFI
446 /// and EAP security management. Both PSK authentication and 802.1X EAP
447 /// authentication can be managed via this protocol and driver or application
448 /// as a consumer can only focus on about packet transmitting or receiving.
449 ///
455 };
456 
459 
460 #endif
#define OPTIONAL
Passing the datum to the function is optional, and a NULL is passed if the value is not supplied.
Definition: Base.h:292
EFI_SUPPLICANT_KEY_TYPE KeyType
Definition: Supplicant.h:242
EFI_80211_SUITE_SELECTOR CipherSuite
Definition: Supplicant.h:263
128 bit buffer containing a unique identifier value.
Definition: Base.h:215
The EFI_SUPPLICANT_PROTOCOL is designed to provide unified place for WIFI and EAP security management...
Definition: Supplicant.h:450
unsigned char BOOLEAN
EFI_SUPPLICANT_GTK_LIST.
Definition: Supplicant.h:273
unsigned int UINT32
Definition: ProcessorBind.h:98
EFI_SUPPLICANT_KEY.
Definition: Supplicant.h:225
UINT16_t BufferSize
Buffer size.
Definition: pxe_api.h:64
EFI_SUPPLICANT_GET_DATA GetData
Definition: Supplicant.h:454
FILE_LICENCE(BSD2_PATENT)
EFI_SUPPLICANT_BUILD_RESPONSE_PACKET BuildResponsePacket
Definition: Supplicant.h:451
EFI_GUID gEfiSupplicantServiceBindingProtocolGuid
EFI_SUPPLICANT_FRAGMENT_DATA.
Definition: Supplicant.h:288
unsigned char UINT8
EFI_80211_SUITE_SELECTOR.
Definition: WiFi2.h:106
#define OUT
Definition: mlx_utils.h:29
EFI_80211_LINK_STATE
EFI_80211_LINK_STATE.
Definition: Supplicant.h:161
#define EFI_MAX_KEY_LEN
Definition: Supplicant.h:220
EFI_SUPPLICANT_KEY_DIRECTION
EFI_SUPPLICANT_KEY_DIRECTION (IEEE Std 802.11 Section 6.3.19.1.2)
Definition: Supplicant.h:193
EFI_STATUS(EFIAPI * EFI_SUPPLICANT_BUILD_RESPONSE_PACKET)(IN EFI_SUPPLICANT_PROTOCOL *This, IN UINT8 *RequestBuffer OPTIONAL, IN UINTN RequestBufferSize OPTIONAL, OUT UINT8 *Buffer, IN OUT UINTN *BufferSize)
BuildResponsePacket() is called during STA and AP authentication is in progress.
Definition: Supplicant.h:338
#define EFIAPI
EFI_SUPPLICANT_DATA_TYPE
EFI_SUPPLICANT_DATA_TYPE.
Definition: Supplicant.h:57
BOOLEAN IsAuthenticator
Definition: Supplicant.h:259
SEGOFF16_t Buffer
Buffer address.
Definition: pxe_api.h:65
EFI_80211_MAC_ADDRESS Addr
Definition: Supplicant.h:246
UINT64 UINTN
Unsigned value of native width.
#define VOID
Undeclared type.
Definition: Base.h:271
#define IN
Definition: mlx_utils.h:28
This file defines the EFI Wireless MAC Connection II Protocol.
EFI_SUPPLICANT_KEY_DIRECTION Direction
Definition: Supplicant.h:267
EFI_SUPPLICANT_CRYPT_MODE
EFI_SUPPLICANT_CRYPT_MODE.
Definition: Supplicant.h:43
EFI_80211_MAC_ADDRESS.
Definition: WiFi2.h:64
EFI_SUPPLICANT_KEY_REFRESH.
Definition: Supplicant.h:212
RETURN_STATUS EFI_STATUS
Function return status for EFI API.
Definition: UefiBaseType.h:31
EFI_SUPPLICANT_SET_DATA SetData
Definition: Supplicant.h:453
EFI_SUPPLICANT_KEY_TYPE
EFI_SUPPLICANT_KEY_TYPE (IEEE Std 802.11 Section 6.3.19.1.2)
Definition: Supplicant.h:183
EFI_STATUS(EFIAPI * EFI_SUPPLICANT_SET_DATA)(IN EFI_SUPPLICANT_PROTOCOL *This, IN EFI_SUPPLICANT_DATA_TYPE DataType, IN VOID *Data, IN UINTN DataSize)
Set Supplicant configuration data.
Definition: Supplicant.h:400
EFI_SUPPLICANT_PROCESS_PACKET ProcessPacket
Definition: Supplicant.h:452
EFI_STATUS(EFIAPI * EFI_SUPPLICANT_PROCESS_PACKET)(IN EFI_SUPPLICANT_PROTOCOL *This, IN OUT EFI_SUPPLICANT_FRAGMENT_DATA **FragmentTable, IN UINT32 *FragmentCount, IN EFI_SUPPLICANT_CRYPT_MODE CryptMode)
ProcessPacket() is called to Supplicant driver to encrypt or decrypt the data depending type of authe...
Definition: Supplicant.h:372
EFI_GUID gEfiSupplicantProtocolGuid
EFI_STATUS(EFIAPI * EFI_SUPPLICANT_GET_DATA)(IN EFI_SUPPLICANT_PROTOCOL *This, IN EFI_SUPPLICANT_DATA_TYPE DataType, OUT UINT8 *Data OPTIONAL, IN OUT UINTN *DataSize)
Get Supplicant configuration data.
Definition: Supplicant.h:437