From 1a64c4b771c9cb69bfd815ff35ee4d1f9115dd0f Mon Sep 17 00:00:00 2001 From: Andrew Zaborowski Date: Fri, 18 Nov 2016 01:24:53 +0100 Subject: [PATCH] eapol: Send EAPOL-Start if AP starts 4-Way Handshake Make the use of EAPOL-Start the default and send it when configured for 8021x and either we receive no EAPOL-EAP from from the AP before timeout, or if the AP tries to start a 4-Way Handshake. --- src/eapol.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/eapol.c b/src/eapol.c index bb08f178..08d57749 100644 --- a/src/eapol.c +++ b/src/eapol.c @@ -760,6 +760,7 @@ struct eapol_sm *eapol_sm_new(struct handshake_state *hs) sm = l_new(struct eapol_sm, 1); sm->handshake = hs; + sm->use_eapol_start = true; return sm; } @@ -1532,8 +1533,18 @@ static void eapol_rx_packet(struct eapol_sm *sm, break; case 3: /* EAPOL-Key */ - if (sm->eap) /* An EAP negotiation in progress? */ + if (sm->eap) { + /* + * Either this is an error (EAP negotiation in + * progress) or the server is giving us a chance to + * use a cached PMK. We don't yet cache PMKs so + * send an EAPOL-Start if we haven't sent one yet. + */ + if (sm->eapol_start_timeout) + send_eapol_start(NULL, sm); + return; + } if (!sm->handshake->have_pmk) return;