Skip to content

Commit

Permalink
Support OWE (opportunistic wireless encryption) passwordless mode (#341)
Browse files Browse the repository at this point in the history
* Support OWE mode

* Correct key mgmt name

* Update main.yml

* Reword OWE as passwordless encrypted instead of insecure

---------

Co-authored-by: Ryan Kornheisl <ryan@skarva.tech>
  • Loading branch information
vjr and zeebok authored Nov 22, 2023
1 parent 4553bda commit b7d2fc5
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 3 deletions.
21 changes: 19 additions & 2 deletions src/Views/WifiPage.vala
Original file line number Diff line number Diff line change
Expand Up @@ -479,8 +479,9 @@ namespace Network {
return;
}

var connection = NM.SimpleConnection.new ();

if (row.is_secured) {
var connection = NM.SimpleConnection.new ();
var s_con = new NM.SettingConnection () {
uuid = NM.Utils.uuid_generate ()
};
Expand Down Expand Up @@ -531,8 +532,24 @@ namespace Network {
wifi_dialog.run ();
wifi_dialog.destroy ();
} else {
if (NM.@80211ApSecurityFlags.KEY_MGMT_OWE in row.ap.get_rsn_flags () ||
NM.@80211ApSecurityFlags.KEY_MGMT_OWE in row.ap.get_wpa_flags ()) {
var s_con = new NM.SettingConnection () {
uuid = NM.Utils.uuid_generate ()
};
connection.add_setting (s_con);
var s_wsec = new NM.SettingWirelessSecurity () {
key_mgmt = "owe"
};
connection.add_setting (s_wsec);
var s_wifi = new NM.SettingWireless () {
ssid = row.ap.get_ssid ()
};
connection.add_setting (s_wifi);
}

client.add_and_activate_connection_async.begin (
NM.SimpleConnection.new (),
connection,
wifi_device,
row.ap.get_path (),
null,
Expand Down
3 changes: 3 additions & 0 deletions src/Widgets/WifiMenuItem.vala
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,9 @@ public class Network.WifiMenuItem : Gtk.ListBoxRow {
} else if (NM.@80211ApSecurityFlags.KEY_MGMT_PSK in flags) {
is_secured = true;
state_string = _("WPA encrypted");
} else if (NM.@80211ApSecurityFlags.KEY_MGMT_OWE in flags) {
is_secured = true;
state_string = _("Passwordless encrypted");
} else if (flags != NM.@80211ApSecurityFlags.NONE) {
is_secured = true;
state_string = _("Encrypted");
Expand Down
2 changes: 1 addition & 1 deletion src/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ plug_files = files(
switchboard_dep = dependency('switchboard-2.0')
switchboard_plugsdir = switchboard_dep.get_pkgconfig_variable('plugsdir', define_variable: ['libdir', libdir])

libnm_dep = dependency('libnm', version: '>=1.20.6')
libnm_dep = dependency('libnm', version: '>=1.24')

args = []
if libnm_dep.version().version_compare('>=1.43.3')
Expand Down

0 comments on commit b7d2fc5

Please sign in to comment.