public class ServerSessionImpl extends AbstractServerSession
AbstractCloseable.State
Session.AttributeKey<T>, Session.TimeoutStatus
SignatureFactoriesManager.Utils
ServerAuthenticationManager.Utils
attributes, authed, authTimeoutStart, channelListenerProxy, channelListeners, clientProposal, clientVersion, currentService, decodeLock, decoderBuffer, decoderLength, decoderState, encodeLock, firstKexPacketFollows, i_c, i_s, idleTimeoutStart, ignorePacketDataLength, ignorePacketsCount, ignorePacketsFrequency, ignorePacketsVariance, inBlocksCount, inBytesCount, inCipher, inCipherSize, inCompression, inMac, inMacResult, inPacketsCount, ioSession, isServer, kex, kexFutureHolder, kexState, lastKeyTimeValue, maxRekeyBlocks, maxRekeyBytes, maxRekeyInterval, maxRekyPackets, negotiationResult, outBlocksCount, outBytesCount, outCipher, outCipherSize, outCompression, outMac, outPacketsCount, pendingPackets, random, requestLock, seqi, seqo, serverProposal, serverVersion, SESSION, sessionId, sessionListenerProxy, sessionListeners, timeoutStatus, uncompressBuffer, username
closeFuture, lock, state
log
DEFAULT_SSH_VERSION_PREFIX
DEFAULT_MAX_AUTH_REQUESTS, MAX_AUTH_REQUESTS
Constructor and Description |
---|
ServerSessionImpl(ServerFactoryManager server,
IoSession ioSession) |
Modifier and Type | Method and Description |
---|---|
int |
getActiveSessionCountForUser(String userName)
Retrieve the current number of sessions active for a given username.
|
KeyPair |
getHostKey() |
long |
getId()
Returns the session id.
|
protected boolean |
readIdentification(Buffer buffer)
Read the other side identification.
|
protected void |
receiveKexInit(Map<KexProposalOption,String> proposal,
byte[] seed) |
protected String |
resolveAvailableSignaturesProposal(FactoryManager proposedManager) |
protected String |
resolveEmptySignaturesProposal(Iterable<String> supported,
Iterable<String> provided)
Called by
resolveAvailableSignaturesProposal(FactoryManager)
if none of the provided keys is supported - last chance for the derived
implementation to do something |
protected byte[] |
sendKexInit(Map<KexProposalOption,String> proposal)
Send the key exchange initialization packet.
|
protected void |
sendServerIdentification() |
protected void |
serviceAccept() |
protected void |
setKexSeed(byte... seed) |
void |
startService(String name) |
checkKeys, getFactoryManager, getGSSAuthenticator, getHostBasedAuthenticator, getKeyboardInteractiveAuthenticator, getPasswordAuthenticator, getPublickeyAuthenticator, getUserAuthFactories, setGSSAuthenticator, setHostBasedAuthenticator, setKeyboardInteractiveAuthenticator, setPasswordAuthenticator, setPublickeyAuthenticator, setUserAuthFactories
addChannelListener, addSessionListener, attachSession, calculateNextIgnorePacketCount, checkAuthenticationTimeout, checkForTimeouts, checkIdleTimeout, checkRekey, comparePreferredKexProposalOption, createBuffer, createBuffer, createProposal, decode, disconnect, doHandleMessage, doReadIdentification, doWritePacket, encode, exceptionCaught, getAttribute, getAuthTimeout, getChannelListenerProxy, getCipherInformation, getClientVersion, getCompressionInformation, getIdleTimeout, getInnerCloseable, getIoSession, getKex, getLock, getMacInformation, getNegotiatedKexParameter, getParentPropertyResolver, getProperties, getServerVersion, getService, getServices, getSession, getSession, getSessionId, getSessionListenerProxy, getTimeoutStatus, getUsername, handleDebug, handleDebug, handleDisconnect, handleDisconnect, handleFirstKexPacketFollows, handleIgnore, handleIgnore, handleKexInit, handleKexMessage, handleMessage, handleNewKeys, handleServiceAccept, handleServiceAccept, handleServiceRequest, handleServiceRequest, handleUnimplemented, handleUnimplemented, isAuthenticated, isRekeyBlocksCountExceeded, isRekeyDataSizeExceeded, isRekeyPacketCountsExceeded, isRekeyRequired, isRekeyTimeIntervalExceeded, mergeProposals, messageReceived, negotiate, notImplemented, preClose, prepareBuffer, receiveKexInit, receiveKexInit, receiveNewKeys, reExchangeKeys, refreshConfiguration, removeChannelListener, removeSessionListener, request, requestFailure, requestNewKeysExchange, requestSuccess, resetIdleTimeout, resizeKey, resolveAvailableSignaturesProposal, resolveIgnoreBufferDataLength, sendIdentification, sendKexInit, sendNewKeys, sendSessionEvent, setAttribute, setAuthenticated, setNegotiationResult, setUsername, toString, validateKexState, writePacket, writePacket
getCipherFactories, getCompressionFactories, getKeyExchangeFactories, getKeyPairProvider, getMacFactories, getSignatureFactories, resolveEffectiveFactories, resolveEffectiveProvider, setCipherFactories, setCompressionFactories, setKeyExchangeFactories, setKeyPairProvider, setMacFactories, setSignatureFactories
doCloseGracefully, doCloseImmediately
builder, close, isClosed, isClosing
close, isOpen
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
createBuffer, createBuffer, disconnect, exceptionCaught, getAttribute, getAuthTimeout, getCipherInformation, getClientVersion, getCompressionInformation, getIdleTimeout, getIoSession, getKex, getMacInformation, getNegotiatedKexParameter, getServerVersion, getService, getSessionId, getTimeoutStatus, isAuthenticated, prepareBuffer, reExchangeKeys, request, resetIdleTimeout, setAttribute, setAuthenticated, writePacket, writePacket
getCipherFactories, getCompressionFactories, getKeyExchangeFactories, getMacFactories, setCipherFactories, setCompressionFactories, setKeyExchangeFactories, setMacFactories
getKeyPairProvider, setKeyPairProvider
getSignatureFactories, setSignatureFactories
addSessionListener, getSessionListenerProxy, removeSessionListener
addChannelListener, getChannelListenerProxy, removeChannelListener
getParentPropertyResolver, getProperties
setUsername
getUsername
public ServerSessionImpl(ServerFactoryManager server, IoSession ioSession) throws Exception
Exception
public void startService(String name) throws Exception
name
- Service nameException
- If failed to start itprotected void serviceAccept() throws IOException
serviceAccept
in class AbstractSession
IOException
protected void sendServerIdentification()
protected byte[] sendKexInit(Map<KexProposalOption,String> proposal) throws IOException
AbstractSession
sendKexInit
in class AbstractSession
proposal
- our proposal for key exchange negotiationIOException
- if an error occurred sending the packetprotected void setKexSeed(byte... seed)
setKexSeed
in class AbstractSession
seed
- The result of the KEXINIT handshake - required for correct
session key establishmentprotected String resolveAvailableSignaturesProposal(FactoryManager proposedManager)
resolveAvailableSignaturesProposal
in class AbstractSession
proposedManager
- The FactoryManager
null
/empty if no proposalprotected String resolveEmptySignaturesProposal(Iterable<String> supported, Iterable<String> provided)
resolveAvailableSignaturesProposal(FactoryManager)
if none of the provided keys is supported - last chance for the derived
implementation to do somethingsupported
- The supported key types - may be null
/emptyprovided
- The available signature types - may be null
/emptynull
by defaultprotected boolean readIdentification(Buffer buffer) throws IOException
AbstractSession
AbstractSession.doReadIdentification(Buffer, boolean)
and
store the result in the needed property.readIdentification
in class AbstractSession
buffer
- the buffer containing the remote identificationtrue
if the identification has been fully read or
false
if more data is neededIOException
- if an error occurs such as a bad protocol versionprotected void receiveKexInit(Map<KexProposalOption,String> proposal, byte[] seed) throws IOException
receiveKexInit
in class AbstractSession
IOException
public KeyPair getHostKey()
KeyPair
representing the current session's used keys
on KEXpublic int getActiveSessionCountForUser(String userName)
ServerSession
userName
- The name of the user - ignored if null
/emptySshSession
objects associated with the userpublic long getId()
Copyright © 2008–2016 The Apache Software Foundation. All rights reserved.