2005-07-21 jrandom

* Fix in the SDK for a bug which would manifest itself as misrouted
      streaming packets when a destination has many concurrent streaming
      connections (thanks duck!)
    * No more "Graceful shutdown in -18140121441141s"
This commit is contained in:
jrandom
2005-07-21 22:37:14 +00:00
committed by zzz
parent 3563aa2e4d
commit 45767360ab
9 changed files with 36 additions and 7 deletions

View File

@ -15,9 +15,9 @@ import net.i2p.CoreVersion;
*
*/
public class RouterVersion {
public final static String ID = "$Revision: 1.205 $ $Date: 2005/07/19 16:00:26 $";
public final static String ID = "$Revision: 1.206 $ $Date: 2005/07/20 14:24:47 $";
public final static String VERSION = "0.5.0.7";
public final static long BUILD = 17;
public final static long BUILD = 18;
public static void main(String args[]) {
System.out.println("I2P Router version: " + VERSION);
System.out.println("Router ID: " + RouterVersion.ID);

View File

@ -251,6 +251,7 @@ public class UDPTransport extends TransportImpl implements TimedWeightedPriority
if (explicitAddressSpecified())
return;
boolean updated = false;
synchronized (this) {
if ( (_externalListenHost == null) ||
(!eq(_externalListenHost.getAddress(), _externalListenPort, ourIP, ourPort)) ) {
@ -259,11 +260,15 @@ public class UDPTransport extends TransportImpl implements TimedWeightedPriority
_externalListenPort = ourPort;
rebuildExternalAddress();
replaceAddress(_externalAddress);
updated = true;
} catch (UnknownHostException uhe) {
_externalListenHost = null;
}
}
}
if (updated)
_context.router().rebuildRouterInfo();
}
private static final boolean eq(byte laddr[], int lport, byte raddr[], int rport) {

View File

@ -24,6 +24,12 @@ public class HopProcessor {
/** helpful flag for debugging */
static final boolean USE_ENCRYPTION = true;
/**
* as of i2p 0.6, the tunnel crypto will change by encrypting the IV both before
* and after using it at each hop so as to prevent a certain type of replay/confirmation
* attack.
*/
static final boolean USE_DOUBLE_IV_ENCRYPTION = false;
static final int IV_LENGTH = 16;
private static final ByteCache _cache = ByteCache.getInstance(128, IV_LENGTH);
@ -78,6 +84,8 @@ public class HopProcessor {
//_log.debug("Before:" + Base64.encode(orig, IV_LENGTH, orig.length - IV_LENGTH));
}
if (USE_ENCRYPTION) {
if (USE_DOUBLE_IV_ENCRYPTION)
updateIV(orig, offset);
encrypt(orig, offset, length);
updateIV(orig, offset);
}

View File

@ -95,5 +95,8 @@ public class OutboundGatewayProcessor {
prev = cur;
cur = xf;
}
if (HopProcessor.USE_DOUBLE_IV_ENCRYPTION)
ctx.aes().decryptBlock(orig, offset, config.getIVKey(), orig, offset);
}
}