public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
* [rpms/python3.14] rawhide: Fix fetching with -fips property for usedforsecurity=True
@ 2026-11-13 11:08 
  0 siblings, 0 replies; only message in thread
From:  @ 2026-11-13 11:08 UTC (permalink / raw)
  To: git-commits

            A new commit has been pushed.

            Repo   : rpms/python3.14
            Branch : rawhide
            Commit : 410b5213d76b920fc66ab579e6da739c0053d926
            Author : Miro Hrončok <miro@hroncok.cz>
            Date   : 2026-11-13T12:07:18+01:00
            Stats  : +61/-1 in 2 file(s)
            URL    : https://src.fedoraproject.org/rpms/python3.14/c/410b5213d76b920fc66ab579e6da739c0053d926?branch=rawhide

            Log:
            Fix fetching with -fips property for usedforsecurity=True

And run tests in forced FIPS mode as well.

(cherry picked from c10s commit 0257f51a2d7af27e0fa2dc1c9fda1888b470cfda)

Unlike c10s with FIPS patch, we actually have 3 errors,
in test_case_md5_0 to _2. Those error existed even on 3.14.9,
so we deselect the tests for now.

For completes:

    ERROR: test_case_md5_2 (test.test_hashlib.HashLibTestCase.test_case_md5_2)
    ----------------------------------------------------------------------
    Traceback (most recent call last):
      File "/builddir/build/BUILD/python3.14-3.14.10-build/Python-3.14.10/Lib/test/test_hashlib.py", line 644, in test_case_md5_2
        self.check(
        ~~~~~~~~~~^
            'md5',
            ^^^^^^
        ...<2 lines>...
            usedforsecurity=False
            ^^^^^^^^^^^^^^^^^^^^^
        )
        ^
      File "/builddir/build/BUILD/python3.14-3.14.10-build/Python-3.14.10/Lib/test/test_hashlib.py", line 511, in check
        self.check_file_digest(name, data, hexdigest)
        ~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^
      File "/builddir/build/BUILD/python3.14-3.14.10-build/Python-3.14.10/Lib/test/test_hashlib.py", line 530, in check_file_digest
        hashlib.file_digest(buf, digest).hexdigest(), hexdigest
        ~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^
      File "/builddir/build/BUILD/python3.14-3.14.10-build/Python-3.14.10/Lib/hashlib.py", line 211, in file_digest
        digestobj = digest()
    _hashlib.UnsupportedDigestmodError: [digital envelope routines] unsupported

(The other two look almost identical.)

---
diff --git a/00500-gh-160923-fix-fetching-with--fips-property-for-usedforsecurity-true.patch b/00500-gh-160923-fix-fetching-with--fips-property-for-usedforsecurity-true.patch
new file mode 100644
index 0000000..393f250
--- /dev/null
+++ b/00500-gh-160923-fix-fetching-with--fips-property-for-usedforsecurity-true.patch
@@ -0,0 +1,41 @@
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
+From: Seth Michael Larson <seth@python.org>
+Date: Thu, 29 Oct 2026 15:55:24 -0500
+Subject: 00500: gh-160923: Fix fetching with `-fips` property for
+ `usedforsecurity=True`
+
+---
+ .../Security/2026-10-29-15-49-06.gh-issue-160923.gCRiZ3.rst  | 5 +++++
+ Modules/_hashopenssl.c                                       | 5 +++--
+ 2 files changed, 8 insertions(+), 2 deletions(-)
+ create mode 100644 Misc/NEWS.d/next/Security/2026-10-29-15-49-06.gh-issue-160923.gCRiZ3.rst
+
+diff --git a/Misc/NEWS.d/next/Security/2026-10-29-15-49-06.gh-issue-160923.gCRiZ3.rst b/Misc/NEWS.d/next/Security/2026-10-29-15-49-06.gh-issue-160923.gCRiZ3.rst
+new file mode 100644
+index 0000000000..8fa1bc394f
+--- /dev/null
++++ b/Misc/NEWS.d/next/Security/2026-10-29-15-49-06.gh-issue-160923.gCRiZ3.rst
+@@ -0,0 +1,5 @@
++.. cve: CVE-2026-119170
++
++Fix fetching with ``-fips`` property for ``usedforsecurity=True``
++in :mod:`hashlib`. This issue only affects Python 3.14.10, and
++all other Python versions are unaffected.
+diff --git a/Modules/_hashopenssl.c b/Modules/_hashopenssl.c
+index 09aa2af173..a87c541902 100644
+--- a/Modules/_hashopenssl.c
++++ b/Modules/_hashopenssl.c
+@@ -417,10 +417,11 @@ py_digest_by_name(PyObject *module, const char *name, enum Py_hash_type py_ht)
+     PY_EVP_MD *digest = NULL, *fresh = NULL;
+     _hashlibstate *state = get_hashlib_state(module);
+     py_hashentry_t *entry = _Py_hashtable_get(state->hashtable, name);
+-    int fips = disable_fips_property(py_ht);
+-    if (fips == -1) {
++    int disable_fips = disable_fips_property(py_ht);
++    if (disable_fips == -1) {
+         goto finally;
+     }
++    int fips = !disable_fips;
+ 
+     if (entry != NULL) {
+         PY_EVP_MD **cached = fips ? &entry->evp : &entry->evp_nosecurity;

diff --git a/python3.14.spec b/python3.14.spec
index 1bc1b35..cdf8ec4 100644
--- a/python3.14.spec
+++ b/python3.14.spec
@@ -49,7 +49,7 @@ URL: https://www.python.org/
 #global prerel ...
 %global upstream_version %{general_version}%{?prerel}
 Version: %{general_version}%{?prerel:~%{prerel}}
-Release: 1%{?dist}
+Release: 2%{?dist}
 License: Python-2.0.1
 
 
@@ -447,6 +447,10 @@ Patch477: 00477-raise-an-error-when-importing-stdlib-modules-compiled-for-a-diff
 # gh-148646: Add --enable-prebuilt-jit-stencils configure flag
 Patch486: 00486-gh-148646-add---enable-prebuilt-jit-stencils-configure-flag.patch
 
+# 00500 # 71a00312c96802a29a8b4b8ebee04ceddedcc4c5
+# gh-160923: Fix fetching with `-fips` property for `usedforsecurity=True`
+Patch500: 00500-gh-160923-fix-fetching-with--fips-property-for-usedforsecurity-true.patch
+
 # (New patches go here ^^^)
 #
 # When adding new patches to "python" and "python3" in Fedora, EL, etc.,
@@ -1526,6 +1530,17 @@ CheckPython() {
     %endif
     -i test_check_probes \
 
+  # Re-run the hashlib/hmac/ssl related tests with FIPS mode forced on.
+  OPENSSL_FORCE_FIPS_MODE=1 LD_LIBRARY_PATH=$ConfDir $ConfDir/python -m test.regrtest \
+    -wW --slowest %{_smp_mflags} \
+    %ifarch riscv64
+    --timeout=8100 \
+    %else
+    --timeout=2700 \
+    %endif
+    test_hashlib test_hmac test_ssl \
+    -i test_case_md5_0 -i test_case_md5_1 -i test_case_md5_2
+
   echo FINISHED: CHECKING OF PYTHON FOR CONFIGURATION: $ConfName
 
 }
@@ -2014,6 +2029,10 @@ CheckPython freethreading
 # ======================================================
 
 %changelog
+* Mon Nov 09 2026 Miro Hrončok <miro@hroncok.cz> - 3.14.10-2
+- Security fix for CVE-2026-119170
+- Fixes a regression in FIPS enforcement of hash algorithms
+
 * Mon Oct 26 2026 Karolina Surma <ksurma@redhat.com> - 3.14.10-1
 - Update to Python 3.14.10
 - CVE-2026-114583: tar filter allows writing outside destination via empty-named symlink

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2026-11-13 11:08 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-11-13 11:08 [rpms/python3.14] rawhide: Fix fetching with -fips property for usedforsecurity=True 

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox