Lines Matching refs:sme
2 * wpa_supplicant - SME
29 #include "sme.h"
65 if (!index_within_array(groups, wpa_s->sme.sae_group_index))
69 int group = groups[wpa_s->sme.sae_group_index];
72 if (sae_set_group(&wpa_s->sme.sae, group) == 0) {
73 wpa_dbg(wpa_s, MSG_DEBUG, "SME: Selected SAE group %d",
74 wpa_s->sme.sae.group);
77 wpa_s->sme.sae_group_index++;
104 &wpa_s->sme.sae) < 0) {
109 len = wpa_s->sme.sae_token ? wpabuf_len(wpa_s->sme.sae_token) : 0;
116 sae_write_commit(&wpa_s->sme.sae, buf, wpa_s->sme.sae_token);
132 sae_write_confirm(&wpa_s->sme.sae, buf);
158 wpa_msg(wpa_s, MSG_ERROR, "SME: No scan result available for "
175 if (wpa_s->sme.ssid_len != params.ssid_len ||
176 os_memcmp(wpa_s->sme.ssid, params.ssid, params.ssid_len) != 0)
177 wpa_s->sme.prev_bssid_set = 0;
179 wpa_s->sme.freq = params.freq;
180 os_memcpy(wpa_s->sme.ssid, params.ssid, params.ssid_len);
181 wpa_s->sme.ssid_len = params.ssid_len;
242 wpa_s->sme.assoc_req_ie_len = sizeof(wpa_s->sme.assoc_req_ie);
244 wpa_s->sme.assoc_req_ie,
245 &wpa_s->sme.assoc_req_ie_len)) {
246 wpa_msg(wpa_s, MSG_WARNING, "SME: Failed to set WPA "
259 wpa_s->sme.assoc_req_ie_len = 0;
261 wpa_s->sme.assoc_req_ie_len = sizeof(wpa_s->sme.assoc_req_ie);
263 wpa_s->sme.assoc_req_ie,
264 &wpa_s->sme.assoc_req_ie_len)) {
265 wpa_msg(wpa_s, MSG_WARNING, "SME: Failed to set WPA "
276 sizeof(wpa_s->sme.assoc_req_ie)) {
277 wpa_s->sme.assoc_req_ie_len = wpabuf_len(wps_ie);
278 os_memcpy(wpa_s->sme.assoc_req_ie, wpabuf_head(wps_ie),
279 wpa_s->sme.assoc_req_ie_len);
281 wpa_s->sme.assoc_req_ie_len = 0;
287 wpa_s->sme.assoc_req_ie_len = 0;
301 if (wpa_s->sme.assoc_req_ie_len + 5 <
302 sizeof(wpa_s->sme.assoc_req_ie)) {
304 u8 *pos = wpa_s->sme.assoc_req_ie +
305 wpa_s->sme.assoc_req_ie_len;
312 wpa_s->sme.assoc_req_ie_len += 5;
315 if (wpa_s->sme.ft_used &&
316 os_memcmp(md, wpa_s->sme.mobility_domain, 2) == 0 &&
318 wpa_dbg(wpa_s, MSG_DEBUG, "SME: Trying to use FT "
321 params.ie = wpa_s->sme.ft_ies;
322 params.ie_len = wpa_s->sme.ft_ies_len;
328 wpa_s->sme.mfp = ssid->ieee80211w == MGMT_FRAME_PROTECTION_DEFAULT ?
330 if (wpa_s->sme.mfp != NO_MGMT_FRAME_PROTECTION) {
336 wpa_dbg(wpa_s, MSG_DEBUG, "SME: Selected AP supports "
338 wpa_s->sme.mfp = MGMT_FRAME_PROTECTION_REQUIRED;
348 pos = wpa_s->sme.assoc_req_ie + wpa_s->sme.assoc_req_ie_len;
349 len = sizeof(wpa_s->sme.assoc_req_ie) -
350 wpa_s->sme.assoc_req_ie_len;
354 wpa_s->sme.assoc_req_ie_len += res;
367 len = sizeof(wpa_s->sme.assoc_req_ie) -
368 wpa_s->sme.assoc_req_ie_len;
370 os_memcpy(wpa_s->sme.assoc_req_ie +
371 wpa_s->sme.assoc_req_ie_len,
373 wpa_s->sme.assoc_req_ie_len += wpabuf_len(hs20);
383 u8 *pos = wpa_s->sme.assoc_req_ie;
384 if (wpa_s->sme.assoc_req_ie_len > 0 && pos[0] == WLAN_EID_RSN)
387 wpa_s->sme.assoc_req_ie_len -
388 (pos - wpa_s->sme.assoc_req_ie));
389 wpa_s->sme.assoc_req_ie_len += ext_capab_len;
406 wpa_s->sme.sae.state = start ? SAE_COMMITTED : SAE_CONFIRMED;
413 wpa_msg(wpa_s, MSG_INFO, "SME: Trying to authenticate with " MACSTR
452 wpa_s->sme.auth_alg = params.auth_alg;
454 wpa_msg(wpa_s, MSG_INFO, "SME: Authentication request to the "
491 wpa_dbg(wpa_s, MSG_DEBUG, "SME: BSS/SSID entry for authentication not valid anymore - drop connection attempt");
508 wpa_dbg(wpa_s, MSG_DEBUG, "SME: Reject sme_authenticate() call since connect_work exist");
512 if (radio_work_pending(wpa_s, "sme-connect")) {
514 * The previous sme-connect work might no longer be valid due to
519 "SME: Remove previous pending sme-connect");
520 radio_remove_works(wpa_s, "sme-connect", 0);
528 cwork->sme = 1;
531 wpa_s->sme.sae.state = SAE_NOTHING;
532 wpa_s->sme.sae.send_confirm = 0;
533 wpa_s->sme.sae_group_index = 0;
536 if (radio_add_work(wpa_s, bss->freq, "sme-connect", 1,
547 wpa_dbg(wpa_s, MSG_DEBUG, "SME: SAE authentication transaction %u "
552 wpa_s->sme.sae.state == SAE_COMMITTED &&
554 wpa_dbg(wpa_s, MSG_DEBUG, "SME: SAE anti-clogging token "
556 wpabuf_free(wpa_s->sme.sae_token);
557 wpa_s->sme.sae_token = wpabuf_alloc_copy(data, len);
565 wpa_s->sme.sae.state == SAE_COMMITTED &&
567 wpa_dbg(wpa_s, MSG_DEBUG, "SME: SAE group not supported");
568 wpa_s->sme.sae_group_index++;
571 wpa_dbg(wpa_s, MSG_DEBUG, "SME: Try next enabled SAE group");
583 wpa_dbg(wpa_s, MSG_DEBUG, "SME SAE commit");
587 if (wpa_s->sme.sae.state != SAE_COMMITTED)
591 if (sae_parse_commit(&wpa_s->sme.sae, data, len, NULL, NULL,
595 if (sae_process_commit(&wpa_s->sme.sae) < 0) {
601 wpabuf_free(wpa_s->sme.sae_token);
602 wpa_s->sme.sae_token = NULL;
607 wpa_dbg(wpa_s, MSG_DEBUG, "SME SAE confirm");
608 if (wpa_s->sme.sae.state != SAE_CONFIRMED)
610 if (sae_check_confirm(&wpa_s->sme.sae, data, len) < 0)
612 wpa_s->sme.sae.state = SAE_ACCEPTED;
613 sae_clear_temp_data(&wpa_s->sme.sae);
627 wpa_dbg(wpa_s, MSG_DEBUG, "SME: Ignore authentication event "
633 wpa_dbg(wpa_s, MSG_DEBUG, "SME: Ignore authentication event "
639 wpa_dbg(wpa_s, MSG_DEBUG, "SME: Ignore authentication with "
645 wpa_dbg(wpa_s, MSG_DEBUG, "SME: Authentication response: peer=" MACSTR
649 wpa_hexdump(MSG_MSGDUMP, "SME: Authentication response IEs",
668 wpa_printf(MSG_DEBUG, "SME: SAE completed - setting PMK for "
670 wpa_sm_set_pmk(wpa_s->wpa, wpa_s->sme.sae.pmk, PMK_LEN);
675 wpa_dbg(wpa_s, MSG_DEBUG, "SME: Authentication failed (status "
680 wpa_s->sme.auth_alg == data->auth.auth_type ||
693 wpa_dbg(wpa_s, MSG_DEBUG, "SME: Trying SHARED auth");
701 wpa_dbg(wpa_s, MSG_DEBUG, "SME: Trying LEAP auth");
743 params.ssid = wpa_s->sme.ssid;
744 params.ssid_len = wpa_s->sme.ssid_len;
745 params.freq = wpa_s->sme.freq;
748 params.wpa_ie = wpa_s->sme.assoc_req_ie_len ?
749 wpa_s->sme.assoc_req_ie : NULL;
750 params.wpa_ie_len = wpa_s->sme.assoc_req_ie_len;
770 if (auth_type == WLAN_AUTH_FT && wpa_s->sme.ft_ies) {
771 params.wpa_ie = wpa_s->sme.ft_ies;
772 params.wpa_ie_len = wpa_s->sme.ft_ies_len;
776 params.mgmt_frame_protection = wpa_s->sme.mfp;
777 if (wpa_s->sme.prev_bssid_set)
778 params.prev_bssid = wpa_s->sme.prev_bssid;
790 wpa_dbg(wpa_s, MSG_DEBUG, "SME: Could not parse own IEs?!");
816 wpa_msg(wpa_s, MSG_INFO, "SME: Association request to the "
833 wpa_dbg(wpa_s, MSG_DEBUG, "SME: Remove mobility domain");
834 os_free(wpa_s->sme.ft_ies);
835 wpa_s->sme.ft_ies = NULL;
836 wpa_s->sme.ft_ies_len = 0;
837 wpa_s->sme.ft_used = 0;
841 os_memcpy(wpa_s->sme.mobility_domain, md, MOBILITY_DOMAIN_ID_LEN);
842 wpa_hexdump(MSG_DEBUG, "SME: FT IEs", ies, ies_len);
843 os_free(wpa_s->sme.ft_ies);
844 wpa_s->sme.ft_ies = os_malloc(ies_len);
845 if (wpa_s->sme.ft_ies == NULL)
847 os_memcpy(wpa_s->sme.ft_ies, ies, ies_len);
848 wpa_s->sme.ft_ies_len = ies_len;
861 wpa_msg(wpa_s, MSG_INFO, "SME: Deauth request to the driver "
864 wpa_s->sme.prev_bssid_set = 0;
878 wpa_dbg(wpa_s, MSG_DEBUG, "SME: Association with " MACSTR " failed: "
898 wpa_dbg(wpa_s, MSG_DEBUG, "SME: Authentication timed out");
907 wpa_dbg(wpa_s, MSG_DEBUG, "SME: Association timed out");
916 wpa_dbg(wpa_s, MSG_DEBUG, "SME: Disassociation event received");
917 if (wpa_s->sme.prev_bssid_set) {
924 wpa_dbg(wpa_s, MSG_DEBUG, "SME: Deauthenticate to clear "
926 wpa_drv_deauthenticate(wpa_s, wpa_s->sme.prev_bssid,
936 wpa_msg(wpa_s, MSG_DEBUG, "SME: Authentication timeout");
946 wpa_msg(wpa_s, MSG_DEBUG, "SME: Association timeout");
970 wpa_dbg(wpa_s, MSG_DEBUG, "SME: Allow pending authentication "
986 os_free(wpa_s->sme.ft_ies);
987 wpa_s->sme.ft_ies = NULL;
988 wpa_s->sme.ft_ies_len = 0;
993 wpabuf_free(wpa_s->sme.sae_token);
994 wpa_s->sme.sae_token = NULL;
995 sae_clear_data(&wpa_s->sme.sae);
1012 wpa_printf(MSG_DEBUG, "SME: Send 20/40 BSS Coexistence to " MACSTR
1015 wpa_hexdump(MSG_DEBUG, "SME: 20/40 BSS Intolerant Channels",
1047 "SME: Failed to send 20/40 BSS Coexistence frame");
1062 if (!wpa_s->sme.sched_obss_scan)
1065 wpa_s->sme.sched_obss_scan = 0;
1098 wpa_printf(MSG_DEBUG, "SME OBSS scan BSS " MACSTR
1170 wpa_printf(MSG_DEBUG, "SME OBSS: Ignore scan request");
1177 wpa_printf(MSG_DEBUG, "SME OBSS: Request an OBSS scan");
1180 wpa_printf(MSG_DEBUG, "SME OBSS: Failed to trigger scan");
1182 wpa_s->sme.sched_obss_scan = 1;
1185 eloop_register_timeout(wpa_s->sme.obss_scan_int, 0,
1199 wpa_s->sme.sched_obss_scan = 0;
1204 * Schedule OBSS scan if driver is using station SME in wpa_supplicant
1241 wpa_s->sme.obss_scan_int = WPA_GET_LE16(ie + 6);
1242 if (wpa_s->sme.obss_scan_int < 10) {
1243 wpa_printf(MSG_DEBUG, "SME: Invalid OBSS Scan Interval %u "
1245 wpa_s->sme.obss_scan_int);
1246 wpa_s->sme.obss_scan_int = 10;
1248 wpa_printf(MSG_DEBUG, "SME: OBSS Scan Interval %u sec",
1249 wpa_s->sme.obss_scan_int);
1250 eloop_register_timeout(wpa_s->sme.obss_scan_int, 0,
1265 os_reltime_sub(&now, &wpa_s->sme.sa_query_start, &passed);
1268 wpa_dbg(wpa_s, MSG_DEBUG, "SME: SA Query timed out");
1283 wpa_dbg(wpa_s, MSG_DEBUG, "SME: Sending SA Query Request to "
1285 wpa_hexdump(MSG_DEBUG, "SME: SA Query Transaction ID",
1293 wpa_msg(wpa_s, MSG_INFO, "SME: Failed to send SA Query "
1304 if (wpa_s->sme.sa_query_count > 0 &&
1308 nbuf = os_realloc_array(wpa_s->sme.sa_query_trans_id,
1309 wpa_s->sme.sa_query_count + 1,
1313 if (wpa_s->sme.sa_query_count == 0) {
1315 os_get_reltime(&wpa_s->sme.sa_query_start);
1317 trans_id = nbuf + wpa_s->sme.sa_query_count * WLAN_SA_QUERY_TR_ID_LEN;
1318 wpa_s->sme.sa_query_trans_id = nbuf;
1319 wpa_s->sme.sa_query_count++;
1328 wpa_dbg(wpa_s, MSG_DEBUG, "SME: Association SA Query attempt %d",
1329 wpa_s->sme.sa_query_count);
1344 os_free(wpa_s->sme.sa_query_trans_id);
1345 wpa_s->sme.sa_query_trans_id = NULL;
1346 wpa_s->sme.sa_query_count = 0;
1368 if (wpa_s->sme.sa_query_count > 0)
1372 if (wpa_s->sme.last_unprot_disconnect.sec &&
1373 !os_reltime_expired(&now, &wpa_s->sme.last_unprot_disconnect, 10))
1375 wpa_s->sme.last_unprot_disconnect = now;
1377 wpa_dbg(wpa_s, MSG_DEBUG, "SME: Unprotected disconnect dropped - "
1388 if (wpa_s->sme.sa_query_trans_id == NULL ||
1392 wpa_dbg(wpa_s, MSG_DEBUG, "SME: Received SA Query response from "
1398 for (i = 0; i < wpa_s->sme.sa_query_count; i++) {
1399 if (os_memcmp(wpa_s->sme.sa_query_trans_id +
1405 if (i >= wpa_s->sme.sa_query_count) {
1406 wpa_dbg(wpa_s, MSG_DEBUG, "SME: No matching SA Query "
1411 wpa_dbg(wpa_s, MSG_DEBUG, "SME: Reply to pending SA Query received "