You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Python 3.10 and later versions rely on OpenSSL 1.1.1 or newer, which includes FIPS-compliance checks.
MD5 is not an approved algorithm in FIPS mode, so attempting to instantiate hashlib.md5() in get_migration_hash will fail when the system is running in FIPS mode.
Since MD5 is used in a non-security context, the usedforsecurity flag should be added.
@staticmethod
def get_migration_hash(app_label: str, migration_name: str) -> str:
hash_md5 = hashlib.md5(usedforsecurity=False)
with open(get_migration_abspath(app_label, migration_name), "rb") as f:
for chunk in iter(lambda: f.read(4096), b""):
hash_md5.update(chunk)
return hash_md5.hexdigest()
Python 3.10 and later versions rely on OpenSSL 1.1.1 or newer, which includes FIPS-compliance checks.
MD5 is not an approved algorithm in FIPS mode, so attempting to instantiate hashlib.md5() will fail when the system is running in FIPS mode.
Since MD5 is used in a non-security context, the change adds the [_usedforsecurity_](https://docs.python.org/3/library/hashlib.html) flag.
The same issue in Django django/django@d10c7bf
Python 3.10 and later versions rely on OpenSSL 1.1.1 or newer, which includes FIPS-compliance checks.
MD5 is not an approved algorithm in FIPS mode, so attempting to instantiate hashlib.md5() in get_migration_hash will fail when the system is running in FIPS mode.
Since MD5 is used in a non-security context, the usedforsecurity flag should be added.
The same issue in Django django/django@d10c7bf
The text was updated successfully, but these errors were encountered: