[PATCH] Don't use 802.11r Fast Transition if the driver doesn't support it

Alex Henrie <[email protected]>
Newsgroups gmane.linux.drivers.hostap
Message-ID <[email protected]>
Since version 1.20, NetworkManager supports 802.11r Fast Transition by
passing both "wpa-psk-sha256" and "ft-psk" to wpa_supplicant as possible
authentication mechanisms. However, wireless adapters such as the
Raspberry Pi 3B's BCM43438 do not support Fast Transition and fail to
connect when wpa_supplicant tries to use it instead of ordinary (slow)
authentication. This patch skips over "ft-psk" in
wpa_supplicant_set_suites if the user's hardware doesn't support it,
making the latest NetworkManager work seamlessly on the Raspberry Pi.

There was already a check in wpa_supplicant_set_suites that disables
Fast Transition if neither SME nor IES is available. However, it is
evident that support for SME or IES is a necessary but not sufficient
condition for supporting Fast Transition.

Signed-off-by: Alex Henrie <[email protected]>
---
 wpa_supplicant/wpa_supplicant.c | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/wpa_supplicant/wpa_supplicant.c b/wpa_supplicant/wpa_supplicant.c
index 634fb290e..567dbfe77 100644
--- a/wpa_supplicant/wpa_supplicant.c
+++ b/wpa_supplicant/wpa_supplicant.c
@@ -1460,8 +1460,15 @@ int wpa_supplicant_set_suites(struct wpa_supplicant *wpa_s,
 #endif /* CONFIG_SAE */
 #ifdef CONFIG_IEEE80211R
 	if (!(wpa_s->drv_flags & (WPA_DRIVER_FLAGS_SME |
-				  WPA_DRIVER_FLAGS_UPDATE_FT_IES)))
+				  WPA_DRIVER_FLAGS_UPDATE_FT_IES))) {
 		sel &= ~WPA_KEY_MGMT_FT;
+	} else {
+		if (!(wpa_s->drv_flags & WPA_DRIVER_FLAGS_4WAY_HANDSHAKE_8021X))
+			sel &= ~(WPA_KEY_MGMT_FT_IEEE8021X |
+				 WPA_KEY_MGMT_FT_IEEE8021X_SHA384);
+		if (!(wpa_s->drv_flags & WPA_DRIVER_FLAGS_4WAY_HANDSHAKE_PSK))
+			sel &= ~WPA_KEY_MGMT_FT_PSK;
+	}
 #endif /* CONFIG_IEEE80211R */
 	if (0) {
 #ifdef CONFIG_IEEE80211R
-- 
2.25.1
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.