]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
WPS: Require PBC match with wps_pbc that specifies BSSID
authorJouni Malinen <jouni.malinen@atheros.com>
Tue, 28 Dec 2010 06:56:23 +0000 (08:56 +0200)
committerJouni Malinen <j@w1.fi>
Tue, 28 Dec 2010 06:56:23 +0000 (08:56 +0200)
The WPS mode was already verified when the AP was configured for
WPA/WPA2, but this was not done with AP that was in open mode.
Fix this by allowing wpa_supplicant_ssid_bss_match() to be called
in non-WPA configuration, too. With this change, wps_pbc BSSID
command will wait until the specified target AP is in active PBC
mode before trying to connect to it.

wpa_supplicant/events.c

index 406535286b1f9089adddfafa88618fcc2866a97a..c48365e5d110f320b126a1f4f73629e8915c80aa 100644 (file)
@@ -420,10 +420,14 @@ static int wpa_supplicant_ssid_bss_match(struct wpa_supplicant *wpa_s,
                return 1;
        }
 
-       if (proto_match == 0)
+       if ((ssid->proto & (WPA_PROTO_WPA | WPA_PROTO_RSN)) &&
+           proto_match == 0) {
                wpa_printf(MSG_DEBUG, "   skip - no WPA/RSN proto match");
+               return 0;
+       }
 
-       return 0;
+       /* Allow in non-WPA configuration */
+       return 1;
 }
 
 
@@ -539,7 +543,7 @@ static struct wpa_ssid * wpa_scan_res_match(struct wpa_supplicant *wpa_s,
                        continue;
                }
 
-               if (wpa && !wpa_supplicant_ssid_bss_match(wpa_s, ssid, bss))
+               if (!wpa_supplicant_ssid_bss_match(wpa_s, ssid, bss))
                        continue;
 
                if (!wpa &&