From d2184f418fe2b5f92bdb74f2dd27b59492cf998b Mon Sep 17 00:00:00 2001 From: zzz Date: Sat, 22 Jun 2013 13:51:50 +0000 Subject: [PATCH] * NetDB: Increase upper limit on ffs again * SSU: Pad session created message with random data instead of zeros --- history.txt | 12 ++++++++++++ router/java/src/net/i2p/router/RouterVersion.java | 2 +- .../networkdb/kademlia/FloodfillMonitorJob.java | 4 ++-- .../net/i2p/router/transport/udp/PacketBuilder.java | 10 ++++++++-- 4 files changed, 23 insertions(+), 5 deletions(-) diff --git a/history.txt b/history.txt index 0751ef78b8..a022fc6df6 100644 --- a/history.txt +++ b/history.txt @@ -1,6 +1,18 @@ +2013-06-22 zzz + * SSU: Pad session created message with random data instead of zeros + 2013-06-22 meeh * I2PTunnel: Change connect proxy default to outproxy-tor.meeh.i2p after h2ik's AWOL +2013-06-21 zzz + * Crypto: AES decrypt speedups + * NetDB, i2psnark: Speed up XORComparators + * SSU: Ignore non-mod-16 padding + +2013-06-20 zzz + * i2psnark: Show start-all button even if tunnel is open, + if at least one torrent is stopped (ticket #808) + 2013-06-17 zzz * Console: Don't display 'unsupported' message when restart button clicked * I2CP: Don't send SendMessageEndMessages from client to router if diff --git a/router/java/src/net/i2p/router/RouterVersion.java b/router/java/src/net/i2p/router/RouterVersion.java index 7ca1a3ec2c..5a58b19bc2 100644 --- a/router/java/src/net/i2p/router/RouterVersion.java +++ b/router/java/src/net/i2p/router/RouterVersion.java @@ -18,7 +18,7 @@ public class RouterVersion { /** deprecated */ public final static String ID = "Monotone"; public final static String VERSION = CoreVersion.VERSION; - public final static long BUILD = 10; + public final static long BUILD = 11; /** for example "-test" */ public final static String EXTRA = ""; diff --git a/router/java/src/net/i2p/router/networkdb/kademlia/FloodfillMonitorJob.java b/router/java/src/net/i2p/router/networkdb/kademlia/FloodfillMonitorJob.java index 242d88b95c..2b1ca90b49 100644 --- a/router/java/src/net/i2p/router/networkdb/kademlia/FloodfillMonitorJob.java +++ b/router/java/src/net/i2p/router/networkdb/kademlia/FloodfillMonitorJob.java @@ -13,7 +13,7 @@ import net.i2p.util.Log; /** * Simple job to monitor the floodfill pool. - * If we are class O, and meet some other criteria, + * If we are class N or O, and meet some other criteria, * we will automatically become floodfill if there aren't enough. * But only change ff status every few hours to minimize ff churn. * @@ -26,7 +26,7 @@ class FloodfillMonitorJob extends JobImpl { private static final int REQUEUE_DELAY = 60*60*1000; private static final long MIN_UPTIME = 2*60*60*1000; private static final long MIN_CHANGE_DELAY = 6*60*60*1000; - private static final int MIN_FF = 1000; + private static final int MIN_FF = 5000; private static final int MAX_FF = 999999; private static final String PROP_FLOODFILL_PARTICIPANT = "router.floodfillParticipant"; diff --git a/router/java/src/net/i2p/router/transport/udp/PacketBuilder.java b/router/java/src/net/i2p/router/transport/udp/PacketBuilder.java index c25f72649a..56d24bce4d 100644 --- a/router/java/src/net/i2p/router/transport/udp/PacketBuilder.java +++ b/router/java/src/net/i2p/router/transport/udp/PacketBuilder.java @@ -614,8 +614,14 @@ class PacketBuilder { _context.aes().encrypt(data, sigBegin, data, sigBegin, state.getCipherKey(), iv, encrWrite); // pad up so we're on the encryption boundary - if ( (off % 16) != 0) - off += 16 - (off % 16); + int rem = off & 0x0f; + if (rem != 0) { + // typ. 12 for IPv4 and 0 for IPv6 + int pad = 16 - rem; + //_log.debug("Adding padding: " + pad); + _context.random().nextBytes(data, off, pad); + off += pad; + } packet.getPacket().setLength(off); authenticate(packet, ourIntroKey, ourIntroKey, iv); setTo(packet, to, state.getSentPort());