Skip to contentSkip to conversation

Possible MFP problem

DISCUSSION Albert Pretorius 2 participants 2 messages Apr 1, 2020 – Apr 2, 2020 1 message not in the archive

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

#1 lore raw

HiI was on IRC earlier about this problem: my new ZyXel router (and aruba access point) does not connect:
iwctl station wlan0 connect NetScannerOperation failed
In dmesg:[43884.555390] wlan0: authenticate with b8:d5:26:23:09:56

[43884.621472] wlan0: send auth to b8:d5:26:23:09:56 (try 1/3)
[43884.623257] wlan0: authenticated
[43884.626163] wlan0: associate with b8:d5:26:23:09:56 (try 1/3)
[43884.630009] wlan0: RX AssocResp from b8:d5:26:23:09:56 (capab=0x411 status=0 aid=1)
[43884.632790] wlan0: associated
[43884.656703] wlan0: deauthenticating from b8:d5:26:23:09:56 by local choice (Reason: 1=UNSPECIFIED)

The iwd debug logging up to failuret:src/network.c:network_connect()
src/network.c:network_connect_psk() ask_passphrase: false
src/station.c:station_enter_state() Old State: disconnected, new state: connecting
src/scan.c:scan_notify() Scan notification Trigger Scan(33)
src/station.c:station_netdev_event() Associating
src/scan.c:scan_notify() Scan notification New Scan Results(34)
src/netdev.c:netdev_link_notify() event 16 on ifindex 4
src/netdev.c:netdev_mlme_notify() MLME notification New Station(19)
src/netdev.c:netdev_mlme_notify() MLME notification Authenticate(37)
src/netdev.c:netdev_authenticate_event()
src/netdev.c:netdev_mlme_notify() MLME notification Associate(38)
src/netdev.c:netdev_associate_event()
src/netdev.c:netdev_mlme_notify() MLME notification Connect(46)
src/netdev.c:netdev_connect_event()
src/netdev.c:netdev_link_notify() event 16 on ifindex 4
src/netdev.c:netdev_link_notify() event 16 on ifindex 4
src/netdev.c:netdev_link_notify() event 16 on ifindex 4
src/netdev.c:netdev_link_notify() event 16 on ifindex 4
src/netdev.c:netdev_unicast_notify() Unicast notification 129
src/netdev.c:netdev_control_port_frame_event()
src/eapol.c:eapol_handle_ptk_1_of_4() ifindex=4
src/netdev.c:netdev_control_port_frame_cb() 0
src/netdev.c:netdev_unicast_notify() Unicast notification 129
src/netdev.c:netdev_control_port_frame_event()
src/eapol.c:eapol_handle_ptk_3_of_4() ifindex=4
src/netdev.c:netdev_set_gtk() 4
src/netdev.c:netdev_set_igtk() 4
src/station.c:station_handshake_event() Setting keys
src/netdev.c:netdev_set_tk() 4
src/netdev.c:netdev_control_port_frame_cb() 0
New Key for Group Mgmt failed for ifindex: 4
I noticed in debug log that the first difference between this new router and tethered mobile phone is this:src/netdev.c:netdev_set_igtk() 4

So being misguided and industrious I commented out the callback setting for IGTK at:https://git.kernel.org/pub/scm/network/wireless/iwd.git/tree/src/handshake.c#n72 which works around the problem for me.I reverted that patch and created /etc/iwd/main.conf with:[General]
ManagementFrameProtection=0

which works but with the caveat that I now have to manually do iwctl connect and type the password in.

I attached the pcap and screen capture at the time of the failed connection attempt (unfortunately the pcap seems to be missing events that are on screen which is why I include both). Please let me know if any more information is needed. Any help greatly appreciated.
many thankscheersalbert
ps. fwiw wpa_supplicant works fine, but I am not keen to use it.

#2 lore raw

Hi Albert,

Quoted 4 lines · Albert Pretorius

Hi
I was on IRC earlier about this problem: my new ZyXel router (and aruba access point) does not connect:

<snip>

Quoted 3 lines

src/netdev.c:netdev_control_port_frame_cb() 0
New Key for Group Mgmt failed for ifindex: 4

So from the pcap log I was able to discern that the kernel is replying with a -EINVAL here, which suggests that some of the info we're getting from the AP is likely invalid.

I have heard reports of some routers sending a key index that is improperly formatted (i.e. in big endian and not little endian). I think recent versions of wpa_s have a workaround for this.

If you're able, can you apply the attached patch on top of iwd (and ell) git HEAD and tell me if this solves this issue?

<snip>

Quoted 2 lines

which works but with the caveat that I now have to manually do iwctl connect and type the password in.

strange. This setting should have no effect on iwctl or any other behavior. It simply picks whether BIP is advertised as a local capability to the AP.

Regards,
-Denis

From fd6820de47b7566e2fa9e6f11ebe35efa94c4cfa Mon Sep 17 00:00:00 2001
From: Denis Kenzior <[email protected]>
Date: Thu, 2 Apr 2020 00:45:55 -0500
Subject: [PATCH] netdev: work around APs that send igtk in big endian

---
 src/netdev.c | 5 +++++
 1 file changed, 5 insertions(+)
src/netdev.c +5 -0
index 799f01e3b332..5587daff2d79 100644
@@ -1297,6 +1297,11 @@ static void netdev_set_igtk(struct handshake_state *hs, uint16_t key_index,
 		return;
 	}
 
+	if (key_index == 0x0400 || key_index == 0x0500) {
+		l_warn("Received a key index that is likely in big endian");
+		key_index = bswap_16(key_index);
+	}
+
 	msg = nl80211_build_new_key_group(netdev->index, cipher, key_index,
 					igtk_buf, igtk_len, ipn, ipn_len, NULL);
 
Signature · 1 line
2.21.0