ssh_kex_rsa.c
error_t sshGenerateExchangeHashSignature(SshConnection *connection, uint8_t *p, size_t *written)
Compute the signature on the exchange hash.
Definition: ssh_exchange_hash.c:271
error_t rsaesOaepDecrypt(const RsaPrivateKey *key, const HashAlgo *hash, const char_t *label, const uint8_t *ciphertext, size_t ciphertextLen, uint8_t *message, size_t messageSize, size_t *messageLen)
RSAES-OAEP decryption operation.
Definition: rsa.c:544
error_t rsaesOaepEncrypt(const PrngAlgo *prngAlgo, void *prngContext, const RsaPublicKey *key, const HashAlgo *hash, const char_t *label, const uint8_t *message, size_t messageLen, uint8_t *ciphertext, size_t *ciphertextLen)
RSAES-OAEP encryption operation.
Definition: rsa.c:438
SSH host key verification.
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 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
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 pemImportRsaPrivateKey(const char_t *input, size_t length, const char_t *password, RsaPrivateKey *privateKey)
Decode a PEM file containing an RSA private key.
Definition: pem_import.c:389
error_t sshParseRsaHostKey(const uint8_t *data, size_t length, SshRsaHostKey *hostKey)
Parse an RSA host key structure.
Definition: ssh_key_parse.c:141
error_t sshImportRsaPublicKey(const char_t *input, size_t length, RsaPublicKey *publicKey)
Decode an SSH public key file containing an RSA public key.
Definition: ssh_key_import.c:86
SSH key file import functions.
error_t sshParseKexRsaDone(SshConnection *connection, const uint8_t *message, size_t length)
Parse SSH_MSG_KEXRSA_DONE message.
Definition: ssh_kex_rsa.c:596
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 sshFormatRsaPublicKey(const RsaPublicKey *publicKey, uint8_t *p, size_t *written)
Format an RSA public host key.
Definition: ssh_key_format.c:53
error_t sshSendNewKeys(SshConnection *connection)
Send SSH_MSG_NEWKEYS message.
Definition: ssh_kex.c:194
Key material generation.
RSA key exchange.
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.
error_t sshFormatTransientRsaPublicKey(SshConnection *connection, uint8_t *p, size_t *written)
Format transient RSA public key.
Definition: ssh_kex_rsa.c:803
bool_t sshCompareAlgo(const char_t *name1, const char_t *name2)
Compare algorithm names.
Definition: ssh_misc.c:1653
error_t sshParseKexRsaSecret(SshConnection *connection, const uint8_t *message, size_t length)
Parse SSH_MSG_KEXRSA_SECRET message.
Definition: ssh_kex_rsa.c:510
error_t sshVerifyServerCertificate(SshConnection *connection, const SshString *publicKeyAlgo, const SshBinaryString *hostKey)
Verify server's certificate.
Definition: ssh_cert_verify.c:158
error_t sshParseKexRsaMessage(SshConnection *connection, uint8_t type, const uint8_t *message, size_t length)
Parse Diffie-Hellman specific messages.
Definition: ssh_kex_rsa.c:680
error_t sshFormatKexRsaDone(SshConnection *connection, uint8_t *p, size_t *length)
Format SSH_MSG_KEXRSA_DONE message.
Definition: ssh_kex_rsa.c:336
error_t sshEncryptSharedSecret(SshConnection *connection, const SshBinaryString *transientRsaPublicKey, uint8_t *encryptedSecret, size_t *encryptedSecretLen)
Encrypt shared secret using RSAES-OAEP.
Definition: ssh_kex_rsa.c:866
error_t sshSendDisconnect(SshConnection *connection, uint32_t reasonCode, const char_t *description)
Send SSH_MSG_DISCONNECT message.
Definition: ssh_transport.c:209
error_t sshParseKexRsaPubKey(SshConnection *connection, const uint8_t *message, size_t length)
Parse SSH_MSG_KEXRSA_PUBKEY message.
Definition: ssh_kex_rsa.c:390
SSH key formatting.
error_t sshDecryptSharedSecret(SshConnection *connection, const uint8_t *encryptedSecret, size_t encryptedSecretLen)
Decrypt shared secret using RSAES-OAEP.
Definition: ssh_kex_rsa.c:971
SSH key exchange.
error_t sshSendKexRsaDone(SshConnection *connection)
Send SSH_MSG_KEXRSA_DONE message.
Definition: ssh_kex_rsa.c:169
Exchange hash calculation.
error_t sshFormatKexRsaSecret(SshConnection *connection, const SshBinaryString *transientRsaPublicKey, uint8_t *p, size_t *length)
Format SSH_MSG_KEXRSA_SECRET message.
Definition: ssh_kex_rsa.c:283
SSH helper functions.
error_t sshFormatHostKey(SshConnection *connection, uint8_t *p, size_t *written)
Format host key structure.
Definition: ssh_misc.c:863
error_t sshFormatKexRsaPubKey(SshConnection *connection, uint8_t *p, size_t *length)
Format SSH_MSG_KEXRSA_PUBKEY message.
Definition: ssh_kex_rsa.c:217
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
int_t sshSelectTransientRsaKey(SshContext *context, const char_t *kexAlgo)
Select a transient RSA key.
Definition: ssh_kex_rsa.c:744
error_t sshImportRsaHostKey(const SshRsaHostKey *hostKey, RsaPublicKey *publicKey)
Import an RSA host key.
Definition: ssh_key_import.c:1146
Secure Shell (SSH)
SSH algorithm negotiation.
Debugging facilities.
error_t sshSendKexRsaSecret(SshConnection *connection, const SshBinaryString *transientRsaPublicKey)
Send SSH_MSG_KEXRSA_SECRET message.
Definition: ssh_kex_rsa.c:121
error_t sshSendKexRsaPubKey(SshConnection *connection)
Send SSH_MSG_KEXRSA_PUBKEY message.
Definition: ssh_kex_rsa.c:61