mirror of
https://git.kernel.org/pub/scm/network/wireless/iwd.git
synced 2025-01-03 10:32:33 +01:00
network: fix 8021x autoconnect
In network_autoconnect, when the network was SECURITY_8021X there was no check (for SECURITY_PSK) before calling network_load_psk. Since the provisioning file was for an 8021x network neither PreSharedKey or Passphrase existed so this would always fail. This fixes the 8021x failure in testConnectAutoconnect.
This commit is contained in:
parent
07c870df55
commit
ad242a796a
@ -505,11 +505,12 @@ int network_autoconnect(struct network *network, struct scan_bss *bss)
|
||||
{
|
||||
struct station *station = network->station;
|
||||
struct wiphy *wiphy = station_get_wiphy(station);
|
||||
enum security security = network_get_security(network);
|
||||
bool is_autoconnectable;
|
||||
bool is_rsn;
|
||||
int ret;
|
||||
|
||||
switch (network_get_security(network)) {
|
||||
switch (security) {
|
||||
case SECURITY_NONE:
|
||||
is_rsn = false;
|
||||
break;
|
||||
@ -541,10 +542,12 @@ int network_autoconnect(struct network *network, struct scan_bss *bss)
|
||||
goto close_settings;
|
||||
}
|
||||
|
||||
if (security == SECURITY_PSK) {
|
||||
ret = network_load_psk(network, bss_is_sae(bss));
|
||||
if (ret < 0)
|
||||
goto close_settings;
|
||||
}
|
||||
}
|
||||
|
||||
/* If no entry, default to Autoconnectable=True */
|
||||
if (!l_settings_get_bool(network->settings, "Settings",
|
||||
@ -555,7 +558,7 @@ int network_autoconnect(struct network *network, struct scan_bss *bss)
|
||||
if (!is_autoconnectable)
|
||||
goto close_settings;
|
||||
|
||||
if (network_get_security(network) == SECURITY_8021X) {
|
||||
if (security == SECURITY_8021X) {
|
||||
struct l_queue *missing_secrets = NULL;
|
||||
|
||||
ret = eap_check_settings(network->settings, network->secrets,
|
||||
|
Loading…
Reference in New Issue
Block a user