From: Peddolla Harshavardhan Reddy Date: Sat, 14 Jun 2025 05:58:53 +0000 (+0530) Subject: nl80211: Provide AKM and cipher suite to PASN command X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ebedf6c0f08cbb933f7a153137386e1659caa9c0;p=thirdparty%2Fhostap.git nl80211: Provide AKM and cipher suite to PASN command 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 --- diff --git a/src/common/wpa_common.c b/src/common/wpa_common.c index 4367a227d..b01706573 100644 --- a/src/common/wpa_common.c +++ b/src/common/wpa_common.c @@ -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; } diff --git a/src/drivers/driver_nl80211.c b/src/drivers/driver_nl80211.c index 9e8d39593..ce86b72c4 100644 --- a/src/drivers/driver_nl80211.c +++ b/src/drivers/driver_nl80211.c @@ -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); }