|
30 | 30 |
|
31 | 31 | support.requires_working_socket(module=True) |
32 | 32 |
|
| 33 | +skip_libssl_fips_mode = unittest.skipIf( |
| 34 | + support.is_libssl_fips_mode(), |
| 35 | + "conservative skip due to OpenSSL FIPS mode possible algorithm nerfing", |
| 36 | +) |
| 37 | + |
33 | 38 | # XXX |
34 | 39 | # Request |
35 | 40 | # CacheFTPHandler (hard to write) |
@@ -1751,6 +1756,7 @@ def test_proxy_basic_auth(self): |
1751 | 1756 | "proxy.example.com:3128", |
1752 | 1757 | ) |
1753 | 1758 |
|
| 1759 | + @skip_libssl_fips_mode # Uses MD5 algorithm in challenge |
1754 | 1760 | def test_proxy_digest_auth(self): |
1755 | 1761 | # gh-60299: ProxyDigestAuthHandler must look up credentials using |
1756 | 1762 | # the proxy's authority |
@@ -1814,6 +1820,7 @@ def test_proxy_digest_auth_uri(self): |
1814 | 1820 | auth = http_handler.requests[1].get_header("Proxy-authorization") |
1815 | 1821 | self.assertIn('uri="%s"' % request_url, auth) |
1816 | 1822 |
|
| 1823 | + @skip_libssl_fips_mode # Uses MD5 algorithm in challenge |
1817 | 1824 | def test_digest_auth_uses_full_url(self): |
1818 | 1825 | # The non-proxy case must keep using the full request URL (not |
1819 | 1826 | # just the host) for the password lookup, so that sub-URI realm |
@@ -1936,6 +1943,7 @@ def check_digest_auth(self, headers, realm): |
1936 | 1943 | self.assertIn('nonce="dcd98b7102dd2f0e8b11d0f600bfb0c093"', auth) |
1937 | 1944 | self.assertIn('opaque="5ccc069c403ebaf9f0171e9517f40e41"', auth) |
1938 | 1945 |
|
| 1946 | + @skip_libssl_fips_mode |
1939 | 1947 | def test_digest_auth_multiple_challenges(self): |
1940 | 1948 | realm = "digest@example.com" |
1941 | 1949 | digest = (f'Digest realm="{realm}", ' |
@@ -2001,6 +2009,7 @@ def test_digest_auth_parse_challenges(self): |
2001 | 2009 | [('Negotiate', 'Negotiate'), ('Bearer', 'Bearer abc=='), |
2002 | 2010 | ('Digest', 'Digest realm="a"')]) |
2003 | 2011 |
|
| 2012 | + @skip_libssl_fips_mode |
2004 | 2013 | def test_proxy_digest_auth_multiple_challenges(self): |
2005 | 2014 | realm = "digest@example.com" |
2006 | 2015 | digest = (f'Digest realm="{realm}", ' |
@@ -2324,12 +2333,6 @@ def test_parse_proxy(self): |
2324 | 2333 | self.assertRaises(ValueError, _parse_proxy, 'file:/ftp.example.com'), |
2325 | 2334 |
|
2326 | 2335 |
|
2327 | | -skip_libssl_fips_mode = unittest.skipIf( |
2328 | | - support.is_libssl_fips_mode(), |
2329 | | - "conservative skip due to OpenSSL FIPS mode possible algorithm nerfing", |
2330 | | -) |
2331 | | - |
2332 | | - |
2333 | 2336 | class TestDigestAuthAlgorithms(unittest.TestCase): |
2334 | 2337 | def setUp(self): |
2335 | 2338 | self.handler = AbstractDigestAuthHandler() |
|
0 commit comments