aboutsummaryrefslogtreecommitdiffstats
path: root/src/p2p/p2p_go_neg.c
diff options
context:
space:
mode:
authorJouni Malinen <jouni.malinen@atheros.com>2010-08-05 09:15:11 -0700
committerJouni Malinen <j@w1.fi>2010-09-09 07:17:23 -0700
commite9a7ae41fa4dcb5df2e1244182ae279b6a16ce17 (patch)
tree6b5c8e4f07a2f7cd3cb9a2774bb80764df7a5c1b /src/p2p/p2p_go_neg.c
parent743ef79914373d75a3d7004a18de5973ee7a2fe6 (diff)
downloadexternal_wpa_supplicant_8_ti-e9a7ae41fa4dcb5df2e1244182ae279b6a16ce17.zip
external_wpa_supplicant_8_ti-e9a7ae41fa4dcb5df2e1244182ae279b6a16ce17.tar.gz
external_wpa_supplicant_8_ti-e9a7ae41fa4dcb5df2e1244182ae279b6a16ce17.tar.bz2
P2P: Use SSID from GO Negotiation to limit WPS provisioning step
In order to avoid picking incorrect SSID from old scan results, use SSID from GO Negotiation to select the AP.
Diffstat (limited to 'src/p2p/p2p_go_neg.c')
-rw-r--r--src/p2p/p2p_go_neg.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/p2p/p2p_go_neg.c b/src/p2p/p2p_go_neg.c
index f55bba7..bf36c7a 100644
--- a/src/p2p/p2p_go_neg.c
+++ b/src/p2p/p2p_go_neg.c
@@ -786,11 +786,14 @@ void p2p_process_go_neg_resp(struct p2p_data *p2p, const u8 *sa,
}
if (!go && msg.group_id) {
- /* TODO: Store SSID for Provisioning step */
+ /* Store SSID for Provisioning step */
+ p2p->ssid_len = msg.group_id_len - ETH_ALEN;
+ os_memcpy(p2p->ssid, msg.group_id + ETH_ALEN, p2p->ssid_len);
} else if (!go) {
wpa_msg(p2p->cfg->msg_ctx, MSG_DEBUG,
"P2P: Mandatory P2P Group ID attribute missing from "
"GO Negotiation Response");
+ p2p->ssid_len = 0;
#ifdef CONFIG_P2P_STRICT
status = P2P_SC_FAIL_INVALID_PARAMS;
goto fail;
@@ -1034,11 +1037,14 @@ void p2p_process_go_neg_conf(struct p2p_data *p2p, const u8 *sa,
}
if (dev->go_state == REMOTE_GO && msg.group_id) {
- /* TODO: Store SSID for Provisioning step */
+ /* Store SSID for Provisioning step */
+ p2p->ssid_len = msg.group_id_len - ETH_ALEN;
+ os_memcpy(p2p->ssid, msg.group_id + ETH_ALEN, p2p->ssid_len);
} else if (dev->go_state == REMOTE_GO) {
wpa_msg(p2p->cfg->msg_ctx, MSG_DEBUG,
"P2P: Mandatory P2P Group ID attribute missing from "
"GO Negotiation Confirmation");
+ p2p->ssid_len = 0;
#ifdef CONFIG_P2P_STRICT
p2p_parse_free(&msg);
return;