Wireless Daemon for Linux
 help / color / mirror / Atom feed
From: Andrew Zaborowski <andrew.zaborowski@intel.com>
To: iwd@lists.01.org
Subject: [PATCH 02/11] eap: Re-send Identity Request on EAPoL-Start
Date: Thu, 27 Aug 2020 20:14:44 +0200	[thread overview]
Message-ID: <20200827181453.61823-2-andrew.zaborowski@intel.com> (raw)
In-Reply-To: <20200827181453.61823-1-andrew.zaborowski@intel.com>

[-- Attachment #1: Type: text/plain, Size: 1942 bytes --]

It looks like clients sometimes miss our unsolicited Identity Request
and need a resend.
---
 src/eap.c   | 12 ++++++++++--
 src/eapol.c | 12 ++++++++----
 2 files changed, 18 insertions(+), 6 deletions(-)

diff --git a/src/eap.c b/src/eap.c
index fcc18c77..dea0c3cf 100644
--- a/src/eap.c
+++ b/src/eap.c
@@ -245,10 +245,18 @@ void eap_start(struct eap_state *eap)
 {
 	uint8_t buf[5];
 
-	L_WARN_ON(!eap->method || !eap->authenticator || eap->identity);
+	L_WARN_ON(!eap->method || !eap->authenticator);
 
+	/*
+	 * Until we've received the Identity response we can resend the
+	 * Identity request with a constant ID on EAPoL-Start.
+	 */
+	if (eap->identity)
+		return;
+
+	eap->last_id = 1;
 	buf[4] = EAP_TYPE_IDENTITY;
-	eap_send_packet(eap, EAP_CODE_REQUEST, ++eap->last_id, buf, 5);
+	eap_send_packet(eap, EAP_CODE_REQUEST, eap->last_id, buf, 5);
 }
 
 void __eap_handle_request(struct eap_state *eap, uint16_t id,
diff --git a/src/eapol.c b/src/eapol.c
index 686187c6..2d339163 100644
--- a/src/eapol.c
+++ b/src/eapol.c
@@ -2239,14 +2239,18 @@ static void eapol_rx_auth_packet(uint16_t proto, const uint8_t *from,
 
 	case 1:	/* EAPOL-Start */
 		/*
-		 * The supplicant might have sent an EAPoL-Start even before
-		 * we queued our EAP Identity Request, so this should happen
-		 * mostly while we wait for the EAP Identity Response or before.
-		 * It's safe to ignore this frame in either case.
+		 * The supplicant may have sent an EAPoL-Start even before
+		 * we queued our EAP Identity Request or it may have missed our
+		 * early Identity Request and may need a retransmission.  Tell
+		 * sm->eap so it can decide whether to send a new Identity
+		 * Request or ignore this.
 		 *
 		 * TODO: if we're already past the full handshake, send a
 		 * new msg 1/4.
 		 */
+		if (sm->eap)
+			eap_start(sm->eap);
+
 		break;
 
 	case 3: /* EAPOL-Key */
-- 
2.25.1

  reply	other threads:[~2020-08-27 18:14 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-08-27 18:14 [PATCH 01/11] wscutil: Add wsc_build_beacon Andrew Zaborowski
2020-08-27 18:14 ` Andrew Zaborowski [this message]
2020-08-27 18:53   ` [PATCH 02/11] eap: Re-send Identity Request on EAPoL-Start Denis Kenzior
2020-08-27 20:47     ` Andrew Zaborowski
2020-08-27 20:38       ` Denis Kenzior
2020-08-27 23:24         ` Andrew Zaborowski
2020-08-27 18:14 ` [PATCH 03/11] eap-wsc: In WSC-R read UUID-E from settings Andrew Zaborowski
2020-08-27 19:03   ` Denis Kenzior
2020-08-27 18:14 ` [PATCH 04/11] ap: Move AP parameters to a struct Andrew Zaborowski
2020-08-27 19:00   ` Denis Kenzior
2020-08-27 18:14 ` [PATCH 05/11] ap: Drop unused variable Andrew Zaborowski
2020-08-27 18:14 ` [PATCH 06/11] ap: Fix incoming Probe Request BSSID check Andrew Zaborowski
2020-08-27 18:14 ` [PATCH 07/11] ap: Stop ongoing handshake on reassociation Andrew Zaborowski
2020-08-27 19:11   ` Denis Kenzior
2020-08-27 20:40     ` Andrew Zaborowski
2020-08-27 18:14 ` [PATCH 08/11] ap: Push Button mode API and beacon changes Andrew Zaborowski
2020-08-27 19:42   ` Denis Kenzior
2020-08-27 20:57     ` Andrew Zaborowski
2020-08-27 20:51       ` Denis Kenzior
2020-08-27 18:14 ` [PATCH 09/11] ap: WSC Probe Request processing logic Andrew Zaborowski
2020-08-27 18:14 ` [PATCH 10/11] ap: Parse WSC PBC association request and build response Andrew Zaborowski
2020-08-27 18:14 ` [PATCH 11/11] ap: Start EAP-WSC authentication with WSC enrollees Andrew Zaborowski
2020-08-27 19:16 ` [PATCH 01/11] wscutil: Add wsc_build_beacon Denis Kenzior
2020-08-27 23:18   ` Andrew Zaborowski
2020-08-28  0:12     ` Denis Kenzior

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200827181453.61823-2-andrew.zaborowski@intel.com \
    --to=andrew.zaborowski@intel.com \
    --cc=iwd@lists.01.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox