Home | History | Annotate | Download | only in wpa_supplicant

Lines Matching refs:wps

2  * wpa_supplicant / WPS integration
24 #include "wps/wps_attr_parse.h"
43 * The minimum time in seconds before trying to associate to a WPS PIN AP that
68 wpa_printf(MSG_DEBUG, "WPS: Continuing association after eapol_cb");
94 wpa_printf(MSG_DEBUG, "WPS: PIN registration with " MACSTR
121 wpa_printf(MSG_DEBUG, "WPS: Network configuration replaced - "
128 wpa_printf(MSG_DEBUG, "WPS: Current network is "
137 wpa_printf(MSG_DEBUG, "WPS: Checking whether fast association "
141 struct wpabuf *wps;
144 wps = wpa_bss_get_vendor_ie_multi(bss,
146 if (wps && wps_parse_msg(wps, &attr) == 0 &&
150 wpabuf_free(wps);
159 wpa_printf(MSG_DEBUG, "WPS: Continue association from timeout");
169 wpa_printf(MSG_DEBUG, "WPS: Registration completed - waiting "
193 * Many existing WPS APs do not know how to negotiate WPA2 or CCMP in
207 wpa_printf(MSG_DEBUG, "WPS: The AP was not found from BSS "
212 wpa_printf(MSG_DEBUG, "WPS: AP found from BSS table");
234 wpa_printf(MSG_DEBUG, "WPS: The AP did not yet advertise WPA "
242 wpa_printf(MSG_DEBUG, "WPS: Add CCMP into the credential "
253 wpa_printf(MSG_DEBUG, "WPS: Add WPA2 into the credential "
305 * Some existing WPS APs will send two creds in case they are
316 "WPS: M8 Creds with different passphrase - do not merge");
324 "WPS: M8 Creds with different PSK - do not merge");
331 "WPS: M8 Creds with different passphrase/PSK type - do not merge");
336 "WPS: Workaround - merge likely WPA/WPA2-mixed mode creds in same M8 message");
385 wpa_hexdump_key(MSG_DEBUG, "WPS: Received Credential attribute",
391 wpa_hexdump_ascii(MSG_DEBUG, "WPS: SSID", cred->ssid, cred->ssid_len);
392 wpa_printf(MSG_DEBUG, "WPS: Authentication Type 0x%x",
394 wpa_printf(MSG_DEBUG, "WPS: Encryption Type 0x%x", cred->encr_type);
395 wpa_printf(MSG_DEBUG, "WPS: Network Key Index %d", cred->key_idx);
396 wpa_hexdump_key(MSG_DEBUG, "WPS: Network Key",
398 wpa_printf(MSG_DEBUG, "WPS: MAC Address " MACSTR,
403 wpa_printf(MSG_DEBUG, "WPS: Workaround - convert mixed-mode "
411 wpa_printf(MSG_DEBUG, "WPS: Ignored credentials for "
419 wpa_printf(MSG_ERROR, "WPS: Reject PSK credential with "
427 wpa_printf(MSG_DEBUG, "WPS: Replace WPS network block based "
451 wpa_printf(MSG_DEBUG, "WPS: Create a new network based on the "
462 * used for the WPS network block.
528 wpa_printf(MSG_ERROR, "WPS: Invalid Network "
544 wpa_printf(MSG_ERROR, "WPS: Invalid Network Key "
559 wpa_printf(MSG_DEBUG, "WPS: Failed to update configuration");
568 * Optimize the post-WPS scan based on the channel used during
606 wpa_printf(MSG_DEBUG, "WPS: Clear WPS network from timeout");
637 * Need to allow WPS processing to complete, e.g., by sending WSC_NACK.
639 wpa_printf(MSG_DEBUG, "WPS: Register timeout to clear WPS network");
670 wpa_printf(MSG_DEBUG, "WPS: Failed to update "
926 /* Remove any existing WPS network from configuration */
976 if (wpa_config_set(ssid, "key_mgmt", "WPS", 0) < 0 ||
1001 * Note: With P2P, the SSID may change at the time the WPS
1016 wpa_hexdump_ascii(MSG_DEBUG, "WPS: Picked SSID from "
1023 wpa_printf(MSG_DEBUG, "WPS: More than one SSID found "
1116 "WPS: Reject request to start Registrar(as station) operation while AP mode is enabled");
1133 wpa_hexdump_ascii(MSG_DEBUG, "WPS: Use specific AP "
1163 "WPS: Reject request to start Registrar(as station) operation while AP mode is enabled");
1172 wpa_printf(MSG_DEBUG, "WPS: Could not add network");
1200 wpa_hexdump_ascii(MSG_DEBUG, "WPS: Use specific AP "
1217 wpa_printf(MSG_DEBUG, "WPS: Failed to set phase1 '%s'", val);
1239 /* Cancel the wps pbc/pin requests */
1244 wpa_printf(MSG_DEBUG, "WPS: Cancelling in AP mode");
1251 wpa_printf(MSG_DEBUG, "WPS: Cancel operation - cancel scan");
1255 wpa_printf(MSG_DEBUG, "WPS: Cancel operation - "
1286 "WPS: Reject request to start Registrar(as station) operation while AP mode is enabled");
1332 "Received new WPA/WPA2-PSK from WPS for STA " MACSTR,
1336 "Received new WPA/WPA2-PSK from WPS for STA " MACSTR
1356 wpa_printf(MSG_DEBUG, "WPS: PIN needed for UUID-E %s", uuid);
1357 len = os_snprintf(txt, sizeof(txt), "WPS-EVENT-PIN-NEEDED %s " MACSTR
1377 wpa_printf(MSG_DEBUG, "WPS ER: SetSelectedRegistrar - sel_reg=%d "
1391 wpa_printf(MSG_INFO, "WPS: Converting display to "
1392 "virtual_display for WPS 2.0 compliance");
1398 wpa_printf(MSG_INFO, "WPS: Converting push_button to "
1399 "virtual_push_button for WPS 2.0 compliance");
1408 struct wps_context *wps)
1419 if (wps != wpa_s->global->ifaces->wps)
1420 os_memcpy(wps->uuid,
1421 wpa_s->global->ifaces->wps->uuid,
1425 uuid_gen_mac_addr(wpa_s->own_addr, wps->uuid);
1429 os_memcpy(wps->uuid, wpa_s->conf->uuid, WPS_UUID_LEN);
1433 uuid_bin2str(wps->uuid, buf, sizeof(buf));
1434 wpa_dbg(wpa_s, MSG_DEBUG, "WPS: UUID %s: %s", src, buf);
1439 struct wps_context *wps)
1441 wpabuf_free(wps->dev.vendor_ext_m1);
1442 wps->dev.vendor_ext_m1 = NULL;
1445 wps->dev.vendor_ext_m1 =
1447 if (!wps->dev.vendor_ext_m1) {
1448 wpa_printf(MSG_ERROR, "WPS: Cannot "
1457 struct wps_context *wps;
1462 wps = os_zalloc(sizeof(*wps));
1463 if (wps == NULL)
1466 wps->cred_cb = wpa_supplicant_wps_cred;
1467 wps->event_cb = wpa_supplicant_wps_event;
1468 wps->rf_band_cb = wpa_supplicant_wps_rf_band;
1469 wps->cb_ctx = wpa_s;
1471 wps->dev.device_name = wpa_s->conf->device_name;
1472 wps->dev.manufacturer = wpa_s->conf->manufacturer;
1473 wps->dev.model_name = wpa_s->conf->model_name;
1474 wps->dev.model_number = wpa_s->conf->model_number;
1475 wps->dev.serial_number = wpa_s->conf->serial_number;
1476 wps->config_methods =
1478 if ((wps->config_methods & (WPS_CONFIG_DISPLAY | WPS_CONFIG_LABEL)) ==
1480 wpa_printf(MSG_ERROR, "WPS: Both Label and Display config "
1482 os_free(wps);
1485 wps->config_methods = wps_fix_config_methods(wps->config_methods);
1486 wps->dev.config_methods = wps->config_methods;
1487 os_memcpy(wps->dev.pri_dev_type, wpa_s->conf->device_type,
1490 wps->dev.num_sec_dev_types = wpa_s->conf->num_sec_device_types;
1491 os_memcpy(wps->dev.sec_dev_type, wpa_s->conf->sec_device_type,
1492 WPS_DEV_TYPE_LEN * wps->dev.num_sec_dev_types);
1494 wpas_wps_set_vendor_ext_m1(wpa_s, wps);
1496 wps->dev.os_version = WPA_GET_BE32(wpa_s->conf->os_version);
1502 wps->dev.rf_bands |= WPS_RF_24GHZ;
1504 wps->dev.rf_bands |= WPS_RF_50GHZ;
1506 wps->dev.rf_bands |= WPS_RF_60GHZ;
1509 if (wps->dev.rf_bands == 0) {
1514 wps->dev.rf_bands = WPS_RF_24GHZ | WPS_RF_50GHZ;
1516 os_memcpy(wps->dev.mac_addr, wpa_s->own_addr, ETH_ALEN);
1517 wpas_wps_set_uuid(wpa_s, wps);
1519 wps->auth_types = WPS_AUTH_WPA2PSK | WPS_AUTH_WPAPSK;
1520 wps->encr_types = WPS_ENCR_AES | WPS_ENCR_TKIP;
1528 wps->registrar = wps_registrar_init(wps, &rcfg);
1529 if (wps->registrar == NULL) {
1530 wpa_printf(MSG_DEBUG, "Failed to initialize WPS Registrar");
1531 os_free(wps);
1535 wpa_s->wps = wps;
1542 static void wpas_wps_nfc_clear(struct wps_context *wps)
1544 wps->ap_nfc_dev_pw_id = 0;
1545 wpabuf_free(wps->ap_nfc_dh_pubkey);
1546 wps->ap_nfc_dh_pubkey = NULL;
1547 wpabuf_free(wps->ap_nfc_dh_privkey);
1548 wps->ap_nfc_dh_privkey = NULL;
1549 wpabuf_free(wps->ap_nfc_dev_pw);
1550 wps->ap_nfc_dev_pw = NULL;
1567 if (wpa_s->wps == NULL)
1573 wpas_wps_nfc_clear(wpa_s->wps);
1576 wps_registrar_deinit(wpa_s->wps->registrar);
1577 wpabuf_free(wpa_s->wps->dh_pubkey);
1578 wpabuf_free(wpa_s->wps->dh_privkey);
1579 wpabuf_free(wpa_s->wps->dev.vendor_ext_m1);
1580 os_free(wpa_s->wps->network_key);
1581 os_free(wpa_s->wps);
1582 wpa_s->wps = NULL;
1597 wpa_printf(MSG_DEBUG, " skip - non-WPS AP");
1602 wpa_printf(MSG_DEBUG, " skip - WPS AP "
1609 wpa_printf(MSG_DEBUG, " selected based on WPS IE "
1617 wpa_printf(MSG_DEBUG, " skip - non-WPS AP");
1622 * Start with WPS APs that advertise our address as an
1624 * allow any WPS AP after couple of scans since some APs do not
1636 " skip - WPS AP without active PIN Registrar (scan_runs=%d age=%d)",
1641 wpa_printf(MSG_DEBUG, " selected based on WPS IE");
1643 wpa_printf(MSG_DEBUG, " selected based on WPS IE "
1651 wpa_printf(MSG_DEBUG, " selected based on WPS IE");
1670 /* allow wildcard SSID for WPS PBC */
1678 /* allow wildcard SSID for WPS PIN */
1699 wpa_printf(MSG_DEBUG, "WPS: Mandatory WPS IE "
1728 wpa_printf(MSG_DEBUG, "WPS: Check whether PBC session overlap is "
1736 wpa_hexdump(MSG_DEBUG, "WPS: UUID of the selected BSS",
1739 wpa_printf(MSG_DEBUG, "WPS: Selected BSS does not include "
1740 "WPS IE?!");
1751 wpa_printf(MSG_DEBUG, "WPS: Another BSS in active PBC mode: "
1753 wpa_hexdump(MSG_DEBUG, "WPS: UUID of the other BSS",
1758 wpa_msg(wpa_s, MSG_INFO, "WPS: PBC overlap detected: "
1777 unsigned int pbc = 0, auth = 0, pin = 0, wps = 0;
1794 wps++;
1804 else if (wps)
1845 wpa_s->wps_er = wps_er_init(wpa_s->wps, wpa_s->ifname, filter);
1881 return wps_registrar_add_pin(wpa_s->wps->registrar, addr,
2076 wpa_printf(MSG_DEBUG, "WPS ER: Terminated");
2099 struct wps_context *wps = wpa_s->wps;
2101 if (wps == NULL)
2105 wps->config_methods = wps_config_methods_str2bin(
2107 if ((wps->config_methods &
2110 wpa_printf(MSG_ERROR, "WPS: Both Label and Display "
2113 wps->config_methods &= ~WPS_CONFIG_LABEL;
2116 wps->config_methods = wps_fix_config_methods(wps->config_methods);
2117 wps->dev.config_methods = wps->config_methods;
2120 os_memcpy(wps->dev.pri_dev_type, wpa_s->conf->device_type,
2124 wps->dev.num_sec_dev_types = wpa_s->conf->num_sec_device_types;
2125 os_memcpy(wps->dev.sec_dev_type, wpa_s->conf->sec_device_type,
2126 wps->dev.num_sec_dev_types * WPS_DEV_TYPE_LEN);
2130 wpas_wps_set_vendor_ext_m1(wpa_s, wps);
2133 wps->dev.os_version = WPA_GET_BE32(wpa_s->conf->os_version);
2136 wpas_wps_set_uuid(wpa_s, wps);
2141 wps->dev.device_name = wpa_s->conf->device_name;
2142 wps->dev.manufacturer = wpa_s->conf->manufacturer;
2143 wps->dev.model_name = wpa_s->conf->model_name;
2144 wps->dev.model_number = wpa_s->conf->model_number;
2145 wps->dev.serial_number = wpa_s->conf->serial_number;
2163 ret = wps_er_config_token_from_cred(wpa_s->wps, &cred);
2228 struct wps_context *wps = wpa_s->wps;
2238 wpa_printf(MSG_DEBUG, "WPS: Missing DH params - "
2244 wpa_printf(MSG_DEBUG, "WPS: Missing Device Password (id=%u) - "
2249 dh5_free(wps->dh_ctx);
2250 wpabuf_free(wps->dh_pubkey);
2251 wpabuf_free(wps->dh_privkey);
2252 wps->dh_privkey = wpabuf_dup(wpa_s->conf->wps_nfc_dh_privkey);
2253 wps->dh_pubkey = wpabuf_dup(wpa_s->conf->wps_nfc_dh_pubkey);
2254 if (wps->dh_privkey == NULL || wps->dh_pubkey == NULL) {
2255 wps->dh_ctx = NULL;
2256 wpabuf_free(wps->dh_pubkey);
2257 wps->dh_pubkey = NULL;
2258 wpabuf_free(wps->dh_privkey);
2259 wps->dh_privkey = NULL;
2260 wpa_printf(MSG_DEBUG, "WPS: Failed to get DH priv/pub key");
2263 wps->dh_ctx = dh5_init_fixed(wps->dh_privkey, wps->dh_pubkey);
2264 if (wps->dh_ctx == NULL) {
2265 wpabuf_free(wps->dh_pubkey);
2266 wps->dh_pubkey = NULL;
2267 wpabuf_free(wps->dh_privkey);
2268 wps->dh_privkey = NULL;
2269 wpa_printf(MSG_DEBUG, "WPS: Failed to initialize DH context");
2297 if (wps_oob_use_cred(wpa_s->wps, attr) < 0)
2315 wpa_printf(MSG_DEBUG, "WPS: Credential container indicated AP channel %u -> %u MHz",
2322 wpa_printf(MSG_DEBUG, "WPS: Request reconnection with new network "
2341 wpa_s->wps->registrar, attr->oob_dev_password,
2348 const struct wpabuf *wps)
2352 wpa_hexdump_buf(MSG_DEBUG, "WPS: Received NFC tag payload", wps);
2354 if (wps_parse_msg(wps, &attr)) {
2355 wpa_printf(MSG_DEBUG, "WPS: Ignore invalid data from NFC tag");
2367 wpa_printf(MSG_DEBUG, "WPS: Ignore unrecognized NFC tag");
2375 const struct wpabuf *wps = data;
2395 wpa_printf(MSG_DEBUG, "WPS: Could not parse NDEF");
2398 wps = tmp;
2401 ret = wpas_wps_nfc_tag_process(wpa_s, wps);
2417 ret = wps_build_nfc_handover_req(wpa_s->wps,
2443 struct wps_context *wps = wpa_s->wps;
2445 if (wps == NULL)
2463 wpas_wps_nfc_clear(wps);
2464 wps->ap_nfc_dev_pw_id = DEV_PW_NFC_CONNECTION_HANDOVER;
2465 wps->ap_nfc_dh_pubkey = wpabuf_dup(wpa_s->conf->wps_nfc_dh_pubkey);
2466 wps->ap_nfc_dh_privkey = wpabuf_dup(wpa_s->conf->wps_nfc_dh_privkey);
2467 if (!wps->ap_nfc_dh_pubkey || !wps->ap_nfc_dh_privkey) {
2468 wpas_wps_nfc_clear(wps);
2472 ret = wps_er_nfc_handover_sel(wpa_s->wps_er, wpa_s->wps, use_uuid,
2507 struct wpabuf *wps;
2517 wps = ndef_parse_wifi(data);
2518 if (wps == NULL)
2520 wpa_printf(MSG_DEBUG, "WPS: Received application/vnd.wfa.wsc "
2522 wpa_hexdump_buf(MSG_DEBUG, "WPS: NFC payload", wps);
2523 if (wpabuf_len(wps) < 2) {
2524 wpa_printf(MSG_DEBUG, "WPS: Too short Wi-Fi Handover Select "
2528 pos = wpabuf_head(wps);
2530 if (wsc_len > wpabuf_len(wps) - 2) {
2531 wpa_printf(MSG_DEBUG, "WPS: Invalid WSC attribute length (%u) "
2538 "WPS: WSC attributes in Wi-Fi Handover Select Message",
2540 if (wsc_len < wpabuf_len(wps) - 2) {
2542 "WPS: Ignore extra data after WSC attributes",
2543 pos + wsc_len, wpabuf_len(wps) - 2 - wsc_len);
2549 wpa_printf(MSG_DEBUG, "WPS: Could not parse WSC attributes in "
2556 wpa_printf(MSG_DEBUG, "WPS: No Out-of-Band Device Password "
2563 wpa_printf(MSG_DEBUG, "WPS: No SSID included in Wi-Fi Handover "
2569 wpa_hexdump_ascii(MSG_DEBUG, "WPS: SSID", attr.ssid, attr.ssid_len);
2573 wpa_printf(MSG_DEBUG, "WPS: MAC Address (BSSID): " MACSTR,
2578 wpa_printf(MSG_DEBUG, "WPS: RF Bands: %d", *attr.rf_bands);
2583 wpa_printf(MSG_DEBUG, "WPS: AP Channel: %d", chan);
2603 "WPS: AP indicated channel %u -> %u MHz",
2608 wpa_hexdump(MSG_DEBUG, "WPS: Out-of-Band Device Password",
2613 wpa_printf(MSG_DEBUG, "WPS: Unexpected OOB Device Password ID "
2618 wpa_hexdump(MSG_DEBUG, "WPS: AP Public Key hash",
2626 wpabuf_free(wps);
2635 wpa_printf(MSG_DEBUG, "NFC: WPS connection handover reported");
2636 wpa_hexdump_buf_key(MSG_DEBUG, "WPS: Carrier record in request", req);
2637 wpa_hexdump_buf_key(MSG_DEBUG, "WPS: Carrier record in select", sel);
2646 struct wpabuf *wps;
2658 wps = ndef_parse_wifi(req);
2659 if (wps == NULL)
2661 wpa_printf(MSG_DEBUG, "WPS: Received application/vnd.wfa.wsc "
2663 wpa_hexdump_buf(MSG_DEBUG, "WPS: NFC payload", wps);
2664 if (wpabuf_len(wps) < 2) {
2665 wpa_printf(MSG_DEBUG, "WPS: Too short Wi-Fi Handover Request "
2669 pos = wpabuf_head(wps);
2671 if (wsc_len > wpabuf_len(wps) - 2) {
2672 wpa_printf(MSG_DEBUG, "WPS: Invalid WSC attribute length (%u) "
2679 "WPS: WSC attributes in Wi-Fi Handover Request Message",
2681 if (wsc_len < wpabuf_len(wps) - 2) {
2683 "WPS: Ignore extra data after WSC attributes",
2684 pos + wsc_len, wpabuf_len(wps) - 2 - wsc_len);
2690 wpa_printf(MSG_DEBUG, "WPS: Could not parse WSC attributes in "
2697 wpa_printf(MSG_DEBUG, "WPS: No Out-of-Band Device Password "
2704 wpa_printf(MSG_DEBUG, "WPS: No UUID-E included in Wi-Fi "
2710 wpa_hexdump(MSG_DEBUG, "WPS: UUID-E", attr.uuid_e, WPS_UUID_LEN);
2712 wpa_hexdump(MSG_DEBUG, "WPS: Out-of-Band Device Password",
2717 wpa_printf(MSG_DEBUG, "WPS: Unexpected OOB Device Password ID "
2722 wpa_hexdump(MSG_DEBUG, "WPS: Enrollee Public Key hash",
2725 ret = wps_registrar_add_nfc_pw_token(wpa_s->wps->registrar,
2731 wpabuf_free(wps);
2755 wpa_printf(MSG_DEBUG, "WPS: AP[%d] " MACSTR " type=%d "
2786 struct wpabuf *wps;
2795 wps = wpa_scan_get_vendor_ie_multi(res, WPS_IE_VENDOR_TYPE);
2796 if (wps == NULL)
2799 r = wps_is_addr_authorized(wps, wpa_s->own_addr, 1);
2807 uuid = wps_get_uuid_e(wps);
2808 pbc_active = wps_is_selected_pbc_registrar(wps);
2813 wpa_printf(MSG_DEBUG, "WPS: AP " MACSTR
2841 wpa_printf(MSG_DEBUG, "WPS: AP " MACSTR " type %d added",
2845 wpabuf_free(wps);