Home | History | Annotate | Download | only in rsn_supp

Lines Matching refs:sm

35  * @sm: Pointer to WPA state machine data from wpa_sm_init()
37 void pmksa_candidate_free(struct wpa_sm *sm)
41 if (sm == NULL)
44 dl_list_for_each_safe(entry, n, &sm->pmksa_candidates,
55 struct wpa_sm *sm = ctx;
60 if (sm->preauth_eapol == NULL ||
61 is_zero_ether_addr(sm->preauth_bssid) ||
62 os_memcmp(sm->preauth_bssid, src_addr, ETH_ALEN) != 0) {
69 eapol_sm_rx_eapol(sm->preauth_eapol, src_addr, buf, len);
76 struct wpa_sm *sm = ctx;
94 sm->pmk_len = pmk_len;
95 pmksa_cache_add(sm->pmksa, pmk, pmk_len,
96 sm->preauth_bssid, sm->own_addr,
97 sm->network_ctx,
100 wpa_msg(sm->ctx->msg_ctx, MSG_INFO,
107 wpa_msg(sm->ctx->msg_ctx, MSG_INFO, "RSN: pre-authentication with "
108 MACSTR " %s", MAC2STR(sm->preauth_bssid),
111 rsn_preauth_deinit(sm);
112 rsn_preauth_candidate_process(sm);
118 struct wpa_sm *sm = eloop_ctx;
120 wpa_msg(sm->ctx->msg_ctx, MSG_INFO, "RSN: pre-authentication with "
121 MACSTR " timed out", MAC2STR(sm->preauth_bssid));
122 rsn_preauth_deinit(sm);
123 rsn_preauth_candidate_process(sm);
130 struct wpa_sm *sm = ctx;
138 if (sm->l2_preauth == NULL)
141 msg = wpa_sm_alloc_eapol(sm, type, buf, len, &msglen, NULL);
146 res = l2_packet_send(sm->l2_preauth, sm->preauth_bssid,
155 * @sm: Pointer to WPA state machine data from wpa_sm_init()
167 int rsn_preauth_init(struct wpa_sm *sm, const u8 *dst,
173 if (sm->preauth_eapol)
176 wpa_msg(sm->ctx->msg_ctx, MSG_DEBUG,
179 sm->l2_preauth = l2_packet_init(sm->ifname, sm->own_addr,
181 rsn_preauth_receive, sm, 0);
182 if (sm->l2_preauth == NULL) {
188 if (sm->bridge_ifname) {
189 sm->l2_preauth_br = l2_packet_init(sm->bridge_ifname,
190 sm->own_addr,
192 rsn_preauth_receive, sm, 0);
193 if (sm->l2_preauth_br == NULL) {
206 ctx->ctx = sm->ctx->ctx;
207 ctx->msg_ctx = sm->ctx->ctx;
210 ctx->cb_ctx = sm;
211 ctx->scard_ctx = sm->scard_ctx;
213 ctx->eapol_send_ctx = sm;
214 ctx->set_config_blob = sm->ctx->set_config_blob;
215 ctx->get_config_blob = sm->ctx->get_config_blob;
217 sm->preauth_eapol = eapol_sm_init(ctx);
218 if (sm->preauth_eapol == NULL) {
227 eapol_conf.fast_reauth = sm->fast_reauth;
228 eapol_conf.workaround = sm->eap_workaround;
229 eapol_sm_notify_config(sm->preauth_eapol, eap_conf, &eapol_conf);
236 eapol_sm_configure(sm->preauth_eapol, -1, -1, 5, 6);
237 os_memcpy(sm->preauth_bssid, dst, ETH_ALEN);
239 eapol_sm_notify_portValid(sm->preauth_eapol, TRUE);
241 eapol_sm_notify_portEnabled(sm->preauth_eapol, TRUE);
243 eloop_register_timeout(sm->dot11RSNAConfigSATimeout, 0,
244 rsn_preauth_timeout, sm, NULL);
252 * @sm: Pointer to WPA state machine data from wpa_sm_init()
257 void rsn_preauth_deinit(struct wpa_sm *sm)
259 if (sm == NULL || !sm->preauth_eapol)
262 eloop_cancel_timeout(rsn_preauth_timeout, sm, NULL);
263 eapol_sm_deinit(sm->preauth_eapol);
264 sm->preauth_eapol = NULL;
265 os_memset(sm->preauth_bssid, 0, ETH_ALEN);
267 l2_packet_deinit(sm->l2_preauth);
268 sm->l2_preauth = NULL;
269 if (sm->l2_preauth_br) {
270 l2_packet_deinit(sm->l2_preauth_br);
271 sm->l2_preauth_br = NULL;
278 * @sm: Pointer to WPA state machine data from wpa_sm_init()
284 void rsn_preauth_candidate_process(struct wpa_sm *sm)
288 if (dl_list_empty(&sm->pmksa_candidates))
293 wpa_msg(sm->ctx->msg_ctx, MSG_DEBUG, "RSN: processing PMKSA candidate "
295 if (sm->preauth_eapol ||
296 sm->proto != WPA_PROTO_RSN ||
297 wpa_sm_get_state(sm) != WPA_COMPLETED ||
298 (sm->key_mgmt != WPA_KEY_MGMT_IEEE8021X &&
299 sm->key_mgmt != WPA_KEY_MGMT_IEEE8021X_SHA256)) {
300 wpa_msg(sm->ctx->msg_ctx, MSG_DEBUG, "RSN: not in suitable "
305 dl_list_for_each_safe(candidate, n, &sm->pmksa_candidates,
308 p = pmksa_cache_get(sm->pmksa, candidate->bssid, NULL, NULL);
309 if (os_memcmp(sm->bssid, candidate->bssid, ETH_ALEN) != 0 &&
311 wpa_msg(sm->ctx->msg_ctx, MSG_DEBUG, "RSN: PMKSA "
316 rsn_preauth_init(sm, candidate->bssid,
317 sm->eap_conf_ctx);
321 wpa_msg(sm->ctx->msg_ctx, MSG_DEBUG, "RSN: PMKSA candidate "
327 wpa_sm_add_pmkid(sm, candidate->bssid, p->pmkid);
333 wpa_msg(sm->ctx->msg_ctx, MSG_DEBUG, "RSN: no more pending PMKSA "
340 * @sm: Pointer to WPA state machine data from wpa_sm_init()
349 void pmksa_candidate_add(struct wpa_sm *sm, const u8 *bssid,
354 if (sm->network_ctx && sm->proactive_key_caching)
355 pmksa_cache_get_opportunistic(sm->pmksa, sm->network_ctx,
367 dl_list_for_each(pos, &sm->pmksa_candidates,
389 dl_list_for_each(pos, &sm->pmksa_candidates,
398 dl_list_add_tail(&sm->pmksa_candidates, &cand->list);
400 wpa_msg(sm->ctx->msg_ctx, MSG_DEBUG, "RSN: added PMKSA cache "
402 rsn_preauth_candidate_process(sm);
410 * @sm: Pointer to WPA state machine data from wpa_sm_init()
417 int rsn_preauth_scan_results(struct wpa_sm *sm)
419 if (sm->ssid_len == 0)
426 pmksa_candidate_free(sm);
434 * @sm: Pointer to WPA state machine data from wpa_sm_init()
439 void rsn_preauth_scan_result(struct wpa_sm *sm, const u8 *bssid,
445 if (ssid[1] != sm->ssid_len ||
446 os_memcmp(ssid + 2, sm->ssid, sm->ssid_len) != 0)
449 if (os_memcmp(bssid, sm->bssid, ETH_ALEN) == 0)
455 pmksa = pmksa_cache_get(sm->pmksa, bssid, NULL, NULL);
461 pmksa_candidate_add(sm, bssid, PMKID_CANDIDATE_PRIO_SCAN,
469 * @sm: Pointer to WPA state machine data from wpa_sm_init()
479 int rsn_preauth_get_status(struct wpa_sm *sm, char *buf, size_t buflen,
485 if (sm->preauth_eapol) {
491 res = eapol_sm_get_status(sm->preauth_eapol,
504 * @sm: Pointer to WPA state machine data from wpa_sm_init()
506 int rsn_preauth_in_progress(struct wpa_sm *sm)
508 return sm->preauth_eapol != NULL;