Class KexManager
java.lang.Object
com.trilead.ssh2.transport.KexManager
- All Implemented Interfaces:
MessageHandler
KexManager.
- Version:
- $Id: KexManager.java,v 1.1 2007/10/15 12:49:56 cplattne Exp $
-
Field Summary
FieldsModifier and TypeFieldDescription(package private) final Object(package private) boolean(package private) ClientServerHello(package private) final String(package private) boolean(package private) int(package private) KeyMaterial(package private) KexState(package private) ConnectionInfoprivate static final Logger(package private) CryptoWishList(package private) DHGexParameters(package private) final int(package private) final SecureRandom(package private) byte[](package private) final TransportManager(package private) ServerHostKeyVerifier -
Constructor Summary
ConstructorsConstructorDescriptionKexManager(TransportManager tm, ClientServerHello csh, CryptoWishList initialCwl, String hostname, int port, ServerHostKeyVerifier keyVerifier, SecureRandom rnd) -
Method Summary
Modifier and TypeMethodDescriptionstatic voidcheckKexAlgorithmList(String[] algos) static voidcheckServerHostkeyAlgorithmsList(String[] algos) private booleancompareFirstOfNameList(String[] a, String[] b) private booleanprivate voidstatic String[]static String[]private StringgetFirstMatch(String[] client, String[] server) getOrWaitForConnectionInfo(int minKexCount) voidhandleEndMessage(Throwable cause) Called to inform that no more messages will be delivered.voidhandleMessage(byte[] msg, int msglen) Handle message.voidinitiateKEX(CryptoWishList cwl, DHGexParameters dhgex) private booleanisGuessOK(KexParameters cpar, KexParameters spar) private NegotiatedParametersmergeKexParameters(KexParameters client, KexParameters server) private booleanverifySignature(byte[] sig, byte[] hostkey)
-
Field Details
-
log
-
DEFAULT_KEY_ALGORITHMS
-
kxs
KexState kxs -
kexCount
int kexCount -
km
KeyMaterial km -
sessionId
byte[] sessionId -
csh
-
accessLock
-
lastConnInfo
ConnectionInfo lastConnInfo -
connectionClosed
boolean connectionClosed -
ignore_next_kex_packet
boolean ignore_next_kex_packet -
tm
-
nextKEXcryptoWishList
CryptoWishList nextKEXcryptoWishList -
nextKEXdhgexParameters
DHGexParameters nextKEXdhgexParameters -
verifier
ServerHostKeyVerifier verifier -
hostname
-
port
final int port -
rnd
-
-
Constructor Details
-
KexManager
public KexManager(TransportManager tm, ClientServerHello csh, CryptoWishList initialCwl, String hostname, int port, ServerHostKeyVerifier keyVerifier, SecureRandom rnd)
-
-
Method Details
-
getOrWaitForConnectionInfo
- Throws:
IOException
-
getFirstMatch
- Throws:
NegotiateException
-
compareFirstOfNameList
-
isGuessOK
-
mergeKexParameters
-
initiateKEX
- Throws:
IOException
-
establishKeyMaterial
private boolean establishKeyMaterial() -
finishKex
- Throws:
IOException
-
getDefaultServerHostkeyAlgorithmList
-
buildDefaultKeyAlgorithms
-
checkServerHostkeyAlgorithmsList
-
getDefaultKexAlgorithmList
-
checkKexAlgorithmList
-
verifySignature
- Throws:
IOException
-
handleMessage
Description copied from interface:MessageHandlerHandle message.- Specified by:
handleMessagein interfaceMessageHandler- Parameters:
msg- the msgmsglen- the msglen- Throws:
IOException- the io exception
-
handleEndMessage
Description copied from interface:MessageHandlerCalled to inform that no more messages will be delivered.- Specified by:
handleEndMessagein interfaceMessageHandler- Parameters:
cause- For diagnosis, the reason that caused the transport to close down.- Throws:
IOException- the io exception
-