aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJouni Malinen <jouni.malinen@atheros.com>2009-05-06 07:56:18 (GMT)
committerJouni Malinen <j@w1.fi>2009-11-22 08:49:37 (GMT)
commit14c5bc5cdcd2454fece4511028139f310caa3560 (patch)
tree9cb8d294293ce38c8f3e643cbc6c939a9206ad78
parent1985be7e409d1ff7055f7a05c593c97e7bd58513 (diff)
downloadhostap-06-14c5bc5cdcd2454fece4511028139f310caa3560.zip
hostap-06-14c5bc5cdcd2454fece4511028139f310caa3560.tar.gz
hostap-06-14c5bc5cdcd2454fece4511028139f310caa3560.tar.bz2
WPS: Add a workaround for auth/encr type flags mismatches
Some deployed implementations seem to advertise incorrect information in this attribute. For example, Linksys WRT350N seems to have a byteorder bug that breaks this negotiation. In order to interoperate with existing implementations, assume that the Enrollee supports everything we do. (cherry picked from commit 826fff182f36fa58418d1c796d6a7c6307b12a14)
-rw-r--r--src/wps/wps_registrar.c32
1 files changed, 31 insertions, 1 deletions
diff --git a/src/wps/wps_registrar.c b/src/wps/wps_registrar.c
index cc03f6d..ce70547 100644
--- a/src/wps/wps_registrar.c
+++ b/src/wps/wps_registrar.c
@@ -23,6 +23,7 @@
#include "wps_dev_attr.h"
#include "wps_upnp.h"
+#define WPS_WORKAROUNDS
struct wps_uuid_pin {
struct wps_uuid_pin *next;
@@ -1678,7 +1679,21 @@ static int wps_process_auth_type_flags(struct wps_data *wps, const u8 *auth)
wpa_printf(MSG_DEBUG, "WPS: No match in supported "
"authentication types (own 0x%x Enrollee 0x%x)",
wps->wps->auth_types, auth_types);
+#ifdef WPS_WORKAROUNDS
+ /*
+ * Some deployed implementations seem to advertise incorrect
+ * information in this attribute. For example, Linksys WRT350N
+ * seems to have a byteorder bug that breaks this negotiation.
+ * In order to interoperate with existing implementations,
+ * assume that the Enrollee supports everything we do.
+ */
+ wpa_printf(MSG_DEBUG, "WPS: Workaround - assume Enrollee "
+ "does not advertise supported authentication types "
+ "correctly");
+ wps->auth_type = wps->wps->auth_types;
+#else /* WPS_WORKAROUNDS */
return -1;
+#endif /* WPS_WORKAROUNDS */
}
return 0;
@@ -1702,8 +1717,23 @@ static int wps_process_encr_type_flags(struct wps_data *wps, const u8 *encr)
wps->encr_type = wps->wps->encr_types & encr_types;
if (wps->encr_type == 0) {
wpa_printf(MSG_DEBUG, "WPS: No match in supported "
- "encryption types");
+ "encryption types (own 0x%x Enrollee 0x%x)",
+ wps->wps->encr_types, encr_types);
+#ifdef WPS_WORKAROUNDS
+ /*
+ * Some deployed implementations seem to advertise incorrect
+ * information in this attribute. For example, Linksys WRT350N
+ * seems to have a byteorder bug that breaks this negotiation.
+ * In order to interoperate with existing implementations,
+ * assume that the Enrollee supports everything we do.
+ */
+ wpa_printf(MSG_DEBUG, "WPS: Workaround - assume Enrollee "
+ "does not advertise supported encryption types "
+ "correctly");
+ wps->encr_type = wps->wps->encr_types;
+#else /* WPS_WORKAROUNDS */
return -1;
+#endif /* WPS_WORKAROUNDS */
}
return 0;