Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGES/2256.bugfix
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Changed the use of raw `hashlib` to `pulp_hashlib` to prevent `UnsupportedDigestmodError` on FIPS-enabled systems.
3 changes: 2 additions & 1 deletion pulp_container/app/registry_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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:
Expand Down
Loading