mirror of
https://github.com/rustdesk/rustdesk.git
synced 2026-04-01 23:31:28 +03:00
password: decrypt password when import user config
Signed-off-by: 21pages <pages21@163.com>
This commit is contained in:
@@ -228,6 +228,13 @@ impl Config2 {
|
||||
config
|
||||
}
|
||||
|
||||
pub fn decrypt_password(&mut self) {
|
||||
if let Some(mut socks) = self.socks.clone() {
|
||||
socks.password = decrypt_str_or_original(&socks.password, PASSWORD_ENC_VERSION).0;
|
||||
self.socks = Some(socks);
|
||||
}
|
||||
}
|
||||
|
||||
pub fn file() -> PathBuf {
|
||||
Config::file_("2")
|
||||
}
|
||||
@@ -299,6 +306,10 @@ impl Config {
|
||||
config
|
||||
}
|
||||
|
||||
pub fn decrypt_password(&mut self) {
|
||||
self.password = decrypt_str_or_original(&self.password, PASSWORD_ENC_VERSION).0;
|
||||
}
|
||||
|
||||
fn store(&self) {
|
||||
let mut config = self.clone();
|
||||
config.password = encrypt_str_or_original(&config.password, PASSWORD_ENC_VERSION);
|
||||
|
||||
Reference in New Issue
Block a user