|
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) |
@@ -1734,6 +1739,7 @@ def test_proxy_basic_auth(self): |
1734 | 1739 | "proxy.example.com:3128", |
1735 | 1740 | ) |
1736 | 1741 |
|
| 1742 | + @skip_libssl_fips_mode # Uses MD5 algorithm in challenge |
1737 | 1743 | def test_proxy_digest_auth(self): |
1738 | 1744 | # gh-60299: ProxyDigestAuthHandler must look up credentials using |
1739 | 1745 | # the proxy's authority |
@@ -1797,6 +1803,7 @@ def test_proxy_digest_auth_uri(self): |
1797 | 1803 | auth = http_handler.requests[1].get_header("Proxy-authorization") |
1798 | 1804 | self.assertIn('uri="%s"' % request_url, auth) |
1799 | 1805 |
|
| 1806 | + @skip_libssl_fips_mode # Uses MD5 algorithm in challenge |
1800 | 1807 | def test_digest_auth_uses_full_url(self): |
1801 | 1808 | # The non-proxy case must keep using the full request URL (not |
1802 | 1809 | # just the host) for the password lookup, so that sub-URI realm |
@@ -1919,6 +1926,7 @@ def check_digest_auth(self, headers, realm): |
1919 | 1926 | self.assertIn('nonce="dcd98b7102dd2f0e8b11d0f600bfb0c093"', auth) |
1920 | 1927 | self.assertIn('opaque="5ccc069c403ebaf9f0171e9517f40e41"', auth) |
1921 | 1928 |
|
| 1929 | + @skip_libssl_fips_mode |
1922 | 1930 | def test_digest_auth_multiple_challenges(self): |
1923 | 1931 | realm = "digest@example.com" |
1924 | 1932 | digest = (f'Digest realm="{realm}", ' |
@@ -1984,6 +1992,7 @@ def test_digest_auth_parse_challenges(self): |
1984 | 1992 | [('Negotiate', 'Negotiate'), ('Bearer', 'Bearer abc=='), |
1985 | 1993 | ('Digest', 'Digest realm="a"')]) |
1986 | 1994 |
|
| 1995 | + @skip_libssl_fips_mode |
1987 | 1996 | def test_proxy_digest_auth_multiple_challenges(self): |
1988 | 1997 | realm = "digest@example.com" |
1989 | 1998 | digest = (f'Digest realm="{realm}", ' |
@@ -2307,12 +2316,6 @@ def test_parse_proxy(self): |
2307 | 2316 | self.assertRaises(ValueError, _parse_proxy, 'file:/ftp.example.com'), |
2308 | 2317 |
|
2309 | 2318 |
|
2310 | | -skip_libssl_fips_mode = unittest.skipIf( |
2311 | | - support.is_libssl_fips_mode(), |
2312 | | - "conservative skip due to OpenSSL FIPS mode possible algorithm nerfing", |
2313 | | -) |
2314 | | - |
2315 | | - |
2316 | 2319 | class TestDigestAuthAlgorithms(unittest.TestCase): |
2317 | 2320 | def setUp(self): |
2318 | 2321 | self.handler = AbstractDigestAuthHandler() |
|
0 commit comments