Home | History | Annotate | Download | only in wpa_supplicant

Lines Matching defs: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 "
933 /* Remove any existing WPS network from configuration */
995 if (wpa_config_set(ssid, "key_mgmt", "WPS", 0) < 0 ||
1020 * Note: With P2P, the SSID may change at the time the WPS
1034 wpa_hexdump_ascii(MSG_DEBUG, "WPS: Picked SSID from "
1041 wpa_printf(MSG_DEBUG, "WPS: More than one SSID found "
1134 "WPS: Reject request to start Registrar(as station) operation while AP mode is enabled");
1145 * When starting a regular WPS process (not P2P group formation)
1162 wpa_hexdump_ascii(MSG_DEBUG, "WPS: Use specific AP "
1193 "WPS: Reject request to start Registrar(as station) operation while AP mode is enabled");
1202 wpa_printf(MSG_DEBUG, "WPS: Could not add network");
1208 * When starting a regular WPS process (not P2P group formation)
1241 wpa_hexdump_ascii(MSG_DEBUG, "WPS: Use specific AP "
1254 wpa_printf(MSG_DEBUG, "WPS: Could not generate PIN");
1261 wpa_printf(MSG_DEBUG, "WPS: Failed to set phase1 '%s'", val);
1299 /* Cancel the wps pbc/pin requests */
1304 wpa_printf(MSG_DEBUG, "WPS: Cancelling in AP mode");
1311 wpa_printf(MSG_DEBUG, "WPS: Cancel operation - cancel scan");
1315 wpa_printf(MSG_DEBUG, "WPS: Cancel operation - "
1346 "WPS: Reject request to start Registrar(as station) operation while AP mode is enabled");
1392 "Received new WPA/WPA2-PSK from WPS for STA " MACSTR,
1396 "Received new WPA/WPA2-PSK from WPS for STA " MACSTR
1416 wpa_printf(MSG_DEBUG, "WPS: PIN needed for UUID-E %s", uuid);
1417 len = os_snprintf(txt, sizeof(txt), "WPS-EVENT-PIN-NEEDED %s " MACSTR
1437 wpa_printf(MSG_DEBUG, "WPS ER: SetSelectedRegistrar - sel_reg=%d "
1451 wpa_printf(MSG_INFO, "WPS: Converting display to "
1452 "virtual_display for WPS 2.0 compliance");
1458 wpa_printf(MSG_INFO, "WPS: Converting push_button to "
1459 "virtual_push_button for WPS 2.0 compliance");
1468 struct wps_context *wps)
1479 if (wps != wpa_s->global->ifaces->wps)
1480 os_memcpy(wps->uuid,
1481 wpa_s->global->ifaces->wps->uuid,
1485 uuid_random(wps->uuid);
1488 uuid_gen_mac_addr(wpa_s->own_addr, wps->uuid);
1492 os_memcpy(wps->uuid, wpa_s->conf->uuid, WPS_UUID_LEN);
1496 uuid_bin2str(wps->uuid, buf, sizeof(buf));
1497 wpa_dbg(wpa_s, MSG_DEBUG, "WPS: UUID %s: %s", src, buf);
1502 struct wps_context *wps)
1504 wpabuf_free(wps->dev.vendor_ext_m1);
1505 wps->dev.vendor_ext_m1 = NULL;
1508 wps->dev.vendor_ext_m1 =
1510 if (!wps->dev.vendor_ext_m1) {
1511 wpa_printf(MSG_ERROR, "WPS: Cannot "
1520 struct wps_context *wps;
1525 wps = os_zalloc(sizeof(*wps));
1526 if (wps == NULL)
1529 wps->cred_cb = wpa_supplicant_wps_cred;
1530 wps->event_cb = wpa_supplicant_wps_event;
1531 wps->rf_band_cb = wpa_supplicant_wps_rf_band;
1532 wps->cb_ctx = wpa_s;
1534 wps->dev.device_name = wpa_s->conf->device_name;
1535 wps->dev.manufacturer = wpa_s->conf->manufacturer;
1536 wps->dev.model_name = wpa_s->conf->model_name;
1537 wps->dev.model_number = wpa_s->conf->model_number;
1538 wps->dev.serial_number = wpa_s->conf->serial_number;
1539 wps->config_methods =
1541 if ((wps->config_methods & (WPS_CONFIG_DISPLAY | WPS_CONFIG_LABEL)) ==
1543 wpa_printf(MSG_ERROR, "WPS: Both Label and Display config "
1545 os_free(wps);
1548 wps->config_methods = wps_fix_config_methods(wps->config_methods);
1549 wps->dev.config_methods = wps->config_methods;
1550 os_memcpy(wps->dev.pri_dev_type, wpa_s->conf->device_type,
1553 wps->dev.num_sec_dev_types = wpa_s->conf->num_sec_device_types;
1554 os_memcpy(wps->dev.sec_dev_type, wpa_s->conf->sec_device_type,
1555 WPS_DEV_TYPE_LEN * wps->dev.num_sec_dev_types);
1557 wpas_wps_set_vendor_ext_m1(wpa_s, wps);
1559 wps->dev.os_version = WPA_GET_BE32(wpa_s->conf->os_version);
1565 wps->dev.rf_bands |= WPS_RF_24GHZ;
1567 wps->dev.rf_bands |= WPS_RF_50GHZ;
1569 wps->dev.rf_bands |= WPS_RF_60GHZ;
1572 if (wps->dev.rf_bands == 0) {
1577 wps->dev.rf_bands = WPS_RF_24GHZ | WPS_RF_50GHZ;
1579 os_memcpy(wps->dev.mac_addr, wpa_s->own_addr, ETH_ALEN);
1580 wpas_wps_set_uuid(wpa_s, wps);
1582 wps->auth_types = WPS_AUTH_WPA2PSK | WPS_AUTH_WPAPSK;
1583 wps->encr_types = WPS_ENCR_AES | WPS_ENCR_TKIP;
1591 wps->registrar = wps_registrar_init(wps, &rcfg);
1592 if (wps->registrar == NULL) {
1593 wpa_printf(MSG_DEBUG, "Failed to initialize WPS Registrar");
1594 os_free(wps);
1598 wpa_s->wps = wps;
1605 static void wpas_wps_nfc_clear(struct wps_context *wps)
1607 wps->ap_nfc_dev_pw_id = 0;
1608 wpabuf_free(wps->ap_nfc_dh_pubkey);
1609 wps->ap_nfc_dh_pubkey = NULL;
1610 wpabuf_free(wps->ap_nfc_dh_privkey);
1611 wps->ap_nfc_dh_privkey = NULL;
1612 wpabuf_free(wps->ap_nfc_dev_pw);
1613 wps->ap_nfc_dev_pw = NULL;
1630 if (wpa_s->wps == NULL)
1636 wpas_wps_nfc_clear(wpa_s->wps);
1639 wps_registrar_deinit(wpa_s->wps->registrar);
1640 wpabuf_free(wpa_s->wps->dh_pubkey);
1641 wpabuf_free(wpa_s->wps->dh_privkey);
1642 wpabuf_free(wpa_s->wps->dev.vendor_ext_m1);
1643 os_free(wpa_s->wps->network_key);
1644 os_free(wpa_s->wps);
1645 wpa_s->wps = NULL;
1660 wpa_printf(MSG_DEBUG, " skip - non-WPS AP");
1665 wpa_printf(MSG_DEBUG, " skip - WPS AP "
1672 wpa_printf(MSG_DEBUG, " selected based on WPS IE "
1680 wpa_printf(MSG_DEBUG, " skip - non-WPS AP");
1685 * Start with WPS APs that advertise our address as an
1687 * allow any WPS AP after couple of scans since some APs do not
1699 " skip - WPS AP without active PIN Registrar (scan_runs=%d age=%d)",
1704 WPS IE");
1706 wpa_printf(MSG_DEBUG, " selected based on WPS IE "
1714 wpa_printf(MSG_DEBUG, " selected based on WPS IE");
1733 /* allow wildcard SSID for WPS PBC */
1741 /* allow wildcard SSID for WPS PIN */
1762 wpa_printf(MSG_DEBUG, "WPS: Mandatory WPS IE "
1791 wpa_printf(MSG_DEBUG, "WPS: Check whether PBC session overlap is "
1799 wpa_hexdump(MSG_DEBUG, "WPS: UUID of the selected BSS",
1802 wpa_printf(MSG_DEBUG, "WPS: Selected BSS does not include "
1803 "WPS IE?!");
1814 wpa_printf(MSG_DEBUG, "WPS: Another BSS in active PBC mode: "
1816 wpa_hexdump(MSG_DEBUG, "WPS: UUID of the other BSS",
1821 wpa_msg(wpa_s, MSG_INFO, "WPS: PBC overlap detected: "
1840 unsigned int pbc = 0, auth = 0, pin = 0, wps = 0;
1857 wps++;
1867 else if (wps)
1908 wpa_s->wps_er = wps_er_init(wpa_s->wps, wpa_s->ifname, filter);
1944 return wps_registrar_add_pin(wpa_s->wps->registrar, addr,
2139 wpa_printf(MSG_DEBUG, "WPS ER: Terminated");
2162 struct wps_context *wps = wpa_s->wps;
2164 if (wps == NULL)
2168 wps->config_methods = wps_config_methods_str2bin(
2170 if ((wps->config_methods &
2173 wpa_printf(MSG_ERROR, "WPS: Both Label and Display "
2176 wps->config_methods &= ~WPS_CONFIG_LABEL;
2179 wps->config_methods = wps_fix_config_methods(wps->config_methods);
2180 wps->dev.config_methods = wps->config_methods;
2183 os_memcpy(wps->dev.pri_dev_type, wpa_s->conf->device_type,
2187 wps->dev.num_sec_dev_types = wpa_s->conf->num_sec_device_types;
2188 os_memcpy(wps->dev.sec_dev_type, wpa_s->conf->sec_device_type,
2189 wps->dev.num_sec_dev_types * WPS_DEV_TYPE_LEN);
2193 wpas_wps_set_vendor_ext_m1(wpa_s, wps);
2196 wps->dev.os_version = WPA_GET_BE32(wpa_s->conf->os_version);
2199 wpas_wps_set_uuid(wpa_s, wps);
2204 wps->dev.device_name = wpa_s->conf->device_name;
2205 wps->dev.manufacturer = wpa_s->conf->manufacturer;
2206 wps->dev.model_name = wpa_s->conf->model_name;
2207 wps->dev.model_number = wpa_s->conf->model_number;
2208 wps->dev.serial_number = wpa_s->conf->serial_number;
2226 ret = wps_er_config_token_from_cred(wpa_s->wps, &cred);
2291 struct wps_context *wps = wpa_s->wps;
2301 wpa_printf(MSG_DEBUG, "WPS: Missing DH params - "
2307 wpa_printf(MSG_DEBUG, "WPS: Missing Device Password (id=%u) - "
2312 dh5_free(wps->dh_ctx);
2313 wpabuf_free(wps->dh_pubkey);
2314 wpabuf_free(wps->dh_privkey);
2315 wps->dh_privkey = wpabuf_dup(wpa_s->conf->wps_nfc_dh_privkey);
2316 wps->dh_pubkey = wpabuf_dup(wpa_s->conf->wps_nfc_dh_pubkey);
2317 if (wps->dh_privkey == NULL || wps->dh_pubkey == NULL) {
2318 wps->dh_ctx = NULL;
2319 wpabuf_free(wps->dh_pubkey);
2320 wps->dh_pubkey = NULL;
2321 wpabuf_free(wps->dh_privkey);
2322 wps->dh_privkey = NULL;
2323 wpa_printf(MSG_DEBUG, "WPS: Failed to get DH priv/pub key");
2326 wps->dh_ctx = dh5_init_fixed(wps->dh_privkey, wps->dh_pubkey);
2327 if (wps->dh_ctx == NULL) {
2328 wpabuf_free(wps->dh_pubkey);
2329 wps->dh_pubkey = NULL;
2330 wpabuf_free(wps->dh_privkey);
2331 wps->dh_privkey = NULL;
2332 wpa_printf(MSG_DEBUG, "WPS: Failed to initialize DH context");
2360 if (wps_oob_use_cred(wpa_s->wps, attr) < 0)
2378 wpa_printf(MSG_DEBUG, "WPS: Credential container indicated AP channel %u -> %u MHz",
2385 wpa_printf(MSG_DEBUG, "WPS: Request reconnection with new network "
2404 wpa_s->wps->registrar, attr->oob_dev_password,
2411 const struct wpabuf *wps)
2415 wpa_hexdump_buf(MSG_DEBUG, "WPS: Received NFC tag payload", wps);
2417 if (wps_parse_msg(wps, &attr)) {
2418 wpa_printf(MSG_DEBUG, "WPS: Ignore invalid data from NFC tag");
2430 wpa_printf(MSG_DEBUG, "WPS: Ignore unrecognized NFC tag");
2438 const struct wpabuf *wps = data;
2458 wpa_printf(MSG_DEBUG, "WPS: Could not parse NDEF");
2461 wps = tmp;
2464 ret = wpas_wps_nfc_tag_process(wpa_s, wps);
2480 ret = wps_build_nfc_handover_req(wpa_s->wps,
2506 struct wps_context *wps = wpa_s->wps;
2508 if (wps == NULL)
2526 wpas_wps_nfc_clear(wps);
2527 wps->ap_nfc_dev_pw_id = DEV_PW_NFC_CONNECTION_HANDOVER;
2528 wps->ap_nfc_dh_pubkey = wpabuf_dup(wpa_s->conf->wps_nfc_dh_pubkey);
2529 wps->ap_nfc_dh_privkey = wpabuf_dup(wpa_s->conf->wps_nfc_dh_privkey);
2530 if (!wps->ap_nfc_dh_pubkey || !wps->ap_nfc_dh_privkey) {
2531 wpas_wps_nfc_clear(wps);
2535 ret = wps_er_nfc_handover_sel(wpa_s->wps_er, wpa_s->wps, use_uuid,
2570 struct wpabuf *wps;
2580 wps = ndef_parse_wifi(data);
2581 if (wps == NULL)
2583 wpa_printf(MSG_DEBUG, "WPS: Received application/vnd.wfa.wsc "
2585 wpa_hexdump_buf(MSG_DEBUG, "WPS: NFC payload", wps);
2586 if (wpabuf_len(wps) < 2) {
2587 wpa_printf(MSG_DEBUG, "WPS: Too short Wi-Fi Handover Select "
2591 pos = wpabuf_head(wps);
2593 if (wsc_len > wpabuf_len(wps) - 2) {
2594 wpa_printf(MSG_DEBUG, "WPS: Invalid WSC attribute length (%u) "
2601 "WPS: WSC attributes in Wi-Fi Handover Select Message",
2603 if (wsc_len < wpabuf_len(wps) - 2) {
2605 "WPS: Ignore extra data after WSC attributes",
2606 pos + wsc_len, wpabuf_len(wps) - 2 - wsc_len);
2612 wpa_printf(MSG_DEBUG, "WPS: Could not parse WSC attributes in "
2619 wpa_printf(MSG_DEBUG, "WPS: No Out-of-Band Device Password "
2626 wpa_printf(MSG_DEBUG, "WPS: No SSID included in Wi-Fi Handover "
2632 wpa_hexdump_ascii(MSG_DEBUG, "WPS: SSID", attr.ssid, attr.ssid_len);
2636 wpa_printf(MSG_DEBUG, "WPS: MAC Address (BSSID): " MACSTR,
2641 wpa_printf(MSG_DEBUG, "WPS: RF Bands: %d", *attr.rf_bands);
2646 wpa_printf(MSG_DEBUG, "WPS: AP Channel: %d", chan);
2666 "WPS: AP indicated channel %u -> %u MHz",
2671 wpa_hexdump(MSG_DEBUG, "WPS: Out-of-Band Device Password",
2676 wpa_printf(MSG_DEBUG, "WPS: Unexpected OOB Device Password ID "
2681 wpa_hexdump(MSG_DEBUG, "WPS: AP Public Key hash",
2689 wpabuf_free(wps);
2698 wpa_printf(MSG_DEBUG, "NFC: WPS connection handover reported");
2699 wpa_hexdump_buf_key(MSG_DEBUG, "WPS: Carrier record in request", req);
2700 wpa_hexdump_buf_key(MSG_DEBUG, "WPS: Carrier record in select", sel);
2709 struct wpabuf *wps;
2721 wps = ndef_parse_wifi(req);
2722 if (wps == NULL)
2724 wpa_printf(MSG_DEBUG, "WPS: Received application/vnd.wfa.wsc "
2726 wpa_hexdump_buf(MSG_DEBUG, "WPS: NFC payload", wps);
2727 if (wpabuf_len(wps) < 2) {
2728 wpa_printf(MSG_DEBUG, "WPS: Too short Wi-Fi Handover Request "
2732 pos = wpabuf_head(wps);
2734 if (wsc_len > wpabuf_len(wps) - 2) {
2735 wpa_printf(MSG_DEBUG, "WPS: Invalid WSC attribute length (%u) "
2742 "WPS: WSC attributes in Wi-Fi Handover Request Message",
2744 if (wsc_len < wpabuf_len(wps) - 2) {
2746 "WPS: Ignore extra data after WSC attributes",
2747 pos + wsc_len, wpabuf_len(wps) - 2 - wsc_len);
2753 wpa_printf(MSG_DEBUG, "WPS: Could not parse WSC attributes in "
2760 wpa_printf(MSG_DEBUG, "WPS: No Out-of-Band Device Password "
2767 wpa_printf(MSG_DEBUG, "WPS: No UUID-E included in Wi-Fi "
2773 wpa_hexdump(MSG_DEBUG, "WPS: UUID-E", attr.uuid_e, WPS_UUID_LEN);
2775 wpa_hexdump(MSG_DEBUG, "WPS: Out-of-Band Device Password",
2780 wpa_printf(MSG_DEBUG, "WPS: Unexpected OOB Device Password ID "
2785 wpa_hexdump(MSG_DEBUG, "WPS: Enrollee Public Key hash",
2788 ret = wps_registrar_add_nfc_pw_token(wpa_s->wps->registrar,
2794 wpabuf_free(wps);
2818 wpa_printf(MSG_DEBUG, "WPS: AP[%d] " MACSTR " type=%d "
2849 struct wpabuf *wps;
2858 wps = wpa_scan_get_vendor_ie_multi(res, WPS_IE_VENDOR_TYPE);
2859 if (wps == NULL)
2862 r = wps_is_addr_authorized(wps, wpa_s->own_addr, 1);
2870 uuid = wps_get_uuid_e(wps);
2871 pbc_active = wps_is_selected_pbc_registrar(wps);
2876 wpa_printf(MSG_DEBUG, "WPS: AP " MACSTR
2904 wpa_printf(MSG_DEBUG, "WPS: AP " MACSTR " type %d added",
2908 wpabuf_free(wps);