mirror of
https://github.com/dani-garcia/vaultwarden.git
synced 2025-06-18 17:30:09 +00:00
Implement constant time equal check for admin, 2fa recover and 2fa remember tokens
This commit is contained in:
parent
bbe2a1b264
commit
9636f33fdb
4 changed files with 13 additions and 3 deletions
|
@ -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
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue