I2P Address: [http://git.idk.i2p]

Skip to content
Snippets Groups Projects
Commit 4a8dbd06 authored by zzz's avatar zzz
Browse files

* Addressbook: Disallow '--' in host names except in IDN,

      add some reserved host names
parent 38c0184f
No related branches found
No related tags found
No related merge requests found
...@@ -169,7 +169,16 @@ public class AddressBook { ...@@ -169,7 +169,16 @@ public class AddressBook {
(! host.startsWith("-")) && (! host.startsWith("-")) &&
(! host.endsWith("-.i2p")) && (! host.endsWith("-.i2p")) &&
host.indexOf("..") < 0 && host.indexOf("..") < 0 &&
// IDN - basic check, not complete validation
(host.indexOf("--") < 0 || host.startsWith("xn--") || host.indexOf(".xn--") > 0) &&
host.replaceAll("[a-z0-9.-]", "").length() == 0 && host.replaceAll("[a-z0-9.-]", "").length() == 0 &&
// some reserved names that may be used for local configuration someday
(! host.equals("proxy.i2p")) &&
(! host.equals("router.i2p")) &&
(! host.equals("console.i2p")) &&
(! host.endsWith(".proxy.i2p")) &&
(! host.endsWith(".router.i2p")) &&
(! host.endsWith(".console.i2p")) &&
dest.length() == 516 && dest.length() == 516 &&
dest.endsWith("AAAA") && dest.endsWith("AAAA") &&
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment