mirror of
https://github.com/vanhoefm/fragattacks.git
synced 2024-11-25 00:38:24 -05:00
P2PS: Authorize any peer for P2PS method if interface address not known
When P2PS PD with default P2PS method is done, the peer that becomes GO should authorize the client. However, P2PS specification doesn't require the client to include its intended interface address in PD Request/Response. As a result, the P2P Client's interface address may not be known and any address may need to be authorized. Previously, client's P2P Device Address was used for authorization, which is not correct when a dedicated interface is used for P2P Client. This is not resulting in a connection failure, however it causes a significant delay (until WPS_PIN_TIME_IGNORE_SEL_REG elapses). Fix this by authorizing the intended interface address, if known; or any address, if not known. Signed-off-by: Andrei Otcheretianski <andrei.otcheretianski@intel.com>
This commit is contained in:
parent
2a098e3668
commit
b9da88d6c1
@ -5980,6 +5980,7 @@ static void p2p_ctrl_flush(struct wpa_supplicant *wpa_s)
|
|||||||
os_memset(wpa_s->p2p_auth_invite, 0, ETH_ALEN);
|
os_memset(wpa_s->p2p_auth_invite, 0, ETH_ALEN);
|
||||||
wpa_s->force_long_sd = 0;
|
wpa_s->force_long_sd = 0;
|
||||||
wpas_p2p_stop_find(wpa_s);
|
wpas_p2p_stop_find(wpa_s);
|
||||||
|
wpa_s->parent->p2ps_method_config_any = 0;
|
||||||
if (wpa_s->global->p2p)
|
if (wpa_s->global->p2p)
|
||||||
p2p_flush(wpa_s->global->p2p);
|
p2p_flush(wpa_s->global->p2p);
|
||||||
}
|
}
|
||||||
|
@ -1714,14 +1714,22 @@ static void p2p_go_configured(void *ctx, void *data)
|
|||||||
params->persistent_group, "");
|
params->persistent_group, "");
|
||||||
wpa_s->group_formation_reported = 1;
|
wpa_s->group_formation_reported = 1;
|
||||||
|
|
||||||
if (wpa_s->parent->p2ps_join_addr_valid) {
|
if (wpa_s->parent->p2ps_method_config_any) {
|
||||||
wpa_dbg(wpa_s, MSG_DEBUG,
|
if (is_zero_ether_addr(wpa_s->parent->p2ps_join_addr)) {
|
||||||
"P2PS: Setting default PIN for " MACSTR,
|
wpa_dbg(wpa_s, MSG_DEBUG,
|
||||||
MAC2STR(wpa_s->parent->p2ps_join_addr));
|
"P2PS: Setting default PIN for ANY");
|
||||||
wpa_supplicant_ap_wps_pin(wpa_s,
|
wpa_supplicant_ap_wps_pin(wpa_s, NULL,
|
||||||
wpa_s->parent->p2ps_join_addr,
|
"12345670", NULL, 0,
|
||||||
"12345670", NULL, 0, 0);
|
0);
|
||||||
wpa_s->parent->p2ps_join_addr_valid = 0;
|
} else {
|
||||||
|
wpa_dbg(wpa_s, MSG_DEBUG,
|
||||||
|
"P2PS: Setting default PIN for " MACSTR,
|
||||||
|
MAC2STR(wpa_s->parent->p2ps_join_addr));
|
||||||
|
wpa_supplicant_ap_wps_pin(
|
||||||
|
wpa_s, wpa_s->parent->p2ps_join_addr,
|
||||||
|
"12345670", NULL, 0, 0);
|
||||||
|
}
|
||||||
|
wpa_s->parent->p2ps_method_config_any = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
os_get_reltime(&wpa_s->global->p2p_go_wait_client);
|
os_get_reltime(&wpa_s->global->p2p_go_wait_client);
|
||||||
@ -3922,25 +3930,31 @@ static void wpas_p2ps_prov_complete(void *ctx, u8 status, const u8 *dev,
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (passwd_id == DEV_PW_P2PS_DEFAULT) {
|
if (passwd_id == DEV_PW_P2PS_DEFAULT) {
|
||||||
os_memcpy(wpa_s->p2ps_join_addr, dev, ETH_ALEN);
|
os_memcpy(wpa_s->p2ps_join_addr, grp_mac,
|
||||||
wpa_s->p2ps_join_addr_valid = 1;
|
ETH_ALEN);
|
||||||
wpa_dbg(wpa_s, MSG_DEBUG,
|
wpa_s->p2ps_method_config_any = 1;
|
||||||
"P2PS: Saving PIN for " MACSTR,
|
|
||||||
MAC2STR(dev));
|
|
||||||
}
|
}
|
||||||
} else if (passwd_id == DEV_PW_P2PS_DEFAULT) {
|
} else if (passwd_id == DEV_PW_P2PS_DEFAULT) {
|
||||||
os_memcpy(go_ifname, go_wpa_s->ifname,
|
os_memcpy(go_ifname, go_wpa_s->ifname,
|
||||||
sizeof(go_ifname));
|
sizeof(go_ifname));
|
||||||
|
|
||||||
wpa_dbg(go_wpa_s, MSG_DEBUG,
|
if (is_zero_ether_addr(grp_mac)) {
|
||||||
"P2P: Setting PIN-1 For " MACSTR, MAC2STR(dev));
|
wpa_dbg(go_wpa_s, MSG_DEBUG,
|
||||||
wpa_supplicant_ap_wps_pin(go_wpa_s, dev, "12345670",
|
"P2P: Setting PIN-1 for ANY");
|
||||||
NULL, 0, 0);
|
wpa_supplicant_ap_wps_pin(go_wpa_s, NULL,
|
||||||
|
"12345670", NULL, 0,
|
||||||
|
0);
|
||||||
|
} else {
|
||||||
|
wpa_dbg(go_wpa_s, MSG_DEBUG,
|
||||||
|
"P2P: Setting PIN-1 for " MACSTR,
|
||||||
|
MAC2STR(grp_mac));
|
||||||
|
wpa_supplicant_ap_wps_pin(go_wpa_s, grp_mac,
|
||||||
|
"12345670", NULL, 0,
|
||||||
|
0);
|
||||||
|
}
|
||||||
|
|
||||||
os_memcpy(wpa_s->p2ps_join_addr, dev, ETH_ALEN);
|
os_memcpy(wpa_s->p2ps_join_addr, grp_mac, ETH_ALEN);
|
||||||
wpa_s->p2ps_join_addr_valid = 1;
|
wpa_s->p2ps_method_config_any = 1;
|
||||||
wpa_dbg(wpa_s, MSG_DEBUG,
|
|
||||||
"P2PS: Saving PIN for " MACSTR, MAC2STR(dev));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
wpa_msg_global(wpa_s, MSG_INFO,
|
wpa_msg_global(wpa_s, MSG_INFO,
|
||||||
@ -5075,6 +5089,7 @@ int wpas_p2p_connect(struct wpa_supplicant *wpa_s, const u8 *peer_addr,
|
|||||||
|
|
||||||
wpa_s->global->p2p_fail_on_wps_complete = 0;
|
wpa_s->global->p2p_fail_on_wps_complete = 0;
|
||||||
wpa_s->global->pending_p2ps_group = 0;
|
wpa_s->global->pending_p2ps_group = 0;
|
||||||
|
wpa_s->p2ps_method_config_any = 0;
|
||||||
|
|
||||||
if (go_intent < 0)
|
if (go_intent < 0)
|
||||||
go_intent = wpa_s->conf->p2p_go_intent;
|
go_intent = wpa_s->conf->p2p_go_intent;
|
||||||
|
@ -820,7 +820,7 @@ struct wpa_supplicant {
|
|||||||
unsigned int p2p_nfc_tag_enabled:1;
|
unsigned int p2p_nfc_tag_enabled:1;
|
||||||
unsigned int p2p_peer_oob_pk_hash_known:1;
|
unsigned int p2p_peer_oob_pk_hash_known:1;
|
||||||
unsigned int p2p_disable_ip_addr_req:1;
|
unsigned int p2p_disable_ip_addr_req:1;
|
||||||
unsigned int p2ps_join_addr_valid:1;
|
unsigned int p2ps_method_config_any:1;
|
||||||
unsigned int p2p_cli_probe:1;
|
unsigned int p2p_cli_probe:1;
|
||||||
int p2p_persistent_go_freq;
|
int p2p_persistent_go_freq;
|
||||||
int p2p_persistent_id;
|
int p2p_persistent_id;
|
||||||
|
Loading…
Reference in New Issue
Block a user