Home | History | Annotate | Download | only in rsn_supp

Lines Matching refs:sm

43  * @sm: Pointer to WPA state machine data from wpa_sm_init()
45 void pmksa_candidate_free(struct wpa_sm *sm)
49 if (sm == NULL)
52 entry = sm->pmksa_candidates;
53 sm->pmksa_candidates = NULL;
65 struct wpa_sm *sm = ctx;
70 if (sm->preauth_eapol == NULL ||
71 is_zero_ether_addr(sm->preauth_bssid) ||
72 os_memcmp(sm->preauth_bssid, src_addr, ETH_ALEN) != 0) {
79 eapol_sm_rx_eapol(sm->preauth_eapol, src_addr, buf, len);
86 struct wpa_sm *sm = ctx;
104 sm->pmk_len = pmk_len;
105 pmksa_cache_add(sm->pmksa, pmk, pmk_len,
106 sm->preauth_bssid, sm->own_addr,
107 sm->network_ctx,
110 wpa_msg(sm->ctx->ctx, MSG_INFO, "RSN: failed to get "
117 wpa_msg(sm->ctx->ctx, MSG_INFO, "RSN: pre-authentication with " MACSTR
118 " %s", MAC2STR(sm->preauth_bssid),
121 rsn_preauth_deinit(sm);
122 rsn_preauth_candidate_process(sm);
128 struct wpa_sm *sm = eloop_ctx;
130 wpa_msg(sm->ctx->ctx, MSG_INFO, "RSN: pre-authentication with " MACSTR
131 " timed out", MAC2STR(sm->preauth_bssid));
132 rsn_preauth_deinit(sm);
133 rsn_preauth_candidate_process(sm);
140 struct wpa_sm *sm = ctx;
148 if (sm->l2_preauth == NULL)
151 msg = wpa_sm_alloc_eapol(sm, type, buf, len, &msglen, NULL);
156 res = l2_packet_send(sm->l2_preauth, sm->preauth_bssid,
165 * @sm: Pointer to WPA state machine data from wpa_sm_init()
177 int rsn_preauth_init(struct wpa_sm *sm, const u8 *dst,
183 if (sm->preauth_eapol)
186 wpa_msg(sm->ctx->ctx, MSG_DEBUG, "RSN: starting pre-authentication "
189 sm->l2_preauth = l2_packet_init(sm->ifname, sm->own_addr,
191 rsn_preauth_receive, sm, 0);
192 if (sm->l2_preauth == NULL) {
198 if (sm->bridge_ifname) {
199 sm->l2_preauth_br = l2_packet_init(sm->bridge_ifname,
200 sm->own_addr,
202 rsn_preauth_receive, sm, 0);
203 if (sm->l2_preauth_br == NULL) {
216 ctx->ctx = sm->ctx->ctx;
217 ctx->msg_ctx = sm->ctx->ctx;
220 ctx->cb_ctx = sm;
221 ctx->scard_ctx = sm->scard_ctx;
223 ctx->eapol_send_ctx = sm;
224 ctx->set_config_blob = sm->ctx->set_config_blob;
225 ctx->get_config_blob = sm->ctx->get_config_blob;
227 sm->preauth_eapol = eapol_sm_init(ctx);
228 if (sm->preauth_eapol == NULL) {
237 eapol_conf.fast_reauth = sm->fast_reauth;
238 eapol_conf.workaround = sm->eap_workaround;
239 eapol_sm_notify_config(sm->preauth_eapol, eap_conf, &eapol_conf);
246 eapol_sm_configure(sm->preauth_eapol, -1, -1, 5, 6);
247 os_memcpy(sm->preauth_bssid, dst, ETH_ALEN);
249 eapol_sm_notify_portValid(sm->preauth_eapol, TRUE);
251 eapol_sm_notify_portEnabled(sm->preauth_eapol, TRUE);
253 eloop_register_timeout(sm->dot11RSNAConfigSATimeout, 0,
254 rsn_preauth_timeout, sm, NULL);
262 * @sm: Pointer to WPA state machine data from wpa_sm_init()
267 void rsn_preauth_deinit(struct wpa_sm *sm)
269 if (sm == NULL || !sm->preauth_eapol)
272 eloop_cancel_timeout(rsn_preauth_timeout, sm, NULL);
273 eapol_sm_deinit(sm->preauth_eapol);
274 sm->preauth_eapol = NULL;
275 os_memset(sm->preauth_bssid, 0, ETH_ALEN);
277 l2_packet_deinit(sm->l2_preauth);
278 sm->l2_preauth = NULL;
279 if (sm->l2_preauth_br) {
280 l2_packet_deinit(sm->l2_preauth_br);
281 sm->l2_preauth_br = NULL;
288 * @sm: Pointer to WPA state machine data from wpa_sm_init()
294 void rsn_preauth_candidate_process(struct wpa_sm *sm)
298 if (sm->pmksa_candidates == NULL)
303 wpa_msg(sm->ctx->ctx, MSG_DEBUG, "RSN: processing PMKSA candidate "
305 if (sm->preauth_eapol ||
306 sm->proto != WPA_PROTO_RSN ||
307 wpa_sm_get_state(sm) != WPA_COMPLETED ||
308 (sm->key_mgmt != WPA_KEY_MGMT_IEEE8021X &&
309 sm->key_mgmt != WPA_KEY_MGMT_IEEE8021X_SHA256)) {
310 wpa_msg(sm->ctx->ctx, MSG_DEBUG, "RSN: not in suitable state "
315 while (sm->pmksa_candidates) {
317 candidate = sm->pmksa_candidates;
318 p = pmksa_cache_get(sm->pmksa, candidate->bssid, NULL);
319 if (os_memcmp(sm->bssid, candidate->bssid, ETH_ALEN) != 0 &&
321 wpa_msg(sm->ctx->ctx, MSG_DEBUG, "RSN: PMKSA "
325 sm->pmksa_candidates = candidate->next;
326 rsn_preauth_init(sm, candidate->bssid,
327 sm->eap_conf_ctx);
331 wpa_msg(sm->ctx->ctx, MSG_DEBUG, "RSN: PMKSA candidate "
337 wpa_sm_add_pmkid(sm, candidate->bssid, p->pmkid);
340 sm->pmksa_candidates = candidate->next;
343 wpa_msg(sm->ctx->ctx, MSG_DEBUG, "RSN: no more pending PMKSA "
350 * @sm: Pointer to WPA state machine data from wpa_sm_init()
359 void pmksa_candidate_add(struct wpa_sm *sm, const u8 *bssid,
364 if (sm->network_ctx && sm->proactive_key_caching)
365 pmksa_cache_get_opportunistic(sm->pmksa, sm->network_ctx,
377 cand = sm->pmksa_candidates;
383 sm->pmksa_candidates = cand->next;
404 pos = sm->pmksa_candidates;
415 sm->pmksa_candidates = cand;
417 wpa_msg(sm->ctx->ctx, MSG_DEBUG, "RSN: added PMKSA cache "
419 rsn_preauth_candidate_process(sm);
427 * @sm: Pointer to WPA state machine data from wpa_sm_init()
433 void rsn_preauth_scan_results(struct wpa_sm *sm,
441 if (sm->ssid_len == 0)
448 pmksa_candidate_free(sm);
456 if (ssid == NULL || ssid[1] != sm->ssid_len ||
457 os_memcmp(ssid + 2, sm->ssid, ssid[1]) != 0)
460 if (os_memcmp(r->bssid, sm->bssid, ETH_ALEN) == 0)
467 pmksa = pmksa_cache_get(sm->pmksa, r->bssid, NULL);
477 pmksa_candidate_add(sm, r->bssid,
487 * @sm: Pointer to WPA state machine data from wpa_sm_init()
497 int rsn_preauth_get_status(struct wpa_sm *sm, char *buf, size_t buflen,
503 if (sm->preauth_eapol) {
509 res = eapol_sm_get_status(sm->preauth_eapol,
522 * @sm: Pointer to WPA state machine data from wpa_sm_init()
524 int rsn_preauth_in_progress(struct wpa_sm *sm)
526 return sm->preauth_eapol != NULL;