SSU: Catch ISE

This commit is contained in:
zzz
2018-06-19 10:31:02 +00:00
parent 5592992b73
commit 03d430ba7c
4 changed files with 26 additions and 3 deletions

View File

@@ -1,4 +1,19 @@
2018-06-19 zzz
* SSU: Set volatile on field (ticket #2260)
2018-06-17 zzz
* NTCP: Log and fail messages on outbound queue overflow
2018-06-16 zzz
* GeoIP: Don't log error when reading to the end
of the geoipv6.dat file
2018-06-15 zzz
* i2ptunnel: Add new irc server
* SusiMail: CSS fixes (ticket #2242)
2018-06-13 zzz
* Console: po-update
* NTCP: Fix clearing of write interest ops on
inbound establishment (ticket #2237)

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

View File

@@ -180,7 +180,11 @@ class InboundEstablishState {
*/
public synchronized void generateSessionKey() throws DHSessionKeyBuilder.InvalidPublicParameterException {
if (_sessionKey != null) return;
_keyBuilder.setPeerPublicValue(_receivedX);
try {
_keyBuilder.setPeerPublicValue(_receivedX);
} catch (IllegalStateException ise) {
throw new DHSessionKeyBuilder.InvalidPublicParameterException("reused keys?", ise);
}
_sessionKey = _keyBuilder.getSessionKey();
ByteArray extra = _keyBuilder.getExtraBytes();
_macKey = new SessionKey(new byte[SessionKey.KEYSIZE_BYTES]);

View File

@@ -383,7 +383,11 @@ class OutboundEstablishState {
if (_sessionKey != null) return;
if (_keyBuilder == null)
throw new DHSessionKeyBuilder.InvalidPublicParameterException("Illegal state - never generated a key builder");
_keyBuilder.setPeerPublicValue(_receivedY);
try {
_keyBuilder.setPeerPublicValue(_receivedY);
} catch (IllegalStateException ise) {
throw new DHSessionKeyBuilder.InvalidPublicParameterException("reused keys?", ise);
}
_sessionKey = _keyBuilder.getSessionKey();
ByteArray extra = _keyBuilder.getExtraBytes();
_macKey = new SessionKey(new byte[SessionKey.KEYSIZE_BYTES]);