[PATCH 45/97] wpa_supplicant: Add support for setting the NAN group keys cipher suite

Andrei Otcheretianski andrei.otcheretianski at intel.com
Tue Apr 28 13:05:46 PDT 2026


From: Avraham Stern <avraham.stern at intel.com>

Extend NAN_SET to support setting the NAN group keys cipher suite.

Signed-off-by: Avraham Stern <avraham.stern at intel.com>
---
 wpa_supplicant/nan_supplicant.c | 29 +++++++++++++++++++++++++++++
 1 file changed, 29 insertions(+)

diff --git a/wpa_supplicant/nan_supplicant.c b/wpa_supplicant/nan_supplicant.c
index 684e52596c..d059a66dc0 100644
--- a/wpa_supplicant/nan_supplicant.c
+++ b/wpa_supplicant/nan_supplicant.c
@@ -1614,6 +1614,35 @@ int wpas_nan_set(struct wpa_supplicant *wpa_s, char *cmd)
 	}
 #endif /* CONFIG_PASN */
 
+	if (os_strcmp("mgmt_group_cipher", cmd) == 0) {
+		int cipher;
+
+		if (os_strcmp(param, "BIP-CMAC-128") == 0) {
+			if (!(wpa_s->drv_enc & WPA_DRIVER_CAPA_ENC_BIP)) {
+				wpa_printf(MSG_DEBUG,
+					   "NAN: BIP-CMAC-128 not supported by driver");
+				return -1;
+			}
+
+			cipher = WPA_CIPHER_AES_128_CMAC;
+		} else if (os_strcmp(param, "BIP-GMAC-256") == 0) {
+			if (!(wpa_s->drv_enc &
+			      WPA_DRIVER_CAPA_ENC_BIP_GMAC_256)) {
+				wpa_printf(MSG_DEBUG,
+					   "NAN: BIP-CMAC-256 not supported by driver");
+				return -1;
+			}
+
+			cipher = WPA_CIPHER_BIP_GMAC_256;
+		} else {
+			wpa_printf(MSG_DEBUG,
+				   "NAN: Invalid mgmt_group_cipher value");
+			return -1;
+		}
+
+		return nan_set_mgmt_group_cipher(wpa_s->nan, cipher);
+	}
+
 	wpa_printf(MSG_INFO, "NAN: Unknown NAN_SET cmd='%s'", cmd);
 	return -1;
 }
-- 
2.53.0




More information about the Hostap mailing list