mirror of
https://github.com/rustdesk/hbb_common.git
synced 2026-04-02 22:16:18 +00:00
fix(password): remove unnecessary check
Signed-off-by: fufesou <linlong1266@gmail.com>
This commit is contained in:
@@ -1271,8 +1271,6 @@ impl Config {
|
||||
}
|
||||
|
||||
/// Persist permanent password storage and salt from service->user config sync.
|
||||
///
|
||||
/// This never accepts plaintext. `storage` must be empty or a valid hashed verifier storage.
|
||||
pub fn set_permanent_password_storage_for_sync(
|
||||
storage: &str,
|
||||
salt: &str,
|
||||
@@ -1289,15 +1287,6 @@ impl Config {
|
||||
return Ok(true);
|
||||
}
|
||||
|
||||
if salt.is_empty() {
|
||||
return Err(anyhow!(
|
||||
"Refusing to persist hashed permanent password without salt"
|
||||
));
|
||||
}
|
||||
if decode_permanent_password_h1_from_storage(storage).is_none() {
|
||||
return Err(anyhow!("Invalid hashed permanent password storage"));
|
||||
}
|
||||
|
||||
if config.password == storage && config.salt == salt {
|
||||
return Ok(false);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user