aboutsummaryrefslogtreecommitdiffstats
path: root/src/wps
diff options
context:
space:
mode:
authorMasashi Honma <honma@ictec.co.jp>2009-01-22 13:12:18 (GMT)
committerJouni Malinen <j@w1.fi>2009-02-08 10:13:40 (GMT)
commit63619ea256e9b6797721f165a6f4ff2b753d63d6 (patch)
treec8f01f360b73ef2921b6a8de4e928aad9eb8c740 /src/wps
parent2b0bb33b500940917103dc9b04cd5ea2f20193a3 (diff)
downloadhostap-06-63619ea256e9b6797721f165a6f4ff2b753d63d6.zip
hostap-06-63619ea256e9b6797721f165a6f4ff2b753d63d6.tar.gz
hostap-06-63619ea256e9b6797721f165a6f4ff2b753d63d6.tar.bz2
WPS: Check Device Password ID attribute only if present in AP search
I can't pass the "Wi-Fi WPS Test Plan Version 1.0 [5.1.4. Add to AP using PIN Config method and PASS PHRASE through wired external registrar]". The wpa_supplicant-0.6.7 can't recoginize the testbed AP(BCM94704AGRRev-E.2.4) as WPS PIN AP. Because after PIN entered, the AP sends Selected Registrar attribute=0 and not send Device Password ID attribute. The proposed change as-is removed validation of Selected Registrar attribute completely. However, that part is not included in this commit since it can cause problems for environments with multiple WPS-enabled APs. Another workaround for this will be considered in wpa_supplicant scanning process (e.g., start trying to use WPS with APs that do not set Selected Registrar to TRUE after couple of scan runs that do not find any APs with Selected Registrar TRUE). (cherry picked from commit e29bcf9eab020e4bd9aae87a7b9602264d228f49)
Diffstat (limited to 'src/wps')
-rw-r--r--src/wps/wps.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/wps/wps.c b/src/wps/wps.c
index 67438de..015eb07 100644
--- a/src/wps/wps.c
+++ b/src/wps/wps.c
@@ -186,7 +186,7 @@ int wps_is_selected_pbc_registrar(const struct wpabuf *msg)
/**
- * wps_is_selected_pbc_registrar - Check whether WPS IE indicates active PIN
+ * wps_is_selected_pin_registrar - Check whether WPS IE indicates active PIN
* @msg: WPS IE contents from Beacon or Probe Response frame
* Returns: 1 if PIN Registrar is active, 0 if not
*/
@@ -202,9 +202,13 @@ int wps_is_selected_pin_registrar(const struct wpabuf *msg)
* Device Password ID here.
*/
- if (wps_parse_msg(msg, &attr) < 0 ||
- !attr.selected_registrar || *attr.selected_registrar == 0 ||
- !attr.dev_password_id ||
+ if (wps_parse_msg(msg, &attr) < 0)
+ return 0;
+
+ if (!attr.selected_registrar || *attr.selected_registrar == 0)
+ return 0;
+
+ if (attr.dev_password_id != NULL &&
WPA_GET_BE16(attr.dev_password_id) == DEV_PW_PUSHBUTTON)
return 0;