diff --git a/core/java/src/net/i2p/data/i2cp/BlindingInfoMessage.java b/core/java/src/net/i2p/data/i2cp/BlindingInfoMessage.java index 950dc393a0..9c8288377c 100644 --- a/core/java/src/net/i2p/data/i2cp/BlindingInfoMessage.java +++ b/core/java/src/net/i2p/data/i2cp/BlindingInfoMessage.java @@ -167,6 +167,8 @@ public class BlindingInfoMessage extends I2CPMessageImpl { throw new IllegalArgumentException("no key required"); if (authType != BlindData.AUTH_NONE && privKey == null) throw new IllegalArgumentException("key required"); + if (privKey != null && privKey.getType() != EncType.ECIES_X25519) + throw new IllegalArgumentException("Bad privkey type"); _sessionId = id; _authType = authType; _blindType = blindType; @@ -336,9 +338,7 @@ public class BlindingInfoMessage extends I2CPMessageImpl { ByteArrayOutputStream os = new ByteArrayOutputStream(512); try { _sessionId.writeBytes(os); - byte flags = (byte) _authType; - if (_privkey != null) - flags |= FLAG_AUTH; + byte flags = (byte) (_authType & FLAG_AUTH); if (_secret != null) flags |= FLAG_SECRET; os.write(flags); @@ -356,7 +356,6 @@ public class BlindingInfoMessage extends I2CPMessageImpl { os.write(_pubkey.getData()); } if (_privkey != null) { - DataHelper.writeLong(os, 2, _privkey.getType().getCode()); os.write(_privkey.getData()); } if (_secret != null) @@ -377,6 +376,7 @@ public class BlindingInfoMessage extends I2CPMessageImpl { buf.append("[BlindingInfoMessage: "); buf.append("\n\tSession: ").append(_sessionId); buf.append("\n\tTimeout: ").append(_expiration); + buf.append("\n\tAuthTyp: ").append(_authType); if (_endpointType == TYPE_HASH) buf.append("\n\tHash: ").append(_hash.toBase32()); else if (_endpointType == TYPE_HOST) diff --git a/history.txt b/history.txt index 8a28a57839..eef381abec 100644 --- a/history.txt +++ b/history.txt @@ -1,3 +1,22 @@ +2019-09-18 zzz + * I2CP: + - More BlindingInfo serialization fixes + - Shorten lookup timeout on router side + +2019-09-17 zzz + * I2CP: Fix BlindingInfo serialization + * i2ptunnel: + - Remove streamr, connect, and httpbidir from wizard + - B32 auth form improvements + - Improve query parsing in local HTTP server + - New CLI BlindingInfo test + * Router: Implement expiration for BlindData entries + +2019-09-14 zzz + * i2ptunnel: Fix SSL wizard for split config (ticket #2610) + * Reseed: Fix adding netid param (ticket #2621) + * Util: Don't attempt to load hidden cert files (ticket #2622) + 2019-09-12 zzz * I2CP: BlindingInfo fixes * i2ptunnel: New form for blinding info diff --git a/router/java/src/net/i2p/router/RouterVersion.java b/router/java/src/net/i2p/router/RouterVersion.java index fecba78d69..a6204817e3 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 = 7; + public final static long BUILD = 8; /** for example "-test" */ public final static String EXTRA = ""; diff --git a/router/java/src/net/i2p/router/client/LookupDestJob.java b/router/java/src/net/i2p/router/client/LookupDestJob.java index bb0c164951..ed06e7d49e 100644 --- a/router/java/src/net/i2p/router/client/LookupDestJob.java +++ b/router/java/src/net/i2p/router/client/LookupDestJob.java @@ -179,8 +179,12 @@ class LookupDestJob extends JobImpl { } } else if (_hash != null) { DoneJob done = new DoneJob(getContext()); + // shorten timeout so we can respond before the client side times out + long timeout = _timeout; + if (timeout > 1500) + timeout -= 500; // TODO tell router this is an encrypted lookup, skip 38 or earlier ffs? - getContext().netDb().lookupDestination(_hash, done, _timeout, _fromLocalDest); + getContext().netDb().lookupDestination(_hash, done, timeout, _fromLocalDest); } else { // blinding decode fail returnFail(HostReplyMessage.RESULT_DECRYPTION_FAILURE);