Author: nextgens
Date: 2007-09-09 19:53:34 +0000 (Sun, 09 Sep 2007)
New Revision: 15090

Modified:
   branches/freenet-jfk/src/freenet/node/FNPPacketMangler.java
Log:
I forgot to test the exponential our peer sent us

Modified: branches/freenet-jfk/src/freenet/node/FNPPacketMangler.java
===================================================================
--- branches/freenet-jfk/src/freenet/node/FNPPacketMangler.java 2007-09-09 
19:41:49 UTC (rev 15089)
+++ branches/freenet-jfk/src/freenet/node/FNPPacketMangler.java 2007-09-09 
19:53:34 UTC (rev 15090)
@@ -517,7 +517,11 @@
                byte[] hisExponential = new 
byte[DiffieHellman.modulusLengthInBytes()];
                System.arraycopy(payload, 4 + NONCE_SIZE, hisExponential, 0, 
DiffieHellman.modulusLengthInBytes());

-               sendMessage2(nonceInitiator, hisExponential, pn, replyTo);
+               NativeBigInteger _hisExponential = new 
NativeBigInteger(hisExponential);
+               if(_hisExponential.compareTo(NativeBigInteger.ONE) > 0)
+                       sendMessage2(nonceInitiator, hisExponential, pn, 
replyTo);
+               else
+                       Logger.error(this, "We can't accept the exponential 
"+pn+" sent us; it's smaller than 1!!");

                long t2=System.currentTimeMillis();
                if((t2-t1)>500)


Reply via email to