mirror of
https://github.com/rustdesk/hbb_common.git
synced 2026-04-02 22:16:18 +00:00
fix(password): use password, best effort
Signed-off-by: fufesou <linlong1266@gmail.com>
This commit is contained in:
@@ -670,6 +670,10 @@ impl Config {
|
|||||||
if config.salt.is_empty() {
|
if config.salt.is_empty() {
|
||||||
config.salt = Config::get_auto_password(DEFAULT_SALT_LEN);
|
config.salt = Config::get_auto_password(DEFAULT_SALT_LEN);
|
||||||
}
|
}
|
||||||
|
if is_permanent_password_hashed_storage(&plain) {
|
||||||
|
config.password = plain;
|
||||||
|
return true;
|
||||||
|
}
|
||||||
let h1 = compute_permanent_password_h1(&plain, &config.salt);
|
let h1 = compute_permanent_password_h1(&plain, &config.salt);
|
||||||
config.password = encode_permanent_password_storage_from_h1(&h1);
|
config.password = encode_permanent_password_storage_from_h1(&h1);
|
||||||
return true;
|
return true;
|
||||||
|
|||||||
Reference in New Issue
Block a user