Skip to contentSkip to conversation

vendor_quirks: add PMKID mismatch quirk

PATCH New Jan-Henrik Bruhn 1 participant 2 messages Oct 27

lore
Share & tools
lore
#0 lore raw

PATCH 1/2 vendor_quirks: add PMKID mismatch quirk

From: Jan-Henrik Bruhn <[email protected]>

pmkid_mismatch:
Extreme Networks APs running WiNG include a PMKID in message 1/4 of the FT-8021X 4-way handshake which does not match any PMKID IWD derives, even directly after a full EAP authentication. This quirk is intended to relax the PMKID check for these APs. They are identified by the Zebra Technologies OUI in their vendor IE.

---
 src/vendor_quirks.c | 9 +++++++++
 src/vendor_quirks.h | 1 +
 2 files changed, 10 insertions(+)
src/vendor_quirks.c +9 -0
index 4fba0c3..accd6b8 100644
@@ -45,6 +45,11 @@ static const struct {
 		{ 0x00, 0x0b, 0x86 },
 		{ .replay_counter_mismatch = true },
 	},
+	{
+		/* Zebra Technologies, WiNG APs now owned by Extreme */
+		{ 0x00, 0xa0, 0xf8 },
+		{ .pmkid_mismatch = true },
+	},
 };
 
 void vendor_quirks_append_for_oui(const uint8_t *oui,
@@ -62,6 +67,7 @@ void vendor_quirks_append_for_oui(const uint8_t *oui,
 				quirk->ignore_bss_tm_candidates;
 		quirks->replay_counter_mismatch |=
 				quirk->replay_counter_mismatch;
+		quirks->pmkid_mismatch |= quirk->pmkid_mismatch;
 	}
 }
 
@@ -77,6 +83,9 @@ const char *vendor_quirks_to_string(struct vendor_quirk quirks)
 	if (quirks.replay_counter_mismatch)
 		s += snprintf(pos, sizeof(out) - s, "ReplayCounterMismatch");
 
+	if (quirks.pmkid_mismatch)
+		s += snprintf(pos, sizeof(out) - s, "PmkidMismatch");
+
 	if (!s)
 		return NULL;
 
src/vendor_quirks.h +1 -0
index b5d726c..ab45c28 100644
@@ -29,6 +29,7 @@
 struct vendor_quirk {
 	bool ignore_bss_tm_candidates : 1;
 	bool replay_counter_mismatch : 1;
+	bool pmkid_mismatch : 1;
 };
 
 void vendor_quirks_append_for_oui(const uint8_t *oui,
Signature · 1 line
2.43.0
#1 lore raw

PATCH 2/2 eapol: use vendor quirk to relax PMKID check

From: Jan-Henrik Bruhn <[email protected]>

Extreme Networks APs running WiNG include a PMKID in message 1/4 of the FT-8021X handshake which IWD cannot validate. It does not match the PMKID derived from either half of the MSK (SHA1 or SHA256), nor PMKR0Name/PMKR1Name, and changes on every attempt. IWD treats this as a PMKSA mismatch and restarts EAP, which only results in another mismatch until the AP deauthenticates the station.

If EAP was just completed the PMK is fresh, so restarting EAP cannot help. The PMKID in 1/4 is also not covered by a MIC, whereas the PMKR1Name in 3/4 is, and is already validated. For APs with the pmkid_mismatch quirk, continue the handshake in this case.

---
Notes:

Seen with Extreme Networks APs (BSSID OUI 00:dc:b2, vendor IE OUI 00:a0:f8 type 5), FT-8021X and PEAPv0/MSCHAPv2 with Crypto-Binding. wpa_supplicant connects fine.

Without this patch (iwd 3.12), every attempt looks like this:

EAP completed with eapSuccess
eapol_handle_ptk_1_of_4() ifindex=9 handshake_state_pmkid_matches() PMKID did not match, trying SHA1 derivation eapol_handle_ptk_1_of_4() Authenticator sent a PMKID that didn't match
PEAP: tls_tx_handshake:1244 Sending a TLS_CLIENT_HELLO of 172 bytes
...
Received Deauthentication event, reason: 32770, from_ap: true

A debug build logged the received PMKIDs (fe890a12..., b7936fa1..., d3531a44...). With this patch 3/4 is accepted and the connection completes.

With FT-8021X removed from AKM selection (same APs, no patch) there is no PMKID mismatch and 802.1X connects fine, so this is specific to the FT-8021X implementation on these APs.

 src/eapol.c | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)
src/eapol.c +7 -2
index 372549c..d802adc 100644
@@ -1256,14 +1256,19 @@ static void eapol_handle_ptk_1_of_4(struct eapol_sm *sm,
 			goto error_unspecified;
 	} else if (pmkid) {
 		if (!handshake_state_pmkid_matches(sm->handshake, pmkid)) {
+			bool ignore = sm->eap_exchanged &&
+				sm->handshake->vendor_quirks.pmkid_mismatch;
+
 			l_debug("Authenticator sent a PMKID that didn't match");
 
 			/*
 			 * If the AP has a different PMKSA from ours and we
 			 * have means to create a new PMKSA through EAP then
-			 * try that, otherwise give up.
+			 * try that, otherwise give up.  Some APs send a PMKID
+			 * we can't derive even after a fresh EAP exchange, in
+			 * which case restarting EAP won't help.
 			 */
-			if (sm->eap) {
+			if (sm->eap && !ignore) {
 				__send_eapol_start(sm, unencrypted);
 				return;
 			}
Signature · 1 line
2.43.0