[][MAC80211][WPA3: Fix to print the capability of sae groups]
[Description]
Add the command "hostapd_cli -i<ifname> get sae_group_capalibity"
instead of "hostapd_cli -i<ifname> get_config", because the WPA3
certification need to get the capability rather than configuration.
[Release-log]
Change-Id: I55b51ccffe198e8248b31ce7d049e6047af50002
Reviewed-on: https://gerrit.mediatek.inc/c/openwrt/feeds/mtk_openwrt_feeds/+/5331271
diff --git a/openwrt_patches-21.02/500-print-sae-groups-by-hostapd-ctrl.patch b/openwrt_patches-21.02/500-print-sae-groups-by-hostapd-ctrl.patch
index f90b6a9..b79c784 100644
--- a/openwrt_patches-21.02/500-print-sae-groups-by-hostapd-ctrl.patch
+++ b/openwrt_patches-21.02/500-print-sae-groups-by-hostapd-ctrl.patch
@@ -1,34 +1,28 @@
diff --git a/package/network/services/hostapd/patches/902-print-sae-groups-by-hostapd-ctrl.patch b/package/network/services/hostapd/patches/902-print-sae-groups-by-hostapd-ctrl.patch
new file mode 100644
-index 0000000..c14aef9
+index 0000000..859fdbf
--- /dev/null
+++ b/package/network/services/hostapd/patches/902-print-sae-groups-by-hostapd-ctrl.patch
-@@ -0,0 +1,28 @@
+@@ -0,0 +1,22 @@
+--- a/hostapd/ctrl_iface.c
++++ b/hostapd/ctrl_iface.c
-+@@ -1301,6 +1301,25 @@ static int hostapd_ctrl_iface_get_config
-+ pos += ret;
++@@ -1584,6 +1584,19 @@ static int hostapd_ctrl_iface_get(struct
++ if (os_snprintf_error(buflen, res))
++ return -1;
++ return res;
+++ } else if (os_strcmp(cmd, "sae_group_capability") == 0) {
+++#ifdef CONFIG_SAE
+++ /* see sae_set_group() */
+++ res = os_snprintf(buf, buflen, "%s%s%s%s19 20 21",
+++ dh_groups_get(15) ? "15 ": "",
+++ dh_groups_get(16) ? "16 ": "",
+++ dh_groups_get(17) ? "17 ": "",
+++ dh_groups_get(18) ? "18 ": "");
+++
+++ if (os_snprintf_error(buflen, res))
+++ return -1;
+++ return res;
+++#endif /* CONFIG_SAE */
+ }
+
-++ if (hapd->conf->wpa && wpa_key_mgmt_sae(hapd->conf->wpa_key_mgmt)) {
-++ int *groups = hapd->conf->sae_groups;
-++ int default_groups[] = { 19, 0 };
-++ int i;
-++
-++ if (!groups)
-++ groups = default_groups;
-++
-++ for (i = 0; groups[i] > 0; i++) {
-++ ret = os_snprintf(pos, end - pos, "%s%d%s",
-++ i == 0 ? "sae_groups=" : "",
-++ groups[i],
-++ groups[i + 1] > 0 ? " " : "\n");
-++ if (os_snprintf_error(end - pos, ret))
-++ return pos - buf;
-++ pos += ret;
-++ }
-++ }
-++
-+ if (hapd->conf->wpa) {
-+ ret = os_snprintf(pos, end - pos, "group_cipher=%s\n",
-+ wpa_cipher_txt(hapd->conf->wpa_group));
++ return -1;