Discussion:
Stale WPS state when authentication fails
(too old to reply)
Juha Kuikka
2015-10-20 23:06:18 UTC
Permalink
Hello,

If I attempt to connect to a network using WPS (pin code or push button)
and the authentication fails it seems the "WiFi.UseWPS" flag never gets
reset.

This causes the next connection attempt to default to the WPS mode (and
fail) and not use the Agent API to request new authentication information.

I did a quick patch that fixes this behavior but I'm not sure if there is a
better way to do this, maybe in the wifi plugin code by indicating key
error if wps fails.

Any advice on where this fix should go?

I tested this on v1.29 and v1.30, both behave the same way before (and
after) the patch.

diff --git a/external/connman-1.29/src/service.c
b/external/connman-1.29/src/service.c
index 2b2fcd5..dd58767 100644
--- a/external/connman-1.29/src/service.c
+++ b/external/connman-1.29/src/service.c
@@ -5464,6 +5464,11 @@ static int service_indicate_state(struct
connman_service *service)

case CONNMAN_SERVICE_STATE_FAILURE:

+ /* Clear WPS usage so on retry new method will be asked
from the user */
+ if (service->type == CONNMAN_SERVICE_TYPE_WIFI)
+ connman_network_set_bool(service->network,
+ "WiFi.UseWPS",
false);
+
if (service->connect_reason ==
CONNMAN_SERVICE_CONNECT_REASON_USER &&
connman_agent_report_error(service, service->path,
error2string(service->error),
Patrik Flykt
2015-10-21 10:07:13 UTC
Permalink
Post by Juha Kuikka
Hello,
If I attempt to connect to a network using WPS (pin code or push button)
and the authentication fails it seems the "WiFi.UseWPS" flag never gets
reset.
This causes the next connection attempt to default to the WPS mode (and
fail) and not use the Agent API to request new authentication information.
I did a quick patch that fixes this behavior but I'm not sure if there is a
better way to do this, maybe in the wifi plugin code by indicating key
error if wps fails.
Please send this as a patch email.
Post by Juha Kuikka
Any advice on where this fix should go?
By quickly looking and not thinking about it, it looks fine. Tomasz?

Patrik

Loading...