* UDP: Catch address without key sooner

This commit is contained in:
zzz
2011-10-05 22:03:33 +00:00
parent 979825b07f
commit a670100ba3
3 changed files with 21 additions and 2 deletions

View File

@ -1,3 +1,7 @@
2011-10-05 zzz
* Streaming: Fix build
* UDP: Catch address without key sooner
2011-09-30 zzz
* logs.jsp: Add wrapper version
* Shitlist: Shorten time

View File

@ -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 = 24;
public final static long BUILD = 25;
/** for example "-test" */
public final static String EXTRA = "-rc";

View File

@ -182,9 +182,24 @@ class EstablishmentManager {
}
deferred = _queuedOutbound.size();
} else {
// must have a valid session key
byte[] keyBytes = addr.getIntroKey();
if (keyBytes == null) {
_transport.markUnreachable(msg.getTarget().getIdentity().calculateHash());
_transport.failed(msg, "Peer has no key, cannot establish");
return;
}
SessionKey sessionKey;
try {
sessionKey = new SessionKey(keyBytes);
} catch (IllegalArgumentException iae) {
_transport.markUnreachable(msg.getTarget().getIdentity().calculateHash());
_transport.failed(msg, "Peer has bad key, cannot establish");
return;
}
state = new OutboundEstablishState(_context, remAddr, port,
msg.getTarget().getIdentity(),
new SessionKey(addr.getIntroKey()), addr);
sessionKey, addr);
OutboundEstablishState oldState = _outboundStates.putIfAbsent(to, state);
boolean isNew = oldState == null;
if (!isNew)