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