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).
This commit is contained in:
Masashi Honma 2009-01-22 15:12:18 +02:00 committed by Jouni Malinen
parent 695e2b48e2
commit e29bcf9eab

View file

@ -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;