From d3e01b9d71046cdf77e4ff4ee6226c9d90d2e549 Mon Sep 17 00:00:00 2001 From: Jouni Malinen Date: Tue, 28 Dec 2010 12:09:14 +0200 Subject: [PATCH] Re-initialize EAP ClientTimeout on for each session ClientTimeout changes from EAP peer methods were not supposed to change behavior for other EAP peer methods or even other sessions of the same method. Re-initialize ClientTimeout whenever an EAP peer method is initialized to avoid this. This addresses problems where WPS (EAP-WSC) reduces the timeout and consecutive EAP runs may fail due to too small timeout. --- src/eap_peer/eap.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/eap_peer/eap.c b/src/eap_peer/eap.c index 482934ae8..330164ae0 100644 --- a/src/eap_peer/eap.c +++ b/src/eap_peer/eap.c @@ -37,6 +37,7 @@ #define STATE_MACHINE_DEBUG_PREFIX "EAP" #define EAP_MAX_AUTH_ROUNDS 50 +#define EAP_CLIENT_TIMEOUT_DEFAULT 60 static Boolean eap_sm_allowMethod(struct eap_sm *sm, int vendor, @@ -268,6 +269,8 @@ SM_STATE(EAP, GET_METHOD) goto nak; } + sm->ClientTimeout = EAP_CLIENT_TIMEOUT_DEFAULT; + wpa_printf(MSG_DEBUG, "EAP: Initialize selected EAP method: " "vendor %u method %u (%s)", sm->reqVendor, method, sm->m->name); @@ -1241,7 +1244,7 @@ struct eap_sm * eap_peer_sm_init(void *eapol_ctx, sm->eapol_ctx = eapol_ctx; sm->eapol_cb = eapol_cb; sm->msg_ctx = msg_ctx; - sm->ClientTimeout = 60; + sm->ClientTimeout = EAP_CLIENT_TIMEOUT_DEFAULT; sm->wps = conf->wps; os_memset(&tlsconf, 0, sizeof(tlsconf));