[RFC v2 44/99] NAN: Extend the nan_ndp_action_notif() callback to include security

Andrei Otcheretianski andrei.otcheretianski at intel.com
Tue Dec 23 03:51:48 PST 2025


From: Ilan Peer <ilan.peer at intel.com>

Extend the nan_ndp_action_notif callback to also include
the requested cipher suite identifier and PMKID from the initiator.

Signed-off-by: Ilan Peer <ilan.peer at intel.com>
---
 src/nan/nan.c | 8 ++++++++
 src/nan/nan.h | 4 ++++
 2 files changed, 12 insertions(+)

diff --git a/src/nan/nan.c b/src/nan/nan.c
index 031839be17..a1c65bb855 100644
--- a/src/nan/nan.c
+++ b/src/nan/nan.c
@@ -1181,6 +1181,14 @@ static void nan_ndp_action_notif(struct nan_data *nan, struct nan_peer *peer)
 	notify.ssi = peer->ndp_setup.ssi;
 	notify.ssi_len = peer->ndp_setup.ssi_len;
 
+	if (peer->ndp_setup.sec.present) {
+		notify.csid = peer->ndp_setup.sec.i_csid;
+		notify.pmkid = peer->ndp_setup.sec.i_pmkid;
+	} else {
+		notify.csid = NAN_CS_NONE;
+		notify.pmkid = NULL;
+	}
+
 	wpa_printf(MSG_DEBUG,
 		   "NAN: NDP action notification peer=" MACSTR ", ndp_status=%u, ndl_status=%u",
 		   MAC2STR(peer->nmi_addr), notify.ndp_status,
diff --git a/src/nan/nan.h b/src/nan/nan.h
index 2bbd5b6da3..ef77acee88 100644
--- a/src/nan/nan.h
+++ b/src/nan/nan.h
@@ -279,6 +279,8 @@ struct nan_ndp_connection_params {
  * @publish_inst_id: identifier for the publish instance function
  * @ssi: service specific information
  * @ssi_len: service specific information length
+ * @csid: NAN cipher suite identifier
+ * @pmkid: NAN PMK identifier; can be NULL if security is not negotiated
  */
 struct nan_ndp_action_notif_params {
 	struct nan_ndp_id ndp_id;
@@ -290,6 +292,8 @@ struct nan_ndp_action_notif_params {
 	u8 publish_inst_id;
 	const u8 *ssi;
 	size_t ssi_len;
+	enum nan_cipher_suite_id csid;
+	const u8 *pmkid;
 };
 
 /**
-- 
2.49.0




More information about the Hostap mailing list