Skip to content

Commit 7d9da92

Browse files
sethmlarsonpicnixz
andauthored
[3.14] gh-160923: Fix fetching with -fips property for usedforsecurity=True (#160984)
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
1 parent 71a0b04 commit 7d9da92

2 files changed

Lines changed: 8 additions & 2 deletions

File tree

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
.. cve: CVE-2026-119170
2+
3+
Fix fetching with ``-fips`` property for ``usedforsecurity=True``
4+
in :mod:`hashlib`. This issue only affects Python 3.14.10, and
5+
all other Python versions are unaffected.

‎Modules/_hashopenssl.c‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -417,10 +417,11 @@ py_digest_by_name(PyObject *module, const char *name, enum Py_hash_type py_ht)
417417
PY_EVP_MD *digest = NULL, *fresh = NULL;
418418
_hashlibstate *state = get_hashlib_state(module);
419419
py_hashentry_t *entry = _Py_hashtable_get(state->hashtable, name);
420-
int fips = disable_fips_property(py_ht);
421-
if (fips == -1) {
420+
int disable_fips = disable_fips_property(py_ht);
421+
if (disable_fips == -1) {
422422
goto finally;
423423
}
424+
int fips = !disable_fips;
424425

425426
if (entry != NULL) {
426427
PY_EVP_MD **cached = fips ? &entry->evp : &entry->evp_nosecurity;

0 commit comments

Comments
 (0)