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.
This commit is contained in:
Jouni Malinen 2010-12-28 12:09:14 +02:00 committed by Jouni Malinen
parent 9dac8c3eaf
commit d3e01b9d71

View file

@ -37,6 +37,7 @@
#define STATE_MACHINE_DEBUG_PREFIX "EAP" #define STATE_MACHINE_DEBUG_PREFIX "EAP"
#define EAP_MAX_AUTH_ROUNDS 50 #define EAP_MAX_AUTH_ROUNDS 50
#define EAP_CLIENT_TIMEOUT_DEFAULT 60
static Boolean eap_sm_allowMethod(struct eap_sm *sm, int vendor, static Boolean eap_sm_allowMethod(struct eap_sm *sm, int vendor,
@ -268,6 +269,8 @@ SM_STATE(EAP, GET_METHOD)
goto nak; goto nak;
} }
sm->ClientTimeout = EAP_CLIENT_TIMEOUT_DEFAULT;
wpa_printf(MSG_DEBUG, "EAP: Initialize selected EAP method: " wpa_printf(MSG_DEBUG, "EAP: Initialize selected EAP method: "
"vendor %u method %u (%s)", "vendor %u method %u (%s)",
sm->reqVendor, method, sm->m->name); 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_ctx = eapol_ctx;
sm->eapol_cb = eapol_cb; sm->eapol_cb = eapol_cb;
sm->msg_ctx = msg_ctx; sm->msg_ctx = msg_ctx;
sm->ClientTimeout = 60; sm->ClientTimeout = EAP_CLIENT_TIMEOUT_DEFAULT;
sm->wps = conf->wps; sm->wps = conf->wps;
os_memset(&tlsconf, 0, sizeof(tlsconf)); os_memset(&tlsconf, 0, sizeof(tlsconf));