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
This commit is contained in:
Shaun Brady
2017-07-06 19:46:15 -04:00
parent 31232ed6a9
commit 51c05296bb

View File

@@ -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