fix: add usedforsecurity=False to hashlib.sha1 calls for FIPS compliance - #77391
Open
JonthanaHanh wants to merge 1 commit into
Open
fix: add usedforsecurity=False to hashlib.sha1 calls for FIPS compliance#77391JonthanaHanh wants to merge 1 commit into
JonthanaHanh wants to merge 1 commit into
Conversation
hashlib.sha1() without usedforsecurity=False crashes on FIPS-enabled systems (RHEL 8/9 with FIPS mode) with ValueError: EVP_DigestInit_ex disabled for FIPS. Two uncovered sites fixed: - tui_gateway/server.py:11671 - config revision hash for MCP reload - optional-skills/security/unbroker/scripts/dossier.py:25 - opaque subject ID generation Both are non-security uses (cache keys / dedup) where SHA-1 is used purely for hashing, not for cryptographic security.
This was referenced Aug 5, 2026
refactor(tui): extract pet payload into tui_gateway/pet_payload (server.py god-file slice R3)
#79261
Open
Open
Contributor
|
suggesting changes The two edited SHA-1 calls correctly opt out of FIPS security restrictions without changing their digest outputs. However, the same non-security use remains unpatched in fallback function-call IDs, webhook deduplication, QQBot upload checksums, and dashboard action names, so FIPS-restricted deployments can still fail on those sibling paths.
Security evidence:
Review setup: I reviewed a run-owned local rebase or patch replay against current GitHub Not checked:
Signed: GPT-5.6-luna-max in Codex |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
hashlib.sha1()withoutusedforsecurity=Falsecrashes on FIPS-enabled systems (RHEL 8/9 with FIPS mode) withValueError: EVP_DigestInit_ex disabled for FIPS.Two uncovered sites fixed:
tui_gateway/server.py:11671— config revision hash for MCP reload detectionoptional-skills/security/unbroker/scripts/dossier.py:25— opaque subject ID generationBoth are non-security uses (cache keys / dedup) where SHA-1 is used purely for content hashing, not for cryptographic security.
Context
This pattern has been fixed across the codebase in prior PRs:
These two sites were missed in the earlier sweeps.
Test Plan
python3 -c "import ast; ast.parse(open('tui_gateway/server.py').read())"python3 -c "import ast; ast.parse(open('optional-skills/security/unbroker/scripts/dossier.py').read())"