Skip to content

Commit e09dc23

Browse files
committed
feat: Indicate that md5 is used as a CRC
MD5 in storage helpers is used as a CRC function for non-cryptographically secure purposes. Ensure that md5 is initiated with `usedforsecurity=False` to ensure that Python in FIPS mode can fetch MD5 implementation for such non cryptographically secure purpose. This is no effective change on non-FIPS mode Python installations. This improves compatibility with most FIPS mode Python installations.
1 parent e84906c commit e09dc23

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

google/cloud/storage/_helpers.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -536,7 +536,7 @@ def _base64_md5hash(buffer_object):
536536
:rtype: str
537537
:returns: A base64 encoded digest of the MD5 hash.
538538
"""
539-
hash_obj = md5()
539+
hash_obj = md5(usedforsecurity=False)
540540
_write_buffer_to_hash(buffer_object, hash_obj)
541541
digest_bytes = hash_obj.digest()
542542
return base64.b64encode(digest_bytes)

0 commit comments

Comments
 (0)