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

wpa3 support #146

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions src/dbus_nm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -253,6 +253,18 @@ impl DBusNetworkManager {
settings.insert("802-11-wireless-security".to_string(), security_settings);
settings.insert("802-1x".to_string(), eap);
}
AccessPointCredentials::Sae { ref passphrase } => {
let mut security_settings: VariantMap = HashMap::new();

add_str(&mut security_settings, "key-mgmt", "sae");
add_str(
&mut security_settings,
"psk",
verify_ascii_password(passphrase)?,
);

settings.insert("802-11-wireless-security".to_string(), security_settings);
}
AccessPointCredentials::None => {}
};

Expand Down
7 changes: 7 additions & 0 deletions src/wifi.rs
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@ bitflags! {
const WPA = 0b0000_0010;
const WPA2 = 0b0000_0100;
const ENTERPRISE = 0b0000_1000;
const WPA3 = 0b0001_0000;
}
}

Expand All @@ -110,6 +111,9 @@ pub enum AccessPointCredentials {
identity: String,
passphrase: String,
},
Sae {
passphrase: String,
},
}

bitflags! {
Expand Down Expand Up @@ -214,6 +218,9 @@ fn get_access_point_security(manager: &DBusNetworkManager, path: &str) -> Result
if rsn_flags != NM80211ApSecurityFlags::AP_SEC_NONE {
security |= Security::WPA2;
}
if rsn_flags.contains(NM80211ApSecurityFlags::AP_SEC_KEY_MGMT_SAE) {
security |= Security::WPA3;
}

if wpa_flags.contains(NM80211ApSecurityFlags::AP_SEC_KEY_MGMT_802_1X)
|| rsn_flags.contains(NM80211ApSecurityFlags::AP_SEC_KEY_MGMT_802_1X)
Expand Down