[freenet-cvs] r15102 - trunk/freenet/src/freenet/keys

juiceman at freenetproject.org juiceman at freenetproject.org
Mon Sep 10 00:51:46 UTC 2007


Author: juiceman
Date: 2007-09-10 00:51:46 +0000 (Mon, 10 Sep 2007)
New Revision: 15102

Modified:
   trunk/freenet/src/freenet/keys/ClientCHK.java
   trunk/freenet/src/freenet/keys/ClientSSK.java
   trunk/freenet/src/freenet/keys/Key.java
Log:
Remove a tad bit more pre-1010 cruft

Modified: trunk/freenet/src/freenet/keys/ClientCHK.java
===================================================================
--- trunk/freenet/src/freenet/keys/ClientCHK.java	2007-09-09 23:27:53 UTC (rev 15101)
+++ trunk/freenet/src/freenet/keys/ClientCHK.java	2007-09-10 00:51:46 UTC (rev 15102)
@@ -71,8 +71,7 @@
             throw new MalformedURLException("No extra bytes in CHK - maybe a 0.5 key?");
         // byte 0 is reserved, for now
         cryptoAlgorithm = extra[1];
-		if((!(cryptoAlgorithm == Key.ALGO_AES_PCFB_256_SHA256 ||
-				(Key.ALLOW_INSECURE_CLIENT_CHKS && cryptoAlgorithm == Key.ALGO_INSECURE_AES_PCFB_256_SHA256))))
+		if(cryptoAlgorithm != Key.ALGO_AES_PCFB_256_SHA256)
 			throw new MalformedURLException("Invalid crypto algorithm");
         controlDocument = (extra[2] & 0x02) != 0;
         compressionAlgorithm = (short)(((extra[3] & 0xff) << 8) + (extra[4] & 0xff));
@@ -88,8 +87,7 @@
 		dis.readFully(extra);
 		// byte 0 is reserved, for now
         cryptoAlgorithm = extra[1];
-		if((!(cryptoAlgorithm == Key.ALGO_AES_PCFB_256_SHA256 ||
-				(Key.ALLOW_INSECURE_CLIENT_CHKS && cryptoAlgorithm == Key.ALGO_INSECURE_AES_PCFB_256_SHA256))))
+		if(cryptoAlgorithm != Key.ALGO_AES_PCFB_256_SHA256)
 			throw new MalformedURLException("Invalid crypto algorithm");
         compressionAlgorithm = (short)(((extra[3] & 0xff) << 8) + (extra[4] & 0xff));
         controlDocument = (extra[2] & 0x02) != 0;

Modified: trunk/freenet/src/freenet/keys/ClientSSK.java
===================================================================
--- trunk/freenet/src/freenet/keys/ClientSSK.java	2007-09-09 23:27:53 UTC (rev 15101)
+++ trunk/freenet/src/freenet/keys/ClientSSK.java	2007-09-10 00:51:46 UTC (rev 15102)
@@ -42,8 +42,7 @@
 		if(extras.length < 5)
 			throw new MalformedURLException("Extra bytes too short: "+extras.length+" bytes");
 		this.cryptoAlgorithm = extras[2];
-		if(!(cryptoAlgorithm == Key.ALGO_AES_PCFB_256_SHA256 ||
-				(Key.ALLOW_INSECURE_CLIENT_SSKS && cryptoAlgorithm == Key.ALGO_INSECURE_AES_PCFB_256_SHA256)))
+		if(cryptoAlgorithm != Key.ALGO_AES_PCFB_256_SHA256)
 			throw new MalformedURLException("Unknown encryption algorithm "+cryptoAlgorithm);
 		if(!Arrays.equals(extras, getExtraBytes()))
 			throw new MalformedURLException("Wrong extra bytes");

Modified: trunk/freenet/src/freenet/keys/Key.java
===================================================================
--- trunk/freenet/src/freenet/keys/Key.java	2007-09-09 23:27:53 UTC (rev 15101)
+++ trunk/freenet/src/freenet/keys/Key.java	2007-09-10 00:51:46 UTC (rev 15102)
@@ -41,10 +41,8 @@
     /** Code for old, insecure (only encrypts first 128 bits of block) 256-bit AES with PCFB and SHA-256.
      * FIXME: REMOVE!! */
 	static final byte ALGO_INSECURE_AES_PCFB_256_SHA256 = 1;
-	
-	public static boolean ALLOW_INSECURE_CLIENT_CHKS = false;
-	public static boolean ALLOW_INSECURE_CLIENT_SSKS = false;
 
+
     protected Key(byte[] routingKey) {
     	this.routingKey = routingKey;
     	hash = Fields.hashCode(routingKey);




More information about the cvs mailing list