]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
nl80211: Provide AKM and cipher suite to PASN command
authorPeddolla Harshavardhan Reddy <peddolla@qti.qualcomm.com>
Sat, 14 Jun 2025 05:58:53 +0000 (11:28 +0530)
committerJouni Malinen <j@w1.fi>
Thu, 19 Jun 2025 15:27:00 +0000 (18:27 +0300)
This is a step towards allowing the driver to initiate PASN
Authentication using user-preferred AKMP and cipher for secure ranging.

Signed-off-by: Peddolla Harshavardhan Reddy <peddolla@qti.qualcomm.com>
src/common/wpa_common.c
src/drivers/driver_nl80211.c

index 4367a227dd7315ff22ef98cf66090d677f22d197..b0170657344fefe66700cb4a73bfa3bb26793e48 100644 (file)
@@ -2851,6 +2851,10 @@ u32 wpa_akm_to_suite(int akm)
                return RSN_AUTH_KEY_MGMT_OWE;
        if (akm & WPA_KEY_MGMT_DPP)
                return RSN_AUTH_KEY_MGMT_DPP;
+#ifdef CONFIG_PASN
+       if (akm & WPA_KEY_MGMT_PASN)
+               return RSN_AUTH_KEY_MGMT_PASN;
+#endif /* CONFIG_PASN */
        return 0;
 }
 
index 9e8d395939d757d434caad6a887eabae42f27ffe..ce86b72c4640f2ee967fc22bb8f1c8e360e89aa6 100644 (file)
@@ -13650,6 +13650,8 @@ static int nl80211_send_pasn_resp(void *priv, struct pasn_auth *params)
                goto fail;
 
        for (i = 0; i < params->num_peers; i++) {
+               int akmp, cipher;
+
                attr1 = nla_nest_start(msg, i);
                if (!attr1 ||
                    nla_put(msg, QCA_WLAN_VENDOR_ATTR_PASN_PEER_SRC_ADDR,
@@ -13663,12 +13665,22 @@ static int nl80211_send_pasn_resp(void *priv, struct pasn_auth *params)
                                 QCA_WLAN_VENDOR_ATTR_PASN_PEER_STATUS_SUCCESS))
                        goto fail;
 
+               akmp = params->peer[i].akmp;
+               cipher = params->peer[i].cipher;
+               if (nla_put_u32(msg, QCA_WLAN_VENDOR_ATTR_PASN_PEER_AKM,
+                               wpa_akm_to_suite(akmp)) ||
+                   nla_put_u32(msg, QCA_WLAN_VENDOR_ATTR_PASN_PEER_CIPHER,
+                               wpa_cipher_to_cipher_suite(cipher)))
+                       goto fail;
+
                wpa_printf(MSG_DEBUG,
                           "nl80211: Own address[%u]: " MACSTR
-                          " Peer address[%u]: " MACSTR " Status: %s",
+                          " Peer address[%u]: " MACSTR
+                          " Status: %s AKMP: 0x%x cipher: 0x%x",
                           i, MAC2STR(params->peer[i].own_addr), i,
                           MAC2STR(params->peer[i].peer_addr),
-                          params->peer[i].status ? "Fail" : "Success");
+                          params->peer[i].status ? "Fail" : "Success",
+                          akmp, cipher);
                nla_nest_end(msg, attr1);
        }