forked from I2P_Developers/i2p.i2p
SSU2: Fixes
Fix conn ids on hole punch Fix min size on relay response
This commit is contained in:
@@ -992,8 +992,8 @@ class IntroductionManager {
|
||||
// send hole punch with the same data we sent to Bob
|
||||
if (_log.shouldDebug())
|
||||
_log.debug("Send hole punch to " + Addresses.toString(testIP, testPort));
|
||||
long rcvId = (nonce << 32) | nonce;
|
||||
long sendId = ~rcvId;
|
||||
long sendId = (nonce << 32) | nonce;
|
||||
long rcvId = ~sendId;
|
||||
packet = _builder2.buildHolePunch(aliceIP, testPort, aliceIntroKey, sendId, rcvId, data);
|
||||
_transport.send(packet);
|
||||
}
|
||||
|
||||
@@ -286,7 +286,7 @@ class SSU2Payload {
|
||||
case BLOCK_RELAYRESP: {
|
||||
if (isHandshake)
|
||||
throw new IOException("Illegal block in handshake: " + type);
|
||||
if (len < 62) // 22 byte data w/ IPv4 + 40 byte DSA sig
|
||||
if (len < 52) // 12 byte data w/o IP or token + 40 byte DSA sig
|
||||
throw new IOException("Bad length for RELAYRESP: " + len);
|
||||
int resp = payload[i + 1] & 0xff; // skip flag
|
||||
byte[] data = new byte[len - 2];
|
||||
|
||||
Reference in New Issue
Block a user