From: Jouni Malinen Date: Sun, 10 Feb 2019 11:41:10 +0000 (+0200) Subject: RSN: Do not start preauthentication timer without candidates X-Git-Tag: hostap_2_8~385 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=02a0a23939b779e8e19c57b5bc8d8964ffd26ed9;p=thirdparty%2Fhostap.git RSN: Do not start preauthentication timer without candidates There is no need to schedule the postponed RSN preauthentication start if there are no candidates. Avoid wasting eloop resources for this. This is most useful for fuzz testing of the 4-way handshake implementation to avoid getting stuck waiting for this unnecessary one second time when using eloop to coordinate the Authenticator and Supplicant state machines. Signed-off-by: Jouni Malinen --- diff --git a/src/rsn_supp/wpa.c b/src/rsn_supp/wpa.c index 18f8c7158..6b27539e7 100644 --- a/src/rsn_supp/wpa.c +++ b/src/rsn_supp/wpa.c @@ -715,7 +715,9 @@ static void wpa_supplicant_key_neg_complete(struct wpa_sm *sm, * likelihood of the first preauth EAPOL-Start frame getting to * the target AP. */ - eloop_register_timeout(1, 0, wpa_sm_start_preauth, sm, NULL); + if (!dl_list_empty(&sm->pmksa_candidates)) + eloop_register_timeout(1, 0, wpa_sm_start_preauth, + sm, NULL); } if (sm->cur_pmksa && sm->cur_pmksa->opportunistic) {