]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
Add SAE to auth_alg capabilities
authorJouni Malinen <j@w1.fi>
Sun, 11 Jan 2015 17:41:01 +0000 (19:41 +0200)
committerJouni Malinen <j@w1.fi>
Sun, 11 Jan 2015 22:19:21 +0000 (00:19 +0200)
This makes it easier for upper layer programs to figure out whether the
wpa_supplicant and and the driver supports SAE.

Signed-off-by: Jouni Malinen <j@w1.fi>
wpa_supplicant/ctrl_iface.c

index 4b4a7c548ef6ac5d6b071dd4008d53ef83d19f24..31b075e4d29cfef1eda6bebb478b3d71e2bce937 100644 (file)
@@ -3499,7 +3499,8 @@ static int ctrl_iface_get_capability_proto(int res, char *strict,
 }
 
 
-static int ctrl_iface_get_capability_auth_alg(int res, char *strict,
+static int ctrl_iface_get_capability_auth_alg(struct wpa_supplicant *wpa_s,
+                                             int res, char *strict,
                                              struct wpa_driver_capa *capa,
                                              char *buf, size_t buflen)
 {
@@ -3543,6 +3544,16 @@ static int ctrl_iface_get_capability_auth_alg(int res, char *strict,
                pos += ret;
        }
 
+#ifdef CONFIG_SAE
+       if (wpa_s->drv_flags & WPA_DRIVER_FLAGS_SAE) {
+               ret = os_snprintf(pos, end - pos, "%sSAE",
+                                 pos == buf ? "" : " ");
+               if (os_snprintf_error(end - pos, ret))
+                       return pos - buf;
+               pos += ret;
+       }
+#endif /* CONFIG_SAE */
+
        return pos - buf;
 }
 
@@ -3741,8 +3752,8 @@ static int wpa_supplicant_ctrl_iface_get_capability(
                                                       buf, buflen);
 
        if (os_strcmp(field, "auth_alg") == 0)
-               return ctrl_iface_get_capability_auth_alg(res, strict, &capa,
-                                                         buf, buflen);
+               return ctrl_iface_get_capability_auth_alg(wpa_s, res, strict,
+                                                         &capa, buf, buflen);
 
        if (os_strcmp(field, "modes") == 0)
                return ctrl_iface_get_capability_modes(res, strict, &capa,