diff --git a/CHANGES/2256.bugfix b/CHANGES/2256.bugfix new file mode 100644 index 000000000..8b42fdb45 --- /dev/null +++ b/CHANGES/2256.bugfix @@ -0,0 +1 @@ +Changed the use of raw `hashlib` to `pulp_hashlib` to prevent `UnsupportedDigestmodError` on FIPS-enabled systems. diff --git a/pulp_container/app/registry_api.py b/pulp_container/app/registry_api.py index 87fde03eb..c3fd23533 100644 --- a/pulp_container/app/registry_api.py +++ b/pulp_container/app/registry_api.py @@ -26,6 +26,7 @@ from django.conf import settings +from pulpcore.plugin import pulp_hashlib from pulpcore.plugin.models import Artifact, ContentArtifact, UploadChunk from pulpcore.plugin.files import PulpTemporaryUploadedFile from pulpcore.plugin.tasking import dispatch @@ -1452,7 +1453,7 @@ def receive_artifact(self, chunk): size = 0 hashers = {} for algorithm in Artifact.DIGEST_FIELDS: - hashers[algorithm] = getattr(hashlib, algorithm)() + hashers[algorithm] = pulp_hashlib.new(algorithm) while True: subchunk = chunk.read(2000000) if not subchunk: