]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
Add support for indicating missing driver AKM capability flags
authorTanmay Garg <tanmayg@codeaurora.org>
Mon, 18 May 2020 10:22:44 +0000 (15:52 +0530)
committerJouni Malinen <j@w1.fi>
Sat, 6 Jun 2020 12:18:13 +0000 (15:18 +0300)
Add support for missing driver AKM capability flags from the list of
RSN_AUTH_KEY_MGMT_* flags and make these available through the
'GET_CAPABILITY key_mgmt' control interface command.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
src/drivers/driver.h
src/drivers/driver_nl80211_capa.c
wpa_supplicant/ctrl_iface.c

index 1e2e332a643aa1a1a665d62f51ddbaca40229ce4..350c1cb57d55e835ce45a50929d6438b95ac7e33 100644 (file)
@@ -1747,6 +1747,13 @@ struct wpa_driver_capa {
 #define WPA_DRIVER_CAPA_KEY_MGMT_FT_FILS_SHA256 0x00004000
 #define WPA_DRIVER_CAPA_KEY_MGMT_FT_FILS_SHA384 0x00008000
 #define WPA_DRIVER_CAPA_KEY_MGMT_SAE           0x00010000
+#define WPA_DRIVER_CAPA_KEY_MGMT_802_1X_SHA256 0x00020000
+#define WPA_DRIVER_CAPA_KEY_MGMT_PSK_SHA256    0x00040000
+#define WPA_DRIVER_CAPA_KEY_MGMT_TPK_HANDSHAKE 0x00080000
+#define WPA_DRIVER_CAPA_KEY_MGMT_FT_SAE                0x00100000
+#define WPA_DRIVER_CAPA_KEY_MGMT_FT_802_1X_SHA384      0x00200000
+#define WPA_DRIVER_CAPA_KEY_MGMT_CCKM          0x00400000
+#define WPA_DRIVER_CAPA_KEY_MGMT_OSEN          0x00800000
        /** Bitfield of supported key management suites */
        unsigned int key_mgmt;
        unsigned int key_mgmt_iftype[WPA_IF_MAX];
index a3341a088930f7b9034391289c9158b8e72c8082..3e8dcef2abc694da73bad1ae0cb62f1502394841 100644 (file)
@@ -281,6 +281,27 @@ static unsigned int get_akm_suites_info(struct nlattr *tb)
                case RSN_AUTH_KEY_MGMT_FT_PSK:
                        key_mgmt |= WPA_DRIVER_CAPA_KEY_MGMT_FT_PSK;
                        break;
+               case RSN_AUTH_KEY_MGMT_802_1X_SHA256:
+                       key_mgmt |= WPA_DRIVER_CAPA_KEY_MGMT_802_1X_SHA256;
+                       break;
+               case RSN_AUTH_KEY_MGMT_PSK_SHA256:
+                       key_mgmt |= WPA_DRIVER_CAPA_KEY_MGMT_PSK_SHA256;
+                       break;
+               case RSN_AUTH_KEY_MGMT_TPK_HANDSHAKE:
+                       key_mgmt |= WPA_DRIVER_CAPA_KEY_MGMT_TPK_HANDSHAKE;
+                       break;
+               case RSN_AUTH_KEY_MGMT_FT_SAE:
+                       key_mgmt |= WPA_DRIVER_CAPA_KEY_MGMT_FT_SAE;
+                       break;
+               case RSN_AUTH_KEY_MGMT_FT_802_1X_SHA384:
+                       key_mgmt |= WPA_DRIVER_CAPA_KEY_MGMT_FT_802_1X_SHA384;
+                       break;
+               case RSN_AUTH_KEY_MGMT_CCKM:
+                       key_mgmt |= WPA_DRIVER_CAPA_KEY_MGMT_CCKM;
+                       break;
+               case RSN_AUTH_KEY_MGMT_OSEN:
+                       key_mgmt |= WPA_DRIVER_CAPA_KEY_MGMT_OSEN;
+                       break;
                case RSN_AUTH_KEY_MGMT_802_1X_SUITE_B:
                        key_mgmt |= WPA_DRIVER_CAPA_KEY_MGMT_SUITE_B;
                        break;
index 79b5e80545fca44a6c28b304210d996d32b5714f..298f3c44288fb82323e622549c5a1269ede9732d 100644 (file)
@@ -4221,6 +4221,27 @@ static int ctrl_iface_get_capability_key_mgmt(int res, bool strict,
                pos += ret;
        }
 
+       if (key_mgmt & WPA_DRIVER_CAPA_KEY_MGMT_WAPI_PSK) {
+               ret = os_snprintf(pos, end - pos, " WAPI-PSK");
+               if (os_snprintf_error(end - pos, ret))
+                       return pos - buf;
+               pos += ret;
+       }
+
+       if (key_mgmt & WPA_DRIVER_CAPA_KEY_MGMT_TPK_HANDSHAKE) {
+               ret = os_snprintf(pos, end - pos, " TPK-HANDSHAKE");
+               if (os_snprintf_error(end - pos, ret))
+                       return pos - buf;
+               pos += ret;
+       }
+
+       if (key_mgmt & WPA_DRIVER_CAPA_KEY_MGMT_CCKM) {
+               ret = os_snprintf(pos, end - pos, " CCKM");
+               if (os_snprintf_error(end - pos, ret))
+                       return pos - buf;
+               pos += ret;
+       }
+
 #ifdef CONFIG_SUITEB
        if (key_mgmt & WPA_DRIVER_CAPA_KEY_MGMT_SUITE_B) {
                ret = os_snprintf(pos, end - pos, " WPA-EAP-SUITE-B");
@@ -4288,6 +4309,28 @@ static int ctrl_iface_get_capability_key_mgmt(int res, bool strict,
                        return pos - buf;
                pos += ret;
        }
+       if (key_mgmt & WPA_DRIVER_CAPA_KEY_MGMT_FT) {
+               ret = os_snprintf(pos, end - pos, " FT-EAP");
+               if (os_snprintf_error(end - pos, ret))
+                       return pos - buf;
+               pos += ret;
+       }
+#ifdef CONFIG_SAE
+       if (key_mgmt & WPA_DRIVER_CAPA_KEY_MGMT_FT_SAE) {
+               ret = os_snprintf(pos, end - pos, " FT-SAE");
+               if (os_snprintf_error(end - pos, ret))
+                       return pos - buf;
+               pos += ret;
+       }
+#endif /* CONFIG_SAE */
+#ifdef CONFIG_SHA384
+       if (key_mgmt & WPA_DRIVER_CAPA_KEY_MGMT_FT_802_1X_SHA384) {
+               ret = os_snprintf(pos, end - pos, " FT-EAP-SHA384");
+               if (os_snprintf_error(end - pos, ret))
+                       return pos - buf;
+               pos += ret;
+       }
+#endif /* CONFIG_SHA384 */
 #endif /* CONFIG_IEEE80211R */
 #ifdef CONFIG_SAE
        if (key_mgmt & WPA_DRIVER_CAPA_KEY_MGMT_SAE) {
@@ -4297,6 +4340,29 @@ static int ctrl_iface_get_capability_key_mgmt(int res, bool strict,
                pos += ret;
        }
 #endif /* CONFIG_SAE */
+#ifdef CONFIG_SHA256
+       if (key_mgmt & WPA_DRIVER_CAPA_KEY_MGMT_802_1X_SHA256) {
+               ret = os_snprintf(pos, end - pos, " WPA-EAP-SHA256");
+               if (os_snprintf_error(end - pos, ret))
+                       return pos - buf;
+               pos += ret;
+       }
+
+       if (key_mgmt & WPA_DRIVER_CAPA_KEY_MGMT_PSK_SHA256) {
+               ret = os_snprintf(pos, end - pos, " WPA-PSK-SHA256");
+               if (os_snprintf_error(end - pos, ret))
+                       return pos - buf;
+               pos += ret;
+       }
+#endif /* CONFIG_SHA256 */
+#ifdef CONFIG_HS20
+       if (key_mgmt & WPA_DRIVER_CAPA_KEY_MGMT_OSEN) {
+               ret = os_snprintf(pos, end - pos, " OSEN");
+               if (os_snprintf_error(end - pos, ret))
+                       return pos - buf;
+               pos += ret;
+       }
+#endif /* CONFIG_HS20 */
 
        return pos - buf;
 }