]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
WPS: Allow testing mode to disable 2.0 functionality
authorJouni Malinen <j@w1.fi>
Sat, 28 Dec 2013 16:35:30 +0000 (18:35 +0200)
committerJouni Malinen <j@w1.fi>
Sun, 29 Dec 2013 08:00:32 +0000 (10:00 +0200)
Previously, wps_version_number was used only to test extensibility to
newer version numbers, but it can also be used to enable testing of
older versions (1.0), e.g., to avoid hitting some 2.0 specific
validation steps.

Signed-hostap: Jouni Malinen <j@w1.fi>

src/wps/wps_attr_build.c

index b2327544744fba0c431b945f035bbacbd878bf2a..336246eaf42a8fcf9e6e8ad37acab0746ef8dc7d 100644 (file)
@@ -201,6 +201,11 @@ int wps_build_wfa_ext(struct wpabuf *msg, int req_to_enroll,
 #ifdef CONFIG_WPS2
        u8 *len;
 
+#ifdef CONFIG_WPS_TESTING
+       if (WPS_VERSION == 0x10)
+               return 0;
+#endif /* CONFIG_WPS_TESTING */
+
        if (wpabuf_tailroom(msg) <
            7 + 3 + (req_to_enroll ? 3 : 0) +
            (auth_macs ? 2 + auth_macs_count * ETH_ALEN : 0))