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

Side by Side Diff: components/url_formatter/url_formatter_unittest.cc

Issue 2889303003: Revert of Mitigate spoofing attempt using Latin letters. (Closed)
Patch Set: Created 3 years, 7 months 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 | « components/url_formatter/url_formatter.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 "components/url_formatter/url_formatter.h" 5 #include "components/url_formatter/url_formatter.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 #include <string.h> 8 #include <string.h>
9 9
10 #include <vector> 10 #include <vector>
(...skipping 263 matching lines...) Expand 10 before | Expand all | Expand 10 after
274 L"\x0455\x0441\x043e\x0440\x0435\u00b7\x0440\x0430\x0443.\x0440\x0444", 274 L"\x0455\x0441\x043e\x0440\x0435\u00b7\x0440\x0430\x0443.\x0440\x0444",
275 true}, 275 true},
276 276
277 // ѕсоре-рау.한국 with ѕсоре and рау in Cyrillic. 277 // ѕсоре-рау.한국 with ѕсоре and рау in Cyrillic.
278 {"xn----8sbn9akccw8m.xn--3e0b707e", 278 {"xn----8sbn9akccw8m.xn--3e0b707e",
279 L"\x0455\x0441\x043e\x0440\x0435-\x0440\x0430\x0443.\xd55c\xad6d", true}, 279 L"\x0455\x0441\x043e\x0440\x0435-\x0440\x0430\x0443.\xd55c\xad6d", true},
280 280
281 // музей (museum in Russian) has characters without a Latin-look-alike. 281 // музей (museum in Russian) has characters without a Latin-look-alike.
282 {"xn--e1adhj9a.com", L"\x043c\x0443\x0437\x0435\x0439.com", true}, 282 {"xn--e1adhj9a.com", L"\x043c\x0443\x0437\x0435\x0439.com", true},
283 283
284 // Combining Diacritic marks after a script other than Latin-Greek-Cyrillic
285 {"xn--rsa2568fvxya.com", L"\xd55c\x0301\xae00.com", false}, // 한́글.com
286 {"xn--rsa0336bjom.com", L"\x6f22\x0307\x5b57.com", false}, // 漢̇字.com
287 // नागरी́.com
288 {"xn--lsa922apb7a6do.com", L"\x0928\x093e\x0917\x0930\x0940\x0301.com",
289 false},
290
291 // Similarity checks against the list of top domains. "digklmo68.com" and
292 // 'digklmo68.co.uk" are listed for unittest in the top domain list.
293 {"xn--igklmo68-nea32c.com", L"\x0111igklmo68.com", false}, // đigklmo68.com
294 {"www.xn--igklmo68-nea32c.com", L"www.\x0111igklmo68.com", false},
295 {"foo.bar.xn--igklmo68-nea32c.com", L"foo.bar.\x0111igklmo68.com", false},
296 {"xn--igklmo68-nea32c.co.uk", L"\x0111igklmo68.co.uk", false},
297 {"mail.xn--igklmo68-nea32c.co.uk", L"mail.\x0111igklmo68.co.uk", false},
298 {"xn--digklmo68-6jf.com", L"di\x0307gklmo68.com", false}, // di̇gklmo68.com
299 {"xn--digklmo68-7vf.com", L"dig\x0331klmo68.com", false}, // dig̱klmo68.com
300 {"xn--diglmo68-omb.com", L"dig\x0138lmo68.com", false}, // digĸlmo68.com
301 {"xn--digkmo68-9ob.com", L"digk\x0142mo68.com", false}, // digkłmo68.com
302 {"xn--digklo68-l89c.com", L"digkl\x1e43o68.com", false}, // digklṃo68.com
303 {"xn--digklm68-b5a.com", L"digklm\x00f8" L"68.com", false}, // digklmø68.com
304 {"xn--digklmo8-h7g.com", L"digklmo\x0431" L"8.com", false}, // digklmoб8.com
305 {"xn--digklmo6-7yr.com", L"digklmo6\x09ea.com", false}, // digklmo6৪.com
306
307 // 'islkpx123.com' is listed for unitest in the top domain list.
308 // 'іѕӏкрх123' can look like 'islkpx123' in some fonts.
309 {"xn--123-bed4a4a6hh40i.com",
310 L"\x0456\x0455\x04cf\x043a\x0440\x0445" L"123.com", false},
311
312 // Mixed digits: the first two will also fail mixed script test 284 // Mixed digits: the first two will also fail mixed script test
313 // Latin + ASCII digit + Deva digit 285 // Latin + ASCII digit + Deva digit
314 {"xn--asc1deva-j0q.co.in", L"asc1deva\x0967.co.in", false}, 286 {"xn--asc1deva-j0q.co.in", L"asc1deva\x0967.co.in", false},
315 // Latin + Deva digit + Beng digit 287 // Latin + Deva digit + Beng digit
316 {"xn--devabeng-f0qu3f.co.in", L"deva\x0967" L"beng\x09e7.co.in", false}, 288 {"xn--devabeng-f0qu3f.co.in", L"deva\x0967" L"beng\x09e7.co.in", false},
317 // ASCII digit + Deva digit 289 // ASCII digit + Deva digit
318 {"xn--79-v5f.co.in", L"7\x09ea" L"9.co.in", false}, 290 {"xn--79-v5f.co.in", L"7\x09ea" L"9.co.in", false},
319 // Deva digit + Beng digit 291 // Deva digit + Beng digit
320 {"xn--e4b0x.co.in", L"\x0967\x09e7.co.in", false}, 292 {"xn--e4b0x.co.in", L"\x0967\x09e7.co.in", false},
321 // U+4E00 (CJK Ideograph One) is not a digit 293 // U+4E00 (CJK Ideograph One) is not a digit
(...skipping 13 matching lines...) Expand all
335 {"xn--58db0a9q.com", L"\x13df\x13aa\x13a1\x13a0.com", false}, 307 {"xn--58db0a9q.com", L"\x13df\x13aa\x13a1\x13a0.com", false},
336 // Scripts excluded from Identifiers: UTS 31 Table 4 308 // Scripts excluded from Identifiers: UTS 31 Table 4
337 // Coptic 309 // Coptic
338 {"xn--5ya.com", L"\x03e7.com", false}, 310 {"xn--5ya.com", L"\x03e7.com", false},
339 // Old Italic 311 // Old Italic
340 {"xn--097cc.com", L"\U00010300\U00010301.com", false}, 312 {"xn--097cc.com", L"\U00010300\U00010301.com", false},
341 313
342 // U+115F (Hangul Filler) 314 // U+115F (Hangul Filler)
343 {"xn--osd3820f24c.kr", L"\xac00\xb098\x115f.kr", false}, 315 {"xn--osd3820f24c.kr", L"\xac00\xb098\x115f.kr", false},
344 {"www.xn--google-ho0coa.com", L"www.\x2039google\x203a.com", false}, 316 {"www.xn--google-ho0coa.com", L"www.\x2039google\x203a.com", false},
345 // Latin small capital w: hardᴡare.com 317 // Latin small capital w
346 {"xn--hardare-l41c.com", L"hard\x1d21" L"are.com", false}, 318 {"xn--hardare-l41c.com", L"hard\x1d21" L"are.com", false},
347 // Minus Sign(U+2212) 319 // Minus Sign(U+2212)
348 {"xn--t9g238xc2a.jp", L"\x65e5\x2212\x672c.jp", false}, 320 {"xn--t9g238xc2a.jp", L"\x65e5\x2212\x672c.jp", false},
349 // Latin Small Letter Script G: ɡɡ.com 321 // Latin Small Letter Script G
350 {"xn--0naa.com", L"\x0261\x0261.com", false}, 322 {"xn--0naa.com", L"\x0261\x0261.com", false},
351 // Hangul Jamo(U+11xx) 323 // Hangul Jamo(U+11xx)
352 {"xn--0pdc3b.com", L"\x1102\x1103\x1110.com", false}, 324 {"xn--0pdc3b.com", L"\x1102\x1103\x1110.com", false},
353 // degree sign: 36°c.com 325 // degree sign
354 {"xn--36c-tfa.com", L"36\x00b0" L"c.com", false}, 326 {"xn--36c-tfa.com", L"36\x00b0" L"c.com", false},
355 // Pound sign 327 // Pound sign
356 {"xn--5free-9ga.com", L"5free\x00a8.com", false}, 328 {"xn--5free-9ga.com", L"5free\x00a8.com", false},
357 // Hebrew points (U+05B0, U+05B6) 329 // Hebrew points (U+05B0, U+05B6)
358 {"xn--7cbl2kc2a.com", L"\x05e1\x05b6\x05e7\x05b0\x05e1.com", false}, 330 {"xn--7cbl2kc2a.com", L"\x05e1\x05b6\x05e7\x05b0\x05e1.com", false},
359 // Danda(U+0964) 331 // Danda(U+0964)
360 {"xn--81bp1b6ch8s.com", L"\x0924\x093f\x091c\x0964\x0930\x0940.com", false}, 332 {"xn--81bp1b6ch8s.com", L"\x0924\x093f\x091c\x0964\x0930\x0940.com", false},
361 // Small letter script G(U+0261) 333 // Small letter script G(U+0261)
362 {"xn--oogle-qmc.com", L"\x0261oogle.com", false}, 334 {"xn--oogle-qmc.com", L"\x0261oogle.com", false},
363 // Small Katakana Extension(U+31F1) 335 // Small Katakana Extension(U+31F1)
364 {"xn--wlk.com", L"\x31f1.com", false}, 336 {"xn--wlk.com", L"\x31f1.com", false},
365 // Heart symbol: ♥ 337 // Heart symbol
366 {"xn--ab-u0x.com", L"ab\x2665.com", false}, 338 {"xn--ab-u0x.com", L"ab\x2665.com", false},
367 // Emoji 339 // Emoji
368 {"xn--vi8hiv.xyz", L"\U0001f355\U0001f4a9.xyz", false}, 340 {"xn--vi8hiv.xyz", L"\U0001f355\U0001f4a9.xyz", false},
369 // Registered trade mark 341 // Registered trade mark
370 {"xn--egistered-fna.com", L"\x00ae" L"egistered.com", false}, 342 {"xn--egistered-fna.com", L"\x00ae" L"egistered.com", false},
371 // Latin Letter Retroflex Click 343 // Latin Letter Retroflex Click
372 {"xn--registered-25c.com", L"registered\x01c3.com", false}, 344 {"xn--registered-25c.com", L"registered\x01c3.com", false},
373 // ASCII '!' not allowed in IDN 345 // ASCII '!' not allowed in IDN
374 {"xn--!-257eu42c.kr", L"\xc548\xb155!.kr", false}, 346 {"xn--!-257eu42c.kr", L"\xc548\xb155!.kr", false},
375 // 'GOOGLE' in IPA extension: ɢᴏᴏɢʟᴇ 347 // 'GOOGLE' in IPA extension
376 {"xn--1naa7pn51hcbaa.com", 348 {"xn--1naa7pn51hcbaa.com",
377 L"\x0262\x1d0f\x1d0f\x0262\x029f\x1d07.com", false}, 349 L"\x0262\x1d0f\x1d0f\x0262\x029f\x1d07.com", false},
378 // Padlock icon spoof. 350 // Padlock icon spoof.
379 {"xn--google-hj64e", L"\U0001f512google.com", false}, 351 {"xn--google-hj64e", L"\U0001f512google.com", false},
380 352
381 // Custom black list 353 // Custom black list
382 // Combining Long Solidus Overlay 354 // Combining Long Solidus Overlay
383 {"google.xn--comabc-k8d", L"google.com\x0338" L"abc", false}, 355 {"google.xn--comabc-k8d", L"google.com\x0338" L"abc", false},
384 // Hyphenation Point instead of Katakana Middle dot 356 // Hyphenation Point instead of Katakana Middle dot
385 {"xn--svgy16dha.jp", L"\x30a1\x2027\x30a3.jp", false}, 357 {"xn--svgy16dha.jp", L"\x30a1\x2027\x30a3.jp", false},
(...skipping 639 matching lines...) Expand 10 before | Expand all | Expand 10 after
1025 0, kNpos, kNpos, kNpos, kNpos, kNpos, kNpos, 0, kNpos, kNpos, kNpos, kNpos, 997 0, kNpos, kNpos, kNpos, kNpos, kNpos, kNpos, 0, kNpos, kNpos, kNpos, kNpos,
1026 0, 1, 2, 3, 4, 5, 6, 7 998 0, 1, 2, 3, 4, 5, 6, 7
1027 }; 999 };
1028 CheckAdjustedOffsets("http://user@foo.com/", kFormatUrlOmitAll, 1000 CheckAdjustedOffsets("http://user@foo.com/", kFormatUrlOmitAll,
1029 net::UnescapeRule::NORMAL, omit_all_offsets); 1001 net::UnescapeRule::NORMAL, omit_all_offsets);
1030 } 1002 }
1031 1003
1032 } // namespace 1004 } // namespace
1033 1005
1034 } // namespace url_formatter 1006 } // namespace url_formatter
OLDNEW
« no previous file with comments | « components/url_formatter/url_formatter.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698