From: Jouni Malinen Date: Mon, 14 Nov 2011 14:16:29 +0000 (+0200) Subject: AP: Only enable WPS for open and WPA/WPA2-Personal configuration X-Git-Tag: aosp-jb-start~334 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=04ed4e984ea6bce08274c1dbbc520eaef2b138b7;p=thirdparty%2Fhostap.git 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 --- diff --git a/wpa_supplicant/ap.c b/wpa_supplicant/ap.c index 10dd62691..1332eff57 100644 --- a/wpa_supplicant/ap.c +++ b/wpa_supplicant/ap.c @@ -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 &&