]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
Show supported group_mgmt capabilities
authorJouni Malinen <jouni@qca.qualcomm.com>
Fri, 23 Jan 2015 13:57:05 +0000 (15:57 +0200)
committerJouni Malinen <j@w1.fi>
Sat, 24 Jan 2015 17:37:42 +0000 (19:37 +0200)
This extends GET_CAPABILITY command to allow the supported group
management frame cipher suites to be listed.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
wpa_supplicant/ctrl_iface.c

index 8e71727fd84fe4de1f31db22c8393871247cc82e..06db7f70373f5176352654df16ad8d31ecac2449 100644 (file)
@@ -3333,6 +3333,13 @@ static const struct cipher_info ciphers[] = {
        { WPA_DRIVER_CAPA_ENC_WEP40, "WEP40", 1 }
 };
 
+static const struct cipher_info ciphers_group_mgmt[] = {
+       { WPA_DRIVER_CAPA_ENC_BIP, "AES-128-CMAC", 1 },
+       { WPA_DRIVER_CAPA_ENC_BIP_GMAC_128, "BIP-GMAC-128", 1 },
+       { WPA_DRIVER_CAPA_ENC_BIP_GMAC_256, "BIP-GMAC-256", 1 },
+       { WPA_DRIVER_CAPA_ENC_BIP_CMAC_256, "BIP-CMAC-256", 1 },
+};
+
 
 static int ctrl_iface_get_capability_pairwise(int res, char *strict,
                                              struct wpa_driver_capa *capa,
@@ -3406,6 +3413,35 @@ static int ctrl_iface_get_capability_group(int res, char *strict,
 }
 
 
+static int ctrl_iface_get_capability_group_mgmt(int res, char *strict,
+                                               struct wpa_driver_capa *capa,
+                                               char *buf, size_t buflen)
+{
+       int ret;
+       char *pos, *end;
+       unsigned int i;
+
+       pos = buf;
+       end = pos + buflen;
+
+       if (res < 0)
+               return 0;
+
+       for (i = 0; i < ARRAY_SIZE(ciphers_group_mgmt); i++) {
+               if (capa->enc & ciphers_group_mgmt[i].capa) {
+                       ret = os_snprintf(pos, end - pos, "%s%s",
+                                         pos == buf ? "" : " ",
+                                         ciphers_group_mgmt[i].name);
+                       if (os_snprintf_error(end - pos, ret))
+                               return pos - buf;
+                       pos += ret;
+               }
+       }
+
+       return pos - buf;
+}
+
+
 static int ctrl_iface_get_capability_key_mgmt(int res, char *strict,
                                              struct wpa_driver_capa *capa,
                                              char *buf, size_t buflen)
@@ -3755,6 +3791,10 @@ static int wpa_supplicant_ctrl_iface_get_capability(
                return ctrl_iface_get_capability_group(res, strict, &capa,
                                                       buf, buflen);
 
+       if (os_strcmp(field, "group_mgmt") == 0)
+               return ctrl_iface_get_capability_group_mgmt(res, strict, &capa,
+                                                           buf, buflen);
+
        if (os_strcmp(field, "key_mgmt") == 0)
                return ctrl_iface_get_capability_key_mgmt(res, strict, &capa,
                                                          buf, buflen);