]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
WPS UFD: Make build conditional on CONFIG_WPS_UFD=y
authorJouni Malinen <j@w1.fi>
Thu, 26 Feb 2009 20:01:36 +0000 (22:01 +0200)
committerJouni Malinen <j@w1.fi>
Thu, 26 Feb 2009 20:01:36 +0000 (22:01 +0200)
Not all embedded devices have USB interface and it is useful to be able
to remove unneeded functionality from the binary. In addition, the
current implementation has some UNIX specific calls in it which may make
it not compile cleanly on all target systems.

hostapd/Makefile
src/wps/wps.c
src/wps/wps_common.c
src/wps/wps_enrollee.c
wpa_supplicant/Makefile

index c5f12f776ae5bed6a928b3eff3fd188c71c56b89..9c44edb1ebad1b743c25f1a0cc91054925e2fbc6 100644 (file)
@@ -313,12 +313,16 @@ OBJS += ../src/wps/wps_attr_process.o
 OBJS += ../src/wps/wps_dev_attr.o
 OBJS += ../src/wps/wps_enrollee.o
 OBJS += ../src/wps/wps_registrar.o
-OBJS += ../src/wps/wps_ufd.o
 NEED_DH_GROUPS=y
 NEED_SHA256=y
 NEED_CRYPTO=y
 NEED_BASE64=y
 
+ifdef CONFIG_WPS_UFD
+CFLAGS += -DCONFIG_WPS_UFD
+OBJS += ../src/wps/wps_ufd.o
+endif
+
 ifdef CONFIG_WPS_UPNP
 CFLAGS += -DCONFIG_WPS_UPNP
 OBJS += ../src/wps/wps_upnp.o
index d26cb3bc888dab35e856346152bcf70b11f04573..79f3512c628b3aa91a74bfdb96d26da3e664fb63 100644 (file)
@@ -299,9 +299,13 @@ struct wpabuf * wps_build_probe_req_ie(int pbc, struct wps_device_data *dev,
 
        if (pbc)
                methods = WPS_CONFIG_PUSHBUTTON;
-       else
+       else {
                methods = WPS_CONFIG_LABEL | WPS_CONFIG_DISPLAY |
-                       WPS_CONFIG_KEYPAD | WPS_CONFIG_USBA;
+                       WPS_CONFIG_KEYPAD;
+#ifdef CONFIG_WPS_UFD
+               methods |= WPS_CONFIG_USBA;
+#endif /* CONFIG_WPS_UFD */
+       }
 
        if (wps_build_version(ie) ||
            wps_build_req_type(ie, req_type) ||
index 3e4ec558d7c7a6951b0967af3df332494b731043..a2c88adead1d0cd33db64430c4aae4c5803dfcfd 100644 (file)
@@ -518,8 +518,10 @@ int wps_process_oob(struct wps_context *wps, int registrar)
 
 struct oob_device_data * wps_get_oob_device(char *device_type)
 {
+#ifdef CONFIG_WPS_UFD
        if (os_strstr(device_type, "ufd") != NULL)
                return &oob_ufd_device_data;
+#endif /* CONFIG_WPS_UFD */
 
        return NULL;
 }
index 2c6d40486fe02d8b7f7aa71fe6df9bab5b1de3e1..3cfc8784ca8104aad6c583eec33c92f6b7ad7a89 100644 (file)
@@ -131,8 +131,10 @@ static struct wpabuf * wps_build_m1(struct wps_data *wps)
        if (msg == NULL)
                return NULL;
 
-       methods = WPS_CONFIG_LABEL | WPS_CONFIG_DISPLAY | WPS_CONFIG_KEYPAD |
-                 WPS_CONFIG_USBA;
+       methods = WPS_CONFIG_LABEL | WPS_CONFIG_DISPLAY | WPS_CONFIG_KEYPAD;
+#ifdef CONFIG_WPS_UFD
+       methods |= WPS_CONFIG_USBA;
+#endif /* CONFIG_WPS_UFD */
        if (wps->pbc)
                methods |= WPS_CONFIG_PUSHBUTTON;
 
index d7f21820aaca69b82545c7dc83f7c53a9f6f9650..83252223c9b1b5f4c33711b01a8fc8bc06ee2347 100644 (file)
@@ -521,13 +521,17 @@ OBJS += ../src/wps/wps_attr_process.o
 OBJS += ../src/wps/wps_dev_attr.o
 OBJS += ../src/wps/wps_enrollee.o
 OBJS += ../src/wps/wps_registrar.o
-OBJS += ../src/wps/wps_ufd.o
 OBJS_h += ../src/eap_server/eap_wsc.o
 CONFIG_IEEE8021X_EAPOL=y
 NEED_DH_GROUPS=y
 NEED_SHA256=y
 NEED_BASE64=y
 
+ifdef CONFIG_WPS_UFD
+CFLAGS += -DCONFIG_WPS_UFD
+OBJS += ../src/wps/wps_ufd.o
+endif
+
 ifdef CONFIG_WPS_UPNP
 CFLAGS += -DCONFIG_WPS_UPNP
 OBJS += ../src/wps/wps_upnp.o