Skip to content

Use pulp_hashlib in receive_artifact()#2258

Merged
mdellweg merged 1 commit into
pulp:mainfrom
kush-gupt:fix/fips-hashlib
Mar 11, 2026
Merged

Use pulp_hashlib in receive_artifact()#2258
mdellweg merged 1 commit into
pulp:mainfrom
kush-gupt:fix/fips-hashlib

Conversation

@kush-gupt
Copy link
Copy Markdown
Contributor

@kush-gupt kush-gupt commented Mar 10, 2026

Summary

  • Replace raw hashlib with pulp_hashlib.new() in receive_artifact() so digest creation goes through the allowed-algorithm gate and works on FIPS-enabled systems.
  • The only call site in pulp_container that iterates Artifact.DIGEST_FIELDS with raw hashlib, bypassing the pulp_hashlib wrapper. Other raw hashlib.sha256() calls elsewhere are FIPS-safe.
  • Validated on a FIPS-enabled RHEL 9.7 VM running Satellite 6.18: manifest upload returned UnsupportedDigestmodError / HTTP 500 before the fix, HTTP 201 after.
  • Re-verified with only this change (no pulpcore modification): Satellite's existing downstream pulp_hashlib md5 patch is sufficient once receive_artifact() routes through it.

Checklist

closes #2256

Made with Cursor

@kush-gupt kush-gupt closed this Mar 10, 2026
@kush-gupt kush-gupt reopened this Mar 10, 2026
@kush-gupt kush-gupt force-pushed the fix/fips-hashlib branch 2 times, most recently from 0b8fa67 to adf021f Compare March 10, 2026 22:13
Copy link
Copy Markdown
Member

@mdellweg mdellweg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This sounds right to me.
The changelog should contain just about enough information for the user to connect the dots (Seeing the UnsupportedDigestmodError e.g. with this bugfix.). Also it's supposed to be a snippet in a mkdocs markdown file.

Comment thread CHANGES/2256.bugfix Outdated
Replace raw hashlib with pulp_hashlib.new() so that
digest creation goes through the allowed-algorithm gate
and works on FIPS-enabled systems.

closes pulp#2256

Signed-off-by: Kush Gupta <kushalgupta@gmail.com>
Made-with: Cursor
@kush-gupt
Copy link
Copy Markdown
Contributor Author

Thanks for the review @mdellweg ! Updated the changelog to what you suggested and amended the commit to include it, let me know if you'd like any other changes!

Copy link
Copy Markdown
Member

@mdellweg mdellweg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nope that's fine. Thank you!

@mdellweg mdellweg enabled auto-merge (rebase) March 11, 2026 12:48
@mdellweg mdellweg merged commit 1487643 into pulp:main Mar 11, 2026
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

receive_artifact() uses raw hashlib, fails on FIPS systems

2 participants