Author: toad
Date: 2007-03-20 20:57:00 +0000 (Tue, 20 Mar 2007)
New Revision: 12237

Modified:
   trunk/freenet/src/freenet/node/FNPPacketMangler.java
Log:
Don't reuse md. But this probably won't fix the hash resetting bug, because we 
were only calling .getDigestLength() anyway

Modified: trunk/freenet/src/freenet/node/FNPPacketMangler.java
===================================================================
--- trunk/freenet/src/freenet/node/FNPPacketMangler.java        2007-03-20 
20:22:35 UTC (rev 12236)
+++ trunk/freenet/src/freenet/node/FNPPacketMangler.java        2007-03-20 
20:57:00 UTC (rev 12237)
@@ -703,7 +703,7 @@
         md.update(seqBuf);
         md.update(plaintext);
         byte[] realHash = md.digest();
-        SHA256.returnMessageDigest(md);
+        SHA256.returnMessageDigest(md); md = null;

         // Now decrypt the original hash

@@ -726,7 +726,7 @@
             packetHash[i] ^= buf[offset+i];
         }
         if(logMINOR) Logger.minor(this, "Contributing entropy");
-        node.random.acceptEntropyBytes(myPacketDataSource, packetHash, 0, 
md.getDigestLength(), 0.5);
+        node.random.acceptEntropyBytes(myPacketDataSource, packetHash, 0, 
HASH_LENGTH, 0.5);
         if(logMINOR) Logger.minor(this, "Contributed entropy");

         // Lots more to do yet!


Reply via email to