]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
PASN: Add support to reject PASN auth 1 based on user input
authorShivam Rai <quic_shivamr@quicinc.com>
Mon, 12 Aug 2024 06:09:46 +0000 (11:39 +0530)
committerJouni Malinen <j@w1.fi>
Thu, 22 Aug 2024 08:28:19 +0000 (11:28 +0300)
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>
src/ap/ieee802_11.c
src/pasn/pasn_common.h
src/pasn/pasn_responder.c

index 5e484641a6e4602dfa6570eb171f00bfc575272b..230fdb7b2d31a7f4da9876f41ed7428aaf380f9a 100644 (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);
                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);
        } else if (trans_seq == 3) {
                if (!sta->pasn) {
index 36710c2b70e91a0a1b0392c700aed55ad72004f7..bb54175b2eee6a17e51a8c758b203ec256ff284d 100644 (file)
@@ -174,7 +174,8 @@ int wpa_pasn_auth_tx_status(struct pasn_data *pasn,
 /* Responder */
 int handle_auth_pasn_1(struct pasn_data *pasn,
                       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,
                       const u8 *peer_addr,
                       const struct ieee80211_mgmt *mgmt, size_t len);
index b99136492fa6b1f00e0bf789bfc835f4706907dd..f6e44a53cb7889a827a4c46b1880613d3bd28ed9 100644 (file)
@@ -597,7 +597,8 @@ fail:
 
 int handle_auth_pasn_1(struct pasn_data *pasn,
                       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 wpa_ie_data rsn_data;
@@ -616,6 +617,12 @@ int handle_auth_pasn_1(struct pasn_data *pasn,
        if (!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,
                                   len - offsetof(struct ieee80211_mgmt,
                                                  u.auth.variable),