Skip to contentSkip to conversation

iwd: Fix connection with invalid passphrase format

PATCH In review VAUTRIN Emmanuel (Canal Plus Prestataire) 2 participants 3 messages Apr 11, 2022 – Apr 14, 2022 1 message not in the archive

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

#1 lore raw

PATCH 1/1 iwd: Fix connection with invalid passphrase format

It is no more possible to connect to a secure network, after entering an invalid passphrase format, for example 64 characters.
In this case, the user agent still needs to be called, to request a new passphrase.

---
 plugins/iwd.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
plugins/iwd.c +3 -1
index ee3ed83e5957..f2d368336d1a 100644
@@ -241,7 +241,9 @@ static void cm_network_connect_cb(DBusMessage *message, void *user_data)
                        return;
 
                DBG("%s connect failed: %s", path, dbus_error);
-               if (!strcmp(dbus_error, "net.connman.iwd.Failed"))
+               if (!strcmp(dbus_error, "net.connman.iwd.Failed") ||
+                                       !strcmp(dbus_error,
+                                       "net.connman.iwd.InvalidFormat"))
                        connman_network_set_error(iwdn->network,
                                        CONNMAN_NETWORK_ERROR_INVALID_KEY);
                else if (!iwdn->autoconnect)

--
2.25.1

Hello,

Please find the well formatted patch in attachment.

Emmanuel

From 8cbd34aa536284a5349ee61a0bdba126b8b42fbf Mon Sep 17 00:00:00 2001
From: Emmanuel VAUTRIN <[email protected]>
Date: Fri, 8 Apr 2022 17:24:19 +0200
Subject: [PATCH] iwd: Fix connection with invalid passphrase format

It is no more possible to connect to a secure network, after entering an invalid passphrase format, for example 64 characters.
In this case, the user agent still needs to be called, to request a new passphrase.

---
 plugins/iwd.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
plugins/iwd.c +3 -1
index ee3ed83e5957..f2d368336d1a 100644
@@ -241,7 +241,9 @@ static void cm_network_connect_cb(DBusMessage *message, void *user_data)
 			return;
 
 		DBG("%s connect failed: %s", path, dbus_error);
-		if (!strcmp(dbus_error, "net.connman.iwd.Failed"))
+		if (!strcmp(dbus_error, "net.connman.iwd.Failed") ||
+					!strcmp(dbus_error,
+					"net.connman.iwd.InvalidFormat"))
 			connman_network_set_error(iwdn->network,
 					CONNMAN_NETWORK_ERROR_INVALID_KEY);
 		else if (!iwdn->autoconnect)
Signature · 1 line
2.25.1
#2 lore raw
Quoted 4 lines · VAUTRIN Emmanuel (Canal Plus Prestataire)

It is no more possible to connect to a secure network, after entering an invalid passphrase format, for example 64 characters.
In this case, the user agent still needs to be called, to request a new passphrase.

Thanks, patch applied.