From 6a5d225b91027a0970f5b51588d87f44d107c5d0 Mon Sep 17 00:00:00 2001 From: Thomas Elrod Date: Fri, 3 Nov 2023 12:44:45 -0500 Subject: [PATCH] Set haslib md5 usedforsecurity to false This utiliy currently fails on FIPS enabled systems due to the use of md5. When calculating the md5s for the chunks usedforsecurity is set to false but not when doing the md5 of all the digests. --- plugins/module_utils/etag.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/module_utils/etag.py b/plugins/module_utils/etag.py index 95c5ac94f81..eb1cea8da25 100644 --- a/plugins/module_utils/etag.py +++ b/plugins/module_utils/etag.py @@ -58,7 +58,7 @@ def calculate_multipart_etag(source_path, chunk_size=DEFAULT_CHUNK_SIZE): else: # > 1 digests = b"".join(m.digest() for m in md5s) - new_md5 = hashlib.md5(digests) + new_md5 = hashlib.md5(digests, usedforsecurity=False) new_etag = f'"{new_md5.hexdigest()}-{len(md5s)}"' return new_etag