summaryrefslogtreecommitdiff
path: root/plugins
diff options
context:
space:
mode:
authorDaniel Wagner <wagi@monom.org>2020-02-05 20:34:49 +0100
committerDaniel Wagner <wagi@monom.org>2020-02-07 08:58:52 +0100
commit262d4756bf63b5ace98e869b891f56d6c742ff85 (patch)
treee55de971e46d83dbf9f10ad9bb11cad3ebfea729 /plugins
parente355e20c94284442d37a8548b70889bcc7d5e3a8 (diff)
downloadconnman-262d4756bf63b5ace98e869b891f56d6c742ff85.tar.gz
iwd: Propogate invalid key on connection attempt failure
Currently all connection attempts are reported as CONNMAN_NETWORK_ERROR_CONNECT_FAIL. When the user enters an wrong passphrase the upper layers wont reset the passphrase unless CONNMAN_NETWORK_ERROR_INVALID_KEY is reported. This prevents the user to enter a new passphrase. Unfortunately, when the passphrase is correct but the connect attempt fails with 'Failed', ConnMan will reset the passphrase. But this behavoir is way better then not being able to provide the correct passphrase. Reported-by: Maxime Roussin-BĂ©langer <maxime.roussinbelanger@gmail.com>
Diffstat (limited to 'plugins')
-rw-r--r--plugins/iwd.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/plugins/iwd.c b/plugins/iwd.c
index 7b5d9b92..39879f6f 100644
--- a/plugins/iwd.c
+++ b/plugins/iwd.c
@@ -241,7 +241,11 @@ static void cm_network_connect_cb(DBusMessage *message, void *user_data)
return;
DBG("%s connect failed: %s", path, dbus_error);
- connman_network_set_error(iwdn->network,
+ if (!strcmp(dbus_error, "net.connman.iwd.Failed"))
+ connman_network_set_error(iwdn->network,
+ CONNMAN_NETWORK_ERROR_INVALID_KEY);
+ else
+ connman_network_set_error(iwdn->network,
CONNMAN_NETWORK_ERROR_CONNECT_FAIL);
return;
}