]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
P2P2: Initialize peer PASN data and set P2P2 on P2P PASN auth frame RX
authorVinay Gannevaram <quic_vganneva@quicinc.com>
Wed, 16 Apr 2025 19:28:49 +0000 (00:58 +0530)
committerJouni Malinen <j@w1.fi>
Tue, 6 May 2025 13:30:32 +0000 (16:30 +0300)
During PASN pairing verification, the PASN authentication frame is
received without the need for provision discovery. If the pairing
initiator's peer entry is removed and added again or the MAC address
is randomized, the Authentication frame is discarded because the PASN
data is not initialized. Therefore, ensure that the PASN data for the
peer is initialized if it is not already present. Also set the P2P2
bool variable to true.

Signed-off-by: Vinay Gannevaram <quic_vganneva@quicinc.com>
src/p2p/p2p.c
wpa_supplicant/p2p_supplicant.c

index 7d6cb97ab51fea5314486330d8de981230feafad..bd113ee20bfefc4ad117207a256a9a8d3698b2b3 100644 (file)
@@ -7265,8 +7265,11 @@ int p2p_pasn_auth_rx(struct p2p_data *p2p, const struct ieee80211_mgmt *mgmt,
        }
 
        if (!dev->pasn) {
-               p2p_dbg(p2p, "PASN: Uninitialized");
-               return -1;
+               dev->pasn = pasn_data_init();
+               if (!dev->pasn) {
+                       p2p_dbg(p2p, "PASN: Uninitialized");
+                       return -1;
+               }
        }
 
        pasn = dev->pasn;
index 449c95fc34125b351e922e5aabddfcd5b3ebc3cd..73dbd5f22dae451575fe557c0b9fbf5e3f2338bb 100644 (file)
@@ -11505,6 +11505,8 @@ int wpas_p2p_pasn_auth_rx(struct wpa_supplicant *wpa_s,
 
        if (wpa_s->global->p2p_disabled || !p2p)
                return -2;
+
+       wpa_s->p2p2 = true;
        return p2p_pasn_auth_rx(p2p, mgmt, len, freq);
 }