|
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) |
@@ -1782,6 +1787,7 @@ def test_proxy_basic_auth(self): |
1782 | 1787 | "proxy.example.com:3128", |
1783 | 1788 | ) |
1784 | 1789 |
|
| 1790 | + @skip_libssl_fips_mode # Uses MD5 algorithm in challenge |
1785 | 1791 | def test_proxy_digest_auth(self): |
1786 | 1792 | # gh-60299: ProxyDigestAuthHandler must look up credentials using |
1787 | 1793 | # the proxy's authority |
@@ -1845,6 +1851,7 @@ def test_proxy_digest_auth_uri(self): |
1845 | 1851 | auth = http_handler.requests[1].get_header("Proxy-authorization") |
1846 | 1852 | self.assertIn('uri="%s"' % request_url, auth) |
1847 | 1853 |
|
| 1854 | + @skip_libssl_fips_mode # Uses MD5 algorithm in challenge |
1848 | 1855 | def test_digest_auth_uses_full_url(self): |
1849 | 1856 | # The non-proxy case must keep using the full request URL (not |
1850 | 1857 | # just the host) for the password lookup, so that sub-URI realm |
@@ -1967,6 +1974,7 @@ def check_digest_auth(self, headers, realm): |
1967 | 1974 | self.assertIn('nonce="dcd98b7102dd2f0e8b11d0f600bfb0c093"', auth) |
1968 | 1975 | self.assertIn('opaque="5ccc069c403ebaf9f0171e9517f40e41"', auth) |
1969 | 1976 |
|
| 1977 | + @skip_libssl_fips_mode |
1970 | 1978 | def test_digest_auth_multiple_challenges(self): |
1971 | 1979 | realm = "digest@example.com" |
1972 | 1980 | digest = (f'Digest realm="{realm}", ' |
@@ -2032,6 +2040,7 @@ def test_digest_auth_parse_challenges(self): |
2032 | 2040 | [('Negotiate', 'Negotiate'), ('Bearer', 'Bearer abc=='), |
2033 | 2041 | ('Digest', 'Digest realm="a"')]) |
2034 | 2042 |
|
| 2043 | + @skip_libssl_fips_mode |
2035 | 2044 | def test_proxy_digest_auth_multiple_challenges(self): |
2036 | 2045 | realm = "digest@example.com" |
2037 | 2046 | digest = (f'Digest realm="{realm}", ' |
@@ -2355,12 +2364,6 @@ def test_parse_proxy(self): |
2355 | 2364 | self.assertRaises(ValueError, _parse_proxy, 'file:/ftp.example.com'), |
2356 | 2365 |
|
2357 | 2366 |
|
2358 | | -skip_libssl_fips_mode = unittest.skipIf( |
2359 | | - support.is_libssl_fips_mode(), |
2360 | | - "conservative skip due to OpenSSL FIPS mode possible algorithm nerfing", |
2361 | | -) |
2362 | | - |
2363 | | - |
2364 | 2367 | class TestDigestAuthAlgorithms(unittest.TestCase): |
2365 | 2368 | def setUp(self): |
2366 | 2369 | self.handler = AbstractDigestAuthHandler() |
|
0 commit comments