Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(71)

Side by Side Diff: net/cert/x509_certificate_unittest.cc

Issue 2397873002: Reject some previuosly-escaped chars in hostnames.
Patch Set: Some tests fixed Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « net/base/filename_util_unittest.cc ('k') | net/http/http_security_headers_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 <stdint.h> 7 #include <stdint.h>
8 8
9 #include <memory> 9 #include <memory>
10 10
(...skipping 955 matching lines...) Expand 10 before | Expand all | Expand 10 after
966 { false, "www.house.example", "ww.house.example" }, 966 { false, "www.house.example", "ww.house.example" },
967 { false, "test.org", "", "www.test.org,*.test.org,*.org" }, 967 { false, "test.org", "", "www.test.org,*.test.org,*.org" },
968 { false, "w.bar.foo.com", "w*.bar.foo.com" }, 968 { false, "w.bar.foo.com", "w*.bar.foo.com" },
969 { false, "www.bar.foo.com", "ww*ww.bar.foo.com" }, 969 { false, "www.bar.foo.com", "ww*ww.bar.foo.com" },
970 { false, "wwww.bar.foo.com", "ww*ww.bar.foo.com" }, 970 { false, "wwww.bar.foo.com", "ww*ww.bar.foo.com" },
971 { false, "wwww.bar.foo.com", "w*w.bar.foo.com" }, 971 { false, "wwww.bar.foo.com", "w*w.bar.foo.com" },
972 { false, "wwww.bar.foo.com", "w*w.bar.foo.c0m" }, 972 { false, "wwww.bar.foo.com", "w*w.bar.foo.c0m" },
973 { false, "WALLY.bar.foo.com", "wa*.bar.foo.com" }, 973 { false, "WALLY.bar.foo.com", "wa*.bar.foo.com" },
974 { false, "wally.bar.foo.com", "*Ly.bar.foo.com" }, 974 { false, "wally.bar.foo.com", "*Ly.bar.foo.com" },
975 { true, "ww%57.foo.com", "", "www.foo.com" }, 975 { true, "ww%57.foo.com", "", "www.foo.com" },
976 { true, "www&.foo.com", "www%26.foo.com" },
977 // Common name must not be used if subject alternative name was provided. 976 // Common name must not be used if subject alternative name was provided.
978 { false, "www.test.co.jp", "www.test.co.jp", 977 { false, "www.test.co.jp", "www.test.co.jp",
979 "*.test.de,*.jp,www.test.co.uk,www.*.co.jp" }, 978 "*.test.de,*.jp,www.test.co.uk,www.*.co.jp" },
980 { false, "www.bar.foo.com", "www.bar.foo.com", 979 { false, "www.bar.foo.com", "www.bar.foo.com",
981 "*.foo.com,*.*.foo.com,*.*.bar.foo.com,*..bar.foo.com," }, 980 "*.foo.com,*.*.foo.com,*.*.bar.foo.com,*..bar.foo.com," },
982 { false, "www.bath.org", "www.bath.org", "", "20.30.40.50" }, 981 { false, "www.bath.org", "www.bath.org", "", "20.30.40.50" },
983 { false, "66.77.88.99", "www.bath.org", "www.bath.org" }, 982 { false, "66.77.88.99", "www.bath.org", "www.bath.org" },
984 // IDN tests 983 // IDN tests
985 { true, "xn--poema-9qae5a.com.br", "xn--poema-9qae5a.com.br" }, 984 { true, "xn--poema-9qae5a.com.br", "xn--poema-9qae5a.com.br" },
986 { true, "www.xn--poema-9qae5a.com.br", "*.xn--poema-9qae5a.com.br" }, 985 { true, "www.xn--poema-9qae5a.com.br", "*.xn--poema-9qae5a.com.br" },
(...skipping 207 matching lines...) Expand 10 before | Expand all | Expand 10 after
1194 &actual_type); 1193 &actual_type);
1195 1194
1196 EXPECT_EQ(data.expected_bits, actual_bits); 1195 EXPECT_EQ(data.expected_bits, actual_bits);
1197 EXPECT_EQ(data.expected_type, actual_type); 1196 EXPECT_EQ(data.expected_type, actual_type);
1198 } 1197 }
1199 1198
1200 INSTANTIATE_TEST_CASE_P(, X509CertificatePublicKeyInfoTest, 1199 INSTANTIATE_TEST_CASE_P(, X509CertificatePublicKeyInfoTest,
1201 testing::ValuesIn(kPublicKeyInfoTestData)); 1200 testing::ValuesIn(kPublicKeyInfoTestData));
1202 1201
1203 } // namespace net 1202 } // namespace net
OLDNEW
« no previous file with comments | « net/base/filename_util_unittest.cc ('k') | net/http/http_security_headers_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698