Addendum Fix to support FIPS enabled machines with MD5 hashing (#17043)

Signed-off-by: sydarb <areebsyed237@gmail.com>
This commit is contained in:
Areeb Syed 2025-04-24 08:25:00 +05:30 committed by GitHub
parent 2c8ed8ee48
commit ed2e464653
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 4 additions and 2 deletions

View File

@ -357,7 +357,8 @@ class SharedStorageConnector(KVConnectorBase_V1):
ids.
"""
input_ids_bytes = input_ids.numpy().tobytes()
input_ids_hash = hashlib.md5(input_ids_bytes).hexdigest()
input_ids_hash = hashlib.md5(input_ids_bytes,
usedforsecurity=False).hexdigest()
foldername = os.path.join(self._storage_path, input_ids_hash)
if create_folder:
os.makedirs(foldername, exist_ok=True)

View File

@ -794,6 +794,7 @@ def compute_hash() -> str:
if key in environment_variables:
factorize(key)
hash_str = hashlib.md5(str(factors).encode()).hexdigest()
hash_str = hashlib.md5(str(factors).encode(),
usedforsecurity=False).hexdigest()
return hash_str