Package com.trilead.ssh2.transport
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) ConnectionInfo
private 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 void
checkKexAlgorithmList
(String[] algos) static void
checkServerHostkeyAlgorithmsList
(String[] algos) private boolean
compareFirstOfNameList
(String[] a, String[] b) private boolean
private void
static String[]
static String[]
private String
getFirstMatch
(String[] client, String[] server) getOrWaitForConnectionInfo
(int minKexCount) void
handleEndMessage
(Throwable cause) Called to inform that no more messages will be delivered.void
handleMessage
(byte[] msg, int msglen) Handle message.void
initiateKEX
(CryptoWishList cwl, DHGexParameters dhgex) private boolean
isGuessOK
(KexParameters cpar, KexParameters spar) private NegotiatedParameters
mergeKexParameters
(KexParameters client, KexParameters server) private boolean
verifySignature
(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:MessageHandler
Handle message.- Specified by:
handleMessage
in interfaceMessageHandler
- Parameters:
msg
- the msgmsglen
- the msglen- Throws:
IOException
- the io exception
-
handleEndMessage
Description copied from interface:MessageHandler
Called to inform that no more messages will be delivered.- Specified by:
handleEndMessage
in interfaceMessageHandler
- Parameters:
cause
- For diagnosis, the reason that caused the transport to close down.- Throws:
IOException
- the io exception
-