From: Jouni Malinen Date: Mon, 20 Sep 2010 21:54:22 +0000 (-0700) Subject: WPS: Add BSSID to strict validation error messages X-Git-Url: http://www.project-moonshot.org/gitweb/?p=libeap.git;a=commitdiff_plain;h=ff28ccafd5995e6026d414481f860c31b0ce56ba WPS: Add BSSID to strict validation error messages This makes it easier to figure out which AP is sending invalid Beacon or Probe Response frames. --- diff --git a/src/wps/wps.h b/src/wps/wps.h index 1b0fcea..a1b7ae7 100644 --- a/src/wps/wps.h +++ b/src/wps/wps.h @@ -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); -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); @@ -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, - int probe) + int probe, const u8 *addr) { return 0; } diff --git a/src/wps/wps_validate.c b/src/wps/wps_validate.c index 55d3677..7888c1b 100644 --- a/src/wps/wps_validate.c +++ b/src/wps/wps_validate.c @@ -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; @@ -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 " - "frame", probe ? "" : "Beacon/"); + "frame from " MACSTR, probe ? "" : "Beacon/", + MAC2STR(addr)); #ifdef WPS_STRICT_WPS2 if (wps2) return -1; diff --git a/wpa_supplicant/wps_supplicant.c b/wpa_supplicant/wps_supplicant.c index 8f4ed51..a324b46 100644 --- a/wpa_supplicant/wps_supplicant.c +++ b/wpa_supplicant/wps_supplicant.c @@ -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 > - 0) < 0) + 0, bss->bssid) < 0) ret = 0; if (bss->beacon_ie_len) { struct wpabuf *bcn_wps;