aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJouni Malinen <jouni.malinen@atheros.com>2010-07-06 19:58:15 (GMT)
committerJouni Malinen <j@w1.fi>2010-09-05 14:23:30 (GMT)
commit940a68159731a7681ded767edd6561c628d52332 (patch)
tree9af2af20fb97a975ddb07ba31725624cd1b2f60e
parentb2f70aa2ea790399e235b8184d4db2538df6d0d8 (diff)
downloadhostap-07-940a68159731a7681ded767edd6561c628d52332.zip
hostap-07-940a68159731a7681ded767edd6561c628d52332.tar.gz
hostap-07-940a68159731a7681ded767edd6561c628d52332.tar.bz2
WPS: Reduce client timeout with EAP-WSC to avoid long wait
This works around issues with EAP-Failure getting lost for some reason. Instead of waiting up to 60 seconds on a timeout, 30 second timeout is now used and whenever the provisioning step has been completed (either successfully or unsuccessfully), this timeout is reduced to 2 seconds. (cherry picked from commit 9301f6515e971a24cb99fc21a272147f3ee1bc9e)
-rw-r--r--src/eap_peer/eap_wsc.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/src/eap_peer/eap_wsc.c b/src/eap_peer/eap_wsc.c
index 9a0354e..8317f72 100644
--- a/src/eap_peer/eap_wsc.c
+++ b/src/eap_peer/eap_wsc.c
@@ -226,6 +226,10 @@ static void * eap_wsc_init(struct eap_sm *sm)
cfg.pin, cfg.pin_len, 0);
}
+ /* Use reduced client timeout for WPS to avoid long wait */
+ if (sm->ClientTimeout > 30)
+ sm->ClientTimeout = 30;
+
return data;
}
@@ -381,6 +385,7 @@ static struct wpabuf * eap_wsc_process(struct eap_sm *sm, void *priv,
u16 message_length = 0;
enum wps_process_res res;
struct wpabuf tmpbuf;
+ struct wpabuf *r;
pos = eap_hdr_validate(EAP_VENDOR_WFA, EAP_VENDOR_TYPE_WSC, reqData,
&len);
@@ -506,7 +511,13 @@ send_msg:
}
eap_wsc_state(data, MESG);
- return eap_wsc_build_msg(data, ret, id);
+ r = eap_wsc_build_msg(data, ret, id);
+ if (data->state == FAIL && ret->methodState == METHOD_DONE) {
+ /* Use reduced client timeout for WPS to avoid long wait */
+ if (sm->ClientTimeout > 2)
+ sm->ClientTimeout = 2;
+ }
+ return r;
}