* Certificates:

- Add a signed Certificate type
      - Add a main() to PrivateKeyFile to generate
        Destinations with various Certificate types
      - Add a VerifiedDestination class to check Certificates
        of various types
      - Add a HashCash library from http://www.nettgryppa.com/code/
        (no distribution restrictions)
      - Allow non-null Certificates in addressbook
This commit is contained in:
zzz
2008-11-02 22:13:11 +00:00
parent 47d5e44b16
commit bf12c5f9bf
9 changed files with 939 additions and 26 deletions

View File

@@ -159,6 +159,9 @@ public class AddressBook {
return this.addresses.toString();
}
private static final int MIN_DEST_LENGTH = 516;
private static final int MAX_DEST_LENGTH = MIN_DEST_LENGTH + 100; // longer than any known cert type for now
/**
* Do basic validation of the hostname and dest
* hostname was already converted to lower case by ConfigParser.parse()
@@ -184,8 +187,8 @@ public class AddressBook {
(! host.endsWith(".router.i2p")) &&
(! host.endsWith(".console.i2p")) &&
dest.length() == 516 &&
dest.endsWith("AAAA") &&
((dest.length() == MIN_DEST_LENGTH && dest.endsWith("AAAA")) ||
(dest.length() > MIN_DEST_LENGTH && dest.length() <= MAX_DEST_LENGTH)) &&
dest.replaceAll("[a-zA-Z0-9~-]", "").length() == 0
;
}

View File

@@ -45,6 +45,7 @@ div.routersummary {
color: inherit;
font-size: small;
clear: left; /* fixes a bug in Opera */
overflow: auto;
}
div.warning {