xref: /freebsd/contrib/wpa/src/ap/wpa_auth_i.h (revision a90b9d0159070121c221b966469c3e36d912bf82)
1e28a4053SRui Paulo /*
2e28a4053SRui Paulo  * hostapd - IEEE 802.11i-2004 / WPA Authenticator: Internal definitions
35b9c547cSRui Paulo  * Copyright (c) 2004-2015, Jouni Malinen <j@w1.fi>
4e28a4053SRui Paulo  *
5f05cddf9SRui Paulo  * This software may be distributed under the terms of the BSD license.
6f05cddf9SRui Paulo  * See README for more details.
7e28a4053SRui Paulo  */
8e28a4053SRui Paulo 
9e28a4053SRui Paulo #ifndef WPA_AUTH_I_H
10e28a4053SRui Paulo #define WPA_AUTH_I_H
11e28a4053SRui Paulo 
1285732ac8SCy Schubert #include "utils/list.h"
1385732ac8SCy Schubert 
14e28a4053SRui Paulo /* max(dot11RSNAConfigGroupUpdateCount,dot11RSNAConfigPairwiseUpdateCount) */
15e28a4053SRui Paulo #define RSNA_MAX_EAPOL_RETRIES 4
16e28a4053SRui Paulo 
17e28a4053SRui Paulo struct wpa_group;
18e28a4053SRui Paulo 
19e28a4053SRui Paulo struct wpa_state_machine {
20e28a4053SRui Paulo 	struct wpa_authenticator *wpa_auth;
21e28a4053SRui Paulo 	struct wpa_group *group;
22e28a4053SRui Paulo 
23e28a4053SRui Paulo 	u8 addr[ETH_ALEN];
245b9c547cSRui Paulo 	u8 p2p_dev_addr[ETH_ALEN];
254bc52338SCy Schubert 	u16 auth_alg;
26e28a4053SRui Paulo 
27e28a4053SRui Paulo 	enum {
28e28a4053SRui Paulo 		WPA_PTK_INITIALIZE, WPA_PTK_DISCONNECT, WPA_PTK_DISCONNECTED,
29e28a4053SRui Paulo 		WPA_PTK_AUTHENTICATION, WPA_PTK_AUTHENTICATION2,
30e28a4053SRui Paulo 		WPA_PTK_INITPMK, WPA_PTK_INITPSK, WPA_PTK_PTKSTART,
31e28a4053SRui Paulo 		WPA_PTK_PTKCALCNEGOTIATING, WPA_PTK_PTKCALCNEGOTIATING2,
32e28a4053SRui Paulo 		WPA_PTK_PTKINITNEGOTIATING, WPA_PTK_PTKINITDONE
33e28a4053SRui Paulo 	} wpa_ptk_state;
34e28a4053SRui Paulo 
35e28a4053SRui Paulo 	enum {
36e28a4053SRui Paulo 		WPA_PTK_GROUP_IDLE = 0,
37e28a4053SRui Paulo 		WPA_PTK_GROUP_REKEYNEGOTIATING,
38e28a4053SRui Paulo 		WPA_PTK_GROUP_REKEYESTABLISHED,
39e28a4053SRui Paulo 		WPA_PTK_GROUP_KEYERROR
40e28a4053SRui Paulo 	} wpa_ptk_group_state;
41e28a4053SRui Paulo 
42c1d255d3SCy Schubert 	bool Init;
43c1d255d3SCy Schubert 	bool DeauthenticationRequest;
44c1d255d3SCy Schubert 	bool AuthenticationRequest;
45c1d255d3SCy Schubert 	bool ReAuthenticationRequest;
46c1d255d3SCy Schubert 	bool Disconnect;
4785732ac8SCy Schubert 	u16 disconnect_reason; /* specific reason code to use with Disconnect */
4885732ac8SCy Schubert 	u32 TimeoutCtr;
4985732ac8SCy Schubert 	u32 GTimeoutCtr;
50c1d255d3SCy Schubert 	bool TimeoutEvt;
51c1d255d3SCy Schubert 	bool EAPOLKeyReceived;
52c1d255d3SCy Schubert 	bool EAPOLKeyPairwise;
53c1d255d3SCy Schubert 	bool EAPOLKeyRequest;
54c1d255d3SCy Schubert 	bool MICVerified;
55c1d255d3SCy Schubert 	bool GUpdateStationKeys;
56e28a4053SRui Paulo 	u8 ANonce[WPA_NONCE_LEN];
57e28a4053SRui Paulo 	u8 SNonce[WPA_NONCE_LEN];
585b9c547cSRui Paulo 	u8 alt_SNonce[WPA_NONCE_LEN];
595b9c547cSRui Paulo 	u8 alt_replay_counter[WPA_REPLAY_COUNTER_LEN];
60780fb4a2SCy Schubert 	u8 PMK[PMK_LEN_MAX];
61780fb4a2SCy Schubert 	unsigned int pmk_len;
6285732ac8SCy Schubert 	u8 pmkid[PMKID_LEN]; /* valid if pmkid_set == 1 */
63e28a4053SRui Paulo 	struct wpa_ptk PTK;
64c1d255d3SCy Schubert 	u8 keyidx_active;
65c1d255d3SCy Schubert 	bool use_ext_key_id;
66c1d255d3SCy Schubert 	bool PTK_valid;
67c1d255d3SCy Schubert 	bool pairwise_set;
68c1d255d3SCy Schubert 	bool tk_already_set;
69e28a4053SRui Paulo 	int keycount;
70c1d255d3SCy Schubert 	bool Pair;
71f05cddf9SRui Paulo 	struct wpa_key_replay_counter {
72e28a4053SRui Paulo 		u8 counter[WPA_REPLAY_COUNTER_LEN];
73c1d255d3SCy Schubert 		bool valid;
74f05cddf9SRui Paulo 	} key_replay[RSNA_MAX_EAPOL_RETRIES],
75f05cddf9SRui Paulo 		prev_key_replay[RSNA_MAX_EAPOL_RETRIES];
76c1d255d3SCy Schubert 	bool PInitAKeys; /* WPA only, not in IEEE 802.11i */
77c1d255d3SCy Schubert 	bool PTKRequest; /* not in IEEE 802.11i state machine */
78c1d255d3SCy Schubert 	bool has_GTK;
79c1d255d3SCy Schubert 	bool PtkGroupInit; /* init request for PTK Group state machine */
80e28a4053SRui Paulo 
81e28a4053SRui Paulo 	u8 *last_rx_eapol_key; /* starting from IEEE 802.1X header */
82e28a4053SRui Paulo 	size_t last_rx_eapol_key_len;
83e28a4053SRui Paulo 
84e28a4053SRui Paulo 	unsigned int changed:1;
85e28a4053SRui Paulo 	unsigned int in_step_loop:1;
86e28a4053SRui Paulo 	unsigned int pending_deinit:1;
87e28a4053SRui Paulo 	unsigned int started:1;
88e28a4053SRui Paulo 	unsigned int mgmt_frame_prot:1;
89*a90b9d01SCy Schubert 	unsigned int mfpr:1;
90f05cddf9SRui Paulo 	unsigned int rx_eapol_key_secure:1;
91f05cddf9SRui Paulo 	unsigned int update_snonce:1;
925b9c547cSRui Paulo 	unsigned int alt_snonce_valid:1;
93*a90b9d01SCy Schubert 	unsigned int waiting_radius_psk:1;
9485732ac8SCy Schubert #ifdef CONFIG_IEEE80211R_AP
95e28a4053SRui Paulo 	unsigned int ft_completed:1;
96e28a4053SRui Paulo 	unsigned int pmk_r1_name_valid:1;
9785732ac8SCy Schubert #endif /* CONFIG_IEEE80211R_AP */
98f05cddf9SRui Paulo 	unsigned int is_wnmsleep:1;
9985732ac8SCy Schubert 	unsigned int pmkid_set:1;
100c1d255d3SCy Schubert 
101*a90b9d01SCy Schubert 	unsigned int ptkstart_without_success;
102*a90b9d01SCy Schubert 
1034bc52338SCy Schubert #ifdef CONFIG_OCV
104c1d255d3SCy Schubert 	int ocv_enabled;
1054bc52338SCy Schubert #endif /* CONFIG_OCV */
106e28a4053SRui Paulo 
107e28a4053SRui Paulo 	u8 req_replay_counter[WPA_REPLAY_COUNTER_LEN];
108e28a4053SRui Paulo 	int req_replay_counter_used;
109e28a4053SRui Paulo 
110e28a4053SRui Paulo 	u8 *wpa_ie;
111e28a4053SRui Paulo 	size_t wpa_ie_len;
112c1d255d3SCy Schubert 	u8 *rsnxe;
113c1d255d3SCy Schubert 	size_t rsnxe_len;
114e28a4053SRui Paulo 
115e28a4053SRui Paulo 	enum {
116e28a4053SRui Paulo 		WPA_VERSION_NO_WPA = 0 /* WPA not used */,
117e28a4053SRui Paulo 		WPA_VERSION_WPA = 1 /* WPA / IEEE 802.11i/D3.0 */,
118e28a4053SRui Paulo 		WPA_VERSION_WPA2 = 2 /* WPA2 / IEEE 802.11i */
119e28a4053SRui Paulo 	} wpa;
120e28a4053SRui Paulo 	int pairwise; /* Pairwise cipher suite, WPA_CIPHER_* */
121e28a4053SRui Paulo 	int wpa_key_mgmt; /* the selected WPA_KEY_MGMT_* */
122e28a4053SRui Paulo 	struct rsn_pmksa_cache_entry *pmksa;
123e28a4053SRui Paulo 
124e28a4053SRui Paulo 	u32 dot11RSNAStatsTKIPLocalMICFailures;
125e28a4053SRui Paulo 	u32 dot11RSNAStatsTKIPRemoteMICFailures;
126e28a4053SRui Paulo 
12785732ac8SCy Schubert #ifdef CONFIG_IEEE80211R_AP
12885732ac8SCy Schubert 	u8 xxkey[PMK_LEN_MAX]; /* PSK or the second 256 bits of MSK, or the
12985732ac8SCy Schubert 				* first 384 bits of MSK */
130e28a4053SRui Paulo 	size_t xxkey_len;
1314bc52338SCy Schubert 	u8 pmk_r1[PMK_LEN_MAX];
1324bc52338SCy Schubert 	unsigned int pmk_r1_len;
133e28a4053SRui Paulo 	u8 pmk_r1_name[WPA_PMK_NAME_LEN]; /* PMKR1Name derived from FT Auth
134e28a4053SRui Paulo 					   * Request */
135e28a4053SRui Paulo 	u8 r0kh_id[FT_R0KH_ID_MAX_LEN]; /* R0KH-ID from FT Auth Request */
136e28a4053SRui Paulo 	size_t r0kh_id_len;
137e28a4053SRui Paulo 	u8 *assoc_resp_ftie;
1385b9c547cSRui Paulo 
139*a90b9d01SCy Schubert 	void (*ft_pending_cb)(void *ctx, const u8 *dst,
1405b9c547cSRui Paulo 			      u16 auth_transaction, u16 status,
1415b9c547cSRui Paulo 			      const u8 *ies, size_t ies_len);
1425b9c547cSRui Paulo 	void *ft_pending_cb_ctx;
1435b9c547cSRui Paulo 	struct wpabuf *ft_pending_req_ies;
14485732ac8SCy Schubert 	u8 ft_pending_pull_nonce[FT_RRB_NONCE_LEN];
1455b9c547cSRui Paulo 	u8 ft_pending_auth_transaction;
1465b9c547cSRui Paulo 	u8 ft_pending_current_ap[ETH_ALEN];
14785732ac8SCy Schubert 	int ft_pending_pull_left_retries;
14885732ac8SCy Schubert #endif /* CONFIG_IEEE80211R_AP */
149f05cddf9SRui Paulo 
150f05cddf9SRui Paulo 	int pending_1_of_4_timeout;
1515b9c547cSRui Paulo 
1525b9c547cSRui Paulo #ifdef CONFIG_P2P
1535b9c547cSRui Paulo 	u8 ip_addr[4];
154*a90b9d01SCy Schubert 	unsigned int ip_addr_bit;
1555b9c547cSRui Paulo #endif /* CONFIG_P2P */
15685732ac8SCy Schubert 
15785732ac8SCy Schubert #ifdef CONFIG_FILS
15885732ac8SCy Schubert 	u8 fils_key_auth_sta[FILS_MAX_KEY_AUTH_LEN];
15985732ac8SCy Schubert 	u8 fils_key_auth_ap[FILS_MAX_KEY_AUTH_LEN];
16085732ac8SCy Schubert 	size_t fils_key_auth_len;
16185732ac8SCy Schubert 	unsigned int fils_completed:1;
16285732ac8SCy Schubert #endif /* CONFIG_FILS */
16385732ac8SCy Schubert 
1644bc52338SCy Schubert #ifdef CONFIG_DPP2
1654bc52338SCy Schubert 	struct wpabuf *dpp_z;
1664bc52338SCy Schubert #endif /* CONFIG_DPP2 */
1674bc52338SCy Schubert 
16885732ac8SCy Schubert #ifdef CONFIG_TESTING_OPTIONS
16985732ac8SCy Schubert 	void (*eapol_status_cb)(void *ctx1, void *ctx2);
17085732ac8SCy Schubert 	void *eapol_status_cb_ctx1;
17185732ac8SCy Schubert 	void *eapol_status_cb_ctx2;
17285732ac8SCy Schubert #endif /* CONFIG_TESTING_OPTIONS */
173*a90b9d01SCy Schubert 
174*a90b9d01SCy Schubert #ifdef CONFIG_IEEE80211BE
175*a90b9d01SCy Schubert 	u8 peer_mld_addr[ETH_ALEN];
176*a90b9d01SCy Schubert 	s8 mld_assoc_link_id;
177*a90b9d01SCy Schubert 	u8 n_mld_affiliated_links;
178*a90b9d01SCy Schubert 
179*a90b9d01SCy Schubert 	struct mld_link {
180*a90b9d01SCy Schubert 		bool valid;
181*a90b9d01SCy Schubert 		u8 peer_addr[ETH_ALEN];
182*a90b9d01SCy Schubert 
183*a90b9d01SCy Schubert 		struct wpa_authenticator *wpa_auth;
184*a90b9d01SCy Schubert 	} mld_links[MAX_NUM_MLD_LINKS];
185*a90b9d01SCy Schubert #endif /* CONFIG_IEEE80211BE */
186*a90b9d01SCy Schubert 
187*a90b9d01SCy Schubert 	bool ssid_protection;
188e28a4053SRui Paulo };
189e28a4053SRui Paulo 
190e28a4053SRui Paulo 
191e28a4053SRui Paulo /* per group key state machine data */
192e28a4053SRui Paulo struct wpa_group {
193e28a4053SRui Paulo 	struct wpa_group *next;
194e28a4053SRui Paulo 	int vlan_id;
195e28a4053SRui Paulo 
196c1d255d3SCy Schubert 	bool GInit;
197e28a4053SRui Paulo 	int GKeyDoneStations;
198c1d255d3SCy Schubert 	bool GTKReKey;
199e28a4053SRui Paulo 	int GTK_len;
200e28a4053SRui Paulo 	int GN, GM;
201c1d255d3SCy Schubert 	bool GTKAuthenticator;
202e28a4053SRui Paulo 	u8 Counter[WPA_NONCE_LEN];
203e28a4053SRui Paulo 
204e28a4053SRui Paulo 	enum {
205e28a4053SRui Paulo 		WPA_GROUP_GTK_INIT = 0,
2065b9c547cSRui Paulo 		WPA_GROUP_SETKEYS, WPA_GROUP_SETKEYSDONE,
2075b9c547cSRui Paulo 		WPA_GROUP_FATAL_FAILURE
208e28a4053SRui Paulo 	} wpa_group_state;
209e28a4053SRui Paulo 
210e28a4053SRui Paulo 	u8 GMK[WPA_GMK_LEN];
211e28a4053SRui Paulo 	u8 GTK[2][WPA_GTK_MAX_LEN];
212e28a4053SRui Paulo 	u8 GNonce[WPA_NONCE_LEN];
213c1d255d3SCy Schubert 	bool changed;
214c1d255d3SCy Schubert 	bool first_sta_seen;
215c1d255d3SCy Schubert 	bool reject_4way_hs_for_entropy;
2165b9c547cSRui Paulo 	u8 IGTK[2][WPA_IGTK_MAX_LEN];
217c1d255d3SCy Schubert 	u8 BIGTK[2][WPA_IGTK_MAX_LEN];
218e28a4053SRui Paulo 	int GN_igtk, GM_igtk;
219c1d255d3SCy Schubert 	int GN_bigtk, GM_bigtk;
220*a90b9d01SCy Schubert 	bool bigtk_set;
221*a90b9d01SCy Schubert 	bool bigtk_configured;
222325151a3SRui Paulo 	/* Number of references except those in struct wpa_group->next */
223325151a3SRui Paulo 	unsigned int references;
224780fb4a2SCy Schubert 	unsigned int num_setup_iface;
225e28a4053SRui Paulo };
226e28a4053SRui Paulo 
227e28a4053SRui Paulo 
228e28a4053SRui Paulo struct wpa_ft_pmk_cache;
229e28a4053SRui Paulo 
230e28a4053SRui Paulo /* per authenticator data */
231e28a4053SRui Paulo struct wpa_authenticator {
232e28a4053SRui Paulo 	struct wpa_group *group;
233e28a4053SRui Paulo 
234e28a4053SRui Paulo 	unsigned int dot11RSNAStatsTKIPRemoteMICFailures;
235e28a4053SRui Paulo 	u32 dot11RSNAAuthenticationSuiteSelected;
236e28a4053SRui Paulo 	u32 dot11RSNAPairwiseCipherSelected;
237e28a4053SRui Paulo 	u32 dot11RSNAGroupCipherSelected;
238e28a4053SRui Paulo 	u8 dot11RSNAPMKIDUsed[PMKID_LEN];
239e28a4053SRui Paulo 	u32 dot11RSNAAuthenticationSuiteRequested; /* FIX: update */
240e28a4053SRui Paulo 	u32 dot11RSNAPairwiseCipherRequested; /* FIX: update */
241e28a4053SRui Paulo 	u32 dot11RSNAGroupCipherRequested; /* FIX: update */
242e28a4053SRui Paulo 	unsigned int dot11RSNATKIPCounterMeasuresInvoked;
243e28a4053SRui Paulo 	unsigned int dot11RSNA4WayHandshakeFailures;
244e28a4053SRui Paulo 
245e28a4053SRui Paulo 	struct wpa_auth_config conf;
24685732ac8SCy Schubert 	const struct wpa_auth_callbacks *cb;
24785732ac8SCy Schubert 	void *cb_ctx;
248e28a4053SRui Paulo 
249e28a4053SRui Paulo 	u8 *wpa_ie;
250e28a4053SRui Paulo 	size_t wpa_ie_len;
251e28a4053SRui Paulo 
252e28a4053SRui Paulo 	u8 addr[ETH_ALEN];
253e28a4053SRui Paulo 
254e28a4053SRui Paulo 	struct rsn_pmksa_cache *pmksa;
255e28a4053SRui Paulo 	struct wpa_ft_pmk_cache *ft_pmk_cache;
2565b9c547cSRui Paulo 
257*a90b9d01SCy Schubert 	bool non_tx_beacon_prot;
258*a90b9d01SCy Schubert 
2595b9c547cSRui Paulo #ifdef CONFIG_P2P
2605b9c547cSRui Paulo 	struct bitfield *ip_pool;
2615b9c547cSRui Paulo #endif /* CONFIG_P2P */
262*a90b9d01SCy Schubert 
263*a90b9d01SCy Schubert #ifdef CONFIG_IEEE80211BE
264*a90b9d01SCy Schubert 	bool is_ml;
265*a90b9d01SCy Schubert 	u8 mld_addr[ETH_ALEN];
266*a90b9d01SCy Schubert 	u8 link_id;
267*a90b9d01SCy Schubert 	bool primary_auth;
268*a90b9d01SCy Schubert #endif /* CONFIG_IEEE80211BE */
269e28a4053SRui Paulo };
270e28a4053SRui Paulo 
271e28a4053SRui Paulo 
27285732ac8SCy Schubert #ifdef CONFIG_IEEE80211R_AP
27385732ac8SCy Schubert 
27485732ac8SCy Schubert #define FT_REMOTE_SEQ_BACKLOG 16
27585732ac8SCy Schubert struct ft_remote_seq_rx {
27685732ac8SCy Schubert 	u32 dom;
27785732ac8SCy Schubert 	struct os_reltime time_offset; /* local time - offset = remote time */
27885732ac8SCy Schubert 
27985732ac8SCy Schubert 	/* accepted sequence numbers: (offset ... offset + 0x40000000]
28085732ac8SCy Schubert 	 *   (except those in last)
28185732ac8SCy Schubert 	 * dropped sequence numbers: (offset - 0x40000000 ... offset]
28285732ac8SCy Schubert 	 * all others trigger SEQ_REQ message (except first message)
28385732ac8SCy Schubert 	 */
28485732ac8SCy Schubert 	u32 last[FT_REMOTE_SEQ_BACKLOG];
28585732ac8SCy Schubert 	unsigned int num_last;
28685732ac8SCy Schubert 	u32 offsetidx;
28785732ac8SCy Schubert 
28885732ac8SCy Schubert 	struct dl_list queue; /* send nonces + rrb msgs awaiting seq resp */
28985732ac8SCy Schubert };
29085732ac8SCy Schubert 
29185732ac8SCy Schubert struct ft_remote_seq_tx {
29285732ac8SCy Schubert 	u32 dom; /* non zero if initialized */
29385732ac8SCy Schubert 	u32 seq;
29485732ac8SCy Schubert };
29585732ac8SCy Schubert 
29685732ac8SCy Schubert struct ft_remote_seq {
29785732ac8SCy Schubert 	struct ft_remote_seq_rx rx;
29885732ac8SCy Schubert 	struct ft_remote_seq_tx tx;
29985732ac8SCy Schubert };
30085732ac8SCy Schubert 
30185732ac8SCy Schubert #endif /* CONFIG_IEEE80211R_AP */
30285732ac8SCy Schubert 
30385732ac8SCy Schubert 
304e28a4053SRui Paulo int wpa_write_rsn_ie(struct wpa_auth_config *conf, u8 *buf, size_t len,
305e28a4053SRui Paulo 		     const u8 *pmkid);
306c1d255d3SCy Schubert int wpa_write_rsnxe(struct wpa_auth_config *conf, u8 *buf, size_t len);
307e28a4053SRui Paulo void wpa_auth_logger(struct wpa_authenticator *wpa_auth, const u8 *addr,
308e28a4053SRui Paulo 		     logger_level level, const char *txt);
309e28a4053SRui Paulo void wpa_auth_vlogger(struct wpa_authenticator *wpa_auth, const u8 *addr,
310c1d255d3SCy Schubert 		      logger_level level, const char *fmt, ...)
311c1d255d3SCy Schubert 	PRINTF_FORMAT(4, 5);
312e28a4053SRui Paulo void __wpa_send_eapol(struct wpa_authenticator *wpa_auth,
313e28a4053SRui Paulo 		      struct wpa_state_machine *sm, int key_info,
314e28a4053SRui Paulo 		      const u8 *key_rsc, const u8 *nonce,
315e28a4053SRui Paulo 		      const u8 *kde, size_t kde_len,
316e28a4053SRui Paulo 		      int keyidx, int encr, int force_version);
317e28a4053SRui Paulo int wpa_auth_for_each_sta(struct wpa_authenticator *wpa_auth,
318e28a4053SRui Paulo 			  int (*cb)(struct wpa_state_machine *sm, void *ctx),
319e28a4053SRui Paulo 			  void *cb_ctx);
320e28a4053SRui Paulo int wpa_auth_for_each_auth(struct wpa_authenticator *wpa_auth,
321e28a4053SRui Paulo 			   int (*cb)(struct wpa_authenticator *a, void *ctx),
322e28a4053SRui Paulo 			   void *cb_ctx);
323*a90b9d01SCy Schubert void wpa_auth_store_ptksa(struct wpa_authenticator *wpa_auth,
324*a90b9d01SCy Schubert 			  const u8 *addr, int cipher,
325*a90b9d01SCy Schubert 			  u32 life_time, const struct wpa_ptk *ptk);
326e28a4053SRui Paulo 
32785732ac8SCy Schubert #ifdef CONFIG_IEEE80211R_AP
328e28a4053SRui Paulo int wpa_write_mdie(struct wpa_auth_config *conf, u8 *buf, size_t len);
329*a90b9d01SCy Schubert int wpa_write_ftie(struct wpa_auth_config *conf, int key_mgmt, size_t key_len,
33085732ac8SCy Schubert 		   const u8 *r0kh_id, size_t r0kh_id_len,
331e28a4053SRui Paulo 		   const u8 *anonce, const u8 *snonce,
332e28a4053SRui Paulo 		   u8 *buf, size_t len, const u8 *subelem,
333c1d255d3SCy Schubert 		   size_t subelem_len, int rsnxe_used);
334*a90b9d01SCy Schubert int wpa_auth_derive_ptk_ft(struct wpa_state_machine *sm, struct wpa_ptk *ptk,
335*a90b9d01SCy Schubert 			   u8 *pmk_r0, u8 *pmk_r1, u8 *pmk_r0_name,
336*a90b9d01SCy Schubert 			   size_t *key_len, size_t kdk_len);
337*a90b9d01SCy Schubert void wpa_auth_ft_store_keys(struct wpa_state_machine *sm, const u8 *pmk_r0,
338*a90b9d01SCy Schubert 			    const u8 *pmk_r1, const u8 *pmk_r0_name,
339*a90b9d01SCy Schubert 			    size_t key_len);
340e28a4053SRui Paulo struct wpa_ft_pmk_cache * wpa_ft_pmk_cache_init(void);
341e28a4053SRui Paulo void wpa_ft_pmk_cache_deinit(struct wpa_ft_pmk_cache *cache);
342c1d255d3SCy Schubert void wpa_ft_install_ptk(struct wpa_state_machine *sm, int retry);
34385732ac8SCy Schubert int wpa_ft_store_pmk_fils(struct wpa_state_machine *sm, const u8 *pmk_r0,
34485732ac8SCy Schubert 			  const u8 *pmk_r0_name);
34585732ac8SCy Schubert #endif /* CONFIG_IEEE80211R_AP */
346e28a4053SRui Paulo 
347e28a4053SRui Paulo #endif /* WPA_AUTH_I_H */
348