]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
WPS: Include all Config Methods in Probe Request
authorJouni Malinen <jouni.malinen@atheros.com>
Mon, 20 Dec 2010 10:54:10 +0000 (12:54 +0200)
committerJouni Malinen <j@w1.fi>
Mon, 20 Dec 2010 10:54:10 +0000 (12:54 +0200)
Do not use active PBC state to figure out which ConfigMethods are
included in Probe Request; instead, include all supported ones.

src/wps/wps.c

index 1f259c212c894997730c88981238958c20eb8687..73dd58cbabb065b6bf07211c5e54c191ce538786 100644 (file)
@@ -435,7 +435,7 @@ struct wpabuf * wps_build_probe_req_ie(int pbc, struct wps_device_data *dev,
                                       enum wps_request_type req_type)
 {
        struct wpabuf *ie;
-       u16 methods;
+       u16 methods = 0;
 
        wpa_printf(MSG_DEBUG, "WPS: Building WPS IE for Probe Request");
 
@@ -443,34 +443,31 @@ struct wpabuf * wps_build_probe_req_ie(int pbc, struct wps_device_data *dev,
        if (ie == NULL)
                return NULL;
 
-       if (pbc) {
-               methods = WPS_CONFIG_PUSHBUTTON;
+       methods |= WPS_CONFIG_PUSHBUTTON;
 #ifdef CONFIG_WPS2
-               /*
-                * TODO: At least in theory, should figure out whether this
-                * Probe Request was triggered with physical or virtual
-                * pushbutton.
-                */
-               methods |= WPS_CONFIG_VIRT_PUSHBUTTON;
+       /*
+        * TODO: Should figure out whether this device has a physical or
+        * virtual pushbutton.
+        */
+       methods |= WPS_CONFIG_VIRT_PUSHBUTTON;
 #endif /* CONFIG_WPS2 */
-       } else {
-               /*
-                * TODO: At least in theory, should figure out whether this
-                * Probe Request was triggered using physical or virtual
-                * display.
-                */
-               methods = WPS_CONFIG_LABEL | WPS_CONFIG_DISPLAY |
+
+       /*
+        * TODO: Should figure out whether this Probe Request was triggered
+        * using physical or virtual display. Also, if the device has a PIN on
+        * a label, that should be indicated here.
+        */
+       methods |= WPS_CONFIG_DISPLAY |
 #ifdef CONFIG_WPS2
-                       WPS_CONFIG_VIRT_DISPLAY |
+               WPS_CONFIG_VIRT_DISPLAY |
 #endif /* CONFIG_WPS2 */
-                       WPS_CONFIG_KEYPAD;
+               WPS_CONFIG_KEYPAD;
 #ifdef CONFIG_WPS_UFD
-               methods |= WPS_CONFIG_USBA;
+       methods |= WPS_CONFIG_USBA;
 #endif /* CONFIG_WPS_UFD */
 #ifdef CONFIG_WPS_NFC
-               methods |= WPS_CONFIG_NFC_INTERFACE;
+       methods |= WPS_CONFIG_NFC_INTERFACE;
 #endif /* CONFIG_WPS_NFC */
-       }
 
        if (wps_build_version(ie) ||
            wps_build_req_type(ie, req_type) ||