Secure Shell (SSH) More...
#include "ssh_config.h"
#include "ssh_legacy.h"
#include "ssh_types.h"
#include "ssh_cert_parse.h"
#include "core/net.h"
#include "core/crypto.h"
#include "cipher/cipher_algorithms.h"
#include "cipher_modes/cipher_modes.h"
#include "hash/hash_algorithms.h"
#include "mac/mac_algorithms.h"
#include "aead/aead_algorithms.h"
#include "pkc/key_exch_algorithms.h"
#include "ecc/ec.h"
Go to the source code of this file.
Data Structures | |
struct SshRsaKey | |
Transient RSA key (for RSA key exchange) More... | |
struct SshDhGexGroup | |
Diffie-Hellman group. More... | |
struct SshHostKey | |
Host key. More... | |
struct SshHostKeyAlgo | |
Host key algorithm. More... | |
struct SshEncryptionEngine | |
Encryption engine. More... | |
struct SshChannelBuffer | |
SSH channel buffer. More... | |
struct _SshChannel | |
SSH channel. More... | |
struct _SshConnection | |
SSH connection. More... | |
struct _SshContext | |
SSH context. More... | |
struct SshChannelEventDesc | |
Structure describing channel events. More... | |
Typedefs | |
typedef error_t(* SshHostKeyVerifyCallback) (SshConnection *connection, const uint8_t *hostKey, size_t hostKeyLen) | |
Host key verification callback function. More... | |
typedef error_t(* SshCertVerifyCallback) (SshConnection *connection, const SshCertificate *cert) | |
Certificate verification callback function. More... | |
typedef error_t(* SshCaPublicKeyVerifyCallback) (SshConnection *connection, const uint8_t *publicKey, size_t publicKeyLen) | |
CA public key verification callback function. More... | |
typedef error_t(* SshPublicKeyAuthCallback) (SshConnection *connection, const char_t *user, const uint8_t *publicKey, size_t publicKeyLen) | |
Public key authentication callback function. More... | |
typedef error_t(* SshCertAuthCallback) (SshConnection *connection, const char_t *user, const SshCertificate *cert) | |
Certificate authentication callback function. More... | |
typedef SshAuthStatus(* SshPasswordAuthCallback) (SshConnection *connection, const char_t *user, const char_t *password, size_t passwordLen) | |
Password authentication callback function. More... | |
typedef SshAuthStatus(* SshPasswordChangeCallback) (SshConnection *connection, const char_t *user, const char_t *oldPassword, size_t oldPasswordLen, const char_t *newPassword, size_t newPasswordLen) | |
Password change callback function. More... | |
typedef error_t(* SshSignGenCallback) (SshConnection *connection, const char_t *publicKeyAlgo, const SshHostKey *hostKey, const SshBinaryString *sessionId, const SshBinaryString *message, uint8_t *p, size_t *written) | |
Signature generation callback function. More... | |
typedef error_t(* SshSignVerifyCallback) (SshConnection *connection, const SshString *publicKeyAlgo, const SshBinaryString *publicKeyBlob, const SshBinaryString *sessionId, const SshBinaryString *message, const SshBinaryString *signatureBlob) | |
Signature verification callback function. More... | |
typedef error_t(* SshEcdhKeyPairGenCallback) (SshConnection *connection, const char_t *kexAlgo, EcPublicKey *publicKey) | |
ECDH key pair generation callback. More... | |
typedef error_t(* SshEcdhSharedSecretCalcCallback) (SshConnection *connection, const char_t *kexAlgo, const EcPublicKey *publicKey, uint8_t *output, size_t *outputLen) | |
ECDH shared secret calculation callback. More... | |
typedef error_t(* SshGlobalReqCallback) (SshConnection *connection, const SshString *name, const uint8_t *data, size_t length, void *param) | |
Global request callback function. More... | |
typedef error_t(* SshChannelReqCallback) (SshChannel *channel, const SshString *type, const uint8_t *data, size_t length, void *param) | |
Channel request callback function. More... | |
typedef error_t(* SshChannelOpenCallback) (SshConnection *connection, const SshString *type, uint32_t senderChannel, uint32_t initialWindowSize, uint32_t maxPacketSize, const uint8_t *data, size_t length, void *param) | |
Channel open callback function. More... | |
typedef error_t(* SshConnectionOpenCallback) (SshConnection *connection, void *param) | |
Connection open callback function. More... | |
typedef void(* SshConnectionCloseCallback) (SshConnection *connection, void *param) | |
Connection close callback function. More... | |
typedef void(* SshKeyLogCallback) (SshConnection *connection, const char_t *key) | |
Key logging callback function (for debugging purpose only) More... | |
Functions | |
error_t sshInit (SshContext *context, SshConnection *connections, uint_t numConnections, SshChannel *channels, uint_t numChannels) | |
SSH context initialization. More... | |
error_t sshSetOperationMode (SshContext *context, SshOperationMode mode) | |
Set operation mode (client or server) More... | |
error_t sshSetPrng (SshContext *context, const PrngAlgo *prngAlgo, void *prngContext) | |
Set the pseudo-random number generator to be used. More... | |
error_t sshSetUsername (SshContext *context, const char_t *username) | |
Set the user name to be used for authentication. More... | |
error_t sshSetPassword (SshContext *context, const char_t *password) | |
Set the password to be used for authentication. More... | |
error_t sshRegisterHostKeyVerifyCallback (SshContext *context, SshHostKeyVerifyCallback callback) | |
Register host key verification callback function. More... | |
error_t sshRegisterCertVerifyCallback (SshContext *context, SshCertVerifyCallback callback) | |
Register certificate verification callback function. More... | |
error_t sshRegisterCaPublicKeyVerifyCallback (SshContext *context, SshCaPublicKeyVerifyCallback callback) | |
Register CA public key verification callback function. More... | |
error_t sshRegisterPublicKeyAuthCallback (SshContext *context, SshPublicKeyAuthCallback callback) | |
Register public key authentication callback function. More... | |
error_t sshRegisterCertAuthCallback (SshContext *context, SshCertAuthCallback callback) | |
Register certificate authentication callback function. More... | |
error_t sshRegisterPasswordAuthCallback (SshContext *context, SshPasswordAuthCallback callback) | |
Register password authentication callback function. More... | |
error_t sshRegisterPasswordChangeCallback (SshContext *context, SshPasswordChangeCallback callback) | |
Register password change callback function. More... | |
error_t sshRegisterSignGenCallback (SshContext *context, SshSignGenCallback callback) | |
Register signature generation callback function. More... | |
error_t sshRegisterSignVerifyCallback (SshContext *context, SshSignVerifyCallback callback) | |
Register signature verification callback function. More... | |
error_t sshRegisterEcdhKeyPairGenCallback (SshContext *context, SshEcdhKeyPairGenCallback callback) | |
Register ECDH key pair generation callback function. More... | |
error_t sshRegisterEcdhSharedSecretCalcCallback (SshContext *context, SshEcdhSharedSecretCalcCallback callback) | |
Register ECDH shared secret calculation callback function. More... | |
error_t sshRegisterGlobalRequestCallback (SshContext *context, SshGlobalReqCallback callback, void *param) | |
Register global request callback function. More... | |
error_t sshUnregisterGlobalRequestCallback (SshContext *context, SshGlobalReqCallback callback) | |
Unregister global request callback function. More... | |
error_t sshRegisterChannelRequestCallback (SshContext *context, SshChannelReqCallback callback, void *param) | |
Register channel request callback function. More... | |
error_t sshUnregisterChannelRequestCallback (SshContext *context, SshChannelReqCallback callback) | |
Unregister channel request callback function. More... | |
error_t sshRegisterChannelOpenCallback (SshContext *context, SshChannelOpenCallback callback, void *param) | |
Register channel open callback function. More... | |
error_t sshUnregisterChannelOpenCallback (SshContext *context, SshChannelOpenCallback callback) | |
Unregister channel open callback function. More... | |
error_t sshRegisterConnectionOpenCallback (SshContext *context, SshConnectionOpenCallback callback, void *param) | |
Register connection open callback function. More... | |
error_t sshUnregisterConnectionOpenCallback (SshContext *context, SshConnectionOpenCallback callback) | |
Unregister connection open callback function. More... | |
error_t sshRegisterConnectionCloseCallback (SshContext *context, SshConnectionCloseCallback callback, void *param) | |
Register connection close callback function. More... | |
error_t sshUnregisterConnectionCloseCallback (SshContext *context, SshConnectionCloseCallback callback) | |
Unregister connection close callback function. More... | |
error_t sshRegisterKeyLogCallback (SshContext *context, SshKeyLogCallback callback) | |
Register key logging callback function (for debugging purpose only) More... | |
error_t sshLoadRsaKey (SshContext *context, uint_t index, const char_t *publicKey, size_t publicKeyLen, const char_t *privateKey, size_t privateKeyLen, const char_t *password) | |
Load transient RSA key (for RSA key exchange) More... | |
error_t sshUnloadRsaKey (SshContext *context, uint_t index) | |
Unload transient RSA key (for RSA key exchange) More... | |
error_t sshLoadDhGexGroup (SshContext *context, uint_t index, const char_t *dhParams, size_t dhParamsLen) | |
Load Diffie-Hellman group. More... | |
error_t sshUnloadDhGexGroup (SshContext *context, uint_t index) | |
Unload Diffie-Hellman group. More... | |
error_t sshLoadHostKey (SshContext *context, uint_t index, const char_t *publicKey, size_t publicKeyLen, const char_t *privateKey, size_t privateKeyLen, const char_t *password) | |
Load entity's host key. More... | |
error_t sshUnloadHostKey (SshContext *context, uint_t index) | |
Unload entity's host key. More... | |
error_t sshLoadCertificate (SshContext *context, uint_t index, const char_t *cert, size_t certLen, const char_t *privateKey, size_t privateKeyLen, const char_t *password) | |
Load entity's certificate. More... | |
error_t sshUnloadCertificate (SshContext *context, uint_t index) | |
Unload entity's certificate. More... | |
error_t sshSetPasswordChangePrompt (SshConnection *connection, const char_t *prompt) | |
Set password change prompt message. More... | |
SshChannel * sshCreateChannel (SshConnection *connection) | |
Create a new SSH channel. More... | |
error_t sshSetChannelTimeout (SshChannel *channel, systime_t timeout) | |
Set timeout for read/write operations. More... | |
error_t sshWriteChannel (SshChannel *channel, const void *data, size_t length, size_t *written, uint_t flags) | |
Write data to the specified channel. More... | |
error_t sshReadChannel (SshChannel *channel, void *data, size_t size, size_t *received, uint_t flags) | |
Receive data from the specified channel. More... | |
error_t sshPollChannels (SshChannelEventDesc *eventDesc, uint_t size, OsEvent *extEvent, systime_t timeout) | |
Wait for one of a set of channels to become ready to perform I/O. More... | |
error_t sshCloseChannel (SshChannel *channel) | |
Close channel. More... | |
void sshDeleteChannel (SshChannel *channel) | |
Release channel. More... | |
void sshDeinit (SshContext *context) | |
Release SSH context. More... | |
Detailed Description
Secure Shell (SSH)
License
SPDX-License-Identifier: GPL-2.0-or-later
Copyright (C) 2019-2025 Oryx Embedded SARL. All rights reserved.
This file is part of CycloneSSH Open.
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- Version
- 2.5.0
Definition in file ssh.h.
Macro Definition Documentation
◆ CYCLONE_SSH_MAJOR_VERSION
◆ CYCLONE_SSH_MINOR_VERSION
◆ CYCLONE_SSH_REV_NUMBER
◆ CYCLONE_SSH_VERSION_STRING
◆ SSH_3DES_SUPPORT
◆ SSH_AES_128_SUPPORT
◆ SSH_AES_192_SUPPORT
◆ SSH_AES_256_SUPPORT
◆ SSH_BLOWFISH_SUPPORT
◆ SSH_BUFFER_SIZE
#define SSH_BUFFER_SIZE (SSH_MAX_PACKET_SIZE + SSH_MAX_PACKET_OVERHEAD) |
◆ SSH_CAMELLIA_128_SUPPORT
◆ SSH_CAMELLIA_192_SUPPORT
◆ SSH_CAMELLIA_256_SUPPORT
◆ SSH_CAST128_SUPPORT
◆ SSH_CBC_CIPHER_SUPPORT
◆ SSH_CERT_SUPPORT
◆ SSH_CHACHA20_POLY1305_SUPPORT
◆ SSH_CHANNEL_BUFFER_SIZE
◆ SSH_CLIENT_SUPPORT
◆ SSH_COOKIE_SIZE
◆ SSH_CTR_CIPHER_SUPPORT
◆ SSH_CURVE25519_SUPPORT
◆ SSH_CURVE448_SUPPORT
◆ SSH_DH_GEX_KEX_SUPPORT
◆ SSH_DH_KEX_SUPPORT
◆ SSH_DSA_SIGN_SUPPORT
◆ SSH_ECDH_CALLBACK_SUPPORT
◆ SSH_ECDH_KEX_SUPPORT
◆ SSH_ECDSA_SIGN_SUPPORT
◆ SSH_ED25519_SIGN_SUPPORT
◆ SSH_ED448_SIGN_SUPPORT
◆ SSH_ENCRYPTED_KEY_SUPPORT
◆ SSH_ETM_SUPPORT
◆ SSH_EXT_INFO_SUPPORT
◆ SSH_FLAG_BREAK
◆ SSH_GCM_CIPHER_SUPPORT
◆ SSH_GLOBAL_REQ_OK_EXT_SUPPORT
◆ SSH_HMAC_SUPPORT
◆ SSH_HYBRID_KEX_SUPPORT
◆ SSH_IDEA_SUPPORT
◆ SSH_KEX_STRICT_SUPPORT
◆ SSH_KEY_LOG_SUPPORT
◆ SSH_MAX_AUTH_ATTEMPTS
◆ SSH_MAX_CHANNEL_OPEN_CALLBACKS
◆ SSH_MAX_CHANNEL_REQ_CALLBACKS
◆ SSH_MAX_CIPHER_BLOCK_SIZE
#define SSH_MAX_CIPHER_BLOCK_SIZE AES_BLOCK_SIZE |
◆ SSH_MAX_CONN_CLOSE_CALLBACKS
◆ SSH_MAX_CONN_OPEN_CALLBACKS
◆ SSH_MAX_CONNECTIONS
◆ SSH_MAX_DH_GEX_GROUPS
◆ SSH_MAX_DH_MODULUS_SIZE
◆ SSH_MAX_DH_SHARED_SECRET_LEN
#define SSH_MAX_DH_SHARED_SECRET_LEN ((SSH_MAX_DH_MODULUS_SIZE + 47) / 8) |
◆ SSH_MAX_DSA_MODULUS_SIZE
◆ SSH_MAX_ECDH_SHARED_SECRET_LEN
◆ SSH_MAX_ENC_KEY_SIZE
◆ SSH_MAX_GLOBAL_REQ_CALLBACKS
◆ SSH_MAX_HASH_DIGEST_SIZE
#define SSH_MAX_HASH_DIGEST_SIZE SHA512_DIGEST_SIZE |
◆ SSH_MAX_HOST_KEYS
◆ SSH_MAX_HYBRID_SHARED_SECRET_LEN
◆ SSH_MAX_ID_LEN
◆ SSH_MAX_MPINT_OVERHEAD
◆ SSH_MAX_PACKET_OVERHEAD
◆ SSH_MAX_PACKET_SIZE
◆ SSH_MAX_PASSWORD_CHANGE_PROMPT_LEN
◆ SSH_MAX_PASSWORD_LEN
◆ SSH_MAX_RSA_KEYS
◆ SSH_MAX_RSA_MODULUS_SIZE
◆ SSH_MAX_RSA_SHARED_SECRET_LEN
#define SSH_MAX_RSA_SHARED_SECRET_LEN ((SSH_MAX_RSA_MODULUS_SIZE + 47) / 8) |
◆ SSH_MAX_SHARED_SECRET_LEN
#define SSH_MAX_SHARED_SECRET_LEN SSH_MAX_RSA_SHARED_SECRET_LEN |
◆ SSH_MAX_USERNAME_LEN
◆ SSH_MD5_96_SUPPORT
◆ SSH_MD5_SUPPORT
◆ SSH_MIN_DH_MODULUS_SIZE
◆ SSH_MIN_DSA_MODULUS_SIZE
◆ SSH_MIN_RSA_MODULUS_SIZE
◆ SSH_MLKEM1024_SUPPORT
◆ SSH_MLKEM768_SUPPORT
◆ SSH_NISTP256_SUPPORT
◆ SSH_NISTP384_SUPPORT
◆ SSH_NISTP521_SUPPORT
◆ SSH_PASSWORD_AUTH_SUPPORT
◆ SSH_PORT
◆ SSH_PREFERRED_DH_MODULUS_SIZE
◆ SSH_PUBLIC_KEY_AUTH_SUPPORT
◆ SSH_RC4_128_SUPPORT
◆ SSH_RC4_256_SUPPORT
◆ SSH_RC4_SUPPORT
◆ SSH_RFC5647_SUPPORT
◆ SSH_RIPEMD160_SUPPORT
◆ SSH_RSA_KEX_SUPPORT
◆ SSH_RSA_SIGN_SUPPORT
◆ SSH_SEED_SUPPORT
◆ SSH_SERPENT_128_SUPPORT
◆ SSH_SERPENT_192_SUPPORT
◆ SSH_SERPENT_256_SUPPORT
◆ SSH_SERVER_SIG_ALGS_EXT_SUPPORT
◆ SSH_SERVER_SUPPORT
◆ SSH_SHA1_96_SUPPORT
◆ SSH_SHA1_SUPPORT
◆ SSH_SHA224_SUPPORT
◆ SSH_SHA256_SUPPORT
◆ SSH_SHA384_SUPPORT
◆ SSH_SHA512_SUPPORT
◆ SSH_SIGN_CALLBACK_SUPPORT
◆ SSH_SNTRUP761_SUPPORT
◆ SSH_STREAM_CIPHER_SUPPORT
◆ SSH_SUPPORT
◆ SSH_TWOFISH_128_SUPPORT
◆ SSH_TWOFISH_192_SUPPORT
◆ SSH_TWOFISH_256_SUPPORT
◆ sshAllocMem
#define sshAllocMem | ( | size | ) | osAllocMem(size) |
◆ SshChannel
#define SshChannel struct _SshChannel |
◆ SshConnection
#define SshConnection struct _SshConnection |
◆ SshContext
#define SshContext struct _SshContext |
◆ sshFreeMem
Typedef Documentation
◆ SshCaPublicKeyVerifyCallback
typedef error_t(* SshCaPublicKeyVerifyCallback) (SshConnection *connection, const uint8_t *publicKey, size_t publicKeyLen) |
◆ SshCertAuthCallback
typedef error_t(* SshCertAuthCallback) (SshConnection *connection, const char_t *user, const SshCertificate *cert) |
◆ SshCertVerifyCallback
typedef error_t(* SshCertVerifyCallback) (SshConnection *connection, const SshCertificate *cert) |
◆ SshChannelOpenCallback
◆ SshChannelReqCallback
◆ SshConnectionCloseCallback
typedef void(* SshConnectionCloseCallback) (SshConnection *connection, void *param) |
◆ SshConnectionOpenCallback
typedef error_t(* SshConnectionOpenCallback) (SshConnection *connection, void *param) |
◆ SshEcdhKeyPairGenCallback
typedef error_t(* SshEcdhKeyPairGenCallback) (SshConnection *connection, const char_t *kexAlgo, EcPublicKey *publicKey) |
◆ SshEcdhSharedSecretCalcCallback
typedef error_t(* SshEcdhSharedSecretCalcCallback) (SshConnection *connection, const char_t *kexAlgo, const EcPublicKey *publicKey, uint8_t *output, size_t *outputLen) |
◆ SshGlobalReqCallback
◆ SshHostKeyVerifyCallback
typedef error_t(* SshHostKeyVerifyCallback) (SshConnection *connection, const uint8_t *hostKey, size_t hostKeyLen) |
◆ SshKeyLogCallback
typedef void(* SshKeyLogCallback) (SshConnection *connection, const char_t *key) |
◆ SshPasswordAuthCallback
typedef SshAuthStatus(* SshPasswordAuthCallback) (SshConnection *connection, const char_t *user, const char_t *password, size_t passwordLen) |
◆ SshPasswordChangeCallback
typedef SshAuthStatus(* SshPasswordChangeCallback) (SshConnection *connection, const char_t *user, const char_t *oldPassword, size_t oldPasswordLen, const char_t *newPassword, size_t newPasswordLen) |
◆ SshPublicKeyAuthCallback
typedef error_t(* SshPublicKeyAuthCallback) (SshConnection *connection, const char_t *user, const uint8_t *publicKey, size_t publicKeyLen) |
◆ SshSignGenCallback
typedef error_t(* SshSignGenCallback) (SshConnection *connection, const char_t *publicKeyAlgo, const SshHostKey *hostKey, const SshBinaryString *sessionId, const SshBinaryString *message, uint8_t *p, size_t *written) |
◆ SshSignVerifyCallback
typedef error_t(* SshSignVerifyCallback) (SshConnection *connection, const SshString *publicKeyAlgo, const SshBinaryString *publicKeyBlob, const SshBinaryString *sessionId, const SshBinaryString *message, const SshBinaryString *signatureBlob) |
Enumeration Type Documentation
◆ SshAuthStatus
enum SshAuthStatus |
◆ SshChannelEvent
enum SshChannelEvent |
◆ SshChannelFlags
enum SshChannelFlags |
◆ SshChannelState
enum SshChannelState |
◆ SshConnectionState
enum SshConnectionState |
SSH connection state.
◆ SshDisconnectReasonCode
Disconnection messages reason codes.
◆ SshMessageType
enum SshMessageType |
SSH message types.
◆ SshOpenFailureReasonCode
◆ SshOperationMode
enum SshOperationMode |
◆ SshRequestState
enum SshRequestState |
Function Documentation
◆ sshCloseChannel()
error_t sshCloseChannel | ( | SshChannel * | channel | ) |
◆ sshCreateChannel()
SshChannel* sshCreateChannel | ( | SshConnection * | connection | ) |
◆ sshDeinit()
void sshDeinit | ( | SshContext * | context | ) |
◆ sshDeleteChannel()
void sshDeleteChannel | ( | SshChannel * | channel | ) |
◆ sshInit()
error_t sshInit | ( | SshContext * | context, |
SshConnection * | connections, | ||
uint_t | numConnections, | ||
SshChannel * | channels, | ||
uint_t | numChannels | ||
) |
◆ sshLoadCertificate()
error_t sshLoadCertificate | ( | SshContext * | context, |
uint_t | index, | ||
const char_t * | cert, | ||
size_t | certLen, | ||
const char_t * | privateKey, | ||
size_t | privateKeyLen, | ||
const char_t * | password | ||
) |
Load entity's certificate.
- Parameters
-
[in] context Pointer to the SSH context [in] index Zero-based index identifying a slot [in] cert Certificate (OpenSSH format). This parameter is taken as reference [in] certLen Length of the certificate [in] privateKey Private key (PEM or OpenSSH format). This parameter is taken as reference [in] privateKeyLen Length of the private key [in] password NULL-terminated string containing the password. This parameter is required if the private key is encrypted
- Returns
- Error code
◆ sshLoadDhGexGroup()
error_t sshLoadDhGexGroup | ( | SshContext * | context, |
uint_t | index, | ||
const char_t * | dhParams, | ||
size_t | dhParamsLen | ||
) |
Load Diffie-Hellman group.
- Parameters
-
[in] context Pointer to the SSH context [in] index Zero-based index identifying a slot [in] dhParams Diffie-Hellman parameters (PEM format). This parameter is taken as reference [in] dhParamsLen Length of the Diffie-Hellman parameters
- Returns
- Error code
◆ sshLoadHostKey()
error_t sshLoadHostKey | ( | SshContext * | context, |
uint_t | index, | ||
const char_t * | publicKey, | ||
size_t | publicKeyLen, | ||
const char_t * | privateKey, | ||
size_t | privateKeyLen, | ||
const char_t * | password | ||
) |
Load entity's host key.
- Parameters
-
[in] context Pointer to the SSH context [in] index Zero-based index identifying a slot [in] publicKey Public key (PEM, SSH2 or OpenSSH format). This parameter is taken as reference [in] publicKeyLen Length of the public key [in] privateKey Private key (PEM or OpenSSH format). This parameter is taken as reference [in] privateKeyLen Length of the private key [in] password NULL-terminated string containing the password. This parameter is required if the private key is encrypted
- Returns
- Error code
◆ sshLoadRsaKey()
error_t sshLoadRsaKey | ( | SshContext * | context, |
uint_t | index, | ||
const char_t * | publicKey, | ||
size_t | publicKeyLen, | ||
const char_t * | privateKey, | ||
size_t | privateKeyLen, | ||
const char_t * | password | ||
) |
Load transient RSA key (for RSA key exchange)
- Parameters
-
[in] context Pointer to the SSH context [in] index Zero-based index identifying a slot [in] publicKey RSA public key (PEM, SSH2 or OpenSSH format). This parameter is taken as reference [in] publicKeyLen Length of the RSA public key [in] privateKey RSA private key (PEM or OpenSSH format). This parameter is taken as reference [in] password NULL-terminated string containing the password. This parameter is required if the private key is encrypted [in] privateKeyLen Length of the RSA private key
- Returns
- Error code
◆ sshPollChannels()
error_t sshPollChannels | ( | SshChannelEventDesc * | eventDesc, |
uint_t | size, | ||
OsEvent * | extEvent, | ||
systime_t | timeout | ||
) |
Wait for one of a set of channels to become ready to perform I/O.
This function determines the status of one or more channels, waiting if necessary, to perform synchronous I/O
- Parameters
-
[in,out] eventDesc Set of entries specifying the events the user is interested in [in] size Number of entries in the descriptor set [in] extEvent External event that can abort the wait if necessary (optional) [in] timeout Maximum time to wait before returning
- Returns
- Error code
◆ sshReadChannel()
error_t sshReadChannel | ( | SshChannel * | channel, |
void * | data, | ||
size_t | size, | ||
size_t * | received, | ||
uint_t | flags | ||
) |
Receive data from the specified channel.
- Parameters
-
[in] channel SSH channel handle [out] data Buffer where to store the incoming data [in] size Maximum number of bytes that can be received [out] received Number of bytes that have been received [in] flags Set of flags that influences the behavior of this function
- Returns
- Error code
◆ sshRegisterCaPublicKeyVerifyCallback()
error_t sshRegisterCaPublicKeyVerifyCallback | ( | SshContext * | context, |
SshCaPublicKeyVerifyCallback | callback | ||
) |
◆ sshRegisterCertAuthCallback()
error_t sshRegisterCertAuthCallback | ( | SshContext * | context, |
SshCertAuthCallback | callback | ||
) |
◆ sshRegisterCertVerifyCallback()
error_t sshRegisterCertVerifyCallback | ( | SshContext * | context, |
SshCertVerifyCallback | callback | ||
) |
◆ sshRegisterChannelOpenCallback()
error_t sshRegisterChannelOpenCallback | ( | SshContext * | context, |
SshChannelOpenCallback | callback, | ||
void * | param | ||
) |
◆ sshRegisterChannelRequestCallback()
error_t sshRegisterChannelRequestCallback | ( | SshContext * | context, |
SshChannelReqCallback | callback, | ||
void * | param | ||
) |
◆ sshRegisterConnectionCloseCallback()
error_t sshRegisterConnectionCloseCallback | ( | SshContext * | context, |
SshConnectionCloseCallback | callback, | ||
void * | param | ||
) |
◆ sshRegisterConnectionOpenCallback()
error_t sshRegisterConnectionOpenCallback | ( | SshContext * | context, |
SshConnectionOpenCallback | callback, | ||
void * | param | ||
) |
◆ sshRegisterEcdhKeyPairGenCallback()
error_t sshRegisterEcdhKeyPairGenCallback | ( | SshContext * | context, |
SshEcdhKeyPairGenCallback | callback | ||
) |
◆ sshRegisterEcdhSharedSecretCalcCallback()
error_t sshRegisterEcdhSharedSecretCalcCallback | ( | SshContext * | context, |
SshEcdhSharedSecretCalcCallback | callback | ||
) |
◆ sshRegisterGlobalRequestCallback()
error_t sshRegisterGlobalRequestCallback | ( | SshContext * | context, |
SshGlobalReqCallback | callback, | ||
void * | param | ||
) |
◆ sshRegisterHostKeyVerifyCallback()
error_t sshRegisterHostKeyVerifyCallback | ( | SshContext * | context, |
SshHostKeyVerifyCallback | callback | ||
) |
◆ sshRegisterKeyLogCallback()
error_t sshRegisterKeyLogCallback | ( | SshContext * | context, |
SshKeyLogCallback | callback | ||
) |
◆ sshRegisterPasswordAuthCallback()
error_t sshRegisterPasswordAuthCallback | ( | SshContext * | context, |
SshPasswordAuthCallback | callback | ||
) |
◆ sshRegisterPasswordChangeCallback()
error_t sshRegisterPasswordChangeCallback | ( | SshContext * | context, |
SshPasswordChangeCallback | callback | ||
) |
◆ sshRegisterPublicKeyAuthCallback()
error_t sshRegisterPublicKeyAuthCallback | ( | SshContext * | context, |
SshPublicKeyAuthCallback | callback | ||
) |
◆ sshRegisterSignGenCallback()
error_t sshRegisterSignGenCallback | ( | SshContext * | context, |
SshSignGenCallback | callback | ||
) |
◆ sshRegisterSignVerifyCallback()
error_t sshRegisterSignVerifyCallback | ( | SshContext * | context, |
SshSignVerifyCallback | callback | ||
) |
◆ sshSetChannelTimeout()
error_t sshSetChannelTimeout | ( | SshChannel * | channel, |
systime_t | timeout | ||
) |
◆ sshSetOperationMode()
error_t sshSetOperationMode | ( | SshContext * | context, |
SshOperationMode | mode | ||
) |
◆ sshSetPassword()
error_t sshSetPassword | ( | SshContext * | context, |
const char_t * | password | ||
) |
◆ sshSetPasswordChangePrompt()
error_t sshSetPasswordChangePrompt | ( | SshConnection * | connection, |
const char_t * | prompt | ||
) |
◆ sshSetPrng()
error_t sshSetPrng | ( | SshContext * | context, |
const PrngAlgo * | prngAlgo, | ||
void * | prngContext | ||
) |
◆ sshSetUsername()
error_t sshSetUsername | ( | SshContext * | context, |
const char_t * | username | ||
) |
◆ sshUnloadCertificate()
error_t sshUnloadCertificate | ( | SshContext * | context, |
uint_t | index | ||
) |
◆ sshUnloadDhGexGroup()
error_t sshUnloadDhGexGroup | ( | SshContext * | context, |
uint_t | index | ||
) |
◆ sshUnloadHostKey()
error_t sshUnloadHostKey | ( | SshContext * | context, |
uint_t | index | ||
) |
◆ sshUnloadRsaKey()
error_t sshUnloadRsaKey | ( | SshContext * | context, |
uint_t | index | ||
) |
◆ sshUnregisterChannelOpenCallback()
error_t sshUnregisterChannelOpenCallback | ( | SshContext * | context, |
SshChannelOpenCallback | callback | ||
) |
◆ sshUnregisterChannelRequestCallback()
error_t sshUnregisterChannelRequestCallback | ( | SshContext * | context, |
SshChannelReqCallback | callback | ||
) |
◆ sshUnregisterConnectionCloseCallback()
error_t sshUnregisterConnectionCloseCallback | ( | SshContext * | context, |
SshConnectionCloseCallback | callback | ||
) |
◆ sshUnregisterConnectionOpenCallback()
error_t sshUnregisterConnectionOpenCallback | ( | SshContext * | context, |
SshConnectionOpenCallback | callback | ||
) |
◆ sshUnregisterGlobalRequestCallback()
error_t sshUnregisterGlobalRequestCallback | ( | SshContext * | context, |
SshGlobalReqCallback | callback | ||
) |
◆ sshWriteChannel()
error_t sshWriteChannel | ( | SshChannel * | channel, |
const void * | data, | ||
size_t | length, | ||
size_t * | written, | ||
uint_t | flags | ||
) |
Write data to the specified channel.
- Parameters
-
[in] channel SSH channel handle [in] data Pointer to the buffer containing the data to be transmitted [in] length Number of data bytes to send [out] written Actual number of bytes written (optional parameter) [in] flags Set of flags that influences the behavior of this function
- Returns
- Error code