From 270c9a43e6433a2d6faebfbdd04d72d32239829c Mon Sep 17 00:00:00 2001 From: Jouni Malinen Date: Sat, 10 May 2014 16:15:20 +0300 Subject: [PATCH] Interworking: Allow FT to be used for connection This extends Interworking network selection to enable FT-EAP as an optional key_mgmt value to allow FT to be used instead of hardcoding WPA2-Enterprise without FT. Signed-off-by: Jouni Malinen --- wpa_supplicant/interworking.c | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/wpa_supplicant/interworking.c b/wpa_supplicant/interworking.c index f46c4cfc8..a8ecb8cc2 100644 --- a/wpa_supplicant/interworking.c +++ b/wpa_supplicant/interworking.c @@ -27,6 +27,7 @@ #include "bss.h" #include "scan.h" #include "notify.h" +#include "driver_i.h" #include "gas_query.h" #include "hs20_supplicant.h" #include "interworking.h" @@ -875,9 +876,23 @@ static void remove_duplicate_network(struct wpa_supplicant *wpa_s, static int interworking_set_hs20_params(struct wpa_supplicant *wpa_s, struct wpa_ssid *ssid) { - if (wpa_config_set(ssid, "key_mgmt", - wpa_s->conf->pmf != NO_MGMT_FRAME_PROTECTION ? - "WPA-EAP WPA-EAP-SHA256" : "WPA-EAP", 0) < 0) + const char *key_mgmt = NULL; +#ifdef CONFIG_IEEE80211R + int res; + struct wpa_driver_capa capa; + + res = wpa_drv_get_capa(wpa_s, &capa); + if (res == 0 && capa.key_mgmt & WPA_DRIVER_CAPA_KEY_MGMT_FT) { + key_mgmt = wpa_s->conf->pmf != NO_MGMT_FRAME_PROTECTION ? + "WPA-EAP WPA-EAP-SHA256 FT-EAP" : + "WPA-EAP FT-EAP"; + } +#endif /* CONFIG_IEEE80211R */ + + if (!key_mgmt) + key_mgmt = wpa_s->conf->pmf != NO_MGMT_FRAME_PROTECTION ? + "WPA-EAP WPA-EAP-SHA256" : "WPA-EAP"; + if (wpa_config_set(ssid, "key_mgmt", key_mgmt, 0) < 0) return -1; if (wpa_config_set(ssid, "proto", "RSN", 0) < 0) return -1;