aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGravatar jesopo2019-02-12 11:59:55 +0000
committerGravatar jesopo2019-02-12 11:59:55 +0000
commit01a7c05687e6cc8600807bc92b11368a0ba92180 (patch)
tree991611bb99ee0cd63aa2f4dc44727615c0236402 /src
parentUse constant-time compare in permissions.py for password identifying (diff)
signature
Change arg types of constant_time_compare to typing.AnyStr (utils.security)
Diffstat (limited to 'src')
-rw-r--r--src/utils/security.py4
1 files changed, 1 insertions, 3 deletions
diff --git a/src/utils/security.py b/src/utils/security.py
index 1c8f2cf4..78a54b5c 100644
--- a/src/utils/security.py
+++ b/src/utils/security.py
@@ -22,7 +22,5 @@ def ssl_wrap(sock: socket.socket, cert: str=None, key: str=None,
return context.wrap_socket(sock, server_side=server_side,
server_hostname=hostname)
-def constant_time_compare(
- a: typing.Union[str, bytes],
- b: typing.Union[str, bytes]) -> bool:
+def constant_time_compare(a: typing.AnyStr, b: typing.AnyStr) -> bool:
return hmac.compare_digest(a, b)