]> git.ipfire.org Git - thirdparty/hostap.git/blame - src/ap/wpa_auth.h
AP: Allow PTK rekeying without Ext KeyID to be disabled as a workaround
[thirdparty/hostap.git] / src / ap / wpa_auth.h
CommitLineData
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
17struct 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
27struct 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
91struct ft_rrb_tlv {
92 le16 type;
93 le16 len;
94 /* followed by data of length len */
6fc6879b
JM
95} STRUCT_PACKED;
96
eefe8630
MB
97struct 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
143struct wpa_authenticator;
144struct wpa_state_machine;
145struct rsn_pmksa_cache_entry;
146struct eapol_state_machine;
eefe8630 147struct ft_remote_seq;
bef4d07a 148struct wpa_channel_info;
6fc6879b
JM
149
150
151struct 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
161struct 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
170struct wpa_auth_config {
171 int wpa;
172 int wpa_key_mgmt;
173 int wpa_pairwise;
174 int wpa_group;
175 int wpa_group_rekey;
176 int wpa_strict_rekey;
177 int wpa_gmk_rekey;
581a8cde 178 int wpa_ptk_rekey;
1a7963e3 179 int wpa_deny_ptk0_rekey;
41f140d3
GK
180 u32 wpa_group_update_count;
181 u32 wpa_pairwise_update_count;
6f234c1e 182 int wpa_disable_eapol_key_retries;
6fc6879b
JM
183 int rsn_pairwise;
184 int rsn_preauth;
185 int eapol_version;
3ae0800c 186 int wmm_enabled;
721abef9 187 int wmm_uapsd;
cb465555 188 int disable_pmksa_caching;
bf98f7f3 189 int okc;
e4bf4db9 190 int tx_status;
70f8cc8e 191 enum mfp_options ieee80211w;
92d407db 192 int beacon_prot;
8dd9f9cd 193 int group_mgmt_cipher;
ba3d435f 194 int sae_require_mfp;
875ab60d
MV
195#ifdef CONFIG_OCV
196 int ocv; /* Operating Channel Validation */
197#endif /* CONFIG_OCV */
4ec1fd8e 198#ifdef CONFIG_IEEE80211R_AP
d6c3067d 199 u8 ssid[SSID_MAX_LEN];
6fc6879b
JM
200 size_t ssid_len;
201 u8 mobility_domain[MOBILITY_DOMAIN_ID_LEN];
202 u8 r0_key_holder[FT_R0KH_ID_MAX_LEN];
203 size_t r0_key_holder_len;
204 u8 r1_key_holder[FT_R1KH_ID_LEN];
83fe4bd3 205 u32 r0_key_lifetime; /* PMK-R0 lifetime seconds */
3a46cf93
MB
206 int rkh_pos_timeout;
207 int rkh_neg_timeout;
208 int rkh_pull_timeout; /* ms */
209 int rkh_pull_retries;
3a3e2832 210 int r1_max_key_lifetime;
6fc6879b 211 u32 reassociation_deadline;
3a46cf93
MB
212 struct ft_remote_r0kh **r0kh_list;
213 struct ft_remote_r1kh **r1kh_list;
6fc6879b 214 int pmk_r1_push;
d7956add 215 int ft_over_ds;
96590564 216 int ft_psk_generate_local;
4ec1fd8e 217#endif /* CONFIG_IEEE80211R_AP */
83421850 218 int disable_gtk;
88b32a99 219 int ap_mlme;
7af092a0
JB
220#ifdef CONFIG_TESTING_OPTIONS
221 double corrupt_gtk_rekey_mic_probability;
bc02843e
JM
222 u8 own_ie_override[MAX_OWN_IE_OVERRIDE];
223 size_t own_ie_override_len;
f2c4b44b
JM
224 u8 rsnxe_override_eapol[MAX_OWN_IE_OVERRIDE];
225 size_t rsnxe_override_eapol_len;
8d84c75f
JM
226 u8 gtk_rsc_override[WPA_KEY_RSC_LEN];
227 u8 igtk_rsc_override[WPA_KEY_RSC_LEN];
228 unsigned int gtk_rsc_override_set:1;
229 unsigned int igtk_rsc_override_set:1;
7af092a0 230#endif /* CONFIG_TESTING_OPTIONS */
25ef8529
JM
231#ifdef CONFIG_P2P
232 u8 ip_addr_go[4];
233 u8 ip_addr_mask[4];
234 u8 ip_addr_start[4];
235 u8 ip_addr_end[4];
236#endif /* CONFIG_P2P */
7eace378
JM
237#ifdef CONFIG_FILS
238 unsigned int fils_cache_id_set:1;
239 u8 fils_cache_id[FILS_CACHE_ID_LEN];
240#endif /* CONFIG_FILS */
a36e13a7 241 int sae_pwe;
65a44e84 242 int owe_ptk_workaround;
6fc6879b
JM
243};
244
245typedef enum {
246 LOGGER_DEBUG, LOGGER_INFO, LOGGER_WARNING
247} logger_level;
248
249typedef enum {
250 WPA_EAPOL_portEnabled, WPA_EAPOL_portValid, WPA_EAPOL_authorized,
251 WPA_EAPOL_portControl_Auto, WPA_EAPOL_keyRun, WPA_EAPOL_keyAvailable,
252 WPA_EAPOL_keyDone, WPA_EAPOL_inc_EapolFramesTx
253} wpa_eapol_variable;
254
255struct wpa_auth_callbacks {
6fc6879b
JM
256 void (*logger)(void *ctx, const u8 *addr, logger_level level,
257 const char *txt);
258 void (*disconnect)(void *ctx, const u8 *addr, u16 reason);
c772d054 259 int (*mic_failure_report)(void *ctx, const u8 *addr);
2c502460 260 void (*psk_failure_report)(void *ctx, const u8 *addr);
6fc6879b
JM
261 void (*set_eapol)(void *ctx, const u8 *addr, wpa_eapol_variable var,
262 int value);
263 int (*get_eapol)(void *ctx, const u8 *addr, wpa_eapol_variable var);
759fd76b 264 const u8 * (*get_psk)(void *ctx, const u8 *addr, const u8 *p2p_dev_addr,
dbfa691d
JM
265 const u8 *prev_psk, size_t *psk_len,
266 int *vlan_id);
6fc6879b 267 int (*get_msk)(void *ctx, const u8 *addr, u8 *msk, size_t *len);
71934751 268 int (*set_key)(void *ctx, int vlan_id, enum wpa_alg alg,
a919a260
AW
269 const u8 *addr, int idx, u8 *key, size_t key_len,
270 enum key_flag key_flag);
6fc6879b 271 int (*get_seqnum)(void *ctx, const u8 *addr, int idx, u8 *seq);
6fc6879b
JM
272 int (*send_eapol)(void *ctx, const u8 *addr, const u8 *data,
273 size_t data_len, int encrypt);
274 int (*for_each_sta)(void *ctx, int (*cb)(struct wpa_state_machine *sm,
275 void *ctx), void *cb_ctx);
bf98f7f3
JM
276 int (*for_each_auth)(void *ctx, int (*cb)(struct wpa_authenticator *a,
277 void *ctx), void *cb_ctx);
6fc6879b
JM
278 int (*send_ether)(void *ctx, const u8 *dst, u16 proto, const u8 *data,
279 size_t data_len);
50bd8e0a
MB
280 int (*send_oui)(void *ctx, const u8 *dst, u8 oui_suffix, const u8 *data,
281 size_t data_len);
bef4d07a 282 int (*channel_info)(void *ctx, struct wpa_channel_info *ci);
dbfa691d 283 int (*update_vlan)(void *ctx, const u8 *addr, int vlan_id);
1034f67b
MV
284 int (*get_sta_tx_params)(void *ctx, const u8 *addr,
285 int ap_max_chanwidth, int ap_seg1_idx,
286 int *bandwidth, int *seg1_idx);
4ec1fd8e 287#ifdef CONFIG_IEEE80211R_AP
6fc6879b 288 struct wpa_state_machine * (*add_sta)(void *ctx, const u8 *sta_addr);
47a039b0
MB
289 int (*set_vlan)(void *ctx, const u8 *sta_addr,
290 struct vlan_description *vlan);
291 int (*get_vlan)(void *ctx, const u8 *sta_addr,
292 struct vlan_description *vlan);
8c345234
MB
293 int (*set_identity)(void *ctx, const u8 *sta_addr,
294 const u8 *identity, size_t identity_len);
295 size_t (*get_identity)(void *ctx, const u8 *sta_addr, const u8 **buf);
296 int (*set_radius_cui)(void *ctx, const u8 *sta_addr,
297 const u8 *radius_cui, size_t radius_cui_len);
298 size_t (*get_radius_cui)(void *ctx, const u8 *sta_addr, const u8 **buf);
3cb286ca
MB
299 void (*set_session_timeout)(void *ctx, const u8 *sta_addr,
300 int session_timeout);
301 int (*get_session_timeout)(void *ctx, const u8 *sta_addr);
8c345234 302
6fc6879b
JM
303 int (*send_ft_action)(void *ctx, const u8 *dst,
304 const u8 *data, size_t data_len);
88b32a99 305 int (*add_tspec)(void *ctx, const u8 *sta_addr, u8 *tspec_ie,
006309b5 306 size_t tspec_ielen);
4ec1fd8e 307#endif /* CONFIG_IEEE80211R_AP */
0f950df0
TP
308#ifdef CONFIG_MESH
309 int (*start_ampe)(void *ctx, const u8 *sta_addr);
310#endif /* CONFIG_MESH */
6fc6879b
JM
311};
312
313struct wpa_authenticator * wpa_init(const u8 *addr,
314 struct wpa_auth_config *conf,
cef8fac0
JB
315 const struct wpa_auth_callbacks *cb,
316 void *cb_ctx);
bdffdc5d 317int wpa_init_keys(struct wpa_authenticator *wpa_auth);
6fc6879b
JM
318void wpa_deinit(struct wpa_authenticator *wpa_auth);
319int wpa_reconfig(struct wpa_authenticator *wpa_auth,
320 struct wpa_auth_config *conf);
321
322enum {
323 WPA_IE_OK, WPA_INVALID_IE, WPA_INVALID_GROUP, WPA_INVALID_PAIRWISE,
324 WPA_INVALID_AKMP, WPA_NOT_ENABLED, WPA_ALLOC_FAIL,
325 WPA_MGMT_FRAME_PROTECTION_VIOLATION, WPA_INVALID_MGMT_GROUP_CIPHER,
567da5bb 326 WPA_INVALID_MDIE, WPA_INVALID_PROTO, WPA_INVALID_PMKID
6fc6879b 327};
91d91abf 328
6fc6879b 329int wpa_validate_wpa_ie(struct wpa_authenticator *wpa_auth,
2c129a1b 330 struct wpa_state_machine *sm, int freq,
6fc6879b 331 const u8 *wpa_ie, size_t wpa_ie_len,
d3516cad 332 const u8 *rsnxe, size_t rsnxe_len,
09368515
JM
333 const u8 *mdie, size_t mdie_len,
334 const u8 *owe_dh, size_t owe_dh_len);
a14896e8
JM
335int wpa_validate_osen(struct wpa_authenticator *wpa_auth,
336 struct wpa_state_machine *sm,
337 const u8 *osen_ie, size_t osen_ie_len);
f3f7540e 338int wpa_auth_uses_mfp(struct wpa_state_machine *sm);
1e93e423
MV
339void wpa_auth_set_ocv(struct wpa_state_machine *sm, int ocv);
340int wpa_auth_uses_ocv(struct wpa_state_machine *sm);
6fc6879b 341struct wpa_state_machine *
94ddef3e
JM
342wpa_auth_sta_init(struct wpa_authenticator *wpa_auth, const u8 *addr,
343 const u8 *p2p_dev_addr);
6f9b5d16
JM
344int wpa_auth_sta_associated(struct wpa_authenticator *wpa_auth,
345 struct wpa_state_machine *sm);
a8d05fca 346void wpa_auth_sta_no_wpa(struct wpa_state_machine *sm);
6fc6879b
JM
347void wpa_auth_sta_deinit(struct wpa_state_machine *sm);
348void wpa_receive(struct wpa_authenticator *wpa_auth,
349 struct wpa_state_machine *sm,
350 u8 *data, size_t data_len);
bb119228 351enum wpa_event {
6fc6879b 352 WPA_AUTH, WPA_ASSOC, WPA_DISASSOC, WPA_DEAUTH, WPA_REAUTH,
0e3bd7ac 353 WPA_REAUTH_EAPOL, WPA_ASSOC_FT, WPA_ASSOC_FILS, WPA_DRV_STA_REMOVED
bb119228 354};
6fc6879b 355void wpa_remove_ptk(struct wpa_state_machine *sm);
bb119228 356int wpa_auth_sm_event(struct wpa_state_machine *sm, enum wpa_event event);
6fc6879b
JM
357void wpa_auth_sm_notify(struct wpa_state_machine *sm);
358void wpa_gtk_rekey(struct wpa_authenticator *wpa_auth);
359int wpa_get_mib(struct wpa_authenticator *wpa_auth, char *buf, size_t buflen);
360int wpa_get_mib_sta(struct wpa_state_machine *sm, char *buf, size_t buflen);
361void wpa_auth_countermeasures_start(struct wpa_authenticator *wpa_auth);
362int wpa_auth_pairwise_set(struct wpa_state_machine *sm);
ff36ff00 363int wpa_auth_get_pairwise(struct wpa_state_machine *sm);
b08c9ad0 364const u8 * wpa_auth_get_pmk(struct wpa_state_machine *sm, int *len);
6fc6879b
JM
365int wpa_auth_sta_key_mgmt(struct wpa_state_machine *sm);
366int wpa_auth_sta_wpa_version(struct wpa_state_machine *sm);
0e3bd7ac 367int wpa_auth_sta_ft_tk_already_set(struct wpa_state_machine *sm);
2f1357fb 368int wpa_auth_sta_fils_tk_already_set(struct wpa_state_machine *sm);
6fc6879b
JM
369int wpa_auth_sta_clear_pmksa(struct wpa_state_machine *sm,
370 struct rsn_pmksa_cache_entry *entry);
371struct rsn_pmksa_cache_entry *
372wpa_auth_sta_get_pmksa(struct wpa_state_machine *sm);
373void wpa_auth_sta_local_mic_failure_report(struct wpa_state_machine *sm);
374const u8 * wpa_auth_get_wpa_ie(struct wpa_authenticator *wpa_auth,
375 size_t *len);
376int wpa_auth_pmksa_add(struct wpa_state_machine *sm, const u8 *pmk,
207976f0 377 unsigned int pmk_len,
6fc6879b
JM
378 int session_timeout, struct eapol_state_machine *eapol);
379int wpa_auth_pmksa_add_preauth(struct wpa_authenticator *wpa_auth,
380 const u8 *pmk, size_t len, const u8 *sta_addr,
381 int session_timeout,
382 struct eapol_state_machine *eapol);
f2991170 383int wpa_auth_pmksa_add_sae(struct wpa_authenticator *wpa_auth, const u8 *addr,
70c93963 384 const u8 *pmk, const u8 *pmkid);
9d94e4bb 385void wpa_auth_add_sae_pmkid(struct wpa_state_machine *sm, const u8 *pmkid);
0c52953b
JM
386int wpa_auth_pmksa_add2(struct wpa_authenticator *wpa_auth, const u8 *addr,
387 const u8 *pmk, size_t pmk_len, const u8 *pmkid,
388 int session_timeout, int akmp);
901d1fe1
JM
389void wpa_auth_pmksa_remove(struct wpa_authenticator *wpa_auth,
390 const u8 *sta_addr);
b8daac18
MH
391int wpa_auth_pmksa_list(struct wpa_authenticator *wpa_auth, char *buf,
392 size_t len);
4c522c77 393void wpa_auth_pmksa_flush(struct wpa_authenticator *wpa_auth);
4d77d80e
MH
394int wpa_auth_pmksa_list_mesh(struct wpa_authenticator *wpa_auth, const u8 *addr,
395 char *buf, size_t len);
396struct rsn_pmksa_cache_entry *
397wpa_auth_pmksa_create_entry(const u8 *aa, const u8 *spa, const u8 *pmk,
398 const u8 *pmkid, int expiration);
399int wpa_auth_pmksa_add_entry(struct wpa_authenticator *wpa_auth,
400 struct rsn_pmksa_cache_entry *entry);
9f2cf23e 401struct rsn_pmksa_cache_entry *
c1bd4bac
JM
402wpa_auth_pmksa_get(struct wpa_authenticator *wpa_auth, const u8 *sta_addr,
403 const u8 *pmkid);
7eace378
JM
404struct rsn_pmksa_cache_entry *
405wpa_auth_pmksa_get_fils_cache_id(struct wpa_authenticator *wpa_auth,
406 const u8 *sta_addr, const u8 *pmkid);
9f2cf23e
MH
407void wpa_auth_pmksa_set_to_sm(struct rsn_pmksa_cache_entry *pmksa,
408 struct wpa_state_machine *sm,
409 struct wpa_authenticator *wpa_auth,
410 u8 *pmkid, u8 *pmk);
6fc6879b 411int wpa_auth_sta_set_vlan(struct wpa_state_machine *sm, int vlan_id);
e4bf4db9
JM
412void wpa_auth_eapol_key_tx_status(struct wpa_authenticator *wpa_auth,
413 struct wpa_state_machine *sm, int ack);
6fc6879b 414
4ec1fd8e 415#ifdef CONFIG_IEEE80211R_AP
6fc6879b 416u8 * wpa_sm_write_assoc_resp_ies(struct wpa_state_machine *sm, u8 *pos,
f238cf9f
JM
417 size_t max_len, int auth_alg,
418 const u8 *req_ies, size_t req_ies_len);
6fc6879b
JM
419void wpa_ft_process_auth(struct wpa_state_machine *sm, const u8 *bssid,
420 u16 auth_transaction, const u8 *ies, size_t ies_len,
421 void (*cb)(void *ctx, const u8 *dst, const u8 *bssid,
422 u16 auth_transaction, u16 resp,
423 const u8 *ies, size_t ies_len),
424 void *ctx);
425u16 wpa_ft_validate_reassoc(struct wpa_state_machine *sm, const u8 *ies,
426 size_t ies_len);
427int wpa_ft_action_rx(struct wpa_state_machine *sm, const u8 *data, size_t len);
428int wpa_ft_rrb_rx(struct wpa_authenticator *wpa_auth, const u8 *src_addr,
429 const u8 *data, size_t data_len);
50bd8e0a
MB
430void wpa_ft_rrb_oui_rx(struct wpa_authenticator *wpa_auth, const u8 *src_addr,
431 const u8 *dst_addr, u8 oui_suffix, const u8 *data,
432 size_t data_len);
6fc6879b 433void wpa_ft_push_pmk_r1(struct wpa_authenticator *wpa_auth, const u8 *addr);
eefe8630 434void wpa_ft_deinit(struct wpa_authenticator *wpa_auth);
3a46cf93 435void wpa_ft_sta_deinit(struct wpa_state_machine *sm);
4ec1fd8e 436#endif /* CONFIG_IEEE80211R_AP */
6fc6879b 437
d32d94db
XC
438void wpa_wnmsleep_rekey_gtk(struct wpa_state_machine *sm);
439void wpa_set_wnmsleep(struct wpa_state_machine *sm, int flag);
440int wpa_wnmsleep_gtk_subelem(struct wpa_state_machine *sm, u8 *pos);
d32d94db 441int wpa_wnmsleep_igtk_subelem(struct wpa_state_machine *sm, u8 *pos);
16889aff 442int wpa_wnmsleep_bigtk_subelem(struct wpa_state_machine *sm, u8 *pos);
d32d94db 443
c10347f2 444int wpa_auth_uses_sae(struct wpa_state_machine *sm);
aa189ac9 445int wpa_auth_uses_ft_sae(struct wpa_state_machine *sm);
c10347f2 446
25ef8529
JM
447int wpa_auth_get_ip_addr(struct wpa_state_machine *sm, u8 *addr);
448
cbc210de
JM
449struct radius_das_attrs;
450int wpa_auth_radius_das_disconnect_pmksa(struct wpa_authenticator *wpa_auth,
451 struct radius_das_attrs *attr);
34782730 452void wpa_auth_reconfig_group_keys(struct wpa_authenticator *wpa_auth);
cbc210de 453
7cebc8e2
MB
454int wpa_auth_ensure_group(struct wpa_authenticator *wpa_auth, int vlan_id);
455int wpa_auth_release_group(struct wpa_authenticator *wpa_auth, int vlan_id);
c4fd6d8a 456int fils_auth_pmk_to_ptk(struct wpa_state_machine *sm, const u8 *pmk,
80ddf5d9 457 size_t pmk_len, const u8 *snonce, const u8 *anonce,
4cada9dc 458 const u8 *dhss, size_t dhss_len,
80ddf5d9 459 struct wpabuf *g_sta, struct wpabuf *g_ap);
78815f3d
JM
460int fils_decrypt_assoc(struct wpa_state_machine *sm, const u8 *fils_session,
461 const struct ieee80211_mgmt *mgmt, size_t frame_len,
462 u8 *pos, size_t left);
e73ffa09 463int fils_encrypt_assoc(struct wpa_state_machine *sm, u8 *buf,
91d91abf
JM
464 size_t current_len, size_t max_len,
465 const struct wpabuf *hlp);
da24c5aa 466int fils_set_tk(struct wpa_state_machine *sm);
fa61bff6 467u8 * hostapd_eid_assoc_fils_session(struct wpa_state_machine *sm, u8 *eid,
8b5ddda5
JM
468 const u8 *fils_session,
469 struct wpabuf *fils_hlp_resp);
087631b9
JM
470const u8 * wpa_fils_validate_fils_session(struct wpa_state_machine *sm,
471 const u8 *ies, size_t ies_len,
472 const u8 *fils_session);
bd599353
JM
473int wpa_fils_validate_key_confirm(struct wpa_state_machine *sm, const u8 *ies,
474 size_t ies_len);
7cebc8e2 475
1034f67b
MV
476int get_sta_tx_parameters(struct wpa_state_machine *sm, int ap_max_chanwidth,
477 int ap_seg1_idx, int *bandwidth, int *seg1_idx);
478
a7968ea5
JM
479int wpa_auth_write_fte(struct wpa_authenticator *wpa_auth, int use_sha384,
480 u8 *buf, size_t len);
8acbf85f
JM
481void wpa_auth_get_fils_aead_params(struct wpa_state_machine *sm,
482 u8 *fils_anonce, u8 *fils_snonce,
483 u8 *fils_kek, size_t *fils_kek_len);
a40bd06e
JM
484void wpa_auth_add_fils_pmk_pmkid(struct wpa_state_machine *sm, const u8 *pmk,
485 size_t pmk_len, const u8 *pmkid);
d8c8d857
JM
486u8 * wpa_auth_write_assoc_resp_owe(struct wpa_state_machine *sm,
487 u8 *pos, size_t max_len,
488 const u8 *req_ies, size_t req_ies_len);
831d8c9c
JM
489u8 * wpa_auth_write_assoc_resp_fils(struct wpa_state_machine *sm,
490 u8 *pos, size_t max_len,
491 const u8 *req_ies, size_t req_ies_len);
36536639 492void wpa_auth_set_auth_alg(struct wpa_state_machine *sm, u16 auth_alg);
10ec6a5f 493void wpa_auth_set_dpp_z(struct wpa_state_machine *sm, const struct wpabuf *z);
5db997e3 494
3d695328
JM
495int wpa_auth_resend_m1(struct wpa_state_machine *sm, int change_anonce,
496 void (*cb)(void *ctx1, void *ctx2),
497 void *ctx1, void *ctx2);
498int wpa_auth_resend_m3(struct wpa_state_machine *sm,
499 void (*cb)(void *ctx1, void *ctx2),
500 void *ctx1, void *ctx2);
501int wpa_auth_resend_group_m1(struct wpa_state_machine *sm,
502 void (*cb)(void *ctx1, void *ctx2),
503 void *ctx1, void *ctx2);
92662fb2 504int wpa_auth_rekey_gtk(struct wpa_authenticator *wpa_auth);
a40bd06e 505void wpa_auth_set_ptk_rekey_timer(struct wpa_state_machine *sm);
6bc2f00f 506
6fc6879b 507#endif /* WPA_AUTH_H */