Lines Matching refs:cred
1484 const struct wps_credential *cred) in wps_build_cred_network_idx() argument
1495 const struct wps_credential *cred) in wps_build_cred_ssid() argument
1499 cred->ssid, cred->ssid_len); in wps_build_cred_ssid()
1501 wpabuf_put_be16(msg, cred->ssid_len); in wps_build_cred_ssid()
1502 wpabuf_put_data(msg, cred->ssid, cred->ssid_len); in wps_build_cred_ssid()
1508 const struct wps_credential *cred) in wps_build_cred_auth_type() argument
1511 cred->auth_type); in wps_build_cred_auth_type()
1514 wpabuf_put_be16(msg, cred->auth_type); in wps_build_cred_auth_type()
1520 const struct wps_credential *cred) in wps_build_cred_encr_type() argument
1523 cred->encr_type); in wps_build_cred_encr_type()
1526 wpabuf_put_be16(msg, cred->encr_type); in wps_build_cred_encr_type()
1532 const struct wps_credential *cred) in wps_build_cred_network_key() argument
1535 (int) cred->key_len); in wps_build_cred_network_key()
1537 cred->key, cred->key_len); in wps_build_cred_network_key()
1539 wpabuf_put_be16(msg, cred->key_len); in wps_build_cred_network_key()
1540 wpabuf_put_data(msg, cred->key, cred->key_len); in wps_build_cred_network_key()
1546 const struct wps_credential *cred) in wps_build_credential() argument
1548 if (wps_build_cred_network_idx(msg, cred) || in wps_build_credential()
1549 wps_build_cred_ssid(msg, cred) || in wps_build_credential()
1550 wps_build_cred_auth_type(msg, cred) || in wps_build_credential()
1551 wps_build_cred_encr_type(msg, cred) || in wps_build_credential()
1552 wps_build_cred_network_key(msg, cred) || in wps_build_credential()
1553 wps_build_mac_addr(msg, cred->mac_addr)) in wps_build_credential()
1560 const struct wps_credential *cred) in wps_build_credential_wrap() argument
1566 if (wps_build_credential(wbuf, cred)) { in wps_build_credential_wrap()
1580 struct wpabuf *cred; in wps_build_cred() local
1587 os_memcpy(&wps->cred, wps->use_cred, sizeof(wps->cred)); in wps_build_cred()
1590 os_memset(&wps->cred, 0, sizeof(wps->cred)); in wps_build_cred()
1592 os_memcpy(wps->cred.ssid, wps->wps->ssid, wps->wps->ssid_len); in wps_build_cred()
1593 wps->cred.ssid_len = wps->wps->ssid_len; in wps_build_cred()
1607 wps->cred.auth_type = wps->auth_type; in wps_build_cred()
1633 wps->cred.encr_type = wps->encr_type; in wps_build_cred()
1637 os_memcpy(wps->cred.mac_addr, wps->mac_addr_e, ETH_ALEN); in wps_build_cred()
1659 os_memcpy(wps->cred.key, wps->new_psk, wps->new_psk_len); in wps_build_cred()
1660 wps->cred.key_len = wps->new_psk_len; in wps_build_cred()
1666 os_memcpy(wps->cred.key, hex, 32 * 2); in wps_build_cred()
1667 wps->cred.key_len = 32 * 2; in wps_build_cred()
1670 os_memcpy(wps->cred.key, wps->wps->network_key, in wps_build_cred()
1672 wps->cred.key_len = wps->wps->network_key_len; in wps_build_cred()
1693 os_memcpy(wps->cred.key, hex, wps->new_psk_len * 2); in wps_build_cred()
1694 wps->cred.key_len = wps->new_psk_len * 2; in wps_build_cred()
1700 cred = wpabuf_alloc(200); in wps_build_cred()
1702 cred = NULL; in wps_build_cred()
1703 if (cred) { in wps_build_cred()
1714 wps_build_credential(cred, &dummy); in wps_build_cred()
1715 wpa_hexdump_buf(MSG_DEBUG, "WPS: Dummy Credential", cred); in wps_build_cred()
1718 wpabuf_put_be16(msg, wpabuf_len(cred)); in wps_build_cred()
1719 wpabuf_put_buf(msg, cred); in wps_build_cred()
1721 wpabuf_free(cred); in wps_build_cred()
1725 cred = wpabuf_alloc(200); in wps_build_cred()
1726 if (cred == NULL) in wps_build_cred()
1729 if (wps_build_credential(cred, &wps->cred)) { in wps_build_cred()
1730 wpabuf_free(cred); in wps_build_cred()
1735 wpabuf_put_be16(msg, wpabuf_len(cred)); in wps_build_cred()
1736 wpabuf_put_buf(msg, cred); in wps_build_cred()
1737 wpabuf_free(cred); in wps_build_cred()
1753 if (wps_build_credential(msg, &wps->cred)) in wps_build_ap_settings()
2771 if (wps->cred.auth_type & WPS_AUTH_WPA2PSK) in wps_sta_cred_cb()
2772 wps->cred.auth_type = WPS_AUTH_WPA2PSK; in wps_sta_cred_cb()
2773 else if (wps->cred.auth_type & WPS_AUTH_WPAPSK) in wps_sta_cred_cb()
2774 wps->cred.auth_type = WPS_AUTH_WPAPSK; in wps_sta_cred_cb()
2775 if (wps->cred.encr_type & WPS_ENCR_AES) in wps_sta_cred_cb()
2776 wps->cred.encr_type = WPS_ENCR_AES; in wps_sta_cred_cb()
2777 else if (wps->cred.encr_type & WPS_ENCR_TKIP) in wps_sta_cred_cb()
2778 wps->cred.encr_type = WPS_ENCR_TKIP; in wps_sta_cred_cb()
2782 wps->wps->cred_cb(wps->wps->cb_ctx, &wps->cred); in wps_sta_cred_cb()
2808 if (wps_process_ap_settings(attr, &wps->cred) < 0) in wps_process_ap_settings_r()
2816 wps_cred_update(&wps->cred, wps->new_ap_settings); in wps_process_ap_settings_r()
2833 wps->cred.cred_attr = wpabuf_head(msg); in wps_process_ap_settings_r()
2834 wps->cred.cred_attr_len = wpabuf_len(msg); in wps_process_ap_settings_r()
2838 &wps->cred); in wps_process_ap_settings_r()
2844 wps->cred.cred_attr = NULL; in wps_process_ap_settings_r()
2845 wps->cred.cred_attr_len = 0; in wps_process_ap_settings_r()
3207 struct wps_credential cred; in wps_process_wsc_done() local
3212 os_memset(&cred, 0, sizeof(cred)); in wps_process_wsc_done()
3213 os_memcpy(cred.ssid, wps->wps->ssid, wps->wps->ssid_len); in wps_process_wsc_done()
3214 cred.ssid_len = wps->wps->ssid_len; in wps_process_wsc_done()
3215 cred.auth_type = WPS_AUTH_WPAPSK | WPS_AUTH_WPA2PSK; in wps_process_wsc_done()
3216 cred.encr_type = WPS_ENCR_TKIP | WPS_ENCR_AES; in wps_process_wsc_done()
3217 os_memcpy(cred.key, wps->new_psk, wps->new_psk_len); in wps_process_wsc_done()
3218 cred.key_len = wps->new_psk_len; in wps_process_wsc_done()
3225 wps->wps->cred_cb(wps->wps->cb_ctx, &cred); in wps_process_wsc_done()
3507 struct wps_credential *cred) in wps_registrar_config_ap() argument
3509 wpa_printf(MSG_DEBUG, "WPS: encr_type=0x%x", cred->encr_type); in wps_registrar_config_ap()
3510 if (!(cred->encr_type & (WPS_ENCR_NONE | WPS_ENCR_TKIP | in wps_registrar_config_ap()
3512 if (cred->encr_type & WPS_ENCR_WEP) { in wps_registrar_config_ap()
3519 "invalid encr_type 0x%x", cred->encr_type); in wps_registrar_config_ap()
3523 if ((cred->encr_type & (WPS_ENCR_TKIP | WPS_ENCR_AES)) == in wps_registrar_config_ap()
3527 cred->encr_type |= WPS_ENCR_AES; in wps_registrar_config_ap()
3530 if ((cred->auth_type & (WPS_AUTH_WPAPSK | WPS_AUTH_WPA2PSK)) == in wps_registrar_config_ap()
3534 cred->auth_type |= WPS_AUTH_WPA2PSK; in wps_registrar_config_ap()
3538 return reg->wps->cred_cb(reg->wps->cb_ctx, cred); in wps_registrar_config_ap()