-
-
Notifications
You must be signed in to change notification settings - Fork 813
Closed
Labels
Description
Use of the md5 hashing algorithm is not permitted in FIPS systems, exhibiting the error:
else hashlib.md5(name.encode("utf8")).hexdigest()[:6],
ValueError: [digital envelope routines] unsupported
This can be fixed via hashlib.md5(usedforsecurity=False):
in database.py:
return hashlib.md5(self.name.encode("utf8"), usedforsecurity=False).hexdigest()[:6]
in init.py:
md5_suffix = hashlib.md5(s.encode("utf8"), usedforsecurity=False).hexdigest()[:6]
I can do a PR if that's easier - I've tested these updates locally and in FIPS environments and they work, but pytest does not pass tests (master is also failing the pytests in the same way).
Note that a similar issue exists in the pint library where hashlib.blake2b is used - in order to allow datasette to run in FIPS this needs to be modified to, for example, hashlib.sha512 .
Reactions are currently unavailable