]>
Commit | Line | Data |
---|---|---|
6fc6879b JM |
1 | /* |
2 | * hostapd - IEEE 802.11i-2004 / WPA Authenticator | |
09368515 | 3 | * Copyright (c) 2004-2017, Jouni Malinen <j@w1.fi> |
6fc6879b | 4 | * |
0f3d578e JM |
5 | * This software may be distributed under the terms of the BSD license. |
6 | * See README for more details. | |
6fc6879b JM |
7 | */ |
8 | ||
9 | #ifndef WPA_AUTH_H | |
10 | #define WPA_AUTH_H | |
11 | ||
90973fb2 JM |
12 | #include "common/defs.h" |
13 | #include "common/eapol_common.h" | |
14 | #include "common/wpa_common.h" | |
d6c3067d | 15 | #include "common/ieee802_11_defs.h" |
6fc6879b | 16 | |
47a039b0 MB |
17 | struct vlan_description; |
18 | ||
bc02843e JM |
19 | #define MAX_OWN_IE_OVERRIDE 256 |
20 | ||
6fc6879b JM |
21 | #ifdef _MSC_VER |
22 | #pragma pack(push, 1) | |
23 | #endif /* _MSC_VER */ | |
24 | ||
c1e033b0 JM |
25 | /* IEEE Std 802.11r-2008, 11A.10.3 - Remote request/response frame definition |
26 | */ | |
6fc6879b JM |
27 | struct ft_rrb_frame { |
28 | u8 frame_type; /* RSN_REMOTE_FRAME_TYPE_FT_RRB */ | |
29 | u8 packet_type; /* FT_PACKET_REQUEST/FT_PACKET_RESPONSE */ | |
2eba45c8 | 30 | le16 action_length; /* little endian length of action_frame */ |
6fc6879b JM |
31 | u8 ap_address[ETH_ALEN]; |
32 | /* | |
33 | * Followed by action_length bytes of FT Action frame (from Category | |
34 | * field to the end of Action Frame body. | |
35 | */ | |
36 | } STRUCT_PACKED; | |
37 | ||
38 | #define RSN_REMOTE_FRAME_TYPE_FT_RRB 1 | |
39 | ||
40 | #define FT_PACKET_REQUEST 0 | |
41 | #define FT_PACKET_RESPONSE 1 | |
50bd8e0a MB |
42 | |
43 | /* Vendor-specific types for R0KH-R1KH protocol; not defined in 802.11r. These | |
44 | * use OUI Extended EtherType as the encapsulating format. */ | |
45 | #define FT_PACKET_R0KH_R1KH_PULL 0x01 | |
46 | #define FT_PACKET_R0KH_R1KH_RESP 0x02 | |
47 | #define FT_PACKET_R0KH_R1KH_PUSH 0x03 | |
eefe8630 MB |
48 | #define FT_PACKET_R0KH_R1KH_SEQ_REQ 0x04 |
49 | #define FT_PACKET_R0KH_R1KH_SEQ_RESP 0x05 | |
6fc6879b | 50 | |
245fc96e MB |
51 | /* packet layout |
52 | * IEEE 802 extended OUI ethertype frame header | |
53 | * u16 authlen (little endian) | |
54 | * multiple of struct ft_rrb_tlv (authenticated only, length = authlen) | |
55 | * multiple of struct ft_rrb_tlv (AES-SIV encrypted, AES-SIV needs an extra | |
56 | * blocksize length) | |
57 | * | |
58 | * AES-SIV AAD; | |
59 | * source MAC address (6) | |
60 | * authenticated-only TLVs (authlen) | |
61 | * subtype (1; FT_PACKET_*) | |
62 | */ | |
6fc6879b | 63 | |
245fc96e MB |
64 | #define FT_RRB_NONCE_LEN 16 |
65 | ||
66 | #define FT_RRB_LAST_EMPTY 0 /* placeholder or padding */ | |
67 | ||
eefe8630 | 68 | #define FT_RRB_SEQ 1 /* struct ft_rrb_seq */ |
245fc96e MB |
69 | #define FT_RRB_NONCE 2 /* size FT_RRB_NONCE_LEN */ |
70 | #define FT_RRB_TIMESTAMP 3 /* le32 unix seconds */ | |
71 | ||
72 | #define FT_RRB_R0KH_ID 4 /* FT_R0KH_ID_MAX_LEN */ | |
73 | #define FT_RRB_R1KH_ID 5 /* FT_R1KH_ID_LEN */ | |
74 | #define FT_RRB_S1KH_ID 6 /* ETH_ALEN */ | |
6fc6879b | 75 | |
245fc96e MB |
76 | #define FT_RRB_PMK_R0_NAME 7 /* WPA_PMK_NAME_LEN */ |
77 | #define FT_RRB_PMK_R0 8 /* PMK_LEN */ | |
78 | #define FT_RRB_PMK_R1_NAME 9 /* WPA_PMK_NAME_LEN */ | |
79 | #define FT_RRB_PMK_R1 10 /* PMK_LEN */ | |
80 | ||
81 | #define FT_RRB_PAIRWISE 11 /* le16 */ | |
3a3e2832 | 82 | #define FT_RRB_EXPIRES_IN 12 /* le16 seconds */ |
245fc96e | 83 | |
17010c38 MB |
84 | #define FT_RRB_VLAN_UNTAGGED 13 /* le16 */ |
85 | #define FT_RRB_VLAN_TAGGED 14 /* n times le16 */ | |
86 | ||
069b4e30 MB |
87 | #define FT_RRB_IDENTITY 15 |
88 | #define FT_RRB_RADIUS_CUI 16 | |
a6509e85 | 89 | #define FT_RRB_SESSION_TIMEOUT 17 /* le32 seconds */ |
069b4e30 | 90 | |
245fc96e MB |
91 | struct ft_rrb_tlv { |
92 | le16 type; | |
93 | le16 len; | |
94 | /* followed by data of length len */ | |
6fc6879b JM |
95 | } STRUCT_PACKED; |
96 | ||
eefe8630 MB |
97 | struct ft_rrb_seq { |
98 | le32 dom; | |
99 | le32 seq; | |
100 | le32 ts; | |
101 | } STRUCT_PACKED; | |
102 | ||
245fc96e MB |
103 | /* session TLVs: |
104 | * required: PMK_R1, PMK_R1_NAME, PAIRWISE | |
a6509e85 MB |
105 | * optional: VLAN_UNTAGGED, VLAN_TAGGED, EXPIRES_IN, IDENTITY, RADIUS_CUI, |
106 | * SESSION_TIMEOUT | |
245fc96e MB |
107 | * |
108 | * pull frame TLVs: | |
109 | * auth: | |
eefe8630 | 110 | * required: SEQ, NONCE, R0KH_ID, R1KH_ID |
245fc96e MB |
111 | * encrypted: |
112 | * required: PMK_R0_NAME, S1KH_ID | |
113 | * | |
114 | * response frame TLVs: | |
115 | * auth: | |
eefe8630 | 116 | * required: SEQ, NONCE, R0KH_ID, R1KH_ID |
245fc96e | 117 | * encrypted: |
3a46cf93 MB |
118 | * required: S1KH_ID |
119 | * optional: session TLVs | |
245fc96e MB |
120 | * |
121 | * push frame TLVs: | |
122 | * auth: | |
eefe8630 | 123 | * required: SEQ, R0KH_ID, R1KH_ID |
245fc96e MB |
124 | * encrypted: |
125 | * required: S1KH_ID, PMK_R0_NAME, session TLVs | |
eefe8630 MB |
126 | * |
127 | * sequence number request frame TLVs: | |
128 | * auth: | |
129 | * required: R0KH_ID, R1KH_ID, NONCE | |
130 | * | |
131 | * sequence number response frame TLVs: | |
132 | * auth: | |
133 | * required: SEQ, NONCE, R0KH_ID, R1KH_ID | |
245fc96e MB |
134 | */ |
135 | ||
6fc6879b JM |
136 | #ifdef _MSC_VER |
137 | #pragma pack(pop) | |
138 | #endif /* _MSC_VER */ | |
139 | ||
140 | ||
141 | /* per STA state machine data */ | |
142 | ||
143 | struct wpa_authenticator; | |
144 | struct wpa_state_machine; | |
145 | struct rsn_pmksa_cache_entry; | |
146 | struct eapol_state_machine; | |
eefe8630 | 147 | struct ft_remote_seq; |
bef4d07a | 148 | struct wpa_channel_info; |
6fc6879b JM |
149 | |
150 | ||
151 | struct ft_remote_r0kh { | |
152 | struct ft_remote_r0kh *next; | |
153 | u8 addr[ETH_ALEN]; | |
154 | u8 id[FT_R0KH_ID_MAX_LEN]; | |
155 | size_t id_len; | |
245fc96e | 156 | u8 key[32]; |
eefe8630 | 157 | struct ft_remote_seq *seq; |
6fc6879b JM |
158 | }; |
159 | ||
160 | ||
161 | struct ft_remote_r1kh { | |
162 | struct ft_remote_r1kh *next; | |
163 | u8 addr[ETH_ALEN]; | |
164 | u8 id[FT_R1KH_ID_LEN]; | |
245fc96e | 165 | u8 key[32]; |
eefe8630 | 166 | struct ft_remote_seq *seq; |
6fc6879b JM |
167 | }; |
168 | ||
169 | ||
170 | struct wpa_auth_config { | |
171 | int wpa; | |
862aac1f | 172 | int extended_key_id; |
6fc6879b JM |
173 | int wpa_key_mgmt; |
174 | int wpa_pairwise; | |
175 | int wpa_group; | |
176 | int wpa_group_rekey; | |
177 | int wpa_strict_rekey; | |
178 | int wpa_gmk_rekey; | |
581a8cde | 179 | int wpa_ptk_rekey; |
1a7963e3 | 180 | int wpa_deny_ptk0_rekey; |
41f140d3 GK |
181 | u32 wpa_group_update_count; |
182 | u32 wpa_pairwise_update_count; | |
6f234c1e | 183 | int wpa_disable_eapol_key_retries; |
6fc6879b JM |
184 | int rsn_pairwise; |
185 | int rsn_preauth; | |
186 | int eapol_version; | |
3ae0800c | 187 | int wmm_enabled; |
721abef9 | 188 | int wmm_uapsd; |
cb465555 | 189 | int disable_pmksa_caching; |
bf98f7f3 | 190 | int okc; |
e4bf4db9 | 191 | int tx_status; |
70f8cc8e | 192 | enum mfp_options ieee80211w; |
92d407db | 193 | int beacon_prot; |
8dd9f9cd | 194 | int group_mgmt_cipher; |
ba3d435f | 195 | int sae_require_mfp; |
875ab60d MV |
196 | #ifdef CONFIG_OCV |
197 | int ocv; /* Operating Channel Validation */ | |
198 | #endif /* CONFIG_OCV */ | |
4ec1fd8e | 199 | #ifdef CONFIG_IEEE80211R_AP |
d6c3067d | 200 | u8 ssid[SSID_MAX_LEN]; |
6fc6879b JM |
201 | size_t ssid_len; |
202 | u8 mobility_domain[MOBILITY_DOMAIN_ID_LEN]; | |
203 | u8 r0_key_holder[FT_R0KH_ID_MAX_LEN]; | |
204 | size_t r0_key_holder_len; | |
205 | u8 r1_key_holder[FT_R1KH_ID_LEN]; | |
83fe4bd3 | 206 | u32 r0_key_lifetime; /* PMK-R0 lifetime seconds */ |
3a46cf93 MB |
207 | int rkh_pos_timeout; |
208 | int rkh_neg_timeout; | |
209 | int rkh_pull_timeout; /* ms */ | |
210 | int rkh_pull_retries; | |
3a3e2832 | 211 | int r1_max_key_lifetime; |
6fc6879b | 212 | u32 reassociation_deadline; |
3a46cf93 MB |
213 | struct ft_remote_r0kh **r0kh_list; |
214 | struct ft_remote_r1kh **r1kh_list; | |
6fc6879b | 215 | int pmk_r1_push; |
d7956add | 216 | int ft_over_ds; |
96590564 | 217 | int ft_psk_generate_local; |
4ec1fd8e | 218 | #endif /* CONFIG_IEEE80211R_AP */ |
83421850 | 219 | int disable_gtk; |
88b32a99 | 220 | int ap_mlme; |
7af092a0 JB |
221 | #ifdef CONFIG_TESTING_OPTIONS |
222 | double corrupt_gtk_rekey_mic_probability; | |
bc02843e JM |
223 | u8 own_ie_override[MAX_OWN_IE_OVERRIDE]; |
224 | size_t own_ie_override_len; | |
4d64fd37 JM |
225 | u8 rsne_override_eapol[MAX_OWN_IE_OVERRIDE]; |
226 | size_t rsne_override_eapol_len; | |
f2c4b44b JM |
227 | u8 rsnxe_override_eapol[MAX_OWN_IE_OVERRIDE]; |
228 | size_t rsnxe_override_eapol_len; | |
46e147fc JM |
229 | u8 rsne_override_ft[MAX_OWN_IE_OVERRIDE]; |
230 | size_t rsne_override_ft_len; | |
231 | u8 rsnxe_override_ft[MAX_OWN_IE_OVERRIDE]; | |
232 | size_t rsnxe_override_ft_len; | |
8d84c75f JM |
233 | u8 gtk_rsc_override[WPA_KEY_RSC_LEN]; |
234 | u8 igtk_rsc_override[WPA_KEY_RSC_LEN]; | |
4d64fd37 | 235 | unsigned int rsne_override_eapol_set:1; |
9128b672 | 236 | unsigned int rsnxe_override_eapol_set:1; |
46e147fc JM |
237 | unsigned int rsne_override_ft_set:1; |
238 | unsigned int rsnxe_override_ft_set:1; | |
8d84c75f JM |
239 | unsigned int gtk_rsc_override_set:1; |
240 | unsigned int igtk_rsc_override_set:1; | |
7af092a0 | 241 | #endif /* CONFIG_TESTING_OPTIONS */ |
25ef8529 JM |
242 | #ifdef CONFIG_P2P |
243 | u8 ip_addr_go[4]; | |
244 | u8 ip_addr_mask[4]; | |
245 | u8 ip_addr_start[4]; | |
246 | u8 ip_addr_end[4]; | |
247 | #endif /* CONFIG_P2P */ | |
7eace378 JM |
248 | #ifdef CONFIG_FILS |
249 | unsigned int fils_cache_id_set:1; | |
250 | u8 fils_cache_id[FILS_CACHE_ID_LEN]; | |
251 | #endif /* CONFIG_FILS */ | |
a36e13a7 | 252 | int sae_pwe; |
65a44e84 | 253 | int owe_ptk_workaround; |
82cc0b0c | 254 | u8 transition_disable; |
7c021dec JM |
255 | #ifdef CONFIG_DPP2 |
256 | int dpp_pfs; | |
257 | #endif /* CONFIG_DPP2 */ | |
6fc6879b JM |
258 | }; |
259 | ||
260 | typedef enum { | |
261 | LOGGER_DEBUG, LOGGER_INFO, LOGGER_WARNING | |
262 | } logger_level; | |
263 | ||
264 | typedef enum { | |
265 | WPA_EAPOL_portEnabled, WPA_EAPOL_portValid, WPA_EAPOL_authorized, | |
266 | WPA_EAPOL_portControl_Auto, WPA_EAPOL_keyRun, WPA_EAPOL_keyAvailable, | |
267 | WPA_EAPOL_keyDone, WPA_EAPOL_inc_EapolFramesTx | |
268 | } wpa_eapol_variable; | |
269 | ||
270 | struct wpa_auth_callbacks { | |
6fc6879b JM |
271 | void (*logger)(void *ctx, const u8 *addr, logger_level level, |
272 | const char *txt); | |
273 | void (*disconnect)(void *ctx, const u8 *addr, u16 reason); | |
c772d054 | 274 | int (*mic_failure_report)(void *ctx, const u8 *addr); |
2c502460 | 275 | void (*psk_failure_report)(void *ctx, const u8 *addr); |
6fc6879b JM |
276 | void (*set_eapol)(void *ctx, const u8 *addr, wpa_eapol_variable var, |
277 | int value); | |
278 | int (*get_eapol)(void *ctx, const u8 *addr, wpa_eapol_variable var); | |
759fd76b | 279 | const u8 * (*get_psk)(void *ctx, const u8 *addr, const u8 *p2p_dev_addr, |
dbfa691d JM |
280 | const u8 *prev_psk, size_t *psk_len, |
281 | int *vlan_id); | |
6fc6879b | 282 | int (*get_msk)(void *ctx, const u8 *addr, u8 *msk, size_t *len); |
71934751 | 283 | int (*set_key)(void *ctx, int vlan_id, enum wpa_alg alg, |
a919a260 AW |
284 | const u8 *addr, int idx, u8 *key, size_t key_len, |
285 | enum key_flag key_flag); | |
6fc6879b | 286 | int (*get_seqnum)(void *ctx, const u8 *addr, int idx, u8 *seq); |
6fc6879b JM |
287 | int (*send_eapol)(void *ctx, const u8 *addr, const u8 *data, |
288 | size_t data_len, int encrypt); | |
289 | int (*for_each_sta)(void *ctx, int (*cb)(struct wpa_state_machine *sm, | |
290 | void *ctx), void *cb_ctx); | |
bf98f7f3 JM |
291 | int (*for_each_auth)(void *ctx, int (*cb)(struct wpa_authenticator *a, |
292 | void *ctx), void *cb_ctx); | |
6fc6879b JM |
293 | int (*send_ether)(void *ctx, const u8 *dst, u16 proto, const u8 *data, |
294 | size_t data_len); | |
50bd8e0a MB |
295 | int (*send_oui)(void *ctx, const u8 *dst, u8 oui_suffix, const u8 *data, |
296 | size_t data_len); | |
bef4d07a | 297 | int (*channel_info)(void *ctx, struct wpa_channel_info *ci); |
dbfa691d | 298 | int (*update_vlan)(void *ctx, const u8 *addr, int vlan_id); |
1034f67b MV |
299 | int (*get_sta_tx_params)(void *ctx, const u8 *addr, |
300 | int ap_max_chanwidth, int ap_seg1_idx, | |
301 | int *bandwidth, int *seg1_idx); | |
4ec1fd8e | 302 | #ifdef CONFIG_IEEE80211R_AP |
6fc6879b | 303 | struct wpa_state_machine * (*add_sta)(void *ctx, const u8 *sta_addr); |
d867e118 | 304 | int (*add_sta_ft)(void *ctx, const u8 *sta_addr); |
47a039b0 MB |
305 | int (*set_vlan)(void *ctx, const u8 *sta_addr, |
306 | struct vlan_description *vlan); | |
307 | int (*get_vlan)(void *ctx, const u8 *sta_addr, | |
308 | struct vlan_description *vlan); | |
8c345234 MB |
309 | int (*set_identity)(void *ctx, const u8 *sta_addr, |
310 | const u8 *identity, size_t identity_len); | |
311 | size_t (*get_identity)(void *ctx, const u8 *sta_addr, const u8 **buf); | |
312 | int (*set_radius_cui)(void *ctx, const u8 *sta_addr, | |
313 | const u8 *radius_cui, size_t radius_cui_len); | |
314 | size_t (*get_radius_cui)(void *ctx, const u8 *sta_addr, const u8 **buf); | |
3cb286ca MB |
315 | void (*set_session_timeout)(void *ctx, const u8 *sta_addr, |
316 | int session_timeout); | |
317 | int (*get_session_timeout)(void *ctx, const u8 *sta_addr); | |
8c345234 | 318 | |
6fc6879b JM |
319 | int (*send_ft_action)(void *ctx, const u8 *dst, |
320 | const u8 *data, size_t data_len); | |
88b32a99 | 321 | int (*add_tspec)(void *ctx, const u8 *sta_addr, u8 *tspec_ie, |
006309b5 | 322 | size_t tspec_ielen); |
4ec1fd8e | 323 | #endif /* CONFIG_IEEE80211R_AP */ |
0f950df0 TP |
324 | #ifdef CONFIG_MESH |
325 | int (*start_ampe)(void *ctx, const u8 *sta_addr); | |
326 | #endif /* CONFIG_MESH */ | |
6fc6879b JM |
327 | }; |
328 | ||
329 | struct wpa_authenticator * wpa_init(const u8 *addr, | |
330 | struct wpa_auth_config *conf, | |
cef8fac0 JB |
331 | const struct wpa_auth_callbacks *cb, |
332 | void *cb_ctx); | |
bdffdc5d | 333 | int wpa_init_keys(struct wpa_authenticator *wpa_auth); |
6fc6879b JM |
334 | void wpa_deinit(struct wpa_authenticator *wpa_auth); |
335 | int wpa_reconfig(struct wpa_authenticator *wpa_auth, | |
336 | struct wpa_auth_config *conf); | |
337 | ||
ca57d5f5 | 338 | enum wpa_validate_result { |
6fc6879b JM |
339 | WPA_IE_OK, WPA_INVALID_IE, WPA_INVALID_GROUP, WPA_INVALID_PAIRWISE, |
340 | WPA_INVALID_AKMP, WPA_NOT_ENABLED, WPA_ALLOC_FAIL, | |
341 | WPA_MGMT_FRAME_PROTECTION_VIOLATION, WPA_INVALID_MGMT_GROUP_CIPHER, | |
7c021dec JM |
342 | WPA_INVALID_MDIE, WPA_INVALID_PROTO, WPA_INVALID_PMKID, |
343 | WPA_DENIED_OTHER_REASON | |
6fc6879b | 344 | }; |
91d91abf | 345 | |
ca57d5f5 JM |
346 | enum wpa_validate_result |
347 | wpa_validate_wpa_ie(struct wpa_authenticator *wpa_auth, | |
348 | struct wpa_state_machine *sm, int freq, | |
349 | const u8 *wpa_ie, size_t wpa_ie_len, | |
350 | const u8 *rsnxe, size_t rsnxe_len, | |
351 | const u8 *mdie, size_t mdie_len, | |
352 | const u8 *owe_dh, size_t owe_dh_len); | |
a14896e8 JM |
353 | int wpa_validate_osen(struct wpa_authenticator *wpa_auth, |
354 | struct wpa_state_machine *sm, | |
355 | const u8 *osen_ie, size_t osen_ie_len); | |
f3f7540e | 356 | int wpa_auth_uses_mfp(struct wpa_state_machine *sm); |
1e93e423 MV |
357 | void wpa_auth_set_ocv(struct wpa_state_machine *sm, int ocv); |
358 | int wpa_auth_uses_ocv(struct wpa_state_machine *sm); | |
6fc6879b | 359 | struct wpa_state_machine * |
94ddef3e JM |
360 | wpa_auth_sta_init(struct wpa_authenticator *wpa_auth, const u8 *addr, |
361 | const u8 *p2p_dev_addr); | |
6f9b5d16 JM |
362 | int wpa_auth_sta_associated(struct wpa_authenticator *wpa_auth, |
363 | struct wpa_state_machine *sm); | |
a8d05fca | 364 | void wpa_auth_sta_no_wpa(struct wpa_state_machine *sm); |
6fc6879b JM |
365 | void wpa_auth_sta_deinit(struct wpa_state_machine *sm); |
366 | void wpa_receive(struct wpa_authenticator *wpa_auth, | |
367 | struct wpa_state_machine *sm, | |
368 | u8 *data, size_t data_len); | |
bb119228 | 369 | enum wpa_event { |
6fc6879b | 370 | WPA_AUTH, WPA_ASSOC, WPA_DISASSOC, WPA_DEAUTH, WPA_REAUTH, |
0e3bd7ac | 371 | WPA_REAUTH_EAPOL, WPA_ASSOC_FT, WPA_ASSOC_FILS, WPA_DRV_STA_REMOVED |
bb119228 | 372 | }; |
6fc6879b | 373 | void wpa_remove_ptk(struct wpa_state_machine *sm); |
bb119228 | 374 | int wpa_auth_sm_event(struct wpa_state_machine *sm, enum wpa_event event); |
6fc6879b JM |
375 | void wpa_auth_sm_notify(struct wpa_state_machine *sm); |
376 | void wpa_gtk_rekey(struct wpa_authenticator *wpa_auth); | |
377 | int wpa_get_mib(struct wpa_authenticator *wpa_auth, char *buf, size_t buflen); | |
378 | int wpa_get_mib_sta(struct wpa_state_machine *sm, char *buf, size_t buflen); | |
379 | void wpa_auth_countermeasures_start(struct wpa_authenticator *wpa_auth); | |
380 | int wpa_auth_pairwise_set(struct wpa_state_machine *sm); | |
ff36ff00 | 381 | int wpa_auth_get_pairwise(struct wpa_state_machine *sm); |
b08c9ad0 | 382 | const u8 * wpa_auth_get_pmk(struct wpa_state_machine *sm, int *len); |
6fc6879b JM |
383 | int wpa_auth_sta_key_mgmt(struct wpa_state_machine *sm); |
384 | int wpa_auth_sta_wpa_version(struct wpa_state_machine *sm); | |
0e3bd7ac | 385 | int wpa_auth_sta_ft_tk_already_set(struct wpa_state_machine *sm); |
2f1357fb | 386 | int wpa_auth_sta_fils_tk_already_set(struct wpa_state_machine *sm); |
6fc6879b JM |
387 | int wpa_auth_sta_clear_pmksa(struct wpa_state_machine *sm, |
388 | struct rsn_pmksa_cache_entry *entry); | |
389 | struct rsn_pmksa_cache_entry * | |
390 | wpa_auth_sta_get_pmksa(struct wpa_state_machine *sm); | |
391 | void wpa_auth_sta_local_mic_failure_report(struct wpa_state_machine *sm); | |
392 | const u8 * wpa_auth_get_wpa_ie(struct wpa_authenticator *wpa_auth, | |
393 | size_t *len); | |
394 | int wpa_auth_pmksa_add(struct wpa_state_machine *sm, const u8 *pmk, | |
207976f0 | 395 | unsigned int pmk_len, |
6fc6879b JM |
396 | int session_timeout, struct eapol_state_machine *eapol); |
397 | int wpa_auth_pmksa_add_preauth(struct wpa_authenticator *wpa_auth, | |
398 | const u8 *pmk, size_t len, const u8 *sta_addr, | |
399 | int session_timeout, | |
400 | struct eapol_state_machine *eapol); | |
f2991170 | 401 | int wpa_auth_pmksa_add_sae(struct wpa_authenticator *wpa_auth, const u8 *addr, |
70c93963 | 402 | const u8 *pmk, const u8 *pmkid); |
9d94e4bb | 403 | void wpa_auth_add_sae_pmkid(struct wpa_state_machine *sm, const u8 *pmkid); |
0c52953b JM |
404 | int wpa_auth_pmksa_add2(struct wpa_authenticator *wpa_auth, const u8 *addr, |
405 | const u8 *pmk, size_t pmk_len, const u8 *pmkid, | |
406 | int session_timeout, int akmp); | |
901d1fe1 JM |
407 | void wpa_auth_pmksa_remove(struct wpa_authenticator *wpa_auth, |
408 | const u8 *sta_addr); | |
b8daac18 MH |
409 | int wpa_auth_pmksa_list(struct wpa_authenticator *wpa_auth, char *buf, |
410 | size_t len); | |
4c522c77 | 411 | void wpa_auth_pmksa_flush(struct wpa_authenticator *wpa_auth); |
4d77d80e MH |
412 | int wpa_auth_pmksa_list_mesh(struct wpa_authenticator *wpa_auth, const u8 *addr, |
413 | char *buf, size_t len); | |
414 | struct rsn_pmksa_cache_entry * | |
415 | wpa_auth_pmksa_create_entry(const u8 *aa, const u8 *spa, const u8 *pmk, | |
416 | const u8 *pmkid, int expiration); | |
417 | int wpa_auth_pmksa_add_entry(struct wpa_authenticator *wpa_auth, | |
418 | struct rsn_pmksa_cache_entry *entry); | |
9f2cf23e | 419 | struct rsn_pmksa_cache_entry * |
c1bd4bac JM |
420 | wpa_auth_pmksa_get(struct wpa_authenticator *wpa_auth, const u8 *sta_addr, |
421 | const u8 *pmkid); | |
7eace378 JM |
422 | struct rsn_pmksa_cache_entry * |
423 | wpa_auth_pmksa_get_fils_cache_id(struct wpa_authenticator *wpa_auth, | |
424 | const u8 *sta_addr, const u8 *pmkid); | |
9f2cf23e MH |
425 | void wpa_auth_pmksa_set_to_sm(struct rsn_pmksa_cache_entry *pmksa, |
426 | struct wpa_state_machine *sm, | |
427 | struct wpa_authenticator *wpa_auth, | |
428 | u8 *pmkid, u8 *pmk); | |
6fc6879b | 429 | int wpa_auth_sta_set_vlan(struct wpa_state_machine *sm, int vlan_id); |
e4bf4db9 JM |
430 | void wpa_auth_eapol_key_tx_status(struct wpa_authenticator *wpa_auth, |
431 | struct wpa_state_machine *sm, int ack); | |
6fc6879b | 432 | |
4ec1fd8e | 433 | #ifdef CONFIG_IEEE80211R_AP |
6fc6879b | 434 | u8 * wpa_sm_write_assoc_resp_ies(struct wpa_state_machine *sm, u8 *pos, |
f238cf9f | 435 | size_t max_len, int auth_alg, |
b7366a94 JM |
436 | const u8 *req_ies, size_t req_ies_len, |
437 | int omit_rsnxe); | |
6fc6879b JM |
438 | void wpa_ft_process_auth(struct wpa_state_machine *sm, const u8 *bssid, |
439 | u16 auth_transaction, const u8 *ies, size_t ies_len, | |
440 | void (*cb)(void *ctx, const u8 *dst, const u8 *bssid, | |
441 | u16 auth_transaction, u16 resp, | |
442 | const u8 *ies, size_t ies_len), | |
443 | void *ctx); | |
444 | u16 wpa_ft_validate_reassoc(struct wpa_state_machine *sm, const u8 *ies, | |
445 | size_t ies_len); | |
446 | int wpa_ft_action_rx(struct wpa_state_machine *sm, const u8 *data, size_t len); | |
447 | int wpa_ft_rrb_rx(struct wpa_authenticator *wpa_auth, const u8 *src_addr, | |
448 | const u8 *data, size_t data_len); | |
50bd8e0a MB |
449 | void wpa_ft_rrb_oui_rx(struct wpa_authenticator *wpa_auth, const u8 *src_addr, |
450 | const u8 *dst_addr, u8 oui_suffix, const u8 *data, | |
451 | size_t data_len); | |
6fc6879b | 452 | void wpa_ft_push_pmk_r1(struct wpa_authenticator *wpa_auth, const u8 *addr); |
eefe8630 | 453 | void wpa_ft_deinit(struct wpa_authenticator *wpa_auth); |
3a46cf93 | 454 | void wpa_ft_sta_deinit(struct wpa_state_machine *sm); |
4ec1fd8e | 455 | #endif /* CONFIG_IEEE80211R_AP */ |
6fc6879b | 456 | |
d32d94db XC |
457 | void wpa_wnmsleep_rekey_gtk(struct wpa_state_machine *sm); |
458 | void wpa_set_wnmsleep(struct wpa_state_machine *sm, int flag); | |
459 | int wpa_wnmsleep_gtk_subelem(struct wpa_state_machine *sm, u8 *pos); | |
d32d94db | 460 | int wpa_wnmsleep_igtk_subelem(struct wpa_state_machine *sm, u8 *pos); |
16889aff | 461 | int wpa_wnmsleep_bigtk_subelem(struct wpa_state_machine *sm, u8 *pos); |
d32d94db | 462 | |
c10347f2 | 463 | int wpa_auth_uses_sae(struct wpa_state_machine *sm); |
aa189ac9 | 464 | int wpa_auth_uses_ft_sae(struct wpa_state_machine *sm); |
c10347f2 | 465 | |
25ef8529 JM |
466 | int wpa_auth_get_ip_addr(struct wpa_state_machine *sm, u8 *addr); |
467 | ||
cbc210de JM |
468 | struct radius_das_attrs; |
469 | int wpa_auth_radius_das_disconnect_pmksa(struct wpa_authenticator *wpa_auth, | |
470 | struct radius_das_attrs *attr); | |
34782730 | 471 | void wpa_auth_reconfig_group_keys(struct wpa_authenticator *wpa_auth); |
cbc210de | 472 | |
7cebc8e2 MB |
473 | int wpa_auth_ensure_group(struct wpa_authenticator *wpa_auth, int vlan_id); |
474 | int wpa_auth_release_group(struct wpa_authenticator *wpa_auth, int vlan_id); | |
c4fd6d8a | 475 | int fils_auth_pmk_to_ptk(struct wpa_state_machine *sm, const u8 *pmk, |
80ddf5d9 | 476 | size_t pmk_len, const u8 *snonce, const u8 *anonce, |
4cada9dc | 477 | const u8 *dhss, size_t dhss_len, |
80ddf5d9 | 478 | struct wpabuf *g_sta, struct wpabuf *g_ap); |
78815f3d JM |
479 | int fils_decrypt_assoc(struct wpa_state_machine *sm, const u8 *fils_session, |
480 | const struct ieee80211_mgmt *mgmt, size_t frame_len, | |
481 | u8 *pos, size_t left); | |
e73ffa09 | 482 | int fils_encrypt_assoc(struct wpa_state_machine *sm, u8 *buf, |
91d91abf JM |
483 | size_t current_len, size_t max_len, |
484 | const struct wpabuf *hlp); | |
da24c5aa | 485 | int fils_set_tk(struct wpa_state_machine *sm); |
fa61bff6 | 486 | u8 * hostapd_eid_assoc_fils_session(struct wpa_state_machine *sm, u8 *eid, |
8b5ddda5 JM |
487 | const u8 *fils_session, |
488 | struct wpabuf *fils_hlp_resp); | |
087631b9 JM |
489 | const u8 * wpa_fils_validate_fils_session(struct wpa_state_machine *sm, |
490 | const u8 *ies, size_t ies_len, | |
491 | const u8 *fils_session); | |
bd599353 JM |
492 | int wpa_fils_validate_key_confirm(struct wpa_state_machine *sm, const u8 *ies, |
493 | size_t ies_len); | |
7cebc8e2 | 494 | |
1034f67b MV |
495 | int get_sta_tx_parameters(struct wpa_state_machine *sm, int ap_max_chanwidth, |
496 | int ap_seg1_idx, int *bandwidth, int *seg1_idx); | |
497 | ||
a7968ea5 JM |
498 | int wpa_auth_write_fte(struct wpa_authenticator *wpa_auth, int use_sha384, |
499 | u8 *buf, size_t len); | |
8acbf85f JM |
500 | void wpa_auth_get_fils_aead_params(struct wpa_state_machine *sm, |
501 | u8 *fils_anonce, u8 *fils_snonce, | |
502 | u8 *fils_kek, size_t *fils_kek_len); | |
a40bd06e JM |
503 | void wpa_auth_add_fils_pmk_pmkid(struct wpa_state_machine *sm, const u8 *pmk, |
504 | size_t pmk_len, const u8 *pmkid); | |
d8c8d857 JM |
505 | u8 * wpa_auth_write_assoc_resp_owe(struct wpa_state_machine *sm, |
506 | u8 *pos, size_t max_len, | |
507 | const u8 *req_ies, size_t req_ies_len); | |
831d8c9c JM |
508 | u8 * wpa_auth_write_assoc_resp_fils(struct wpa_state_machine *sm, |
509 | u8 *pos, size_t max_len, | |
510 | const u8 *req_ies, size_t req_ies_len); | |
36536639 | 511 | void wpa_auth_set_auth_alg(struct wpa_state_machine *sm, u16 auth_alg); |
10ec6a5f | 512 | void wpa_auth_set_dpp_z(struct wpa_state_machine *sm, const struct wpabuf *z); |
5db997e3 | 513 | |
3d695328 JM |
514 | int wpa_auth_resend_m1(struct wpa_state_machine *sm, int change_anonce, |
515 | void (*cb)(void *ctx1, void *ctx2), | |
516 | void *ctx1, void *ctx2); | |
517 | int wpa_auth_resend_m3(struct wpa_state_machine *sm, | |
518 | void (*cb)(void *ctx1, void *ctx2), | |
519 | void *ctx1, void *ctx2); | |
520 | int wpa_auth_resend_group_m1(struct wpa_state_machine *sm, | |
521 | void (*cb)(void *ctx1, void *ctx2), | |
522 | void *ctx1, void *ctx2); | |
92662fb2 | 523 | int wpa_auth_rekey_gtk(struct wpa_authenticator *wpa_auth); |
a40bd06e | 524 | void wpa_auth_set_ptk_rekey_timer(struct wpa_state_machine *sm); |
6bc2f00f | 525 | |
6fc6879b | 526 | #endif /* WPA_AUTH_H */ |