Repository navigation
Patch CPython 3.14.10 FIPS regression in _hashopenssl.c - #342
Merged
Merged
Conversation
CPython 3.14.10 shipped a bad backport of upstream gh-149816 (CPython PR #160006, merged 2026-10-21). The main-branch fix landed as ``int fips = !disable_fips_property(py_ht);`` in ``Modules/_hashopenssl.c::py_digest_by_name``, but the 3.14 backport dropped the leading ``!``, inverting the FIPS property polarity: * ``openssl_md5(usedforsecurity=False)`` under FIPS now fetches MD5 without the ``-fips`` property filter, so OpenSSL can't find a non-FIPS MD5 and the probe raises. hashlib.py's dispatch then falls back to the builtin ``_md5`` (compiled in via ``--with-builtin-hashlib-hashes=blake2,md5,sha1,sha2,sha3``), which has no FIPS awareness and silently returns an MD5 digest. * Conversely, ``openssl_md5(usedforsecurity=True)`` would fetch with the ``-fips`` filter and succeed in FIPS mode via a non-FIPS provider, silently bypassing FIPS enforcement. Caught by ``Test FIPS compatability (3.14, x86_64)`` on PR #338 after the Python 3.14.9 -> 3.14.10 bump; 3.10-3.13 and 3.14.9 pass, 3.14.10 fails. Apply the one-character fix as a build-time patch across linux/darwin/ windows. The regex matches the broken form only -- a correctly-fixed source has ``!disable_fips_property`` and the regex won't match, so this is idempotent and self-disabling. Remove once a 3.14 point release ships the real fix. Refs: - CPython main fix: python/cpython@23469818538c - 3.14 bad backport: python/cpython#160006
2 tasks
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
Refs
Test plan