diff options
| author | 2019-02-12 11:59:55 +0000 | |
|---|---|---|
| committer | 2019-02-12 11:59:55 +0000 | |
| commit | 01a7c05687e6cc8600807bc92b11368a0ba92180 (patch) | |
| tree | 991611bb99ee0cd63aa2f4dc44727615c0236402 /src | |
| parent | Use 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.py | 4 |
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) |
