1
0
Fork 0
mirror of https://github.com/dani-garcia/vaultwarden.git synced 2025-09-12 12:42:42 +00:00

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

This commit is contained in:
Daniel García 2019-02-11 23:45:55 +01:00
commit 9636f33fdb
No known key found for this signature in database
GPG key ID: FC8A7D14C3CD543A
4 changed files with 13 additions and 3 deletions

View file

@ -89,7 +89,7 @@ fn post_admin_login(data: Form<LoginForm>, mut cookies: Cookies, ip: ClientIp) -
fn _validate_token(token: &str) -> bool {
match CONFIG.admin_token().as_ref() {
None => false,
Some(t) => t == token,
Some(t) => crate::crypto::ct_eq(t, token),
}
}