in need of reliable WPS, I've taken a closer look into
implementation. As stated in a previous mail, I had trouble connecting
via WPS in case multiple WPS-enabled networks are present.
The current implementation does not allow identification of networks
advertising as WPS registrar from client programs. Therefore, a client
cannot tell which network it should try to connect with unless it is
given a hint from the user by means of some interactive UI. I
understand that asking the user for the intended network is a good way
to avoid accidental connections with wrong/malicious networks.
However, in case there is no way to ask the user for the correct
network (e.g., devices with no display), the network must be
determined automatically. Since it is currently impossible to tell
which network has WPS activated, such an automatic network selection
must be based on pure guessing and is therefore very unreliable in
case there are multiple networks in range, especially if their
strengths are similar.
And so I dived into ConnMan...
To support automatic network selection, I have patched current master
of ConnMan to add the string "wps_advertising" to the "Security"
array of WiFi services while WPS is being advertised for the service.
It basically works by making the wps_advertizing flag in
network_added() in plugins/wifi.c available to the service code in
src/service.c (incidental remark: "advertizing" is not an English
word, it should be "advertising" even in AE).
I added some code to add_or_replace_bss_to_network() in
gsupplicant/supplicant.c and to network_changed() in plugins/wifi.c
for reporting changes of WPS capabilities so that WPS changes are made
available to clients as soon as they are reported by wpa_supplicant.
On the way, I have found that WPS capabilities updates in gsupplicant
are incorrect and incomplete. This is a bug in the current code which
should probably be fixed anyway, independently of my other changes.
All in all, I have three patches against master ready now which seem
to work pretty well to fix my use case. Would you guys be interested
to review these patches?
please go ahead and send them.
On a different note, have you tried iwd instead of wpa_supplicant? It has a way better WPS
implementation and we would also like to get feedback on it.