ssh_kex_dh_gex.c
Go to the documentation of this file.
625 TRACE_INFO("SSH_MSG_KEX_DH_GEX_REQUEST_OLD message received (%" PRIuSIZE " bytes)...\r\n", length);
error_t sshGenerateExchangeHashSignature(SshConnection *connection, uint8_t *p, size_t *written)
Compute the signature on the exchange hash.
Definition: ssh_exchange_hash.c:271
SSH host key verification.
error_t sshDigestDhGexParams(SshConnection *connection)
Update exchange hash with min, n, max, p, g and e.
Definition: ssh_kex_dh_gex.c:1214
void sshDumpKey(SshConnection *connection, const char_t *label, const uint8_t *key, size_t keyLen)
Dump secret key (for debugging purpose only)
Definition: ssh_key_material.c:1128
error_t dhCheckPublicKey(DhParameters *params, const Mpi *publicKey)
Check Diffie-Hellman public value.
Definition: dh.c:183
error_t sshFormatKexDhGexInit(SshConnection *connection, uint8_t *p, size_t *length)
Format SSH_MSG_KEX_DH_GEX_INIT message.
Definition: ssh_kex_dh_gex.c:400
error_t sshParseKexDhGexGroup(SshConnection *connection, const uint8_t *message, size_t length)
Parse SSH_MSG_KEX_DH_GEX_GROUP message.
Definition: ssh_kex_dh_gex.c:690
error_t sshVerifyServerHostKey(SshConnection *connection, const SshString *publicKeyAlgo, const SshBinaryString *hostKey)
Verify server's host key.
Definition: ssh_key_verify.c:172
error_t sshVerifyExchangeHashSignature(SshConnection *connection, const SshBinaryString *serverHostKey, const SshBinaryString *signature)
Verify the signature on the exchange hash.
Definition: ssh_exchange_hash.c:330
error_t sshParseKexDhGexRequest(SshConnection *connection, const uint8_t *message, size_t length)
Parse SSH_MSG_KEX_DH_GEX_REQUEST message.
Definition: ssh_kex_dh_gex.c:537
SSH transport layer protocol.
error_t sshUpdateExchangeHashRaw(SshConnection *connection, const void *data, size_t length)
Update exchange hash calculation (raw data)
Definition: ssh_exchange_hash.c:203
SSH certificate verification.
error_t sshParseKexDhGexInit(SshConnection *connection, const uint8_t *message, size_t length)
Parse SSH_MSG_KEX_DH_GEX_INIT message.
Definition: ssh_kex_dh_gex.c:783
error_t sshFormatKexDhGexRequest(SshConnection *connection, uint8_t *p, size_t *length)
Format SSH_MSG_KEX_DH_GEX_REQUEST message.
Definition: ssh_kex_dh_gex.c:294
int_t sshSelectDhGexGroup(SshContext *context, uint32_t minDhModulusSize, uint32_t preferredDhModulusSize, uint32_t maxDhModulusSize)
Select a Diffie-Hellman group that best matches client's request.
Definition: ssh_kex_dh_gex.c:1103
error_t mpiImport(Mpi *r, const uint8_t *data, uint_t length, MpiFormat format)
Octet string to integer conversion.
Definition: mpi.c:624
error_t sshSendPacket(SshConnection *connection, uint8_t *payload, size_t payloadLen)
Send SSH packet.
Definition: ssh_packet.c:57
bool_t sshIsCertPublicKeyAlgo(const SshString *publicKeyAlgo)
Test if the specified public key algorithm is using certificates.
Definition: ssh_algorithms.c:1556
error_t sshSendNewKeys(SshConnection *connection)
Send SSH_MSG_NEWKEYS message.
Definition: ssh_kex.c:194
Key material generation.
error_t dhComputeSharedSecret(DhContext *context, uint8_t *output, size_t outputSize, size_t *outputLen)
Compute Diffie-Hellman shared secret.
Definition: dh.c:223
error_t sshConvertArrayToMpint(const uint8_t *value, size_t length, uint8_t *p, size_t *written)
Convert a binary string to mpint representation.
Definition: ssh_misc.c:1531
PEM file import functions.
DH GEX (Diffie-Hellman Group Exchange) key exchange.
error_t sshParseKexDhGexMessage(SshConnection *connection, uint8_t type, const uint8_t *message, size_t length)
Parse Diffie-Hellman Group Exchange specific messages.
Definition: ssh_kex_dh_gex.c:1027
error_t sshFormatKexDhGexGroup(SshConnection *connection, uint8_t *p, size_t *length)
Format SSH_MSG_KEX_DH_GEX_GROUP message.
Definition: ssh_kex_dh_gex.c:335
error_t sshVerifyServerCertificate(SshConnection *connection, const SshString *publicKeyAlgo, const SshBinaryString *hostKey)
Verify server's certificate.
Definition: ssh_cert_verify.c:158
error_t sshParseKexDhGexReply(SshConnection *connection, const uint8_t *message, size_t length)
Parse SSH_MSG_KEX_DH_GEX_REPLY message.
Definition: ssh_kex_dh_gex.c:864
error_t sshFormatKexDhGexReply(SshConnection *connection, uint8_t *p, size_t *length)
Format SSH_MSG_KEX_DH_GEX_REPLY message.
Definition: ssh_kex_dh_gex.c:443
error_t sshComputeDhGexSharedSecret(SshConnection *connection)
Diffie-Hellman shared secret calculation.
Definition: ssh_kex_dh_gex.c:1184
SSH key exchange.
error_t sshSendKexDhGexReply(SshConnection *connection)
Send SSH_MSG_KEX_DH_GEX_REPLY message.
Definition: ssh_kex_dh_gex.c:234
error_t sshFormatMpint(const Mpi *value, uint8_t *p, size_t *written)
Format a multiple precision integer.
Definition: ssh_misc.c:1487
error_t sshSendKexDhGexRequest(SshConnection *connection)
Send SSH_MSG_KEX_DH_GEX_REQUEST message.
Definition: ssh_kex_dh_gex.c:59
Exchange hash calculation.
error_t sshSendKexDhGexInit(SshConnection *connection)
Send SSH_MSG_KEX_DH_GEX_INIT message.
Definition: ssh_kex_dh_gex.c:176
error_t sshSendKexDhGexGroup(SshConnection *connection)
Send SSH_MSG_KEX_DH_GEX_GROUP message.
Definition: ssh_kex_dh_gex.c:105
SSH helper functions.
error_t sshFormatHostKey(SshConnection *connection, uint8_t *p, size_t *written)
Format host key structure.
Definition: ssh_misc.c:863
SSH packet encryption/decryption.
error_t sshUpdateExchangeHash(SshConnection *connection, const void *data, size_t length)
Update exchange hash calculation.
Definition: ssh_exchange_hash.c:164
error_t sshParseBinaryString(const uint8_t *p, size_t length, SshBinaryString *string)
Parse a binary string.
Definition: ssh_misc.c:1189
error_t dhGenerateKeyPair(DhContext *context, const PrngAlgo *prngAlgo, void *prngContext)
Diffie-Hellman key pair generation.
Definition: dh.c:119
Secure Shell (SSH)
SSH algorithm negotiation.
error_t pemImportDhParameters(const char_t *input, size_t length, DhParameters *params)
Decode a PEM file containing Diffie-Hellman parameters.
Definition: pem_import.c:149
error_t sshParseKexDhGexRequestOld(SshConnection *connection, const uint8_t *message, size_t length)
Parse SSH_MSG_KEX_DH_GEX_REQUEST_OLD message.
Definition: ssh_kex_dh_gex.c:616
Debugging facilities.