mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-27 06:45:07 +02:00
8201815: Use Mozilla Public Suffix List
Reviewed-by: michaelm, erikj, ihse
This commit is contained in:
parent
19f5116cd9
commit
60ff77bd97
13 changed files with 13920 additions and 928 deletions
|
@ -675,9 +675,21 @@ public final class SocketPermission extends Permission
|
|||
|
||||
private transient String cdomain, hdomain;
|
||||
|
||||
/**
|
||||
* previously we allowed domain names to be specified in IDN ACE form
|
||||
* Need to check for that and convert to Unicode
|
||||
*/
|
||||
private static String checkForIDN(String name) {
|
||||
if (name.startsWith("xn--") || name.contains(".xn--")) {
|
||||
return IDN.toUnicode(name);
|
||||
} else {
|
||||
return name;
|
||||
}
|
||||
}
|
||||
|
||||
private boolean match(String cname, String hname) {
|
||||
String a = cname.toLowerCase();
|
||||
String b = hname.toLowerCase();
|
||||
String a = checkForIDN(cname.toLowerCase());
|
||||
String b = checkForIDN(hname.toLowerCase());
|
||||
if (a.startsWith(b) &&
|
||||
((a.length() == b.length()) || (a.charAt(b.length()) == '.'))) {
|
||||
return true;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue