3
0
mirror of https://git.kernel.org/pub/scm/network/wireless/iwd.git synced 2024-11-22 06:29:23 +01:00

p2p: Send the right UUID-E in probe request WSC IEs

When building the scan IEs for our provisioning scans, use the UUID-E
based on the Interface Address, not the Device Address, as that is what
wsc.c will be using to in the registration protocol.

Eventually we may have to base the UUID-E on the Device Address or
something else that is persistent, and pass the actual UUID-E to wsc.c,
as the Interface Address is randomly generated on every connect attempt.
IIRC the UUID-E is supposed to be persistent.
This commit is contained in:
Andrew Zaborowski 2020-08-25 04:45:32 +02:00 committed by Denis Kenzior
parent 7a91f6dba4
commit 19ab25f1d6

View File

@ -329,6 +329,7 @@ static uint8_t *p2p_build_scan_ies(struct p2p_device *dev, uint8_t *buf,
size_t wsc_ie_size;
uint8_t wfd_ie[32];
size_t wfd_ie_size;
const uint8_t *addr;
p2p_info.capability = dev->capability;
memcpy(p2p_info.listen_channel.country, dev->listen_country, 3);
@ -350,7 +351,14 @@ static uint8_t *p2p_build_scan_ies(struct p2p_device *dev, uint8_t *buf,
wsc_info.request_type = WSC_REQUEST_TYPE_ENROLLEE_INFO;
wsc_info.config_methods = dev->device_info.wsc_config_methods;
if (!wsc_uuid_from_addr(dev->addr, wsc_info.uuid_e))
/*
* If we're doing the provisioning scan, we need to use the same UUID-E
* that we'll use in the WSC enrollee registration protocol because the
* GO might validate it.
*/
addr = dev->conn_peer ? dev->conn_addr : dev->addr;
if (!wsc_uuid_from_addr(addr, wsc_info.uuid_e))
return NULL;
wsc_info.primary_device_type = dev->device_info.primary_device_type;