22 int ptk_set, tptk_set;
23 unsigned int msg_3_of_4_ok:1;
24 u8 snonce[WPA_NONCE_LEN];
25 u8 anonce[WPA_NONCE_LEN];
27 u8 rx_replay_counter[WPA_REPLAY_COUNTER_LEN];
28 int rx_replay_counter_set;
29 u8 request_counter[WPA_REPLAY_COUNTER_LEN];
35 struct dl_list pmksa_candidates;
40 u8 preauth_bssid[ETH_ALEN];
52 int allowed_pairwise_cipher;
53 int proactive_key_caching;
61 u8 own_addr[ETH_ALEN];
63 const char *bridge_ifname;
66 unsigned int dot11RSNAConfigPMKLifetime;
67 unsigned int dot11RSNAConfigPMKReauthThreshold;
68 unsigned int dot11RSNAConfigSATimeout;
70 unsigned int dot11RSNA4WayHandshakeFailures;
74 unsigned int pairwise_cipher;
75 unsigned int group_cipher;
76 unsigned int key_mgmt;
77 unsigned int mgmt_group_cipher;
83 size_t assoc_wpa_ie_len;
84 u8 *ap_wpa_ie, *ap_rsn_ie;
85 size_t ap_wpa_ie_len, ap_rsn_ie_len;
93 int tdls_chan_switch_prohibited;
103 int tdls_external_setup;
106 int tdls_chan_switch;
109 #ifdef CONFIG_IEEE80211R
113 u8 pmk_r0_name[WPA_PMK_NAME_LEN];
115 u8 pmk_r1_name[WPA_PMK_NAME_LEN];
116 u8 mobility_domain[MOBILITY_DOMAIN_ID_LEN];
117 u8 r0kh_id[FT_R0KH_ID_MAX_LEN];
119 u8 r1kh_id[FT_R1KH_ID_LEN];
121 int over_the_ds_in_progress;
122 u8 target_ap[ETH_ALEN];
123 int set_ptk_after_assoc;
126 size_t assoc_resp_ies_len;
130 u8 p2p_ip_addr[3 * 4];
135 static inline void wpa_sm_set_state(
struct wpa_sm *sm,
enum wpa_states state)
137 WPA_ASSERT(sm->ctx->set_state);
138 sm->ctx->set_state(sm->ctx->ctx, state);
143 WPA_ASSERT(sm->ctx->get_state);
144 return sm->ctx->get_state(sm->ctx->ctx);
147 static inline void wpa_sm_deauthenticate(
struct wpa_sm *sm,
int reason_code)
149 WPA_ASSERT(sm->ctx->deauthenticate);
150 sm->ctx->deauthenticate(sm->ctx->ctx, reason_code);
153 static inline int wpa_sm_set_key(
struct wpa_sm *sm,
enum wpa_alg alg,
154 const u8 *addr,
int key_idx,
int set_tx,
155 const u8 *seq,
size_t seq_len,
156 const u8 *key,
size_t key_len)
158 WPA_ASSERT(sm->ctx->set_key);
159 return sm->ctx->set_key(sm->ctx->ctx, alg, addr, key_idx, set_tx,
160 seq, seq_len, key, key_len);
163 static inline void * wpa_sm_get_network_ctx(
struct wpa_sm *sm)
165 WPA_ASSERT(sm->ctx->get_network_ctx);
166 return sm->ctx->get_network_ctx(sm->ctx->ctx);
169 static inline int wpa_sm_get_bssid(
struct wpa_sm *sm, u8 *bssid)
171 WPA_ASSERT(sm->ctx->get_bssid);
172 return sm->ctx->get_bssid(sm->ctx->ctx, bssid);
175 static inline int wpa_sm_ether_send(
struct wpa_sm *sm,
const u8 *dest,
176 u16 proto,
const u8 *buf,
size_t len)
178 WPA_ASSERT(sm->ctx->ether_send);
179 return sm->ctx->ether_send(sm->ctx->ctx, dest, proto, buf, len);
182 static inline int wpa_sm_get_beacon_ie(
struct wpa_sm *sm)
184 WPA_ASSERT(sm->ctx->get_beacon_ie);
185 return sm->ctx->get_beacon_ie(sm->ctx->ctx);
188 static inline void wpa_sm_cancel_auth_timeout(
struct wpa_sm *sm)
190 WPA_ASSERT(sm->ctx->cancel_auth_timeout);
191 sm->ctx->cancel_auth_timeout(sm->ctx->ctx);
194 static inline u8 * wpa_sm_alloc_eapol(
struct wpa_sm *sm, u8 type,
195 const void *data, u16 data_len,
196 size_t *msg_len,
void **data_pos)
198 WPA_ASSERT(sm->ctx->alloc_eapol);
199 return sm->ctx->alloc_eapol(sm->ctx->ctx, type, data, data_len,
203 static inline int wpa_sm_add_pmkid(
struct wpa_sm *sm,
const u8 *bssid,
206 WPA_ASSERT(sm->ctx->add_pmkid);
207 return sm->ctx->add_pmkid(sm->ctx->ctx, bssid, pmkid);
210 static inline int wpa_sm_remove_pmkid(
struct wpa_sm *sm,
const u8 *bssid,
213 WPA_ASSERT(sm->ctx->remove_pmkid);
214 return sm->ctx->remove_pmkid(sm->ctx->ctx, bssid, pmkid);
217 static inline int wpa_sm_mlme_setprotection(
struct wpa_sm *sm,
const u8 *addr,
218 int protect_type,
int key_type)
220 WPA_ASSERT(sm->ctx->mlme_setprotection);
221 return sm->ctx->mlme_setprotection(sm->ctx->ctx, addr, protect_type,
225 static inline int wpa_sm_update_ft_ies(
struct wpa_sm *sm,
const u8 *md,
226 const u8 *ies,
size_t ies_len)
228 if (sm->ctx->update_ft_ies)
229 return sm->ctx->update_ft_ies(sm->ctx->ctx, md, ies, ies_len);
233 static inline int wpa_sm_send_ft_action(
struct wpa_sm *sm, u8 action,
235 const u8 *ies,
size_t ies_len)
237 if (sm->ctx->send_ft_action)
238 return sm->ctx->send_ft_action(sm->ctx->ctx, action, target_ap,
243 static inline int wpa_sm_mark_authenticated(
struct wpa_sm *sm,
246 if (sm->ctx->mark_authenticated)
247 return sm->ctx->mark_authenticated(sm->ctx->ctx, target_ap);
251 static inline void wpa_sm_set_rekey_offload(
struct wpa_sm *sm)
253 if (!sm->ctx->set_rekey_offload)
255 sm->ctx->set_rekey_offload(sm->ctx->ctx, sm->ptk.kek, sm->ptk.kek_len,
256 sm->ptk.kck, sm->ptk.kck_len,
257 sm->rx_replay_counter);
261 static inline int wpa_sm_tdls_get_capa(
struct wpa_sm *sm,
264 int *tdls_chan_switch)
266 if (sm->ctx->tdls_get_capa)
267 return sm->ctx->tdls_get_capa(sm->ctx->ctx, tdls_supported,
268 tdls_ext_setup, tdls_chan_switch);
272 static inline int wpa_sm_send_tdls_mgmt(
struct wpa_sm *sm,
const u8 *dst,
273 u8 action_code, u8 dialog_token,
274 u16 status_code, u32 peer_capab,
275 int initiator,
const u8 *buf,
278 if (sm->ctx->send_tdls_mgmt)
279 return sm->ctx->send_tdls_mgmt(sm->ctx->ctx, dst, action_code,
280 dialog_token, status_code,
281 peer_capab, initiator, buf,
286 static inline int wpa_sm_tdls_oper(
struct wpa_sm *sm,
int oper,
289 if (sm->ctx->tdls_oper)
290 return sm->ctx->tdls_oper(sm->ctx->ctx, oper, peer);
295 wpa_sm_tdls_peer_addset(
struct wpa_sm *sm,
const u8 *addr,
int add,
296 u16 aid, u16 capability,
const u8 *supp_rates,
297 size_t supp_rates_len,
300 u8 qosinfo,
int wmm,
const u8 *ext_capab,
301 size_t ext_capab_len,
const u8 *supp_channels,
302 size_t supp_channels_len,
const u8 *supp_oper_classes,
303 size_t supp_oper_classes_len)
305 if (sm->ctx->tdls_peer_addset)
306 return sm->ctx->tdls_peer_addset(sm->ctx->ctx, addr, add,
307 aid, capability, supp_rates,
308 supp_rates_len, ht_capab,
309 vht_capab, qosinfo, wmm,
310 ext_capab, ext_capab_len,
314 supp_oper_classes_len);
319 wpa_sm_tdls_enable_channel_switch(
struct wpa_sm *sm,
const u8 *addr,
323 if (sm->ctx->tdls_enable_channel_switch)
324 return sm->ctx->tdls_enable_channel_switch(sm->ctx->ctx, addr,
331 wpa_sm_tdls_disable_channel_switch(
struct wpa_sm *sm,
const u8 *addr)
333 if (sm->ctx->tdls_disable_channel_switch)
334 return sm->ctx->tdls_disable_channel_switch(sm->ctx->ctx, addr);
339 static inline int wpa_sm_key_mgmt_set_pmk(
struct wpa_sm *sm,
340 const u8 *pmk,
size_t pmk_len)
342 if (!sm->proactive_key_caching)
344 if (!sm->ctx->key_mgmt_set_pmk)
346 return sm->ctx->key_mgmt_set_pmk(sm->ctx->ctx, pmk, pmk_len);
350 int ver,
const u8 *dest, u16 proto,
351 u8 *msg,
size_t msg_len, u8 *key_mic);
354 int ver,
const u8 *nonce,
355 const u8 *wpa_ie,
size_t wpa_ie_len,
359 u16 ver, u16 key_info,
362 int wpa_derive_ptk_ft(
struct wpa_sm *sm,
const unsigned char *src_addr,
365 void wpa_tdls_assoc(
struct wpa_sm *sm);
366 void wpa_tdls_disassoc(
struct wpa_sm *sm);
int wpa_supplicant_send_4_of_4(struct wpa_sm *sm, const unsigned char *dst, const struct wpa_eapol_key *key, u16 ver, u16 key_info, struct wpa_ptk *ptk)
Send message 4 of WPA/RSN 4-Way Handshake.
Definition: wpa.c:1087
int wpa_supplicant_send_2_of_4(struct wpa_sm *sm, const unsigned char *dst, const struct wpa_eapol_key *key, int ver, const u8 *nonce, const u8 *wpa_ie, size_t wpa_ie_len, struct wpa_ptk *ptk)
Send message 2 of WPA/RSN 4-Way Handshake.
Definition: wpa.c:319
void wpa_eapol_key_send(struct wpa_sm *sm, const u8 *kck, size_t kck_len, int ver, const u8 *dest, u16 proto, u8 *msg, size_t msg_len, u8 *key_mic)
Send WPA/RSN EAPOL-Key message.
Definition: wpa.c:34
Definition: ieee802_11_defs.h:634
Definition: pmksa_cache_auth.c:20
wpa_states
wpa_supplicant state
Definition: defs.h:161
Definition: ieee802_11_defs.h:668
Definition: l2_packet_freebsd.c:32
Definition: wpa_common.h:166
WPA Pairwise Transient Key IEEE Std 802.11i-2004 - 8.5.1.2 Pairwise key hierarchy.
Definition: wpa_common.h:205
Doubly-linked list.
Definition: list.h:12
PMKSA cache entry.
Definition: pmksa_cache_auth.h:14
Internal data for EAPOL state machines.
Definition: eapol_supp_sm.c:28
Channel parameters.
Definition: driver.h:510
Internal WPA state machine data.
Definition: wpa_i.h:18