Author: toad
Date: 2007-04-13 16:32:27 +0000 (Fri, 13 Apr 2007)
New Revision: 12639
Modified:
trunk/freenet/src/freenet/keys/Key.java
trunk/freenet/src/freenet/node/NodeClientCore.java
Log:
Config options for allowing insecure SSKs and CHKs
Modified: trunk/freenet/src/freenet/keys/Key.java
===================================================================
--- trunk/freenet/src/freenet/keys/Key.java 2007-04-13 16:28:54 UTC (rev
12638)
+++ trunk/freenet/src/freenet/keys/Key.java 2007-04-13 16:32:27 UTC (rev
12639)
@@ -39,8 +39,8 @@
* FIXME: REMOVE!! */
static final byte ALGO_INSECURE_AES_PCFB_256_SHA256 = 1;
- static boolean ALLOW_INSECURE_CLIENT_CHKS;
- static boolean ALLOW_INSECURE_CLIENT_SSKS;
+ public static boolean ALLOW_INSECURE_CLIENT_CHKS;
+ public static boolean ALLOW_INSECURE_CLIENT_SSKS;
protected Key(byte[] routingKey) {
this.routingKey = routingKey;
Modified: trunk/freenet/src/freenet/node/NodeClientCore.java
===================================================================
--- trunk/freenet/src/freenet/node/NodeClientCore.java 2007-04-13 16:28:54 UTC
(rev 12638)
+++ trunk/freenet/src/freenet/node/NodeClientCore.java 2007-04-13 16:32:27 UTC
(rev 12639)
@@ -33,6 +33,7 @@
import freenet.keys.ClientKeyBlock;
import freenet.keys.ClientSSK;
import freenet.keys.ClientSSKBlock;
+import freenet.keys.Key;
import freenet.keys.KeyBlock;
import freenet.keys.NodeCHK;
import freenet.keys.SSKBlock;
@@ -306,6 +307,36 @@
lazyResume = nodeConfig.getBoolean("lazyResume");
+ // FIXME remove and remove related code when we can just block
them.
+ // REDFLAG normally we wouldn't use static variables to carry
important non-final data, but in this
+ // case it's temporary code which will be removed before 0.7.0.
+
+ nodeConfig.register("allowInsecureCHKs", true, sortOrder++,
true, false, "Allow insecure CHKs?", "Before 1010, all CHKs were insecure (only
half encrypted). Allow old CHKs?",
+ new BooleanCallback() {
+
+ public boolean get() {
+ return
Key.ALLOW_INSECURE_CLIENT_CHKS;
+ }
+
+ public void set(boolean val) throws
InvalidConfigValueException {
+ Key.ALLOW_INSECURE_CLIENT_CHKS
= val;
+ }
+
+ });
+
+ nodeConfig.register("allowInsecureSSKs", true, sortOrder++,
true, false, "Allow insecure SSKs?", "Before 1010, all SSKs were insecure (only
half encrypted). Allow old SSKs?",
+ new BooleanCallback() {
+
+ public boolean get() {
+ return
Key.ALLOW_INSECURE_CLIENT_SSKS;
+ }
+
+ public void set(boolean val) throws
InvalidConfigValueException {
+ Key.ALLOW_INSECURE_CLIENT_SSKS
= val;
+ }
+
+ });
+
}
protected synchronized void setDownloadAllowedDirs(String[] val) {