All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] iwd: Fix connection with no passphrase
       [not found] <20220118105214.1201110-1-Emmanuel.VAUTRIN@cpexterne.org>
@ 2022-01-18 11:01 ` VAUTRIN Emmanuel (Canal Plus Prestataire)
  2022-01-18 11:03   ` Michael Nazzareno Trimarchi
  0 siblings, 1 reply; 4+ messages in thread
From: VAUTRIN Emmanuel (Canal Plus Prestataire) @ 2022-01-18 11:01 UTC (permalink / raw)
  To: connman

[-- Attachment #1: Type: text/plain, Size: 923 bytes --]

During a failing connection on a secure network with no passphrase,
agent_request_passphrase() crashes, trying to manipulate the value
of the "WiFi.Passphrase" key, which is null.
---
 plugins/iwd.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/plugins/iwd.c b/plugins/iwd.c
index b0e17a4d6396..b524a731fb92 100644
--- a/plugins/iwd.c
+++ b/plugins/iwd.c
@@ -1489,6 +1489,8 @@ static DBusMessage *agent_request_passphrase(DBusConnection *dbus_conn,
                 return get_reply_on_error(message, EINVAL);
 
         passwd = connman_network_get_string(iwdn->network, "WiFi.Passphrase");
+       if (!passwd)
+               return get_reply_on_error(message, ENOKEY);
 
         return g_dbus_create_reply(message, DBUS_TYPE_STRING, &passwd,
                                         DBUS_TYPE_INVALID);
-- 
2.25.1
Hi,

Same problem here, I attach the patch.

Best Regards,

Emmanuel

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-iwd-Fix-connection-with-no-passphrase.patch --]
[-- Type: text/x-patch; name="0001-iwd-Fix-connection-with-no-passphrase.patch", Size: 967 bytes --]

From b2a5e64a1e79b0c112e764e691050a63ae9e49ec Mon Sep 17 00:00:00 2001
From: Emmanuel VAUTRIN <Emmanuel.VAUTRIN@cpexterne.org>
Date: Thu, 6 Jan 2022 15:11:34 +0100
Subject: [PATCH] iwd: Fix connection with no passphrase

During a failing connection on a secure network with no passphrase,
agent_request_passphrase() crashes, trying to manipulate the value
of the "WiFi.Passphrase" key, which is null.
---
 plugins/iwd.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/plugins/iwd.c b/plugins/iwd.c
index b0e17a4d6396..b524a731fb92 100644
--- a/plugins/iwd.c
+++ b/plugins/iwd.c
@@ -1489,6 +1489,8 @@ static DBusMessage *agent_request_passphrase(DBusConnection *dbus_conn,
 		return get_reply_on_error(message, EINVAL);
 
 	passwd = connman_network_get_string(iwdn->network, "WiFi.Passphrase");
+	if (!passwd)
+		return get_reply_on_error(message, ENOKEY);
 
 	return g_dbus_create_reply(message, DBUS_TYPE_STRING, &passwd,
 					DBUS_TYPE_INVALID);
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] iwd: Fix connection with no passphrase
  2022-01-18 11:01 ` [PATCH] iwd: Fix connection with no passphrase VAUTRIN Emmanuel (Canal Plus Prestataire)
@ 2022-01-18 11:03   ` Michael Nazzareno Trimarchi
  2022-01-21  7:53     ` Daniel Wagner
  0 siblings, 1 reply; 4+ messages in thread
From: Michael Nazzareno Trimarchi @ 2022-01-18 11:03 UTC (permalink / raw)
  To: VAUTRIN Emmanuel (Canal Plus Prestataire); +Cc: connman

Hi

On Tue, Jan 18, 2022 at 12:01 PM VAUTRIN Emmanuel (Canal Plus
Prestataire) <Emmanuel.VAUTRIN@cpexterne.org> wrote:
>
> During a failing connection on a secure network with no passphrase,
> agent_request_passphrase() crashes, trying to manipulate the value
> of the "WiFi.Passphrase" key, which is null.
> ---
>  plugins/iwd.c | 2 ++
>  1 file changed, 2 insertions(+)
>
> diff --git a/plugins/iwd.c b/plugins/iwd.c
> index b0e17a4d6396..b524a731fb92 100644
> --- a/plugins/iwd.c
> +++ b/plugins/iwd.c
> @@ -1489,6 +1489,8 @@ static DBusMessage *agent_request_passphrase(DBusConnection *dbus_conn,
>                  return get_reply_on_error(message, EINVAL);
>
>          passwd = connman_network_get_string(iwdn->network, "WiFi.Passphrase");
> +       if (!passwd)
> +               return get_reply_on_error(message, ENOKEY);
>
>          return g_dbus_create_reply(message, DBUS_TYPE_STRING, &passwd,
>                                          DBUS_TYPE_INVALID);
> --
> 2.25.1

I don't know if we have some Reviewed-by: Michael Trimarchi
<michael@amarulasolutions.com>

Michael

> Hi,
>
> Same problem here, I attach the patch.
>
> Best Regards,
>
> Emmanuel



-- 
Michael Nazzareno Trimarchi
Co-Founder & Chief Executive Officer
M. +39 347 913 2170
michael@amarulasolutions.com
__________________________________

Amarula Solutions BV
Joop Geesinkweg 125, 1114 AB, Amsterdam, NL
T. +31 (0)85 111 9172
info@amarulasolutions.com
www.amarulasolutions.com

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] iwd: Fix connection with no passphrase
  2022-01-18 11:03   ` Michael Nazzareno Trimarchi
@ 2022-01-21  7:53     ` Daniel Wagner
  2022-01-21  9:46       ` VAUTRIN Emmanuel (Canal Plus Prestataire)
  0 siblings, 1 reply; 4+ messages in thread
From: Daniel Wagner @ 2022-01-21  7:53 UTC (permalink / raw)
  To: Michael Nazzareno Trimarchi
  Cc: VAUTRIN Emmanuel (Canal Plus Prestataire), connman

On Tue, Jan 18, 2022 at 12:03:12PM +0100, Michael Nazzareno Trimarchi wrote:
> On Tue, Jan 18, 2022 at 12:01 PM VAUTRIN Emmanuel (Canal Plus
> Prestataire) <Emmanuel.VAUTRIN@cpexterne.org> wrote:
> >
> > During a failing connection on a secure network with no passphrase,
> > agent_request_passphrase() crashes, trying to manipulate the value
> > of the "WiFi.Passphrase" key, which is null.

Patch applied.

> I don't know if we have some Reviewed-by: Michael Trimarchi
> <michael@amarulasolutions.com>

No, we didn't do this SoB & Co stuff so far. IIRC it is something Intel
sponsored projects do. Though this is project is complete independent by
now. I haven't really spend any time figuring out the legal stuff. Hence
I didn't wanted to start adding SoB. The reviewed tag seems not to touch
any of the legal stuff. Added it :)

Daniel

^ permalink raw reply	[flat|nested] 4+ messages in thread

* RE: [PATCH] iwd: Fix connection with no passphrase
  2022-01-21  7:53     ` Daniel Wagner
@ 2022-01-21  9:46       ` VAUTRIN Emmanuel (Canal Plus Prestataire)
  0 siblings, 0 replies; 4+ messages in thread
From: VAUTRIN Emmanuel (Canal Plus Prestataire) @ 2022-01-21  9:46 UTC (permalink / raw)
  To: connman

> Patch applied.
Great, thank you Daniel!

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2022-01-21  9:46 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <20220118105214.1201110-1-Emmanuel.VAUTRIN@cpexterne.org>
2022-01-18 11:01 ` [PATCH] iwd: Fix connection with no passphrase VAUTRIN Emmanuel (Canal Plus Prestataire)
2022-01-18 11:03   ` Michael Nazzareno Trimarchi
2022-01-21  7:53     ` Daniel Wagner
2022-01-21  9:46       ` VAUTRIN Emmanuel (Canal Plus Prestataire)

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.