Lines Matching refs:cred

89 static int wps_process_cred_network_idx(struct wps_credential *cred,
104 static int wps_process_cred_ssid(struct wps_credential *cred, const u8 *ssid,
118 if (ssid_len <= sizeof(cred->ssid)) {
119 os_memcpy(cred->ssid, ssid, ssid_len);
120 cred->ssid_len = ssid_len;
127 static int wps_process_cred_auth_type(struct wps_credential *cred,
136 cred->auth_type = WPA_GET_BE16(auth_type);
138 cred->auth_type);
144 static int wps_process_cred_encr_type(struct wps_credential *cred,
153 cred->encr_type = WPA_GET_BE16(encr_type);
155 cred->encr_type);
161 static int wps_process_cred_network_key_idx(struct wps_credential *cred,
168 cred->key_idx = *key_idx;
174 static int wps_process_cred_network_key(struct wps_credential *cred,
180 if (cred->auth_type == WPS_AUTH_OPEN &&
181 cred->encr_type == WPS_ENCR_NONE) {
191 if (key_len <= sizeof(cred->key)) {
192 os_memcpy(cred->key, key, key_len);
193 cred->key_len = key_len;
200 static int wps_process_cred_mac_addr(struct wps_credential *cred,
210 os_memcpy(cred->mac_addr, mac_addr, ETH_ALEN);
216 static int wps_process_cred_eap_type(struct wps_credential *cred,
228 static int wps_process_cred_eap_identity(struct wps_credential *cred,
242 static int wps_process_cred_key_prov_auto(struct wps_credential *cred,
255 static int wps_process_cred_802_1x_enabled(struct wps_credential *cred,
267 static void wps_workaround_cred_key(struct wps_credential *cred)
269 if (cred->auth_type & (WPS_AUTH_WPAPSK | WPS_AUTH_WPA2PSK) &&
270 cred->key_len > 8 && cred->key_len < 64 &&
271 cred->key[cred->key_len - 1] == 0) {
279 cred->key_len--;
285 struct wps_credential *cred)
290 if (wps_process_cred_network_idx(cred, attr->network_idx) ||
291 wps_process_cred_ssid(cred, attr->ssid, attr->ssid_len) ||
292 wps_process_cred_auth_type(cred, attr->auth_type) ||
293 wps_process_cred_encr_type(cred, attr->encr_type) ||
294 wps_process_cred_network_key_idx(cred, attr->network_key_idx) ||
295 wps_process_cred_network_key(cred, attr->network_key,
297 wps_process_cred_mac_addr(cred, attr->mac_addr) ||
298 wps_process_cred_eap_type(cred, attr->eap_type,
300 wps_process_cred_eap_identity(cred, attr->eap_identity,
302 wps_process_cred_key_prov_auto(cred, attr->key_prov_auto) ||
303 wps_process_cred_802_1x_enabled(cred, attr->dot1x_enabled))
306 wps_workaround_cred_key(cred);
313 struct wps_credential *cred)
316 os_memset(cred, 0, sizeof(*cred));
318 if (wps_process_cred_ssid(cred, attr->ssid, attr->ssid_len) ||
319 wps_process_cred_auth_type(cred, attr->auth_type) ||
320 wps_process_cred_encr_type(cred, attr->encr_type) ||
321 wps_process_cred_network_key_idx(cred, attr->network_key_idx) ||
322 wps_process_cred_network_key(cred, attr->network_key,
324 wps_process_cred_mac_addr(cred, attr->mac_addr))
327 wps_workaround_cred_key(cred);