mirror of
https://github.com/Kozea/Radicale.git
synced 2025-08-07 18:30:54 +00:00
Move authentication delay into __init__.py and add config
Use the delay for all backends (not only htpasswd). Add configuration option to configure the delay.
This commit is contained in:
parent
fb970246e0
commit
f2fb07fa84
5 changed files with 18 additions and 5 deletions
|
@ -58,8 +58,6 @@ import functools
|
|||
import hashlib
|
||||
import hmac
|
||||
import os
|
||||
import random
|
||||
import time
|
||||
from importlib import import_module
|
||||
|
||||
|
||||
|
@ -198,6 +196,4 @@ class Auth(BaseAuth):
|
|||
login, hash_value = line.split(":")
|
||||
if login == user and self.verify(hash_value, password):
|
||||
return True
|
||||
# Random timer to avoid timing oracles and simple bruteforce attacks
|
||||
time.sleep(1 + random.random())
|
||||
return False
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue