mirror of
https://github.com/dani-garcia/vaultwarden.git
synced 2025-09-10 18:55:57 +03:00
Implement constant time equal check for admin, 2fa recover and 2fa remember tokens
This commit is contained in:
@@ -86,7 +86,7 @@ impl User {
|
||||
|
||||
pub fn check_valid_recovery_code(&self, recovery_code: &str) -> bool {
|
||||
if let Some(ref totp_recover) = self.totp_recover {
|
||||
recovery_code == totp_recover.to_lowercase()
|
||||
crate::crypto::ct_eq(recovery_code, totp_recover.to_lowercase())
|
||||
} else {
|
||||
false
|
||||
}
|
||||
|
Reference in New Issue
Block a user