From 51c05296bbe5e892a199b01d8c05ecae00dce628 Mon Sep 17 00:00:00 2001 From: Shaun Brady Date: Thu, 6 Jul 2017 19:46:15 -0400 Subject: [PATCH] Switch md5 hashing for sha256 On FIPS[0] enabled systems unsafe cryptographic modules are disabled. This commit changes out the md5 function for sha256, both of hashlib. [0] http://csrc.nist.gov/groups/STM/cmvp/documents/140-1/140val-all.htm --- compressor/cache.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/compressor/cache.py b/compressor/cache.py index 6f6657d..7561e6c 100644 --- a/compressor/cache.py +++ b/compressor/cache.py @@ -18,7 +18,7 @@ _cachekey_func = None def get_hexdigest(plaintext, length=None): - digest = hashlib.md5(smart_bytes(plaintext)).hexdigest() + digest = hashlib.sha256(smart_bytes(plaintext)).hexdigest() if length: return digest[:length] return digest