Changeset b1d6012


Ignore:
Timestamp:
Aug 8, 2014 4:40:48 PM (6 years ago)
Author:
zzz <zzz@…>
Branches:
master
Children:
fe4d98f
Parents:
c9e20c5
Message:

better msg to client on unsupported sigtype

File:
1 edited

Legend:

Unmodified
Added
Removed
  • router/java/src/net/i2p/router/client/ClientMessageEventListener.java

    rc9e20c5 rb1d6012  
    1212
    1313import net.i2p.CoreVersion;
     14import net.i2p.crypto.SigType;
    1415import net.i2p.data.Hash;
    1516import net.i2p.data.Payload;
     
    196197                _log.debug("Signature verified correctly on create session message");
    197198        } else {
    198             if (_log.shouldLog(Log.ERROR))
    199                 _log.error("Signature verification *FAILED* on a create session message.  Hijack attempt?");
    200199            // For now, we do NOT send a SessionStatusMessage - see javadoc above
    201             _runner.disconnectClient("Invalid signature on CreateSessionMessage");
     200            int itype = in.getDestination().getCertificate().getCertificateType();
     201            SigType stype = SigType.getByCode(itype);
     202            if (stype == null || !stype.isAvailable()) {
     203                _log.error("Client requested unsupported signature type " + itype);
     204                _runner.disconnectClient("Unsupported signature type " + itype);
     205            } else {
     206                _log.error("Signature verification failed on a create session message");
     207                _runner.disconnectClient("Invalid signature on CreateSessionMessage");
     208            }
    202209            return;
    203210        }
Note: See TracChangeset for help on using the changeset viewer.