wpa_supplicant: Add wps_disabled parameter to network block
authorLior David <qca_liord@qca.qualcomm.com>
Tue, 12 Apr 2016 15:13:22 +0000 (18:13 +0300)
committerJouni Malinen <j@w1.fi>
Sat, 14 May 2016 16:43:30 +0000 (19:43 +0300)
Add a new parameter wps_disabled to network block (wpa_ssid). This
parameter allows WPS functionality to be disabled in AP mode.

Signed-off-by: Lior David <qca_liord@qca.qualcomm.com>
wpa_supplicant/ap.c
wpa_supplicant/config.c
wpa_supplicant/config_file.c
wpa_supplicant/config_ssid.h
wpa_supplicant/wpa_cli.c
wpa_supplicant/wpa_supplicant.conf

index 4ed0400..1ba2ab3 100644 (file)
@@ -420,6 +420,8 @@ static int wpa_supplicant_conf_ap(struct wpa_supplicant *wpa_s,
             !(bss->wpa & 2)))
                goto no_wps; /* WPS2 does not allow WPA/TKIP-only
                              * configuration */
+       if (ssid->wps_disabled)
+               goto no_wps;
        bss->eap_server = 1;
 
        if (!ssid->ignore_broadcast_ssid)
index d9a1603..674faab 100644 (file)
@@ -2055,6 +2055,7 @@ static const struct parse_data ssid_fields[] = {
 #endif /* CONFIG_HS20 */
        { INT_RANGE(mac_addr, 0, 2) },
        { INT_RANGE(pbss, 0, 2) },
+       { INT_RANGE(wps_disabled, 0, 1) },
 };
 
 #undef OFFSET
index 38061f1..939a795 100644 (file)
@@ -756,6 +756,7 @@ static void wpa_config_write_network(FILE *f, struct wpa_ssid *ssid)
        INT(mixed_cell);
        INT(max_oper_chwidth);
        INT(pbss);
+       INT(wps_disabled);
 #ifdef CONFIG_IEEE80211W
        write_int(f, "ieee80211w", ssid->ieee80211w,
                  MGMT_FRAME_PROTECTION_DEFAULT);
index c2af91d..1ecdfc0 100644 (file)
@@ -748,6 +748,14 @@ struct wpa_ssid {
         * this MBSS will trigger a peering attempt.
         */
        int no_auto_peer;
+
+       /**
+        * wps_disabled - WPS disabled in AP mode
+        *
+        * 0 = WPS enabled and configured (default)
+        * 1 = WPS disabled
+        */
+       int wps_disabled;
 };
 
 #endif /* CONFIG_SSID_H */
index ca2673b..9b1c802 100644 (file)
@@ -1612,7 +1612,7 @@ static const char *network_fields[] = {
 #ifdef CONFIG_HS20
        "update_identifier",
 #endif /* CONFIG_HS20 */
-       "mac_addr", "pbss"
+       "mac_addr", "pbss", "wps_disabled"
 };
 
 
index 45bf518..2d487c5 100644 (file)
@@ -1175,6 +1175,11 @@ fast_reauth=1
 # Beacon interval (default: 100 TU)
 #beacon_int=100
 
+# WPS in AP mode
+# 0 = WPS enabled and configured (default)
+# 1 = WPS disabled
+#wps_disabled=0
+
 # MAC address policy
 # 0 = use permanent MAC address
 # 1 = use random MAC address for each ESS connection