]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
WPS: Do not advertise support for WEP in WPS 2.0 build
authorJouni Malinen <jouni.malinen@atheros.com>
Thu, 4 Nov 2010 15:37:20 +0000 (17:37 +0200)
committerJouni Malinen <j@w1.fi>
Thu, 4 Nov 2010 15:37:20 +0000 (17:37 +0200)
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.

src/wps/wps_attr_build.c

index 681c465c16d36c9e1deb4f7721c25f277198924a..9196e5b6b2a13f506e516cbec66660ba489d1b81 100644 (file)
@@ -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;
 }