Skip to content
This repository was archived by the owner on Aug 4, 2021. It is now read-only.

Commit 442d323

Browse files
committed
compare digest using secrets library
1 parent d1e04e1 commit 442d323

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

swift_upload_runner/auth.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
import typing
77
import hmac
88
import time
9+
import secrets
910

1011
import aiohttp.web
1112

@@ -85,7 +86,7 @@ async def test_signature(
8586
byte_message,
8687
digestmod="sha256"
8788
).hexdigest()
88-
if digest == signature:
89+
if secrets.compare_digest(digest, signature):
8990
return True
9091
raise aiohttp.web.HTTPUnauthorized(
9192
reason="Missing valid query signature"

0 commit comments

Comments
 (0)