commit ad242a796afb14692f19bfd266a1f8ced08c6d3b
parent 07c870df55d29ff7f9d7b9f5cf66ba8efd0028a5
Author: James Prestwood <james.prestwood@linux.intel.com>
Date: Thu, 15 Nov 2018 08:58:35 -0800
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.
Diffstat:
1 file changed, 8 insertions(+), 5 deletions(-)
diff --git a/src/network.c b/src/network.c
@@ -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,9 +542,11 @@ int network_autoconnect(struct network *network, struct scan_bss *bss)
goto close_settings;
}
- ret = network_load_psk(network, bss_is_sae(bss));
- if (ret < 0)
- 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 */
@@ -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,