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

Bugfix/some fixes #8

Merged
merged 3 commits into from
Sep 28, 2020
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
compare digest using secrets library
  • Loading branch information
blankdots committed Sep 28, 2020
commit 442d323deede8c7ed86e86f9f0d79fd8f077f488
3 changes: 2 additions & 1 deletion swift_upload_runner/auth.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import typing
import hmac
import time
import secrets

import aiohttp.web

Expand Down Expand Up @@ -85,7 +86,7 @@ async def test_signature(
byte_message,
digestmod="sha256"
).hexdigest()
if digest == signature:
if secrets.compare_digest(digest, signature):
return True
raise aiohttp.web.HTTPUnauthorized(
reason="Missing valid query signature"
Expand Down