Lines Matching refs:cred
184 const struct wps_credential *cred) in wpas_wps_security_workaround() argument
205 bss = wpa_bss_get(wpa_s, cred->mac_addr, ssid->ssid, ssid->ssid_len); in wpas_wps_security_workaround()
360 const struct wps_credential *cred) in wpa_supplicant_wps_cred() argument
370 wpa_s->conf->wps_cred_processing == 2) && cred->cred_attr) { in wpa_supplicant_wps_cred()
371 size_t blen = cred->cred_attr_len * 2 + 1; in wpa_supplicant_wps_cred()
375 cred->cred_attr, cred->cred_attr_len); in wpa_supplicant_wps_cred()
381 wpas_notify_wps_credential(wpa_s, cred); in wpa_supplicant_wps_cred()
386 cred->cred_attr, cred->cred_attr_len); in wpa_supplicant_wps_cred()
391 wpa_hexdump_ascii(MSG_DEBUG, "WPS: SSID", cred->ssid, cred->ssid_len); in wpa_supplicant_wps_cred()
393 cred->auth_type); in wpa_supplicant_wps_cred()
394 wpa_printf(MSG_DEBUG, "WPS: Encryption Type 0x%x", cred->encr_type); in wpa_supplicant_wps_cred()
395 wpa_printf(MSG_DEBUG, "WPS: Network Key Index %d", cred->key_idx); in wpa_supplicant_wps_cred()
397 cred->key, cred->key_len); in wpa_supplicant_wps_cred()
399 MAC2STR(cred->mac_addr)); in wpa_supplicant_wps_cred()
401 auth_type = cred->auth_type; in wpa_supplicant_wps_cred()
418 if (cred->key_len < 8 || cred->key_len > 2 * PMK_LEN) { in wpa_supplicant_wps_cred()
421 (unsigned long) cred->key_len); in wpa_supplicant_wps_cred()
474 ssid->ssid = os_malloc(cred->ssid_len); in wpa_supplicant_wps_cred()
476 os_memcpy(ssid->ssid, cred->ssid, cred->ssid_len); in wpa_supplicant_wps_cred()
477 ssid->ssid_len = cred->ssid_len; in wpa_supplicant_wps_cred()
480 switch (cred->encr_type) { in wpa_supplicant_wps_cred()
525 if (cred->key_len == 2 * PMK_LEN) { in wpa_supplicant_wps_cred()
526 if (hexstr2bin((const char *) cred->key, ssid->psk, in wpa_supplicant_wps_cred()
534 } else if (cred->key_len >= 8 && cred->key_len < 2 * PMK_LEN) { in wpa_supplicant_wps_cred()
536 ssid->passphrase = os_malloc(cred->key_len + 1); in wpa_supplicant_wps_cred()
539 os_memcpy(ssid->passphrase, cred->key, cred->key_len); in wpa_supplicant_wps_cred()
540 ssid->passphrase[cred->key_len] = '\0'; in wpa_supplicant_wps_cred()
546 (unsigned long) cred->key_len); in wpa_supplicant_wps_cred()
552 wpas_wps_security_workaround(wpa_s, ssid, cred); in wpa_supplicant_wps_cred()
790 const struct wps_credential *cred = ap_settings->cred; in wpa_supplicant_wps_event_er_ap_settings() local
793 if (cred->auth_type & (WPS_AUTH_WPAPSK | WPS_AUTH_WPA2PSK)) { in wpa_supplicant_wps_event_er_ap_settings()
794 if (cred->key_len >= 8 && cred->key_len <= 64) { in wpa_supplicant_wps_event_er_ap_settings()
795 os_memcpy(key_str, cred->key, cred->key_len); in wpa_supplicant_wps_event_er_ap_settings()
796 key_str[cred->key_len] = '\0'; in wpa_supplicant_wps_event_er_ap_settings()
805 uuid_str, wpa_ssid_txt(cred->ssid, cred->ssid_len), in wpa_supplicant_wps_event_er_ap_settings()
806 cred->auth_type, cred->encr_type, key_str); in wpa_supplicant_wps_event_er_ap_settings()
1967 struct wps_credential *cred) in wpas_wps_network_to_cred() argument
1969 os_memset(cred, 0, sizeof(*cred)); in wpas_wps_network_to_cred()
1972 os_memcpy(cred->ssid, ssid->ssid, ssid->ssid_len); in wpas_wps_network_to_cred()
1973 cred->ssid_len = ssid->ssid_len; in wpas_wps_network_to_cred()
1975 cred->auth_type = (ssid->proto & WPA_PROTO_RSN) ? in wpas_wps_network_to_cred()
1978 cred->encr_type = WPS_ENCR_AES; in wpas_wps_network_to_cred()
1980 cred->encr_type = WPS_ENCR_TKIP; in wpas_wps_network_to_cred()
1982 cred->key_len = os_strlen(ssid->passphrase); in wpas_wps_network_to_cred()
1983 if (cred->key_len >= 64) in wpas_wps_network_to_cred()
1985 os_memcpy(cred->key, ssid->passphrase, cred->key_len); in wpas_wps_network_to_cred()
1987 cred->key_len = 32; in wpas_wps_network_to_cred()
1988 os_memcpy(cred->key, ssid->psk, 32); in wpas_wps_network_to_cred()
1992 cred->auth_type = WPS_AUTH_OPEN; in wpas_wps_network_to_cred()
1993 cred->encr_type = WPS_ENCR_NONE; in wpas_wps_network_to_cred()
2006 struct wps_credential cred; in wpas_wps_er_set_config() local
2019 if (wpas_wps_network_to_cred(ssid, &cred) < 0) in wpas_wps_er_set_config()
2021 ret = wps_er_set_config(wpa_s->wps_er, use_uuid, use_addr, &cred); in wpas_wps_er_set_config()
2022 os_memset(&cred, 0, sizeof(cred)); in wpas_wps_er_set_config()
2032 struct wps_credential cred; in wpas_wps_er_config() local
2045 os_memset(&cred, 0, sizeof(cred)); in wpas_wps_er_config()
2047 if ((len & 1) || len > 2 * sizeof(cred.ssid) || in wpas_wps_er_config()
2048 hexstr2bin(settings->ssid_hex, cred.ssid, len / 2)) in wpas_wps_er_config()
2050 cred.ssid_len = len / 2; in wpas_wps_er_config()
2053 if ((len & 1) || len > 2 * sizeof(cred.key) || in wpas_wps_er_config()
2054 hexstr2bin(settings->key_hex, cred.key, len / 2)) in wpas_wps_er_config()
2056 cred.key_len = len / 2; in wpas_wps_er_config()
2059 cred.auth_type = WPS_AUTH_OPEN; in wpas_wps_er_config()
2061 cred.auth_type = WPS_AUTH_WPAPSK; in wpas_wps_er_config()
2063 cred.auth_type = WPS_AUTH_WPA2PSK; in wpas_wps_er_config()
2068 cred.encr_type = WPS_ENCR_NONE; in wpas_wps_er_config()
2071 cred.encr_type = WPS_ENCR_WEP; in wpas_wps_er_config()
2074 cred.encr_type = WPS_ENCR_TKIP; in wpas_wps_er_config()
2076 cred.encr_type = WPS_ENCR_AES; in wpas_wps_er_config()
2081 (const u8 *) pin, os_strlen(pin), &cred); in wpas_wps_er_config()
2204 struct wps_credential cred; in wpas_wps_network_config_token() local
2206 if (wpas_wps_network_to_cred(ssid, &cred) < 0) in wpas_wps_network_config_token()
2209 ret = wps_er_config_token_from_cred(wpa_s->wps, &cred); in wpas_wps_network_config_token()