P2PS: Validate WPS config methods more accurately in PD Request
In case of a P2PS PD, allow keypad, display, and P2PS WPS config methods. For a legacy PD, allow keypad, display, and pushbutton methods. Signed-off-by: Andrei Otcheretianski <andrei.otcheretianski@intel.com> Reviewed-by: Ilan Peer <ilan.peer@intel.com>
This commit is contained in:
parent
ea210b9f8a
commit
2fc866d1bc
1 changed files with 7 additions and 3 deletions
|
@ -418,6 +418,7 @@ void p2p_process_prov_disc_req(struct p2p_data *p2p, const u8 *sa,
|
||||||
u8 group_mac[ETH_ALEN];
|
u8 group_mac[ETH_ALEN];
|
||||||
int passwd_id = DEV_PW_DEFAULT;
|
int passwd_id = DEV_PW_DEFAULT;
|
||||||
u16 config_methods;
|
u16 config_methods;
|
||||||
|
u16 allowed_config_methods = WPS_CONFIG_DISPLAY | WPS_CONFIG_KEYPAD;
|
||||||
|
|
||||||
if (p2p_parse(data, len, &msg))
|
if (p2p_parse(data, len, &msg))
|
||||||
return;
|
return;
|
||||||
|
@ -441,9 +442,12 @@ void p2p_process_prov_disc_req(struct p2p_data *p2p, const u8 *sa,
|
||||||
dev->info.wfd_subelems = wpabuf_dup(msg.wfd_subelems);
|
dev->info.wfd_subelems = wpabuf_dup(msg.wfd_subelems);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!(msg.wps_config_methods &
|
if (msg.adv_id)
|
||||||
(WPS_CONFIG_DISPLAY | WPS_CONFIG_KEYPAD |
|
allowed_config_methods |= WPS_CONFIG_P2PS;
|
||||||
WPS_CONFIG_PUSHBUTTON | WPS_CONFIG_P2PS))) {
|
else
|
||||||
|
allowed_config_methods |= WPS_CONFIG_PUSHBUTTON;
|
||||||
|
|
||||||
|
if (!(msg.wps_config_methods & allowed_config_methods)) {
|
||||||
p2p_dbg(p2p, "Unsupported Config Methods in Provision Discovery Request");
|
p2p_dbg(p2p, "Unsupported Config Methods in Provision Discovery Request");
|
||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue