[freenet-cvs] r13572 - trunk/freenet/src/freenet/node

nextgens at freenetproject.org nextgens at freenetproject.org
Wed Jun 13 18:31:55 UTC 2007


Author: nextgens
Date: 2007-06-13 18:31:55 +0000 (Wed, 13 Jun 2007)
New Revision: 13572

Modified:
   trunk/freenet/src/freenet/node/FNPPacketMangler.java
Log:
simplify the code so that it can be understood

Modified: trunk/freenet/src/freenet/node/FNPPacketMangler.java
===================================================================
--- trunk/freenet/src/freenet/node/FNPPacketMangler.java	2007-06-13 18:24:33 UTC (rev 13571)
+++ trunk/freenet/src/freenet/node/FNPPacketMangler.java	2007-06-13 18:31:55 UTC (rev 13572)
@@ -252,12 +252,7 @@
         if(negType == 0) {
         	Logger.error(this, "Old ephemeral Diffie-Hellman (negType 0) not supported.");
         	return;
-        }
-        
-        if(negType != 1) {
-            Logger.error(this, "Decrypted auth packet but unknown negotiation type "+negType+" from "+replyTo+" possibly from "+pn);
-            return;
-        }else if (negType == 0 || negType == 1){
+        }else if (negType == 1) {
         	// Four stage Diffie-Hellman. 0 = ephemeral, 1 = payload stages are signed (not quite STS)
         	// FIXME reduce to 3 stages and implement STS properly (we have a separate validation mechanism in PeerNode)
         	// AFAICS this (with negType=1) is equivalent in security to STS; it expands the second phase into a second and a fourth phase.
@@ -314,7 +309,10 @@
         		// We are Alice
         		processSignedDHTwoOrThree(3, payload, pn, replyTo, false);
         	}
-        }
+        }else {
+            Logger.error(this, "Decrypted auth packet but unknown negotiation type "+negType+" from "+replyTo+" possibly from "+pn);
+            return;
+	}
     }
 
     /**




More information about the cvs mailing list