Use MD5 usedforsecurity=False on Python 3.9 and higher to pass FIPS

Closes #2270
This commit is contained in:
Simon Willison 2024-02-13 18:23:54 -08:00 committed by GitHub
commit b89cac3b6a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 11 additions and 3 deletions

View file

@ -1,7 +1,6 @@
import asyncio
from collections import namedtuple
from pathlib import Path
import hashlib
import janus
import queue
import sys
@ -15,6 +14,7 @@ from .utils import (
detect_spatialite,
get_all_foreign_keys,
get_outbound_foreign_keys,
md5_not_usedforsecurity,
sqlite_timelimit,
sqlite3,
table_columns,
@ -74,7 +74,7 @@ class Database:
def color(self):
if self.hash:
return self.hash[:6]
return hashlib.md5(self.name.encode("utf8")).hexdigest()[:6]
return md5_not_usedforsecurity(self.name)[:6]
def suggest_name(self):
if self.path: