Interworking: Fix INTERWORKING_CONNECT with zero-length SSID BSS entry

For Interworking connection to work, the SSID of the selected BSS needs
to be known to be able to associate with the AP. It was possible for the
scan results to include two BSS entries matching the BSSID when an
earlier scan with that AP has shown a hidden SSID configuration (e.g.,
when running hwsim test cases, but at least in theory, this could happen
with real use cases as well). When that happened, the incorrect BSS
entry may not have included RSN configuration and as such, it would get
rejected for Interworking connection.

Fix this by confirming that the selected BSS entry has a real SSID. If
not, try to find another BSS entry matching the same BSSID and use that,
if found with an SSID.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
This commit is contained in:
Jouni Malinen 2015-01-15 12:24:18 +02:00 committed by Jouni Malinen
parent 1fef85c7c5
commit 783b2a977f

View file

@ -5526,6 +5526,27 @@ static int ctrl_interworking_connect(struct wpa_supplicant *wpa_s, char *dst)
return -1;
}
if (bss->ssid_len == 0) {
int found = 0;
wpa_printf(MSG_DEBUG, "Selected BSS entry for " MACSTR
" does not have SSID information", MAC2STR(bssid));
dl_list_for_each_reverse(bss, &wpa_s->bss, struct wpa_bss,
list) {
if (os_memcmp(bss->bssid, bssid, ETH_ALEN) == 0 &&
bss->ssid_len > 0) {
found = 1;
break;
}
}
if (!found)
return -1;
wpa_printf(MSG_DEBUG,
"Found another matching BSS entry with SSID");
}
return interworking_connect(wpa_s, bss);
}