OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "net/cert/x509_certificate.h" | 5 #include "net/cert/x509_certificate.h" |
6 | 6 |
7 #include "base/basictypes.h" | 7 #include "base/basictypes.h" |
8 #include "base/files/file_path.h" | 8 #include "base/files/file_path.h" |
9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
10 #include "base/pickle.h" | 10 #include "base/pickle.h" |
(...skipping 993 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1004 // always be the left-most label, and only a single label. | 1004 // always be the left-most label, and only a single label. |
1005 { false, "baz1.example.net", "baz*.example.net" }, | 1005 { false, "baz1.example.net", "baz*.example.net" }, |
1006 { false, "foobaz.example.net", "*baz.example.net" }, | 1006 { false, "foobaz.example.net", "*baz.example.net" }, |
1007 { false, "buzz.example.net", "b*z.example.net" }, | 1007 { false, "buzz.example.net", "b*z.example.net" }, |
1008 { false, "www.test.example.net", "www.*.example.net" }, | 1008 { false, "www.test.example.net", "www.*.example.net" }, |
1009 // Wildcards should not be valid for public registry controlled domains, | 1009 // Wildcards should not be valid for public registry controlled domains, |
1010 // and unknown/unrecognized domains, at least three domain components must | 1010 // and unknown/unrecognized domains, at least three domain components must |
1011 // be present. | 1011 // be present. |
1012 { true, "www.test.example", "*.test.example" }, | 1012 { true, "www.test.example", "*.test.example" }, |
1013 { true, "test.example.co.uk", "*.example.co.uk" }, | 1013 { true, "test.example.co.uk", "*.example.co.uk" }, |
1014 { false, "test.example", "*.exmaple" }, | 1014 { false, "test.example", "*.example" }, |
1015 { false, "example.co.uk", "*.co.uk" }, | 1015 { false, "example.co.uk", "*.co.uk" }, |
1016 { false, "foo.com", "*.com" }, | 1016 { false, "foo.com", "*.com" }, |
1017 { false, "foo.us", "*.us" }, | 1017 { false, "foo.us", "*.us" }, |
1018 { false, "foo", "*" }, | 1018 { false, "foo", "*" }, |
1019 // IDN variants of wildcards and registry controlled domains. | 1019 // IDN variants of wildcards and registry controlled domains. |
1020 { true, "www.xn--poema-9qae5a.com.br", "*.xn--poema-9qae5a.com.br" }, | 1020 { true, "www.xn--poema-9qae5a.com.br", "*.xn--poema-9qae5a.com.br" }, |
1021 { true, "test.example.xn--mgbaam7a8h", "*.example.xn--mgbaam7a8h" }, | 1021 { true, "test.example.xn--mgbaam7a8h", "*.example.xn--mgbaam7a8h" }, |
1022 { false, "xn--poema-9qae5a.com.br", "*.com.br" }, | 1022 { false, "xn--poema-9qae5a.com.br", "*.com.br" }, |
1023 { false, "example.xn--mgbaam7a8h", "*.xn--mgbaam7a8h" }, | 1023 { false, "example.xn--mgbaam7a8h", "*.xn--mgbaam7a8h" }, |
1024 // Wildcards should be permissible for 'private' registry controlled | 1024 // Wildcards should be permissible for 'private' registry controlled |
(...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1193 &actual_type); | 1193 &actual_type); |
1194 | 1194 |
1195 EXPECT_EQ(data.expected_bits, actual_bits); | 1195 EXPECT_EQ(data.expected_bits, actual_bits); |
1196 EXPECT_EQ(data.expected_type, actual_type); | 1196 EXPECT_EQ(data.expected_type, actual_type); |
1197 } | 1197 } |
1198 | 1198 |
1199 INSTANTIATE_TEST_CASE_P(, X509CertificatePublicKeyInfoTest, | 1199 INSTANTIATE_TEST_CASE_P(, X509CertificatePublicKeyInfoTest, |
1200 testing::ValuesIn(kPublicKeyInfoTestData)); | 1200 testing::ValuesIn(kPublicKeyInfoTestData)); |
1201 | 1201 |
1202 } // namespace net | 1202 } // namespace net |
OLD | NEW |