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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user