SSU2: Immediately fail session request containing zero token

i2pd will send this after retry with zero token and termination
This commit is contained in:
zzz
2022-08-25 10:56:34 -04:00
parent 2f06e9bebf
commit f4875d12fa

View File

@@ -121,6 +121,8 @@ class InboundEstablishState2 extends InboundEstablishState implements SSU2Payloa
(ENFORCE_TOKEN && !_transport.getEstablisher().isInboundTokenValid(_remoteHostId, token)))) {
if (_log.shouldInfo())
_log.info("Invalid token " + token + " in session request from: " + _aliceSocketAddress);
if (token == 0)
throw new GeneralSecurityException("Zero token in session request from: " + _aliceSocketAddress);
_currentState = InboundState.IB_STATE_REQUEST_BAD_TOKEN_RECEIVED;
_sendHeaderEncryptKey2 = introKey;
// Generate token for the retry.