[PATCH] wpa_supplicant: Add the authentication failures count as a DBus attribute

Federico Sauter federico.sauter at ableton.com
Mon Sep 30 06:02:09 PDT 2019


I would like to establish whether the authentication using a supplied PSK for a BSS was successful or not. The success case is easy, since it results in the establishment of the connection (fi.w1.wpa_supplicant1.Interface property state = connected).

The error case is more tricky, since I found no way of getting an authentication failure signal over DBus. This information would be available over the socket interface: in the CTRL-EVENT-SSID-TEMP-DISABLED event, but there seems to be nothing comparable over the DBus interface.

In my observations, the AssocStatusCode, DisconnectReason, and AuthStatusCode attributes are never set to anything other than zero, making them unfit for this.

Therefore, I added a DBus attribute for auth_failures. A change in its state is notified in the wpas_auth_failed() function, ensuring that an authentication failure is always notified by listening to the PropertiesChanged signal and checking that the new AuthFailures attribute is greater than zero.

However, by further reading the code I noticed that wpas_auth_failed() may also be called from wpas_connection_failed() in the context of blacklist management. In that case, the auth_failures  attribute would probably not be an accurate sign of an authentication failure (?).

Is the wpas_auth_failed() function the one and only place where an authentication failure can be accurately diagnosed, or are there any other locations in the code base that should be taken into account?

Would it make sense to change the wpas_connection_failed() as well so that it temp-disables an SSID, but it doesn't use the auth_failures counter for that?

Attached you will find the proposed patch.

Kind regards,
Federico Sauter

-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-wpa_supplicant-Add-auth_failures-count-as-a-DBus-att.patch
Type: application/octet-stream
Size: 6276 bytes
Desc: 0001-wpa_supplicant-Add-auth_failures-count-as-a-DBus-att.patch
URL: <http://lists.infradead.org/pipermail/hostap/attachments/20190930/8a680f47/attachment-0001.obj>

More information about the Hostap mailing list