Ver código fonte

Revert "Use secure RNG for auth delay"

This reverts commit 7b79c00ae21347146916722cd53f0be7164b179a.
Unrud 5 anos atrás
pai
commit
d26ee9e7ed
1 arquivos alterados com 1 adições e 3 exclusões
  1. 1 3
      radicale/app/__init__.py

+ 1 - 3
radicale/app/__init__.py

@@ -55,8 +55,6 @@ from radicale.app.put import ApplicationPutMixin
 from radicale.app.report import ApplicationReportMixin
 from radicale.log import logger
 
-secure_random = random.SystemRandom()
-
 VERSION = pkg_resources.get_distribution("radicale").version
 
 
@@ -254,7 +252,7 @@ class Application(
             # Random delay to avoid timing oracles and bruteforce attacks
             delay = self.configuration.get("auth", "delay")
             if delay > 0:
-                random_delay = delay * (0.5 + secure_random.random())
+                random_delay = delay * (0.5 + random.random())
                 logger.debug("Sleeping %.3f seconds", random_delay)
                 time.sleep(random_delay)