Implement constant time equal check for admin, 2fa recover and 2fa remember tokens

This commit is contained in:
Daniel García committed 2019-02-11 23:45:55 +01:00
1 parent bbe2a1b264
commit 9636f33fdb
4 files changed
+13 -3

No files matched your search

+1 -1
View File
@@ -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
}