aboutsummaryrefslogtreecommitdiffstats
path: root/src/wps/wps_defs.h
diff options
context:
space:
mode:
authorJouni Malinen <jouni.malinen@atheros.com>2010-09-22 02:51:23 (GMT)
committerJouni Malinen <j@w1.fi>2010-09-22 02:51:23 (GMT)
commitb4e34f2fdf2d6c5b5f33a412908a3d1aa7d13f56 (patch)
treeb8079b0ba39ba5c4904e49fe6ee1d6200d341344 /src/wps/wps_defs.h
parentab98525399f65fb90bb77f48882be1ed9ddacdf9 (diff)
downloadhostap-b4e34f2fdf2d6c5b5f33a412908a3d1aa7d13f56.zip
hostap-b4e34f2fdf2d6c5b5f33a412908a3d1aa7d13f56.tar.gz
hostap-b4e34f2fdf2d6c5b5f33a412908a3d1aa7d13f56.tar.bz2
WPS: Make testing operations configurable at runtime
Instead of build time options (CONFIG_WPS_TESTING_EXTRA_CRED and CONFIG_WPS_EXTENSIBILITY_TESTING), use a single build option (CONFIG_WPS_TESTING) and runtime configuration of which testing operations are enabled. This allows a single binary to be used for various tests. The runtime configuration can be done through control interface with wpa_cli/hostapd_cli commands: Enable extensibility tests: set wps_version_number 0x57 Disable extensibility tests (WPS2 build): set wps_version_number 0x20 Enable extra credential tests: set wps_testing_dummy_cred 1 Disable extra credential tests: set wps_testing_dummy_cred 0
Diffstat (limited to 'src/wps/wps_defs.h')
-rw-r--r--src/wps/wps_defs.h14
1 files changed, 10 insertions, 4 deletions
diff --git a/src/wps/wps_defs.h b/src/wps/wps_defs.h
index 719333a..868f8ad 100644
--- a/src/wps/wps_defs.h
+++ b/src/wps/wps_defs.h
@@ -15,16 +15,22 @@
#ifndef WPS_DEFS_H
#define WPS_DEFS_H
+#ifdef CONFIG_WPS_TESTING
+
+extern int wps_version_number;
+extern int wps_testing_dummy_cred;
+#define WPS_VERSION wps_version_number
+
+#else /* CONFIG_WPS_TESTING */
+
#ifdef CONFIG_WPS2
-#ifdef CONFIG_WPS_EXTENSIBILITY_TESTING
-#define WPS_VERSION 0x57
-#else /* CONFIG_WPS_EXTENSIBILITY_TESTING */
#define WPS_VERSION 0x20
-#endif /* CONFIG_WPS_EXTENSIBILITY_TESTING */
#else /* CONFIG_WPS2 */
#define WPS_VERSION 0x10
#endif /* CONFIG_WPS2 */
+#endif /* CONFIG_WPS_TESTING */
+
/* Diffie-Hellman 1536-bit MODP Group; RFC 3526, Group 5 */
#define WPS_DH_GROUP 5