aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJouni Malinen <jouni.malinen@atheros.com>2010-11-04 15:37:20 (GMT)
committerJouni Malinen <j@w1.fi>2010-11-04 15:37:20 (GMT)
commit7b23f0f3c870262725795763bdbad0a86b4cf34e (patch)
treebea58b9c61db5bb163953a043a2c6425af827cf5
parentc7c0ddfd91d7118063ba85100900144ed11e5862 (diff)
downloadhostap-7b23f0f3c870262725795763bdbad0a86b4cf34e.zip
hostap-7b23f0f3c870262725795763bdbad0a86b4cf34e.tar.gz
hostap-7b23f0f3c870262725795763bdbad0a86b4cf34e.tar.bz2
WPS: Do not advertise support for WEP in WPS 2.0 build
There is no point in advertising support for WEP or Shared Key authentication if we are going to reject those anyway based on WPS 2.0 rules.
-rw-r--r--src/wps/wps_attr_build.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/src/wps/wps_attr_build.c b/src/wps/wps_attr_build.c
index 681c465..9196e5b 100644
--- a/src/wps/wps_attr_build.c
+++ b/src/wps/wps_attr_build.c
@@ -254,20 +254,28 @@ int wps_build_registrar_nonce(struct wps_data *wps, struct wpabuf *msg)
int wps_build_auth_type_flags(struct wps_data *wps, struct wpabuf *msg)
{
+ u16 auth_types = WPS_AUTH_TYPES;
+#ifdef CONFIG_WPS2
+ auth_types &= ~WPS_AUTH_SHARED;
+#endif /* CONFIG_WPS2 */
wpa_printf(MSG_DEBUG, "WPS: * Authentication Type Flags");
wpabuf_put_be16(msg, ATTR_AUTH_TYPE_FLAGS);
wpabuf_put_be16(msg, 2);
- wpabuf_put_be16(msg, WPS_AUTH_TYPES);
+ wpabuf_put_be16(msg, auth_types);
return 0;
}
int wps_build_encr_type_flags(struct wps_data *wps, struct wpabuf *msg)
{
+ u16 encr_types = WPS_ENCR_TYPES;
+#ifdef CONFIG_WPS2
+ encr_types &= ~WPS_ENCR_WEP;
+#endif /* CONFIG_WPS2 */
wpa_printf(MSG_DEBUG, "WPS: * Encryption Type Flags");
wpabuf_put_be16(msg, ATTR_ENCR_TYPE_FLAGS);
wpabuf_put_be16(msg, 2);
- wpabuf_put_be16(msg, WPS_ENCR_TYPES);
+ wpabuf_put_be16(msg, encr_types);
return 0;
}