aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJouni Malinen <jouni.malinen@atheros.com>2010-07-06 22:29:33 (GMT)
committerJouni Malinen <j@w1.fi>2010-09-05 14:24:57 (GMT)
commitee6d6679a5d2493b229212bd51499eaedcea6890 (patch)
treecc1e38f162177b6d0815dfd1deafad3058bdf1f1
parent940a68159731a7681ded767edd6561c628d52332 (diff)
downloadhostap-07-ee6d6679a5d2493b229212bd51499eaedcea6890.zip
hostap-07-ee6d6679a5d2493b229212bd51499eaedcea6890.tar.gz
hostap-07-ee6d6679a5d2493b229212bd51499eaedcea6890.tar.bz2
WPS: Move from WLAN_STA_MAYBE_WPS to WLAN_STA_WPS based on EAP messages
If the station does not include WSC IE in Association Request, it is marked with WLAN_STA_MAYBE_WPS flag. We can update that to WLAN_STA_WPS if the station uses either of the WPS identity strings. This enables some workarounds for WPS stations. (cherry picked from commit 4e22adb4d1e6e300e76a107246e2047c0195aad3)
-rw-r--r--src/ap/ieee802_1x.c25
1 files changed, 25 insertions, 0 deletions
diff --git a/src/ap/ieee802_1x.c b/src/ap/ieee802_1x.c
index 4ab1001..eb160f8 100644
--- a/src/ap/ieee802_1x.c
+++ b/src/ap/ieee802_1x.c
@@ -23,6 +23,7 @@
#include "radius/radius.h"
#include "radius/radius_client.h"
#include "eap_server/eap.h"
+#include "eap_common/eap_wsc_common.h"
#include "eapol_auth/eapol_auth_sm.h"
#include "eapol_auth/eapol_auth_sm_i.h"
#include "hostapd.h"
@@ -1455,6 +1456,30 @@ static void ieee802_1x_rekey(void *eloop_ctx, void *timeout_ctx)
static void ieee802_1x_eapol_send(void *ctx, void *sta_ctx, u8 type,
const u8 *data, size_t datalen)
{
+#ifdef CONFIG_WPS
+ struct sta_info *sta = sta_ctx;
+
+ if ((sta->flags & (WLAN_STA_WPS | WLAN_STA_MAYBE_WPS)) ==
+ WLAN_STA_MAYBE_WPS) {
+ const u8 *identity;
+ size_t identity_len;
+ struct eapol_state_machine *sm = sta->eapol_sm;
+
+ identity = eap_get_identity(sm->eap, &identity_len);
+ if (identity &&
+ ((identity_len == WSC_ID_ENROLLEE_LEN &&
+ os_memcmp(identity, WSC_ID_ENROLLEE,
+ WSC_ID_ENROLLEE_LEN) == 0) ||
+ (identity_len == WSC_ID_REGISTRAR_LEN &&
+ os_memcmp(identity, WSC_ID_REGISTRAR,
+ WSC_ID_REGISTRAR_LEN) == 0))) {
+ wpa_printf(MSG_DEBUG, "WPS: WLAN_STA_MAYBE_WPS -> "
+ "WLAN_STA_WPS");
+ sta->flags |= WLAN_STA_WPS;
+ }
+ }
+#endif /* CONFIG_WPS */
+
ieee802_1x_send(ctx, sta_ctx, type, data, datalen);
}