Home | History | Annotate | Download | only in ap

Lines Matching refs:cred

320 				       const struct wps_credential *cred)
327 if (cred->ssid_len <= SSID_MAX_LEN) {
328 os_memcpy(bss->ssid.ssid, cred->ssid, cred->ssid_len);
329 bss->ssid.ssid_len = cred->ssid_len;
333 if ((cred->auth_type & (WPS_AUTH_WPA2 | WPS_AUTH_WPA2PSK)) &&
334 (cred->auth_type & (WPS_AUTH_WPA | WPS_AUTH_WPAPSK)))
336 else if (cred->auth_type & (WPS_AUTH_WPA2 | WPS_AUTH_WPA2PSK))
338 else if (cred->auth_type & (WPS_AUTH_WPA | WPS_AUTH_WPAPSK))
344 if (cred->auth_type & (WPS_AUTH_WPA2 | WPS_AUTH_WPA))
346 if (cred->auth_type & (WPS_AUTH_WPA2PSK | WPS_AUTH_WPAPSK))
350 if (cred->encr_type & WPS_ENCR_AES) {
356 if (cred->encr_type & WPS_ENCR_TKIP)
363 if (cred->key_len >= 8 && cred->key_len < 64) {
365 bss->ssid.wpa_passphrase = os_zalloc(cred->key_len + 1);
367 os_memcpy(bss->ssid.wpa_passphrase, cred->key,
368 cred->key_len);
370 } else if (cred->key_len == 64) {
375 hexstr2bin((const char *) cred->key,
403 const struct wps_credential *cred = ctx;
415 cred->cred_attr, cred->cred_attr_len);
418 wpa_hexdump_ascii(MSG_DEBUG, "WPS: SSID", cred->ssid, cred->ssid_len);
420 cred->auth_type);
421 wpa_printf(MSG_DEBUG, "WPS: Encryption Type 0x%x", cred->encr_type);
422 wpa_printf(MSG_DEBUG, "WPS: Network Key Index %d", cred->key_idx);
424 cred->key, cred->key_len);
426 MAC2STR(cred->mac_addr));
429 hapd->conf->wps_cred_processing == 2) && cred->cred_attr) {
430 hapd_new_ap_event(hapd, cred->cred_attr, cred->cred_attr_len);
435 if (attr && wps_build_credential_wrap(attr, cred) == 0)
445 os_memcpy(hapd->wps->ssid, cred->ssid, cred->ssid_len);
446 hapd->wps->ssid_len = cred->ssid_len;
447 hapd->wps->encr_types = cred->encr_type;
448 hapd->wps->encr_types_rsn = cred->encr_type;
449 hapd->wps->encr_types_wpa = cred->encr_type;
450 hapd->wps->auth_types = cred->auth_type;
451 hapd->wps->ap_encr_type = cred->encr_type;
452 hapd->wps->ap_auth_type = cred->auth_type;
453 if (cred->key_len == 0) {
457 } else if ((cred->auth_type & (WPS_AUTH_WPA2PSK | WPS_AUTH_WPAPSK)) &&
458 (cred->key_len < 8 || cred->key_len > 2 * PMK_LEN)) {
460 (unsigned long) cred->key_len);
464 hapd->wps->network_key_len < cred->key_len) {
467 hapd->wps->network_key = os_malloc(cred->key_len);
471 hapd->wps->network_key_len = cred->key_len;
472 os_memcpy(hapd->wps->network_key, cred->key, cred->key_len);
477 return hapd_wps_reconfig_in_memory(hapd, cred);
505 if (is_hex(cred->ssid, cred->ssid_len)) {
507 for (i = 0; i < cred->ssid_len; i++)
508 fprintf(nconf, "%02x", cred->ssid[i]);
512 for (i = 0; i < cred->ssid_len; i++)
513 fputc(cred->ssid[i], nconf);
517 if ((cred->auth_type & (WPS_AUTH_WPA2 | WPS_AUTH_WPA2PSK)) &&
518 (cred->auth_type & (WPS_AUTH_WPA | WPS_AUTH_WPAPSK)))
520 else if (cred->auth_type & (WPS_AUTH_WPA2 | WPS_AUTH_WPA2PSK))
522 else if (cred->auth_type & (WPS_AUTH_WPA | WPS_AUTH_WPAPSK))
533 if (cred->auth_type & (WPS_AUTH_WPA2 | WPS_AUTH_WPA)) {
537 if (cred->auth_type & (WPS_AUTH_WPA2PSK | WPS_AUTH_WPAPSK))
543 if (cred->encr_type & WPS_ENCR_AES) {
551 if (cred->encr_type & WPS_ENCR_TKIP) {
556 if (cred->key_len >= 8 && cred->key_len < 64) {
558 for (i = 0; i < cred->key_len; i++)
559 fputc(cred->key[i], nconf);
561 } else if (cred->key_len == 64) {
563 for (i = 0; i < cred->key_len; i++)
564 fputc(cred->key[i], nconf);
569 (unsigned long) cred->key_len);
629 static int hostapd_wps_cred_cb(void *ctx, const struct wps_credential *cred)
632 return hostapd_wps_for_each(hapd, hapd_wps_cred_cb, (void *) cred);
1676 struct wps_credential cred;
1679 os_memset(&cred, 0, sizeof(cred));
1682 if ((len & 1) || len > 2 * sizeof(cred.ssid) ||
1683 hexstr2bin(ssid, cred.ssid, len / 2))
1685 cred.ssid_len = len / 2;
1688 cred.auth_type = WPS_AUTH_OPEN;
1690 cred.auth_type = WPS_AUTH_WPAPSK;
1692 cred.auth_type = WPS_AUTH_WPA2PSK;
1698 cred.encr_type = WPS_ENCR_NONE;
1700 cred.encr_type = WPS_ENCR_TKIP;
1702 cred.encr_type = WPS_ENCR_AES;
1706 cred.encr_type = WPS_ENCR_NONE;
1710 if ((len & 1) || len > 2 * sizeof(cred.key) ||
1711 hexstr2bin(key, cred.key, len / 2))
1713 cred.key_len = len / 2;
1716 return wps_registrar_config_ap(hapd->wps->registrar, &cred);