AP: Only enable WPS for open and WPA/WPA2-Personal configuration

When wpa_supplicant AP mode is used, WPS was enabled by default
regardless of security mode. This is not desired for WEP, so change
the AP configuration to enable WPS only for open and WPA/WPA2-Personal
networks.

Signed-hostap: Jouni Malinen <jouni@qca.qualcomm.com>
This commit is contained in:
Jouni Malinen 2011-11-14 16:16:29 +02:00 committed by Jouni Malinen
parent 16476dd124
commit 04ed4e984e

View file

@ -213,9 +213,13 @@ static int wpa_supplicant_conf_ap(struct wpa_supplicant *wpa_s,
#ifdef CONFIG_WPS
/*
* Enable WPS by default, but require user interaction to actually use
* it. Only the internal Registrar is supported.
* Enable WPS by default for open and WPA/WPA2-Personal network, but
* require user interaction to actually use it. Only the internal
* Registrar is supported.
*/
if (bss->ssid.security_policy != SECURITY_WPA_PSK &&
bss->ssid.security_policy != SECURITY_PLAINTEXT)
goto no_wps;
bss->eap_server = 1;
bss->wps_state = 2;
bss->ap_setup_locked = 2;
@ -240,6 +244,7 @@ static int wpa_supplicant_conf_ap(struct wpa_supplicant *wpa_s,
else
os_memcpy(bss->uuid, wpa_s->conf->uuid, WPS_UUID_LEN);
os_memcpy(bss->os_version, wpa_s->conf->os_version, 4);
no_wps:
#endif /* CONFIG_WPS */
if (wpa_s->max_stations &&