File tree Expand file tree Collapse file tree 4 files changed +10
-7
lines changed
Expand file tree Collapse file tree 4 files changed +10
-7
lines changed Original file line number Diff line number Diff line change @@ -335,7 +335,7 @@ jobs:
335335 strategy :
336336 fail-fast : false
337337 matrix :
338- cloud-provider : [aws]
338+ cloud-provider : [aws, azure, gcp ]
339339 steps :
340340 - uses : actions/checkout@v4
341341 - name : Setup parameters file
Original file line number Diff line number Diff line change @@ -15,6 +15,7 @@ Source code is also available at: https://github.com/snowflakedb/snowflake-conne
1515 - Added no_proxy parameter for proxy configuration without using environmental variables.
1616 - Added OAUTH_AUTHORIZATION_CODE and OAUTH_CLIENT_CREDENTIALS to list of authenticators that don't require user to be set
1717 - Added ` oauth_socket_uri ` connection parameter allowing to separate server and redirect URIs for local OAuth server.
18+ - Fixed FIPS environments md5 hash isues with multipart upload on Azure.
1819
1920- v4.0.0(October 09,2025)
2021 - Added support for checking certificates revocation using revocation lists (CRLs)
Original file line number Diff line number Diff line change 1414from .constants import FileHeader , ResultStatus
1515from .encryption_util import EncryptionMetadata
1616from .storage_client import SnowflakeStorageClient
17- from .util_text import get_md5
17+ from .util_text import get_md5_for_integrity
1818from .vendored import requests
1919
2020if TYPE_CHECKING : # pragma: no cover
@@ -241,9 +241,9 @@ def _complete_multipart_upload(self) -> None:
241241 fd .close ()
242242 headers = {
243243 "x-ms-blob-content-encoding" : "utf-8" ,
244- "x-ms-blob-content-md5" : base64 .b64encode (get_md5 ( file_content )). decode (
245- "utf-8"
246- ),
244+ "x-ms-blob-content-md5" : base64 .b64encode (
245+ get_md5_for_integrity ( file_content )
246+ ). decode ( "utf-8" ) ,
247247 }
248248 azure_metadata = self ._prepare_file_metadata ()
249249 headers .update (azure_metadata )
Original file line number Diff line number Diff line change @@ -293,9 +293,11 @@ def _base64_bytes_to_str(x) -> str | None:
293293 return base64 .b64encode (x ).decode ("utf-8" ) if x else None
294294
295295
296- def get_md5 (text : str | bytes ) -> bytes :
296+ def get_md5_for_integrity (text : str | bytes ) -> bytes :
297+ # MD5 should not be used for security reasons - only integrity is safe and allowed
297298 if isinstance (text , str ):
298299 text = text .encode ("utf-8" )
299- md5 = hashlib .md5 ()
300+ # Usedforsecurity=False added to support FIPS envs as well
301+ md5 = hashlib .md5 (usedforsecurity = False )
300302 md5 .update (text )
301303 return md5 .digest ()
You can’t perform that action at this time.
0 commit comments