https://github.com/python/cpython/commit/a18fd5432db9549282187665d157f04fc63f818a
commit: a18fd5432db9549282187665d157f04fc63f818a
branch: 3.14
author: Seth Larson <[email protected]>
committer: picnixz <[email protected]>
date: 2026-11-13T16:49:34+01:00
summary:

[3.14] gh-161263: Skip MD5 algorithm challenge tests on FIPS (#161345)

(cherry picked from commit 41c224c45c32190a1675d2f9d3b733862e502ff4)
(cherry picked from commit 20dd2f6)

Co-authored-by: Hugo van Kemenade <[email protected]>

files:
A Misc/NEWS.d/next/Tests/2026-11-03-13-12-50.gh-issue-161263.Voe8VM.rst
M Lib/test/test_urllib2.py

diff --git a/Lib/test/test_urllib2.py b/Lib/test/test_urllib2.py
index 928c40ed1d741e..67399ab9f885ca 100644
--- a/Lib/test/test_urllib2.py
+++ b/Lib/test/test_urllib2.py
@@ -30,6 +30,11 @@
 
 support.requires_working_socket(module=True)
 
+skip_libssl_fips_mode = unittest.skipIf(
+    support.is_libssl_fips_mode(),
+    "conservative skip due to OpenSSL FIPS mode possible algorithm nerfing",
+)
+
 # XXX
 # Request
 # CacheFTPHandler (hard to write)
@@ -1734,6 +1739,7 @@ def test_proxy_basic_auth(self):
                               "proxy.example.com:3128",
                               )
 
+    @skip_libssl_fips_mode  # Uses MD5 algorithm in challenge
     def test_proxy_digest_auth(self):
         # gh-60299: ProxyDigestAuthHandler must look up credentials using
         # the proxy's authority
@@ -1797,6 +1803,7 @@ def test_proxy_digest_auth_uri(self):
         auth = http_handler.requests[1].get_header("Proxy-authorization")
         self.assertIn('uri="%s"' % request_url, auth)
 
+    @skip_libssl_fips_mode  # Uses MD5 algorithm in challenge
     def test_digest_auth_uses_full_url(self):
         # The non-proxy case must keep using the full request URL (not
         # just the host) for the password lookup, so that sub-URI realm
@@ -1919,6 +1926,7 @@ def check_digest_auth(self, headers, realm):
             self.assertIn('nonce="dcd98b7102dd2f0e8b11d0f600bfb0c093"', auth)
             self.assertIn('opaque="5ccc069c403ebaf9f0171e9517f40e41"', auth)
 
+    @skip_libssl_fips_mode
     def test_digest_auth_multiple_challenges(self):
         realm = "[email protected]"
         digest = (f'Digest realm="{realm}", '
@@ -1984,6 +1992,7 @@ def test_digest_auth_parse_challenges(self):
             [('Negotiate', 'Negotiate'), ('Bearer', 'Bearer abc=='),
              ('Digest', 'Digest realm="a"')])
 
+    @skip_libssl_fips_mode
     def test_proxy_digest_auth_multiple_challenges(self):
         realm = "[email protected]"
         digest = (f'Digest realm="{realm}", '
@@ -2307,12 +2316,6 @@ def test_parse_proxy(self):
         self.assertRaises(ValueError, _parse_proxy, 'file:/ftp.example.com'),
 
 
-skip_libssl_fips_mode = unittest.skipIf(
-    support.is_libssl_fips_mode(),
-    "conservative skip due to OpenSSL FIPS mode possible algorithm nerfing",
-)
-
-
 class TestDigestAuthAlgorithms(unittest.TestCase):
     def setUp(self):
         self.handler = AbstractDigestAuthHandler()
diff --git 
a/Misc/NEWS.d/next/Tests/2026-11-03-13-12-50.gh-issue-161263.Voe8VM.rst 
b/Misc/NEWS.d/next/Tests/2026-11-03-13-12-50.gh-issue-161263.Voe8VM.rst
new file mode 100644
index 00000000000000..98c631cc2f663a
--- /dev/null
+++ b/Misc/NEWS.d/next/Tests/2026-11-03-13-12-50.gh-issue-161263.Voe8VM.rst
@@ -0,0 +1,2 @@
+Skip tests which use MD5 algorithm for WWW-Authenticate challenges when
+libssl is in FIPS mode.

_______________________________________________
Python-checkins mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3//lists/python-checkins.python.org
Member address: [email protected]

Reply via email to