PASN: Add support to reject PASN auth 1 based on user input

When the PASN implementation is used as a library for Wi-Fi Aware
applications there is need to reject the PASN auth 1 frame based on the
user input. Add support to send PASN auth 2 with failure status for
auth 1 frame received to address this need.

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
This commit is contained in:
Shivam Rai 2024-08-12 11:39:46 +05:30 committed by Jouni Malinen
parent 18116e38a2
commit 8f21cdf9d7
3 changed files with 11 additions and 3 deletions

View file

@ -2850,7 +2850,7 @@ static void handle_auth_pasn(struct hostapd_data *hapd, struct sta_info *sta,
hapd_pasn_update_params(hapd, sta, mgmt, len); hapd_pasn_update_params(hapd, sta, mgmt, len);
if (handle_auth_pasn_1(sta->pasn, hapd->own_addr, if (handle_auth_pasn_1(sta->pasn, hapd->own_addr,
sta->addr, mgmt, len) < 0) sta->addr, mgmt, len, false) < 0)
ap_free_sta(hapd, sta); ap_free_sta(hapd, sta);
} else if (trans_seq == 3) { } else if (trans_seq == 3) {
if (!sta->pasn) { if (!sta->pasn) {

View file

@ -174,7 +174,8 @@ int wpa_pasn_auth_tx_status(struct pasn_data *pasn,
/* Responder */ /* Responder */
int handle_auth_pasn_1(struct pasn_data *pasn, int handle_auth_pasn_1(struct pasn_data *pasn,
const u8 *own_addr, const u8 *peer_addr, const u8 *own_addr, const u8 *peer_addr,
const struct ieee80211_mgmt *mgmt, size_t len); const struct ieee80211_mgmt *mgmt, size_t len,
bool reject);
int handle_auth_pasn_3(struct pasn_data *pasn, const u8 *own_addr, int handle_auth_pasn_3(struct pasn_data *pasn, const u8 *own_addr,
const u8 *peer_addr, const u8 *peer_addr,
const struct ieee80211_mgmt *mgmt, size_t len); const struct ieee80211_mgmt *mgmt, size_t len);

View file

@ -597,7 +597,8 @@ fail:
int handle_auth_pasn_1(struct pasn_data *pasn, int handle_auth_pasn_1(struct pasn_data *pasn,
const u8 *own_addr, const u8 *peer_addr, const u8 *own_addr, const u8 *peer_addr,
const struct ieee80211_mgmt *mgmt, size_t len) const struct ieee80211_mgmt *mgmt, size_t len,
bool reject)
{ {
struct ieee802_11_elems elems; struct ieee802_11_elems elems;
struct wpa_ie_data rsn_data; struct wpa_ie_data rsn_data;
@ -616,6 +617,12 @@ int handle_auth_pasn_1(struct pasn_data *pasn,
if (!groups) if (!groups)
groups = default_groups; groups = default_groups;
if (reject) {
wpa_printf(MSG_DEBUG, "PASN: Received Rejection");
status = WLAN_STATUS_UNSPECIFIED_FAILURE;
goto send_resp;
}
if (ieee802_11_parse_elems(mgmt->u.auth.variable, if (ieee802_11_parse_elems(mgmt->u.auth.variable,
len - offsetof(struct ieee80211_mgmt, len - offsetof(struct ieee80211_mgmt,
u.auth.variable), u.auth.variable),