aboutsummaryrefslogtreecommitdiffstats
path: root/src/eapol_supp
diff options
context:
space:
mode:
authorJouni Malinen <j@w1.fi>2012-08-26 20:01:26 (GMT)
committerJouni Malinen <j@w1.fi>2012-08-26 20:35:07 (GMT)
commit00e5e3d5099eac9e75e23056dbbb9add73f63b0a (patch)
tree84a797fbcb215bd80ba2650ba573cd2b2665cd48 /src/eapol_supp
parent2af4d404a8ba4a4b561258187dc9b7c465ee31ec (diff)
downloadhostap-00e5e3d5099eac9e75e23056dbbb9add73f63b0a.zip
hostap-00e5e3d5099eac9e75e23056dbbb9add73f63b0a.tar.gz
hostap-00e5e3d5099eac9e75e23056dbbb9add73f63b0a.tar.bz2
Disable network block temporarily on authentication failures
If 4-way handshake fails due to likely PSK failure or if EAP authentication fails, disable the network block temporarily. Use longer duration if multiple consecutive failures are seen. Signed-hostap: Jouni Malinen <j@w1.fi>
Diffstat (limited to 'src/eapol_supp')
-rw-r--r--src/eapol_supp/eapol_supp_sm.c8
-rw-r--r--src/eapol_supp/eapol_supp_sm.h5
2 files changed, 13 insertions, 0 deletions
diff --git a/src/eapol_supp/eapol_supp_sm.c b/src/eapol_supp/eapol_supp_sm.c
index 07ef83b..8503554 100644
--- a/src/eapol_supp/eapol_supp_sm.c
+++ b/src/eapol_supp/eapol_supp_sm.c
@@ -1920,3 +1920,11 @@ void eapol_sm_set_ext_pw_ctx(struct eapol_sm *sm,
if (sm && sm->eap)
eap_sm_set_ext_pw_ctx(sm->eap, ext);
}
+
+
+int eapol_sm_failed(struct eapol_sm *sm)
+{
+ if (sm == NULL)
+ return 0;
+ return !sm->eapSuccess && sm->eapFail;
+}
diff --git a/src/eapol_supp/eapol_supp_sm.h b/src/eapol_supp/eapol_supp_sm.h
index b69dd97..d2a4b94 100644
--- a/src/eapol_supp/eapol_supp_sm.h
+++ b/src/eapol_supp/eapol_supp_sm.h
@@ -278,6 +278,7 @@ void eapol_sm_invalidate_cached_session(struct eapol_sm *sm);
const char * eapol_sm_get_method_name(struct eapol_sm *sm);
void eapol_sm_set_ext_pw_ctx(struct eapol_sm *sm,
struct ext_password_data *ext);
+int eapol_sm_failed(struct eapol_sm *sm);
#else /* IEEE8021X_EAPOL */
static inline struct eapol_sm *eapol_sm_init(struct eapol_ctx *ctx)
{
@@ -373,6 +374,10 @@ static inline void eapol_sm_set_ext_pw_ctx(struct eapol_sm *sm,
struct ext_password_data *ext)
{
}
+static inline int eapol_sm_failed(struct eapol_sm *sm)
+{
+ return 0;
+}
#endif /* IEEE8021X_EAPOL */
#endif /* EAPOL_SUPP_SM_H */