nerves-networking / vintage_net_wifi

WiFi networking for VintageNet
Apache License 2.0
31 stars 17 forks source link

Parsing all flags in scan_results for WPA2/WPA3-Personal #52

Closed jsimmonds2 closed 3 years ago

jsimmonds2 commented 3 years ago

Newer Wi-Fi routers implement WPA3 and can offer stations a mixed WPA2/WPA3-Personal security choice.

VintageNet WiFi fails to report the presence of WPA2 security in this case.

On the recent Buildroot Linux used by FarmBot Inc. on Raspberry Pi 3 Model B this scan result shows the flags as decoded by wpa_supplicant for such a router configuration, but VintageNet only reports WPS and ESS bits.

iex(farmbot@farmbot-84e5.local)18> cmd 'wpa_cli -i wlan0 -p /tmp/vintage_net/wpa_supplicant scan_results'
bssid / frequency / signal level / flags / ssid
3c:7c:3f:40:ae:f1       2442    -11     [WPA2-PSK+SAE-CCMP][WPS][ESS]   IoT
f0:2f:74:28:b6:01       2442    -31     [WPA2-PSK+SAE-CCMP][WPS][ESS]   IoT
f0:2f:74:28:6b:70       2442    -34     [WPA2-PSK+SAE-CCMP][WPS][ESS]   IoT
5c:a5:bc:9a:da:a5       2412    -40     [WPA2-PSK-CCMP][ESS]    IoT-1
[ . . . ]

This defect resulted in this discussion over in the FarmBot Forum :)

fhunleth commented 3 years ago

Thanks for posting this.

Were you or someone else from FarmBot planning to send a PR?

ConnorRigby commented 3 years ago

Looks like we're missing a line here https://github.com/nerves-networking/vintage_net_wifi/blob/main/lib/vintage_net_wifi/wpa_supplicant_decoder.ex#L257 i'm updating right now.

fhunleth commented 3 years ago

PR #53 fixes this specific issue, but it doesn't fix connections to pure WPA3 and WPA2/3 access points. I think the change at https://github.com/nerves-networking/vintage_net_wifi/commit/bac1209a6a77d9d0541314c0e160d153868f3d30 is really close, but I haven't been able to test. I should get another try tomorrow. My plan is to merge this PR after confirming that WPA3 network connections work.

fhunleth commented 3 years ago

Update: I merged #53. WPA3 still isn't working, but I'm getting errors that look like device driver ones and the changes in #53 are needed no matter what.