[PATCH 51/92] wpa_supplicant: Add cipher_suites parameter to NAN_PUBLISH command
Andrei Otcheretianski
andrei.otcheretianski at intel.com
Wed Apr 22 05:23:42 PDT 2026
From: Avraham Stern <avraham.stern at intel.com>
Allow specifying a comma-separated list of cipher suite IDs in the
NAN_PUBLISH command. The cipher suites will be included in the
Cipher Suite Information attribute (CSIA) added to publish messages.
Example usage:
NAN_PUBLISH service_name=test cipher_suites=1,2
Signed-off-by: Avraham Stern <avraham.stern at intel.com>
---
wpa_supplicant/ctrl_iface.c | 16 ++++++++++++++++
1 file changed, 16 insertions(+)
diff --git a/wpa_supplicant/ctrl_iface.c b/wpa_supplicant/ctrl_iface.c
index 013cc98567..5570df81c6 100644
--- a/wpa_supplicant/ctrl_iface.c
+++ b/wpa_supplicant/ctrl_iface.c
@@ -12778,6 +12778,7 @@ static int wpas_ctrl_nan_publish(struct wpa_supplicant *wpa_s, char *cmd,
int ret = -1;
enum nan_service_protocol_type srv_proto_type = 0;
int *freq_list = NULL;
+ int *cipher_list = NULL;
bool p2p = false;
os_memset(¶ms, 0, sizeof(params));
@@ -12889,6 +12890,20 @@ static int wpas_ctrl_nan_publish(struct wpa_supplicant *wpa_s, char *cmd,
continue;
}
+ if (os_strncmp(token, "cipher_suites=", 14) == 0) {
+ char *pos = token + 14;
+
+ while (pos && pos[0]) {
+ int_array_add_unique(&cipher_list, atoi(pos));
+ pos = os_strchr(pos, ',');
+ if (pos)
+ pos++;
+ }
+
+ params.cipher_suites_list = cipher_list;
+ continue;
+ }
+
wpa_printf(MSG_INFO, "CTRL: Invalid NAN_PUBLISH parameter: %s",
token);
goto fail;
@@ -12901,6 +12916,7 @@ static int wpas_ctrl_nan_publish(struct wpa_supplicant *wpa_s, char *cmd,
fail:
wpabuf_free(ssi);
os_free(freq_list);
+ os_free(cipher_list);
return ret;
}
--
2.53.0
More information about the Hostap
mailing list