3
0
mirror of https://git.kernel.org/pub/scm/network/wireless/iwd.git synced 2024-12-22 21:22:37 +01:00

scan: allow non-utf8 SSIDs to be scanned for

IWD has restricted SSIDs to only utf8 so they can be displayed but
with the addition of OWE transition networks this is an unneeded
restriction (for these networks). The SSID of an OWE transition
network is never displayed to the user so limiting to utf8 isn't
required.

Allow non-utf8 SSIDs to be scanned for by including the length in
the scan parameters and not relying on strlen().
This commit is contained in:
James Prestwood 2021-09-16 09:30:41 -07:00 committed by Denis Kenzior
parent 56c2cf9f10
commit df6221bcb2
4 changed files with 14 additions and 7 deletions

View File

@ -1980,7 +1980,8 @@ static void p2p_provision_scan_start(struct p2p_device *dev)
params.flush = true;
params.no_cck_rates = true;
params.ssid = dev->go_group_id.ssid;
params.ssid = (const uint8_t *)dev->go_group_id.ssid;
params.ssid_len = strlen(dev->go_group_id.ssid);
params.extra_ie = p2p_build_scan_ies(dev, buf, sizeof(buf),
&params.extra_ie_size);
L_WARN_ON(!params.extra_ie);
@ -3783,7 +3784,8 @@ static bool p2p_device_scan_start(struct p2p_device *dev)
L_WARN_ON(!params.extra_ie);
params.flush = true;
/* P2P Wildcard SSID because we don't need legacy networks to reply */
params.ssid = "DIRECT-";
params.ssid = (const uint8_t *)"DIRECT-";
params.ssid_len = strlen("DIRECT-");
/*
* Must send probe requests at 6Mb/s, OFDM only. The no-CCK rates
* flag forces the drivers to do exactly this for 2.4GHz frames.

View File

@ -542,7 +542,7 @@ static void scan_cmds_add(struct l_queue *cmds, struct scan_context *sc,
if (params->ssid) {
/* direct probe request scan */
l_genl_msg_append_attr(cmd, NL80211_ATTR_SSID,
strlen(params->ssid), params->ssid);
params->ssid_len, params->ssid);
l_genl_msg_leave_nested(cmd);
l_queue_push_tail(cmds, cmd);

View File

@ -97,7 +97,8 @@ struct scan_parameters {
bool randomize_mac_addr_hint : 1;
bool no_cck_rates : 1;
bool duration_mandatory : 1;
const char *ssid; /* Used for direct probe request */
const uint8_t *ssid; /* Used for direct probe request */
size_t ssid_len;
const uint8_t *source_mac;
};

View File

@ -2009,9 +2009,12 @@ static int station_roam_scan(struct station *station,
l_debug("ifindex: %u", netdev_get_ifindex(station->netdev));
if (station->connected_network)
if (station->connected_network) {
const char *ssid = network_get_ssid(station->connected_network);
/* Use direct probe request */
params.ssid = network_get_ssid(station->connected_network);
params.ssid = (const uint8_t *)ssid;
params.ssid_len = strlen(ssid);
}
if (!freq_set)
station->roam_scan_full = true;
@ -2916,7 +2919,8 @@ static struct l_dbus_message *station_dbus_connect_hidden_network(
return dbus_error_not_hidden(message);
}
params.ssid = ssid;
params.ssid = (const uint8_t *)ssid;
params.ssid_len = strlen(ssid);
/* HW cannot randomize our MAC if connected */
if (!station->connected_bss)