aboutsummaryrefslogtreecommitdiffstats
path: root/src/p2p
diff options
context:
space:
mode:
authorJouni Malinen <jouni@qca.qualcomm.com>2012-05-08 17:34:19 +0300
committerJouni Malinen <j@w1.fi>2012-05-08 17:38:57 +0300
commit051c7bbdd00ba413a6876651f8dbdc9df26b733a (patch)
treee26fddbeaf449df1971ef9a01a31bd63666fa7e6 /src/p2p
parent6f251b6bb504176bc9086cde3a1bbe744d15bce8 (diff)
downloadexternal_wpa_supplicant_8_ti-051c7bbdd00ba413a6876651f8dbdc9df26b733a.zip
external_wpa_supplicant_8_ti-051c7bbdd00ba413a6876651f8dbdc9df26b733a.tar.gz
external_wpa_supplicant_8_ti-051c7bbdd00ba413a6876651f8dbdc9df26b733a.tar.bz2
P2P: Reject PD Request for unknown group
If PD Request includes P2P Group ID, verify that the specified group matches with a group we are currently operating. If no match is found, reject the PD Request for join-a-group case. Signed-hostap: Jouni Malinen <jouni@qca.qualcomm.com>
Diffstat (limited to 'src/p2p')
-rw-r--r--src/p2p/p2p_pd.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/p2p/p2p_pd.c b/src/p2p/p2p_pd.c
index 2985e5a..6e251c5 100644
--- a/src/p2p/p2p_pd.c
+++ b/src/p2p/p2p_pd.c
@@ -126,6 +126,21 @@ void p2p_process_prov_disc_req(struct p2p_data *p2p, const u8 *sa,
goto out;
}
+ if (msg.group_id) {
+ size_t i;
+ for (i = 0; i < p2p->num_groups; i++) {
+ if (p2p_group_is_group_id_match(p2p->groups[i],
+ msg.group_id,
+ msg.group_id_len))
+ break;
+ }
+ if (i == p2p->num_groups) {
+ wpa_msg(p2p->cfg->msg_ctx, MSG_DEBUG, "P2P: PD "
+ "request for unknown P2P Group ID - reject");
+ goto out;
+ }
+ }
+
if (dev)
dev->flags &= ~(P2P_DEV_PD_PEER_DISPLAY |
P2P_DEV_PD_PEER_KEYPAD);