From b31a7497e159f99513e91c4c727eab0cd13b2a37 Mon Sep 17 00:00:00 2001 From: Harsh Gupta <42064744+Harshg999@users.noreply.github.com> Date: Thu, 10 Oct 2024 23:16:49 +0530 Subject: [PATCH] [raz][fips] Fix S3 WRITE operations from regressing in non-raz setup (#3861) --- desktop/core/ext-py3/boto-2.49.0/boto/utils.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/desktop/core/ext-py3/boto-2.49.0/boto/utils.py b/desktop/core/ext-py3/boto-2.49.0/boto/utils.py index fcefb8fafd2..5b6a3f5fc57 100644 --- a/desktop/core/ext-py3/boto-2.49.0/boto/utils.py +++ b/desktop/core/ext-py3/boto-2.49.0/boto/utils.py @@ -61,7 +61,7 @@ from contextlib import contextmanager -from hashlib import md5, sha512 +from hashlib import md5, sha512, new as hashlib_new _hashfn = sha512 from boto.compat import json @@ -1030,7 +1030,8 @@ def compute_md5(fp, buf_size=8192, size=None): def compute_hash(fp, buf_size=8192, size=None, hash_algorithm=md5): - hash_obj = hash_algorithm(usedforsecurity=False) if hash_algorithm == md5 else hash_algorithm() + # Add usedforsecurity as False for MD5 hash algorithm to support FIPS + hash_obj = hashlib_new('md5', usedforsecurity=False) if hash_algorithm == md5 else hash_algorithm() spos = fp.tell() if size and size < buf_size: s = fp.read(size)