]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
Use per-interface type driver key_mgmt capabilities when possible
authorVeerendranath Jakkam <vjakkam@codeaurora.org>
Wed, 22 Apr 2020 07:24:35 +0000 (12:54 +0530)
committerJouni Malinen <j@w1.fi>
Tue, 12 May 2020 14:33:54 +0000 (17:33 +0300)
Use key_mgmt_iftype instead of key_mgmt when the specific interface type
is known by the context of the operation.

Use per interface type AKM capabilities in capa.key_mgmt_iftype array
based on the wpa_supplicant context instead of using capa.key_mgmt to
determine the driver AKM capability.

Signed-off-by: Veerendranath Jakkam <vjakkam@codeaurora.org>
wpa_supplicant/dpp_supplicant.c
wpa_supplicant/interworking.c
wpa_supplicant/wps_supplicant.c

index b9b882bf2d5334065c843a856acda946b94caf62..a41b3f5c0222f7cd2c51e833efaf31681a6a491f 100644 (file)
@@ -1136,7 +1136,8 @@ static struct wpa_ssid * wpas_dpp_add_network(struct wpa_supplicant *wpa_s,
 
                res = wpa_drv_get_capa(wpa_s, &capa);
                if (res == 0 &&
-                   !(capa.key_mgmt & WPA_DRIVER_CAPA_KEY_MGMT_SAE) &&
+                   !(capa.key_mgmt_iftype[WPA_IF_STATION] &
+                     WPA_DRIVER_CAPA_KEY_MGMT_SAE) &&
                    !(wpa_s->drv_flags & WPA_DRIVER_FLAGS_SAE)) {
                        wpa_printf(MSG_DEBUG,
                                   "DPP: SAE not supported by the driver");
index c48525cec5c2fb591922d7b882ed8dfe746c8b88..a380123b3efb13cdbe07c1f8ba437e8cdeba94b2 100644 (file)
@@ -946,7 +946,8 @@ static int interworking_set_hs20_params(struct wpa_supplicant *wpa_s,
        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) {
+       if (res == 0 && capa.key_mgmt_iftype[WPA_IF_STATION] &
+           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";
index b160fd0d406122a00e4292751baeb77906503cc8..b7680f0888e27d28d5a408930fbe70f38380469c 100644 (file)
@@ -188,6 +188,7 @@ static void wpas_wps_security_workaround(struct wpa_supplicant *wpa_s,
        const u8 *ie;
        struct wpa_ie_data adv;
        int wpa2 = 0, ccmp = 0;
+       enum wpa_driver_if_type iftype;
 
        /*
         * Many existing WPS APs do not know how to negotiate WPA2 or CCMP in
@@ -239,9 +240,12 @@ static void wpas_wps_security_workaround(struct wpa_supplicant *wpa_s,
                return;
        }
 
+       iftype = ssid->p2p_group ? WPA_IF_P2P_CLIENT : WPA_IF_STATION;
+
        if (ccmp && !(ssid->pairwise_cipher & WPA_CIPHER_CCMP) &&
            (ssid->pairwise_cipher & WPA_CIPHER_TKIP) &&
-           (capa.key_mgmt & WPA_DRIVER_CAPA_KEY_MGMT_WPA2_PSK)) {
+           (capa.key_mgmt_iftype[iftype] &
+            WPA_DRIVER_CAPA_KEY_MGMT_WPA2_PSK)) {
                wpa_printf(MSG_DEBUG, "WPS: Add CCMP into the credential "
                           "based on scan results");
                if (wpa_s->conf->ap_scan == 1)