|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.sshtools.j2ssh.transport.SshMessage | +--com.sshtools.j2ssh.transport.kex.SshMsgKexDhReply
The server responds to a SSH_MSG_KEXDH_INIT with the following:
byte SSH_MSG_KEXDH_REPLY
string server public host key and certificates (K_S)
mpint f
string signature of H
The hash H is computed as the HASH hash of the concatenation of the following:
string V_C, the client's version string (CR and NL excluded)
string V_S, the server's version string (CR and NL excluded)
string I_C, the payload of the client's SSH_MSG_KEXINIT
string I_S, the payload of the server's SSH_MSG_KEXINIT
string K_S, the host key
mpint e, exchange value sent by the client
mpint f, exchange value sent by the server
mpint K, the shared secret
This value is called the exchange hash, and it is used to authenticate the key exchange. The exchange hash SHOULD be kept secret.
The signature algorithm MUST be applied over H, not the original data. Most signature algorithms include hashing and additional padding. For example, "ssh-dss" specifies SHA-1 hashing; in that case, the data is first hashed with HASH to compute H, and H is then hashed with SHA-1 as part of the signing operation.
Field Summary | |
protected static int |
SSH_MSG_KEXDH_REPLY
The message id of the message |
Constructor Summary | |
SshMsgKexDhReply()
Constructs the message from data received. |
|
SshMsgKexDhReply(byte[] hostKey,
java.math.BigInteger f,
byte[] signature)
Constructs the message ready for sending. |
Method Summary | |
protected void |
constructByteArray(ByteArrayWriter baw)
Abstract method implementation to construct a byte array containing the message. |
protected void |
constructMessage(ByteArrayReader bar)
Abstract method implementation to construct the message from a byte array. |
java.math.BigInteger |
getF()
Gets the f attribute of the message |
byte[] |
getHostKey()
Gets the hostKey attribute of the message |
java.lang.String |
getMessageName()
Gets the messageName attribute of the SshMsgKexDhReply object |
byte[] |
getSignature()
Gets the signature attribute of the message |
Methods inherited from class com.sshtools.j2ssh.transport.SshMessage |
fromByteArray, getMessageId, toByteArray |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected static final int SSH_MSG_KEXDH_REPLY
Constructor Detail |
public SshMsgKexDhReply(byte[] hostKey, java.math.BigInteger f, byte[] signature)
hostKey
- The servers host key dataf
- The diffie hellman f valuesignature
- The signature to verify ownership of a private keypublic SshMsgKexDhReply()
Method Detail |
public java.lang.String getMessageName()
getMessageName
in class SshMessage
protected void constructMessage(ByteArrayReader bar) throws InvalidMessageException
constructMessage
in class SshMessage
bar
- The byte array containing the data.
InvalidMessageException
- Thrown if the data cannot be read.protected void constructByteArray(ByteArrayWriter baw) throws InvalidMessageException
constructByteArray
in class SshMessage
baw
- The byte array being written to.
InvalidMessageException
- Thrown if the data cannot be written.public byte[] getHostKey()
public java.math.BigInteger getF()
public byte[] getSignature()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |