Skip to content

Commit

Permalink
[raz][fips] Fix S3 WRITE operations from regressing in non-raz setup (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
Harshg999 authored Oct 10, 2024
1 parent 961f7ea commit b31a749
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions desktop/core/ext-py3/boto-2.49.0/boto/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit b31a749

Please sign in to comment.