fix(vpn): set data ciphers
This commit is contained in:
parent
d928f3f4d5
commit
371e0b0762
2 changed files with 26 additions and 0 deletions
|
|
@ -683,6 +683,17 @@ impl Page {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if let Err(why) = nmcli::add_fallback(&connection_name).await {
|
||||||
|
return Message::VpnDialogError(VpnDialog::Password {
|
||||||
|
error: Some((ErrorKind::Config, why.to_string())),
|
||||||
|
id: connection_name.clone(),
|
||||||
|
uuid,
|
||||||
|
username,
|
||||||
|
password,
|
||||||
|
password_hidden: true,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
if let Err(why) = nmcli::set_password_flags_none(&connection_name).await {
|
if let Err(why) = nmcli::set_password_flags_none(&connection_name).await {
|
||||||
return Message::VpnDialogError(VpnDialog::Password {
|
return Message::VpnDialogError(VpnDialog::Password {
|
||||||
error: Some((ErrorKind::WithPassword("password-flags"), why.to_string())),
|
error: Some((ErrorKind::WithPassword("password-flags"), why.to_string())),
|
||||||
|
|
|
||||||
|
|
@ -28,6 +28,21 @@ pub async fn set_password_flags_none(connection_name: &str) -> Result<(), String
|
||||||
.apply(crate::utils::map_stderr_output)
|
.apply(crate::utils::map_stderr_output)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pub async fn add_fallback(connection_name: &str) -> Result<(), String> {
|
||||||
|
tokio::process::Command::new("nmcli")
|
||||||
|
.args([
|
||||||
|
"con",
|
||||||
|
"mod",
|
||||||
|
connection_name,
|
||||||
|
"+vpn.data",
|
||||||
|
"data-ciphers=AES-256-GCM:AES-128-GCM:CHACHA20-POLY1305:AES-256-CBC:AES-128-CBC",
|
||||||
|
])
|
||||||
|
.stderr(Stdio::piped())
|
||||||
|
.output()
|
||||||
|
.await
|
||||||
|
.apply(crate::utils::map_stderr_output)
|
||||||
|
}
|
||||||
|
|
||||||
pub async fn set_password(connection_name: &str, password: &str) -> Result<(), String> {
|
pub async fn set_password(connection_name: &str, password: &str) -> Result<(), String> {
|
||||||
tokio::process::Command::new("nmcli")
|
tokio::process::Command::new("nmcli")
|
||||||
.args([
|
.args([
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue