Change arg types of constant_time_compare to typing.AnyStr (utils.security)
This commit is contained in:
parent
ce23442f4b
commit
01a7c05687
1 changed files with 1 additions and 3 deletions
|
@ -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,
|
return context.wrap_socket(sock, server_side=server_side,
|
||||||
server_hostname=hostname)
|
server_hostname=hostname)
|
||||||
|
|
||||||
def constant_time_compare(
|
def constant_time_compare(a: typing.AnyStr, b: typing.AnyStr) -> bool:
|
||||||
a: typing.Union[str, bytes],
|
|
||||||
b: typing.Union[str, bytes]) -> bool:
|
|
||||||
return hmac.compare_digest(a, b)
|
return hmac.compare_digest(a, b)
|
||||||
|
|
Loading…
Reference in a new issue