Skip to content
Merged
Changes from all commits
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
3 changes: 3 additions & 0 deletions libcloud/storage/drivers/atmos.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,9 @@ def _calculate_signature(self, params, headers):
signature.extend([k + ":" + collapse(v) for k, v in xhdrs])
signature = "\n".join(signature)
key = base64.b64decode(self.key)
# The Atmos REST authentication protocol mandates HMAC-SHA1. Using a
# different digest would produce signatures the service cannot verify.
# codeql[py/weak-sensitive-data-hashing]
signature = hmac.new(b(key), b(signature), hashlib.sha1).digest()

return base64.b64encode(b(signature)).decode("utf-8")
Expand Down