WPS 2.0: Add tool for testing protocol extensibility

This is disabled by default and can be enabled by defining
CONFIG_WPS_EXTENSIBILITY_TESTING.
This commit is contained in:
Jouni Malinen 2010-06-10 22:25:51 -07:00 committed by Jouni Malinen
parent 4a34969824
commit c15a854aec
2 changed files with 13 additions and 1 deletions

View file

@ -178,6 +178,13 @@ int wps_build_version2(struct wpabuf *msg)
wpabuf_put_be16(msg, ATTR_VERSION2); wpabuf_put_be16(msg, ATTR_VERSION2);
wpabuf_put_be16(msg, 1); wpabuf_put_be16(msg, 1);
wpabuf_put_u8(msg, WPS_VERSION); wpabuf_put_u8(msg, WPS_VERSION);
#ifdef CONFIG_WPS_EXTENSIBILITY_TESTING
wpa_printf(MSG_DEBUG, "WPS: * Extensibility Testing - extra "
"attribute";
wpabuf_put_be16(msg, ATTR_EXTENSIBILITY_TEST);
wpabuf_put_be16(msg, 1);
wpabuf_put_u8(msg, 42);
#endif /* CONFIG_WPS_EXTENSIBILITY_TESTING */
return 0; return 0;
} }

View file

@ -15,7 +15,11 @@
#ifndef WPS_DEFS_H #ifndef WPS_DEFS_H
#define WPS_DEFS_H #define WPS_DEFS_H
#ifdef CONFIG_WPS_EXTENSIBILITY_TESTING
#define WPS_VERSION 0x57
#else /* CONFIG_WPS_EXTENSIBILITY_TESTING */
#define WPS_VERSION 0x20 #define WPS_VERSION 0x20
#endif /* CONFIG_WPS_EXTENSIBILITY_TESTING */
/* Diffie-Hellman 1536-bit MODP Group; RFC 3526, Group 5 */ /* Diffie-Hellman 1536-bit MODP Group; RFC 3526, Group 5 */
#define WPS_DH_GROUP 5 #define WPS_DH_GROUP 5
@ -130,7 +134,8 @@ enum wps_attribute {
ATTR_VERSION2 = 0x1067, ATTR_VERSION2 = 0x1067,
ATTR_REQUEST_TO_ENROLL = 0x1068, ATTR_REQUEST_TO_ENROLL = 0x1068,
ATTR_AUTHORIZED_MACS = 0x1069, ATTR_AUTHORIZED_MACS = 0x1069,
ATTR_REQUESTED_DEV_TYPE = 0x106a ATTR_REQUESTED_DEV_TYPE = 0x106a,
ATTR_EXTENSIBILITY_TEST = 0x10fa /* _NOT_ defined in the spec */
}; };
/* Device Password ID */ /* Device Password ID */