Author: toad
Date: 2008-03-18 21:55:33 +0000 (Tue, 18 Mar 2008)
New Revision: 18562

Modified:
   trunk/freenet/src/freenet/node/FNPPacketMangler.java
Log:
Maximum padded size 1280 not 1312.

Modified: trunk/freenet/src/freenet/node/FNPPacketMangler.java
===================================================================
--- trunk/freenet/src/freenet/node/FNPPacketMangler.java        2008-03-18 
16:00:26 UTC (rev 18561)
+++ trunk/freenet/src/freenet/node/FNPPacketMangler.java        2008-03-18 
21:55:33 UTC (rev 18562)
@@ -2357,9 +2357,11 @@
                // worthless) job of disguising the traffic. FIXME!!!!!
                // Ideally we'd mimic the size profile - and the session bytes! 
- of a common protocol.

-               int paddedLen = ((packetLength + 63) / 64) * 64;
+               int REMAINING_OVERHEAD = 32;
+               int paddedLen = ((packetLength + REMAINING_OVERHEAD + 63) / 64) 
* 64;
                paddedLen += node.fastWeakRandom.nextInt(64);
                if(packetLength <= 1280 && paddedLen > 1280) paddedLen = 1280;
+               paddedLen -= REMAINING_OVERHEAD;

                byte[] padding = new byte[paddedLen - packetLength];
                node.fastWeakRandom.nextBytes(padding);


Reply via email to