Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: WPA3 personal support #5586

Merged
merged 10 commits into from
Dec 5, 2024
Merged

feat: WPA3 personal support #5586

merged 10 commits into from
Dec 5, 2024

Conversation

pierantoniomerlino
Copy link
Contributor

@pierantoniomerlino pierantoniomerlino commented Nov 26, 2024

This PR adds the experimental support for the WPA Personal security in WiFi connections, both for Station and AP mode.

Related Issue: This PR fixes/closes N/A

Description of the solution adopted: The PR removes the filtering of WPA3 hotspots, so the user can perform a scan from the webUI and select such types of networks. The supported securities are WPA3 and WPA2/WPA3 Personal.
As usual, after the network selection, the Wireless tab is filled accordingly.
The AP mode is supported as well. So, the user can configure Kura to implement an Access Point with WPA3 Personal security.
The code configured the proper properties to NetworkManager using the DBus APIs.

The feature is marked as experimental (and the tooltip on the webUI warns the user about it) because on several devices (like the RPI) it is not fully supported [1].

WPA3 allows passwords of any length, instead of WPA2 that limits to 8-63 chars. Since this is dependant on the underlying implementation, I preferred to leave this as is. For example, it seems that the Linux driver limit the password length to 128bytes.

[1] On the RPI5, with the latest wifi module firmware, the station mode will probably work. The Access Point mode is not currently supported.

@pierantoniomerlino pierantoniomerlino changed the title feat: Wpa3 personal support feat: WPA3 personal support Dec 2, 2024
@MMaiero
Copy link
Contributor

MMaiero commented Dec 2, 2024

@pierantoniomerlino Is this ready for review or still a draft?

@pierantoniomerlino pierantoniomerlino marked this pull request as ready for review December 2, 2024 12:18
MMaiero
MMaiero previously approved these changes Dec 3, 2024
Copy link
Contributor

@MMaiero MMaiero left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested with Raspberry PI 3. Direct wpa3 AP not possible, but compatibility mode tested.

Comment on lines +32 to +49
case "NONE":
return KuraWifiSecurityType.SECURITY_NONE;
case "SECURITY_WEP":
return KuraWifiSecurityType.SECURITY_WEP;
case "SECURITY_WPA":
return KuraWifiSecurityType.SECURITY_WPA;
case "SECURITY_WPA2":
return KuraWifiSecurityType.SECURITY_WPA2;
case "SECURITY_WPA3":
return KuraWifiSecurityType.SECURITY_WPA3;
case "SECURITY_WPA2_WPA3_ENTERPRISE":
return KuraWifiSecurityType.SECURITY_WPA2_WPA3_ENTERPRISE;
case "SECURITY_WPA_WPA2":
return KuraWifiSecurityType.SECURITY_WPA_WPA2;
case "SECURITY_WPA2_WPA3":
return KuraWifiSecurityType.SECURITY_WPA2_WPA3;
default:
throw new IllegalArgumentException("Invalid security type: " + securityType);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Indentation

pierantoniomerlino and others added 10 commits December 5, 2024 09:21
Signed-off-by: pierantoniomerlino <[email protected]>
Signed-off-by: pierantoniomerlino <[email protected]>
Signed-off-by: pierantoniomerlino <[email protected]>
Signed-off-by: pierantoniomerlino <[email protected]>
Signed-off-by: pierantoniomerlino <[email protected]>
Signed-off-by: pierantoniomerlino <[email protected]>
Signed-off-by: pierantoniomerlino <[email protected]>
…/web/client/messages/Messages.properties

Co-authored-by: Mattia Dal Ben <[email protected]>
@mattdibi
Copy link
Contributor

mattdibi commented Dec 5, 2024

Tested on RPi4. I created an ad-hoc WPA3 Personal endpoint for testing. The RPi4 was not able to connect even when issuing the command via nmcli...

root@raspberrypi:/home/pi# nmcli dev wifi connect WPA3Testing password passwordForTesting ifname wlan0
Error: Connection activation failed: Secrets were required, but not provided.

after power cycling the RPi4 it was finally able to connect via command line.

root@raspberrypi:/home/pi# nmcli dev wifi connect WPA3Testing password passwordForTesting ifname wlan0
Device 'wlan0' successfully activated with '98aeec5c-4d04-4d37-88e0-38052140ee99'.

Unfortunately Kura doesn't seem to be happy about what's going on under the hood

image

Even after a reinstall, when trying to connect to a WPA3 endpoint Kura gets stuck in this "Roll-back changes" loop

@mattdibi
Copy link
Contributor

mattdibi commented Dec 5, 2024

@MMaiero @pierantoniomerlino to me the code is ok... everything else outside our control isn't... are we sure we want to merge this?

@pierantoniomerlino
Copy link
Contributor Author

@mattdibi Thanks for the feedback. With @MMaiero we decided to contribute the feature, but to hide the WPA3 entry in the webUI. It will be available only setting a property in the kura.properties file. This will be documented, so a user will be able to test the WPA3 connection on his device. When the support for WPA3 will be more reliable, we'll remove the property and make the feature available by default.

@mattdibi
Copy link
Contributor

mattdibi commented Dec 5, 2024

@mattdibi Thanks for the feedback. With @MMaiero we decided to contribute the feature, but to hide the WPA3 entry in the webUI. It will be available only setting a property in the kura.properties file. This will be documented, so a user will be able to test the WPA3 connection on his device. When the support for WPA3 will be more reliable, we'll remove the property and make the feature available by default.

Oh ok... this is a good compromise 👍

@mattdibi mattdibi merged commit 27b8caa into develop Dec 5, 2024
4 checks passed
@mattdibi mattdibi deleted the wpa3_personal_support branch December 5, 2024 10:49
MMaiero pushed a commit that referenced this pull request Dec 20, 2024
* Removed filter for WPA3 security

Signed-off-by: pierantoniomerlino <[email protected]>

* First implementation of WPA3 personal station mode

Signed-off-by: pierantoniomerlino <[email protected]>

* Removed OWE filtering

Signed-off-by: pierantoniomerlino <[email protected]>

* Added support for wpa2/wpa3

Signed-off-by: pierantoniomerlino <[email protected]>

* Added tests for WPA3 configuration

Signed-off-by: pierantoniomerlino <[email protected]>

* Added experimetal tag to WPA3 feature

Signed-off-by: pierantoniomerlino <[email protected]>

* Fixed wpa2/wpa3 selection

Signed-off-by: pierantoniomerlino <[email protected]>

* Added experimetal tag to GwtWifiSecurity

Signed-off-by: pierantoniomerlino <[email protected]>

* Fixed indentation

Signed-off-by: pierantoniomerlino <[email protected]>

* Update kura/org.eclipse.kura.web2/src/main/resources/org/eclipse/kura/web/client/messages/Messages.properties

Co-authored-by: Mattia Dal Ben <[email protected]>

---------

Signed-off-by: pierantoniomerlino <[email protected]>
Co-authored-by: Mattia Dal Ben <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants