OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "base/file_path.h" | 5 #include "base/file_path.h" |
6 #include "base/file_util.h" | 6 #include "base/file_util.h" |
7 #include "base/path_service.h" | 7 #include "base/path_service.h" |
8 #include "base/pickle.h" | 8 #include "base/pickle.h" |
9 #include "base/sha1.h" | 9 #include "base/sha1.h" |
10 #include "base/string_number_conversions.h" | 10 #include "base/string_number_conversions.h" |
(...skipping 1327 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1338 "*.foo.com,*.*.foo.com,*.*.bar.foo.com,*..bar.foo.com," }, | 1338 "*.foo.com,*.*.foo.com,*.*.bar.foo.com,*..bar.foo.com," }, |
1339 { false, "www.bath.org", "www.bath.org", "", "20.30.40.50" }, | 1339 { false, "www.bath.org", "www.bath.org", "", "20.30.40.50" }, |
1340 { false, "66.77.88.99", "www.bath.org", "www.bath.org" }, | 1340 { false, "66.77.88.99", "www.bath.org", "www.bath.org" }, |
1341 // IDN tests | 1341 // IDN tests |
1342 { true, "xn--poema-9qae5a.com.br", "xn--poema-9qae5a.com.br" }, | 1342 { true, "xn--poema-9qae5a.com.br", "xn--poema-9qae5a.com.br" }, |
1343 { true, "www.xn--poema-9qae5a.com.br", "*.xn--poema-9qae5a.com.br" }, | 1343 { true, "www.xn--poema-9qae5a.com.br", "*.xn--poema-9qae5a.com.br" }, |
1344 { false, "xn--poema-9qae5a.com.br", "", "*.xn--poema-9qae5a.com.br," | 1344 { false, "xn--poema-9qae5a.com.br", "", "*.xn--poema-9qae5a.com.br," |
1345 "xn--poema-*.com.br," | 1345 "xn--poema-*.com.br," |
1346 "xn--*-9qae5a.com.br," | 1346 "xn--*-9qae5a.com.br," |
1347 "*--poema-9qae5a.com.br" }, | 1347 "*--poema-9qae5a.com.br" }, |
| 1348 { true, "xn--poema-9qae5a.com.br", "*.com.br" }, |
1348 // The following are adapted from the examples quoted from | 1349 // The following are adapted from the examples quoted from |
1349 // http://tools.ietf.org/html/rfc6125#section-6.4.3 | 1350 // http://tools.ietf.org/html/rfc6125#section-6.4.3 |
1350 // (e.g., *.example.com would match foo.example.com but | 1351 // (e.g., *.example.com would match foo.example.com but |
1351 // not bar.foo.example.com or example.com). | 1352 // not bar.foo.example.com or example.com). |
1352 { true, "foo.example.com", "*.example.com" }, | 1353 { true, "foo.example.com", "*.example.com" }, |
1353 { false, "bar.foo.example.com", "*.example.com" }, | 1354 { false, "bar.foo.example.com", "*.example.com" }, |
1354 { false, "example.com", "*.example.com" }, | 1355 { false, "example.com", "*.example.com" }, |
1355 // (e.g., baz*.example.net and *baz.example.net and b*z.example.net would | 1356 // (e.g., baz*.example.net and *baz.example.net and b*z.example.net would |
1356 // be taken to match baz1.example.net and foobaz.example.net and | 1357 // be taken to match baz1.example.net and foobaz.example.net and |
1357 // buzz.example.net, respectively | 1358 // buzz.example.net, respectively |
1358 { true, "baz1.example.net", "baz*.example.net" }, | 1359 { true, "baz1.example.net", "baz*.example.net" }, |
1359 { true, "foobaz.example.net", "*baz.example.net" }, | 1360 { true, "foobaz.example.net", "*baz.example.net" }, |
1360 { true, "buzz.example.net", "b*z.example.net" }, | 1361 { true, "buzz.example.net", "b*z.example.net" }, |
1361 // Wildcards should not be valid for registry-controlled domains, and for | 1362 // Wildcards should not be valid unless there are at least three name |
1362 // unknown/unrecognized domains, at least three domain components must be | 1363 // components. |
1363 // present. | 1364 { true, "h.co.uk", "*.co.uk" }, |
1364 { true, "www.test.example", "*.test.example" }, | |
1365 { true, "test.example.co.uk", "*.example.co.uk" }, | |
1366 { false, "test.example", "*.example" }, | |
1367 { false, "example.co.uk", "*.co.uk" }, | |
1368 { false, "foo.com", "*.com" }, | 1365 { false, "foo.com", "*.com" }, |
1369 { false, "foo.us", "*.us" }, | 1366 { false, "foo.us", "*.us" }, |
1370 { false, "foo", "*" }, | 1367 { false, "foo", "*" }, |
1371 // IDN variants of wildcards and registry-controlled domains. | |
1372 { true, "www.xn--poema-9qae5a.com.br", "*.xn--poema-9qae5a.com.br" }, | |
1373 { true, "test.example.xn--mgbaam7a8h", "*.example.xn--mgbaam7a8h" }, | |
1374 { false, "xn--poema-9qae5a.com.br", "*.com.br" }, | |
1375 { false, "example.xn--mgbaam7a8h", "*.xn--mgbaam7a8h" }, | |
1376 // Multiple wildcards are not valid. | 1368 // Multiple wildcards are not valid. |
1377 { false, "foo.example.com", "*.*.com" }, | 1369 { false, "foo.example.com", "*.*.com" }, |
1378 { false, "foo.bar.example.com", "*.bar.*.com" }, | 1370 { false, "foo.bar.example.com", "*.bar.*.com" }, |
1379 // Absolute vs relative DNS name tests. Although not explicitly specified | 1371 // Absolute vs relative DNS name tests. Although not explicitly specified |
1380 // in RFC 6125, absolute reference names (those ending in a .) should | 1372 // in RFC 6125, absolute reference names (those ending in a .) should |
1381 // match either absolute or relative presented names. | 1373 // match either absolute or relative presented names. |
1382 { true, "foo.com", "foo.com." }, | 1374 { true, "foo.com", "foo.com." }, |
1383 { true, "foo.com.", "foo.com" }, | 1375 { true, "foo.com.", "foo.com" }, |
1384 { true, "foo.com.", "foo.com." }, | 1376 { true, "foo.com.", "foo.com." }, |
1385 { true, "f", "f." }, | 1377 { true, "f", "f." }, |
1386 { true, "f.", "f" }, | 1378 { true, "f.", "f" }, |
1387 { true, "f.", "f." }, | 1379 { true, "f.", "f." }, |
1388 { true, "www-3.bar.foo.com", "*.bar.foo.com." }, | 1380 { true, "www-3.bar.foo.com", "*.bar.foo.com." }, |
1389 { true, "www-3.bar.foo.com.", "*.bar.foo.com" }, | 1381 { true, "www-3.bar.foo.com.", "*.bar.foo.com" }, |
1390 { true, "www-3.bar.foo.com.", "*.bar.foo.com." }, | 1382 { true, "www-3.bar.foo.com.", "*.bar.foo.com." }, |
1391 { false, ".", "." }, | 1383 { false, ".", "." }, |
1392 { false, "example.com", "*.com." }, | 1384 { false, "example.com", "*.com." }, |
1393 { false, "example.com.", "*.com" }, | 1385 { false, "example.com.", "*.com" }, |
1394 { false, "example.com.", "*.com." }, | 1386 { false, "example.com.", "*.com." }, |
1395 { false, "foo.", "*." }, | 1387 { false, "foo.", "*." }, |
1396 { false, "foo", "*." }, | |
1397 { false, "foo.co.uk", "*.co.uk." }, | |
1398 { false, "foo.co.uk.", "*.co.uk." }, | |
1399 // IP addresses in common name; IPv4 only. | 1388 // IP addresses in common name; IPv4 only. |
1400 { true, "127.0.0.1", "127.0.0.1" }, | 1389 { true, "127.0.0.1", "127.0.0.1" }, |
1401 { true, "192.168.1.1", "192.168.1.1" }, | 1390 { true, "192.168.1.1", "192.168.1.1" }, |
1402 { true, "676768", "0.10.83.160" }, | 1391 { true, "676768", "0.10.83.160" }, |
1403 { true, "1.2.3", "1.2.0.3" }, | 1392 { true, "1.2.3", "1.2.0.3" }, |
1404 { false, "192.169.1.1", "192.168.1.1" }, | 1393 { false, "192.169.1.1", "192.168.1.1" }, |
1405 { false, "12.19.1.1", "12.19.1.1/255.255.255.0" }, | 1394 { false, "12.19.1.1", "12.19.1.1/255.255.255.0" }, |
1406 { false, "FEDC:ba98:7654:3210:FEDC:BA98:7654:3210", | 1395 { false, "FEDC:ba98:7654:3210:FEDC:BA98:7654:3210", |
1407 "FEDC:BA98:7654:3210:FEDC:ba98:7654:3210" }, | 1396 "FEDC:BA98:7654:3210:FEDC:ba98:7654:3210" }, |
1408 { false, "1111:2222:3333:4444:5555:6666:7777:8888", | 1397 { false, "1111:2222:3333:4444:5555:6666:7777:8888", |
(...skipping 284 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1693 #define MAYBE_VerifyMixed VerifyMixed | 1682 #define MAYBE_VerifyMixed VerifyMixed |
1694 #endif | 1683 #endif |
1695 WRAPPED_INSTANTIATE_TEST_CASE_P( | 1684 WRAPPED_INSTANTIATE_TEST_CASE_P( |
1696 MAYBE_VerifyMixed, | 1685 MAYBE_VerifyMixed, |
1697 X509CertificateWeakDigestTest, | 1686 X509CertificateWeakDigestTest, |
1698 testing::ValuesIn(kVerifyMixedTestData)); | 1687 testing::ValuesIn(kVerifyMixedTestData)); |
1699 | 1688 |
1700 #endif // defined(USE_NSS) || defined(OS_WIN) | 1689 #endif // defined(USE_NSS) || defined(OS_WIN) |
1701 | 1690 |
1702 } // namespace net | 1691 } // namespace net |
OLD | NEW |