• Home
  • Raw
  • Download

Lines Matching refs:wps

141 			struct wpabuf *wps;  in wpas_wps_eapol_cb()  local
144 wps = wpa_bss_get_vendor_ie_multi(bss, in wpas_wps_eapol_cb()
146 if (wps && wps_parse_msg(wps, &attr) == 0 && in wpas_wps_eapol_cb()
150 wpabuf_free(wps); in wpas_wps_eapol_cb()
1511 struct wps_context *wps) in wpas_wps_set_uuid() argument
1522 if (wps != wpa_s->global->ifaces->wps) in wpas_wps_set_uuid()
1523 os_memcpy(wps->uuid, in wpas_wps_set_uuid()
1524 wpa_s->global->ifaces->wps->uuid, in wpas_wps_set_uuid()
1528 uuid_random(wps->uuid); in wpas_wps_set_uuid()
1531 uuid_gen_mac_addr(wpa_s->own_addr, wps->uuid); in wpas_wps_set_uuid()
1535 os_memcpy(wps->uuid, wpa_s->conf->uuid, WPS_UUID_LEN); in wpas_wps_set_uuid()
1539 uuid_bin2str(wps->uuid, buf, sizeof(buf)); in wpas_wps_set_uuid()
1545 struct wps_context *wps) in wpas_wps_set_vendor_ext_m1() argument
1547 wpabuf_free(wps->dev.vendor_ext_m1); in wpas_wps_set_vendor_ext_m1()
1548 wps->dev.vendor_ext_m1 = NULL; in wpas_wps_set_vendor_ext_m1()
1551 wps->dev.vendor_ext_m1 = in wpas_wps_set_vendor_ext_m1()
1553 if (!wps->dev.vendor_ext_m1) { in wpas_wps_set_vendor_ext_m1()
1563 struct wps_context *wps; in wpas_wps_init() local
1568 wps = os_zalloc(sizeof(*wps)); in wpas_wps_init()
1569 if (wps == NULL) in wpas_wps_init()
1572 wps->cred_cb = wpa_supplicant_wps_cred; in wpas_wps_init()
1573 wps->event_cb = wpa_supplicant_wps_event; in wpas_wps_init()
1574 wps->rf_band_cb = wpa_supplicant_wps_rf_band; in wpas_wps_init()
1575 wps->cb_ctx = wpa_s; in wpas_wps_init()
1577 wps->dev.device_name = wpa_s->conf->device_name; in wpas_wps_init()
1578 wps->dev.manufacturer = wpa_s->conf->manufacturer; in wpas_wps_init()
1579 wps->dev.model_name = wpa_s->conf->model_name; in wpas_wps_init()
1580 wps->dev.model_number = wpa_s->conf->model_number; in wpas_wps_init()
1581 wps->dev.serial_number = wpa_s->conf->serial_number; in wpas_wps_init()
1582 wps->config_methods = in wpas_wps_init()
1584 if ((wps->config_methods & (WPS_CONFIG_DISPLAY | WPS_CONFIG_LABEL)) == in wpas_wps_init()
1588 os_free(wps); in wpas_wps_init()
1591 wps->config_methods = wps_fix_config_methods(wps->config_methods); in wpas_wps_init()
1592 wps->dev.config_methods = wps->config_methods; in wpas_wps_init()
1593 os_memcpy(wps->dev.pri_dev_type, wpa_s->conf->device_type, in wpas_wps_init()
1596 wps->dev.num_sec_dev_types = wpa_s->conf->num_sec_device_types; in wpas_wps_init()
1597 os_memcpy(wps->dev.sec_dev_type, wpa_s->conf->sec_device_type, in wpas_wps_init()
1598 WPS_DEV_TYPE_LEN * wps->dev.num_sec_dev_types); in wpas_wps_init()
1600 wpas_wps_set_vendor_ext_m1(wpa_s, wps); in wpas_wps_init()
1602 wps->dev.os_version = WPA_GET_BE32(wpa_s->conf->os_version); in wpas_wps_init()
1608 wps->dev.rf_bands |= WPS_RF_24GHZ; in wpas_wps_init()
1610 wps->dev.rf_bands |= WPS_RF_50GHZ; in wpas_wps_init()
1612 wps->dev.rf_bands |= WPS_RF_60GHZ; in wpas_wps_init()
1615 if (wps->dev.rf_bands == 0) { in wpas_wps_init()
1620 wps->dev.rf_bands = WPS_RF_24GHZ | WPS_RF_50GHZ; in wpas_wps_init()
1622 os_memcpy(wps->dev.mac_addr, wpa_s->own_addr, ETH_ALEN); in wpas_wps_init()
1623 wpas_wps_set_uuid(wpa_s, wps); in wpas_wps_init()
1626 wps->auth_types = WPS_AUTH_WPA2PSK; in wpas_wps_init()
1627 wps->encr_types = WPS_ENCR_AES; in wpas_wps_init()
1629 wps->auth_types = WPS_AUTH_WPA2PSK | WPS_AUTH_WPAPSK; in wpas_wps_init()
1630 wps->encr_types = WPS_ENCR_AES | WPS_ENCR_TKIP; in wpas_wps_init()
1639 wps->registrar = wps_registrar_init(wps, &rcfg); in wpas_wps_init()
1640 if (wps->registrar == NULL) { in wpas_wps_init()
1642 os_free(wps); in wpas_wps_init()
1646 wpa_s->wps = wps; in wpas_wps_init()
1653 static void wpas_wps_nfc_clear(struct wps_context *wps) in wpas_wps_nfc_clear() argument
1655 wps->ap_nfc_dev_pw_id = 0; in wpas_wps_nfc_clear()
1656 wpabuf_free(wps->ap_nfc_dh_pubkey); in wpas_wps_nfc_clear()
1657 wps->ap_nfc_dh_pubkey = NULL; in wpas_wps_nfc_clear()
1658 wpabuf_free(wps->ap_nfc_dh_privkey); in wpas_wps_nfc_clear()
1659 wps->ap_nfc_dh_privkey = NULL; in wpas_wps_nfc_clear()
1660 wpabuf_free(wps->ap_nfc_dev_pw); in wpas_wps_nfc_clear()
1661 wps->ap_nfc_dev_pw = NULL; in wpas_wps_nfc_clear()
1678 if (wpa_s->wps == NULL) in wpas_wps_deinit()
1684 wpas_wps_nfc_clear(wpa_s->wps); in wpas_wps_deinit()
1687 wps_registrar_deinit(wpa_s->wps->registrar); in wpas_wps_deinit()
1688 wpabuf_free(wpa_s->wps->dh_pubkey); in wpas_wps_deinit()
1689 wpabuf_free(wpa_s->wps->dh_privkey); in wpas_wps_deinit()
1690 wpabuf_free(wpa_s->wps->dev.vendor_ext_m1); in wpas_wps_deinit()
1691 os_free(wpa_s->wps->network_key); in wpas_wps_deinit()
1692 os_free(wpa_s->wps); in wpas_wps_deinit()
1693 wpa_s->wps = NULL; in wpas_wps_deinit()
1900 unsigned int pbc = 0, auth = 0, pin = 0, wps = 0; in wpas_wps_notify_scan_results() local
1917 wps++; in wpas_wps_notify_scan_results()
1927 else if (wps) in wpas_wps_notify_scan_results()
1968 wpa_s->wps_er = wps_er_init(wpa_s->wps, wpa_s->ifname, filter); in wpas_wps_er_start()
2004 return wps_registrar_add_pin(wpa_s->wps->registrar, addr, in wpas_wps_er_add_pin()
2222 struct wps_context *wps = wpa_s->wps; in wpas_wps_update_config() local
2224 if (wps == NULL) in wpas_wps_update_config()
2228 wps->config_methods = wps_config_methods_str2bin( in wpas_wps_update_config()
2230 if ((wps->config_methods & in wpas_wps_update_config()
2236 wps->config_methods &= ~WPS_CONFIG_LABEL; in wpas_wps_update_config()
2239 wps->config_methods = wps_fix_config_methods(wps->config_methods); in wpas_wps_update_config()
2240 wps->dev.config_methods = wps->config_methods; in wpas_wps_update_config()
2243 os_memcpy(wps->dev.pri_dev_type, wpa_s->conf->device_type, in wpas_wps_update_config()
2247 wps->dev.num_sec_dev_types = wpa_s->conf->num_sec_device_types; in wpas_wps_update_config()
2248 os_memcpy(wps->dev.sec_dev_type, wpa_s->conf->sec_device_type, in wpas_wps_update_config()
2249 wps->dev.num_sec_dev_types * WPS_DEV_TYPE_LEN); in wpas_wps_update_config()
2253 wpas_wps_set_vendor_ext_m1(wpa_s, wps); in wpas_wps_update_config()
2256 wps->dev.os_version = WPA_GET_BE32(wpa_s->conf->os_version); in wpas_wps_update_config()
2259 wpas_wps_set_uuid(wpa_s, wps); in wpas_wps_update_config()
2264 wps->dev.device_name = wpa_s->conf->device_name; in wpas_wps_update_config()
2265 wps->dev.manufacturer = wpa_s->conf->manufacturer; in wpas_wps_update_config()
2266 wps->dev.model_name = wpa_s->conf->model_name; in wpas_wps_update_config()
2267 wps->dev.model_number = wpa_s->conf->model_number; in wpas_wps_update_config()
2268 wps->dev.serial_number = wpa_s->conf->serial_number; in wpas_wps_update_config()
2275 struct wps_context *wps; in wpas_wps_update_mac_addr() local
2277 wps = wpa_s->wps; in wpas_wps_update_mac_addr()
2278 if (wps) in wpas_wps_update_mac_addr()
2279 os_memcpy(wps->dev.mac_addr, wpa_s->own_addr, ETH_ALEN); in wpas_wps_update_mac_addr()
2296 ret = wps_er_config_token_from_cred(wpa_s->wps, &cred); in wpas_wps_network_config_token()
2361 struct wps_context *wps = wpa_s->wps; in wpas_wps_start_nfc() local
2382 dh5_free(wps->dh_ctx); in wpas_wps_start_nfc()
2383 wpabuf_free(wps->dh_pubkey); in wpas_wps_start_nfc()
2384 wpabuf_free(wps->dh_privkey); in wpas_wps_start_nfc()
2385 wps->dh_privkey = wpabuf_dup(wpa_s->conf->wps_nfc_dh_privkey); in wpas_wps_start_nfc()
2386 wps->dh_pubkey = wpabuf_dup(wpa_s->conf->wps_nfc_dh_pubkey); in wpas_wps_start_nfc()
2387 if (wps->dh_privkey == NULL || wps->dh_pubkey == NULL) { in wpas_wps_start_nfc()
2388 wps->dh_ctx = NULL; in wpas_wps_start_nfc()
2389 wpabuf_free(wps->dh_pubkey); in wpas_wps_start_nfc()
2390 wps->dh_pubkey = NULL; in wpas_wps_start_nfc()
2391 wpabuf_free(wps->dh_privkey); in wpas_wps_start_nfc()
2392 wps->dh_privkey = NULL; in wpas_wps_start_nfc()
2396 wps->dh_ctx = dh5_init_fixed(wps->dh_privkey, wps->dh_pubkey); in wpas_wps_start_nfc()
2397 if (wps->dh_ctx == NULL) { in wpas_wps_start_nfc()
2398 wpabuf_free(wps->dh_pubkey); in wpas_wps_start_nfc()
2399 wps->dh_pubkey = NULL; in wpas_wps_start_nfc()
2400 wpabuf_free(wps->dh_privkey); in wpas_wps_start_nfc()
2401 wps->dh_privkey = NULL; in wpas_wps_start_nfc()
2430 if (wps_oob_use_cred(wpa_s->wps, attr) < 0) in wpas_wps_use_cred()
2474 wpa_s->wps->registrar, attr->oob_dev_password, in wpas_wps_add_nfc_password_token()
2481 const struct wpabuf *wps) in wpas_wps_nfc_tag_process() argument
2485 wpa_hexdump_buf(MSG_DEBUG, "WPS: Received NFC tag payload", wps); in wpas_wps_nfc_tag_process()
2487 if (wps_parse_msg(wps, &attr)) { in wpas_wps_nfc_tag_process()
2508 const struct wpabuf *wps = data; in wpas_wps_nfc_tag_read() local
2531 wps = tmp; in wpas_wps_nfc_tag_read()
2534 ret = wpas_wps_nfc_tag_process(wpa_s, wps); in wpas_wps_nfc_tag_read()
2550 ret = wps_build_nfc_handover_req(wpa_s->wps, in wpas_wps_nfc_handover_req()
2576 struct wps_context *wps = wpa_s->wps; in wpas_wps_er_nfc_handover_sel() local
2578 if (wps == NULL) in wpas_wps_er_nfc_handover_sel()
2596 wpas_wps_nfc_clear(wps); in wpas_wps_er_nfc_handover_sel()
2597 wps->ap_nfc_dev_pw_id = DEV_PW_NFC_CONNECTION_HANDOVER; in wpas_wps_er_nfc_handover_sel()
2598 wps->ap_nfc_dh_pubkey = wpabuf_dup(wpa_s->conf->wps_nfc_dh_pubkey); in wpas_wps_er_nfc_handover_sel()
2599 wps->ap_nfc_dh_privkey = wpabuf_dup(wpa_s->conf->wps_nfc_dh_privkey); in wpas_wps_er_nfc_handover_sel()
2600 if (!wps->ap_nfc_dh_pubkey || !wps->ap_nfc_dh_privkey) { in wpas_wps_er_nfc_handover_sel()
2601 wpas_wps_nfc_clear(wps); in wpas_wps_er_nfc_handover_sel()
2605 ret = wps_er_nfc_handover_sel(wpa_s->wps_er, wpa_s->wps, use_uuid, in wpas_wps_er_nfc_handover_sel()
2640 struct wpabuf *wps; in wpas_wps_nfc_rx_handover_sel() local
2650 wps = ndef_parse_wifi(data); in wpas_wps_nfc_rx_handover_sel()
2651 if (wps == NULL) in wpas_wps_nfc_rx_handover_sel()
2655 wpa_hexdump_buf(MSG_DEBUG, "WPS: NFC payload", wps); in wpas_wps_nfc_rx_handover_sel()
2656 if (wpabuf_len(wps) < 2) { in wpas_wps_nfc_rx_handover_sel()
2661 pos = wpabuf_head(wps); in wpas_wps_nfc_rx_handover_sel()
2663 if (wsc_len > wpabuf_len(wps) - 2) { in wpas_wps_nfc_rx_handover_sel()
2673 if (wsc_len < wpabuf_len(wps) - 2) { in wpas_wps_nfc_rx_handover_sel()
2676 pos + wsc_len, wpabuf_len(wps) - 2 - wsc_len); in wpas_wps_nfc_rx_handover_sel()
2759 wpabuf_free(wps); in wpas_wps_nfc_rx_handover_sel()
2779 struct wpabuf *wps; in wpas_er_wps_nfc_report_handover() local
2791 wps = ndef_parse_wifi(req); in wpas_er_wps_nfc_report_handover()
2792 if (wps == NULL) in wpas_er_wps_nfc_report_handover()
2796 wpa_hexdump_buf(MSG_DEBUG, "WPS: NFC payload", wps); in wpas_er_wps_nfc_report_handover()
2797 if (wpabuf_len(wps) < 2) { in wpas_er_wps_nfc_report_handover()
2802 pos = wpabuf_head(wps); in wpas_er_wps_nfc_report_handover()
2804 if (wsc_len > wpabuf_len(wps) - 2) { in wpas_er_wps_nfc_report_handover()
2814 if (wsc_len < wpabuf_len(wps) - 2) { in wpas_er_wps_nfc_report_handover()
2817 pos + wsc_len, wpabuf_len(wps) - 2 - wsc_len); in wpas_er_wps_nfc_report_handover()
2858 ret = wps_registrar_add_nfc_pw_token(wpa_s->wps->registrar, in wpas_er_wps_nfc_report_handover()
2864 wpabuf_free(wps); in wpas_er_wps_nfc_report_handover()
2920 struct wpabuf *wps; in wpas_wps_update_ap_info_bss() local
2929 wps = wpa_scan_get_vendor_ie_multi(res, WPS_IE_VENDOR_TYPE); in wpas_wps_update_ap_info_bss()
2930 if (wps == NULL) in wpas_wps_update_ap_info_bss()
2933 r = wps_is_addr_authorized(wps, wpa_s->own_addr, 1); in wpas_wps_update_ap_info_bss()
2941 uuid = wps_get_uuid_e(wps); in wpas_wps_update_ap_info_bss()
2942 pbc_active = wps_is_selected_pbc_registrar(wps); in wpas_wps_update_ap_info_bss()
2979 wpabuf_free(wps); in wpas_wps_update_ap_info_bss()