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

Commit 2a2a83e

Browse files
authored
Merge pull request #8 from CSCfi/bugfix/some-fixes
Bugfix/some fixes
2 parents 752457f + 442d323 commit 2a2a83e

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
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"

swift_upload_runner/download.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,8 @@ def download_into_queue(
120120
"X-Auth-Token": self.auth.get_token(),
121121
"Accept-Encoding": "identity"
122122
},
123-
stream=True
123+
stream=True,
124+
verify=True
124125
) as req:
125126
print(f"""
126127
Request headers:
@@ -419,7 +420,8 @@ def get_object_listing(
419420
),
420421
headers={
421422
"X-Auth-Token": self.auth.get_token()
422-
}
423+
},
424+
verify=True
423425
) as req:
424426
self.fs = self._parse_archive_fs([
425427
i.split("/") for i in req.text.lstrip().rstrip().split("\n")

0 commit comments

Comments
 (0)