diff --git a/libcloud/storage/drivers/atmos.py b/libcloud/storage/drivers/atmos.py index c9d29d326e..90a83b0164 100644 --- a/libcloud/storage/drivers/atmos.py +++ b/libcloud/storage/drivers/atmos.py @@ -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")