]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
P2P2: Fix pairing verification without encrypted elements
authorShivani Baranwal <quic_shivbara@quicinc.com>
Thu, 17 Oct 2024 09:41:53 +0000 (15:11 +0530)
committerJouni Malinen <j@w1.fi>
Thu, 31 Oct 2024 11:57:55 +0000 (13:57 +0200)
During the pairing verification process, the KEK might not be derived,
and the PASN encrypted elements are absent in the P2P2 IE. Therefore, it
is necessary to permit other attributes such as PCEA and the Action
Frame Wrapper attribute in the Authentication frame for the invitation
process.

Signed-off-by: Shivani Baranwal <quic_shivbara@quicinc.com>
src/p2p/p2p.c
src/pasn/pasn_common.c

index 646be7d68986cb6c70e740a644fb43726d86b2cb..462a81de57f00f777d0bc355c643f8a3a8efe9a1 100644 (file)
@@ -6731,7 +6731,7 @@ int p2p_prepare_data_element(struct p2p_data *p2p, const u8 *peer_addr)
        }
 
        if (p2p_pasn_add_encrypted_data(p2p, dev, extra_ies) < 0)
-               goto out;
+               p2p_dbg(p2p, "Failed to add PASN encrypted elements");
 
        pasn->extra_ies = os_memdup(wpabuf_head_u8(extra_ies),
                                    wpabuf_len(extra_ies));
index 8a42e09410d9072103bea6ea7b1e477ae3388045..654656e58dc658b5b1395e6be25955602f6365c3 100644 (file)
@@ -254,6 +254,11 @@ int pasn_add_encrypted_data(struct pasn_data *pasn, struct wpabuf *buf,
        u8 *len;
        size_t pad_len = 0;
 
+       if (!pasn->ptk.kek_len) {
+               wpa_printf(MSG_DEBUG, "PASN: KEK not available");
+               return -2;
+       }
+
        pad_len = data_len % 8;
        if (pad_len) {
                pad_len = 8 - pad_len;