From 01a7c05687e6cc8600807bc92b11368a0ba92180 Mon Sep 17 00:00:00 2001 From: jesopo Date: Tue, 12 Feb 2019 11:59:55 +0000 Subject: [PATCH] Change arg types of constant_time_compare to typing.AnyStr (utils.security) --- src/utils/security.py | 4 +--- 1 file changed, 1 insertion(+), 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)