WPS: Add BSSID to strict validation error messages
authorJouni Malinen <jouni.malinen@atheros.com>
Mon, 20 Sep 2010 21:54:22 +0000 (14:54 -0700)
committerJouni Malinen <j@w1.fi>
Mon, 20 Sep 2010 21:54:22 +0000 (14:54 -0700)
This makes it easier to figure out which AP is sending invalid
Beacon or Probe Response frames.

src/wps/wps.h
src/wps/wps_validate.c
wpa_supplicant/wps_supplicant.c

index 1b0fcea..a1b7ae7 100644 (file)
@@ -763,7 +763,8 @@ u16 wps_config_methods_str2bin(const char *str);
 
 #ifdef CONFIG_WPS_STRICT
 int wps_validate_beacon(const struct wpabuf *wps_ie);
 
 #ifdef CONFIG_WPS_STRICT
 int wps_validate_beacon(const struct wpabuf *wps_ie);
-int wps_validate_beacon_probe_resp(const struct wpabuf *wps_ie, int probe);
+int wps_validate_beacon_probe_resp(const struct wpabuf *wps_ie, int probe,
+                                  const u8 *addr);
 int wps_validate_probe_req(const struct wpabuf *wps_ie);
 int wps_validate_assoc_req(const struct wpabuf *wps_ie);
 int wps_validate_assoc_resp(const struct wpabuf *wps_ie);
 int wps_validate_probe_req(const struct wpabuf *wps_ie);
 int wps_validate_assoc_req(const struct wpabuf *wps_ie);
 int wps_validate_assoc_resp(const struct wpabuf *wps_ie);
@@ -791,7 +792,7 @@ static inline int wps_validate_beacon(const struct wpabuf *wps_ie){
 }
 
 static inline int wps_validate_beacon_probe_resp(const struct wpabuf *wps_ie,
 }
 
 static inline int wps_validate_beacon_probe_resp(const struct wpabuf *wps_ie,
-                                                int probe)
+                                                int probe, const u8 *addr)
 {
        return 0;
 }
 {
        return 0;
 }
index 55d3677..7888c1b 100644 (file)
@@ -1122,7 +1122,8 @@ int wps_validate_beacon(const struct wpabuf *wps_ie)
 }
 
 
 }
 
 
-int wps_validate_beacon_probe_resp(const struct wpabuf *wps_ie, int probe)
+int wps_validate_beacon_probe_resp(const struct wpabuf *wps_ie, int probe,
+                                  const u8 *addr)
 {
        struct wps_parse_attr attr;
        int wps2, sel_reg;
 {
        struct wps_parse_attr attr;
        int wps2, sel_reg;
@@ -1166,7 +1167,8 @@ int wps_validate_beacon_probe_resp(const struct wpabuf *wps_ie, int probe)
            wps_validate_authorized_macs(attr.authorized_macs,
                                         attr.authorized_macs_len, 0)) {
                wpa_printf(MSG_INFO, "WPS-STRICT: Invalid %sProbe Response "
            wps_validate_authorized_macs(attr.authorized_macs,
                                         attr.authorized_macs_len, 0)) {
                wpa_printf(MSG_INFO, "WPS-STRICT: Invalid %sProbe Response "
-                          "frame", probe ? "" : "Beacon/");
+                          "frame from " MACSTR, probe ? "" : "Beacon/",
+                          MAC2STR(addr));
 #ifdef WPS_STRICT_WPS2
                if (wps2)
                        return -1;
 #ifdef WPS_STRICT_WPS2
                if (wps2)
                        return -1;
index 8f4ed51..a324b46 100644 (file)
@@ -1117,7 +1117,7 @@ int wpas_wps_ssid_wildcard_ok(struct wpa_supplicant *wpa_s,
 #ifdef CONFIG_WPS_STRICT
        if (wps_ie) {
                if (wps_validate_beacon_probe_resp(wps_ie, bss->beacon_ie_len >
 #ifdef CONFIG_WPS_STRICT
        if (wps_ie) {
                if (wps_validate_beacon_probe_resp(wps_ie, bss->beacon_ie_len >
-                                                  0) < 0)
+                                                  0, bss->bssid) < 0)
                        ret = 0;
                if (bss->beacon_ie_len) {
                        struct wpabuf *bcn_wps;
                        ret = 0;
                if (bss->beacon_ie_len) {
                        struct wpabuf *bcn_wps;