ssh.h File Reference

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...
 

Macros

#define CYCLONE_SSH_VERSION_STRING   "2.4.0"
 
#define CYCLONE_SSH_MAJOR_VERSION   2
 
#define CYCLONE_SSH_MINOR_VERSION   4
 
#define CYCLONE_SSH_REV_NUMBER   0
 
#define SSH_SUPPORT   ENABLED
 
#define SSH_CLIENT_SUPPORT   ENABLED
 
#define SSH_SERVER_SUPPORT   ENABLED
 
#define SSH_PUBLIC_KEY_AUTH_SUPPORT   ENABLED
 
#define SSH_PASSWORD_AUTH_SUPPORT   ENABLED
 
#define SSH_ENCRYPTED_KEY_SUPPORT   DISABLED
 
#define SSH_CERT_SUPPORT   DISABLED
 
#define SSH_EXT_INFO_SUPPORT   DISABLED
 
#define SSH_SERVER_SIG_ALGS_EXT_SUPPORT   ENABLED
 
#define SSH_GLOBAL_REQ_OK_EXT_SUPPORT   DISABLED
 
#define SSH_KEX_STRICT_SUPPORT   ENABLED
 
#define SSH_SIGN_CALLBACK_SUPPORT   DISABLED
 
#define SSH_ECDH_CALLBACK_SUPPORT   DISABLED
 
#define SSH_MAX_HOST_KEYS   3
 
#define SSH_MAX_CONNECTIONS   10
 
#define SSH_MAX_GLOBAL_REQ_CALLBACKS   3
 
#define SSH_MAX_CHANNEL_REQ_CALLBACKS   3
 
#define SSH_MAX_CHANNEL_OPEN_CALLBACKS   1
 
#define SSH_MAX_CONN_OPEN_CALLBACKS   1
 
#define SSH_MAX_CONN_CLOSE_CALLBACKS   1
 
#define SSH_MAX_AUTH_ATTEMPTS   10
 
#define SSH_MAX_PACKET_SIZE   2048
 
#define SSH_CHANNEL_BUFFER_SIZE   2048
 
#define SSH_MAX_ID_LEN   80
 
#define SSH_MAX_USERNAME_LEN   32
 
#define SSH_MAX_PASSWORD_LEN   32
 
#define SSH_MAX_PASSWORD_CHANGE_PROMPT_LEN   0
 
#define SSH_ETM_SUPPORT   DISABLED
 
#define SSH_STREAM_CIPHER_SUPPORT   DISABLED
 
#define SSH_CBC_CIPHER_SUPPORT   DISABLED
 
#define SSH_CTR_CIPHER_SUPPORT   ENABLED
 
#define SSH_GCM_CIPHER_SUPPORT   ENABLED
 
#define SSH_RFC5647_SUPPORT   DISABLED
 
#define SSH_CHACHA20_POLY1305_SUPPORT   DISABLED
 
#define SSH_RC4_SUPPORT   DISABLED
 
#define SSH_RC4_128_SUPPORT   DISABLED
 
#define SSH_RC4_256_SUPPORT   DISABLED
 
#define SSH_CAST128_SUPPORT   DISABLED
 
#define SSH_IDEA_SUPPORT   DISABLED
 
#define SSH_BLOWFISH_SUPPORT   DISABLED
 
#define SSH_3DES_SUPPORT   DISABLED
 
#define SSH_AES_128_SUPPORT   ENABLED
 
#define SSH_AES_192_SUPPORT   ENABLED
 
#define SSH_AES_256_SUPPORT   ENABLED
 
#define SSH_TWOFISH_128_SUPPORT   DISABLED
 
#define SSH_TWOFISH_192_SUPPORT   DISABLED
 
#define SSH_TWOFISH_256_SUPPORT   DISABLED
 
#define SSH_SERPENT_128_SUPPORT   DISABLED
 
#define SSH_SERPENT_192_SUPPORT   DISABLED
 
#define SSH_SERPENT_256_SUPPORT   DISABLED
 
#define SSH_CAMELLIA_128_SUPPORT   DISABLED
 
#define SSH_CAMELLIA_192_SUPPORT   DISABLED
 
#define SSH_CAMELLIA_256_SUPPORT   DISABLED
 
#define SSH_SEED_SUPPORT   DISABLED
 
#define SSH_MD5_SUPPORT   DISABLED
 
#define SSH_MD5_96_SUPPORT   DISABLED
 
#define SSH_RIPEMD160_SUPPORT   DISABLED
 
#define SSH_SHA1_SUPPORT   ENABLED
 
#define SSH_SHA1_96_SUPPORT   DISABLED
 
#define SSH_SHA224_SUPPORT   DISABLED
 
#define SSH_SHA256_SUPPORT   ENABLED
 
#define SSH_SHA384_SUPPORT   ENABLED
 
#define SSH_SHA512_SUPPORT   ENABLED
 
#define SSH_RSA_KEX_SUPPORT   DISABLED
 
#define SSH_DH_KEX_SUPPORT   ENABLED
 
#define SSH_DH_GEX_KEX_SUPPORT   DISABLED
 
#define SSH_ECDH_KEX_SUPPORT   ENABLED
 
#define SSH_HYBRID_KEX_SUPPORT   DISABLED
 
#define SSH_RSA_SIGN_SUPPORT   ENABLED
 
#define SSH_DSA_SIGN_SUPPORT   ENABLED
 
#define SSH_ECDSA_SIGN_SUPPORT   ENABLED
 
#define SSH_ED25519_SIGN_SUPPORT   ENABLED
 
#define SSH_ED448_SIGN_SUPPORT   DISABLED
 
#define SSH_NISTP256_SUPPORT   ENABLED
 
#define SSH_NISTP384_SUPPORT   ENABLED
 
#define SSH_NISTP521_SUPPORT   ENABLED
 
#define SSH_CURVE25519_SUPPORT   ENABLED
 
#define SSH_CURVE448_SUPPORT   DISABLED
 
#define SSH_SNTRUP761_SUPPORT   DISABLED
 
#define SSH_KYBER512_SUPPORT   DISABLED
 
#define SSH_KYBER768_SUPPORT   DISABLED
 
#define SSH_KYBER1024_SUPPORT   DISABLED
 
#define SSH_KEY_LOG_SUPPORT   DISABLED
 
#define SSH_MAX_RSA_KEYS   2
 
#define SSH_MAX_DH_GEX_GROUPS   2
 
#define SSH_MIN_DH_MODULUS_SIZE   1024
 
#define SSH_PREFERRED_DH_MODULUS_SIZE   2048
 
#define SSH_MAX_DH_MODULUS_SIZE   3072
 
#define SSH_MIN_RSA_MODULUS_SIZE   1024
 
#define SSH_MAX_RSA_MODULUS_SIZE   4096
 
#define SSH_MIN_DSA_MODULUS_SIZE   1024
 
#define SSH_MAX_DSA_MODULUS_SIZE   4096
 
#define sshAllocMem(size)   osAllocMem(size)
 
#define sshFreeMem(p)   osFreeMem(p)
 
#define SSH_HMAC_SUPPORT   ENABLED
 
#define SSH_MAX_ENC_KEY_SIZE   64
 
#define SSH_MAX_CIPHER_BLOCK_SIZE   AES_BLOCK_SIZE
 
#define SSH_MAX_HASH_DIGEST_SIZE   SHA512_DIGEST_SIZE
 
#define SSH_MAX_RSA_SHARED_SECRET_LEN   ((SSH_MAX_RSA_MODULUS_SIZE + 47) / 8)
 
#define SSH_MAX_DH_SHARED_SECRET_LEN   ((SSH_MAX_DH_MODULUS_SIZE + 47) / 8)
 
#define SSH_MAX_ECDH_SHARED_SECRET_LEN   71
 
#define SSH_MAX_HYBRID_SHARED_SECRET_LEN   68
 
#define SSH_MAX_SHARED_SECRET_LEN   SSH_MAX_RSA_SHARED_SECRET_LEN
 
#define SSH_PORT   22
 
#define SSH_COOKIE_SIZE   16
 
#define SSH_MAX_MPINT_OVERHEAD   5
 
#define SSH_MAX_PACKET_OVERHEAD   128
 
#define SSH_BUFFER_SIZE   (SSH_MAX_PACKET_SIZE + SSH_MAX_PACKET_OVERHEAD)
 
#define SshContext   struct _SshContext
 
#define SshConnection   struct _SshConnection
 
#define SshChannel   struct _SshChannel
 
#define SSH_FLAG_BREAK(c)   (SSH_FLAG_BREAK_CHAR | LSB(c))
 

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...
 

Enumerations

enum  SshOperationMode { SSH_OPERATION_MODE_CLIENT = 0 , SSH_OPERATION_MODE_SERVER = 1 }
 Mode of operation. More...
 
enum  SshAuthStatus { SSH_AUTH_STATUS_FAILURE = 0 , SSH_AUTH_STATUS_SUCCESS = 1 , SSH_AUTH_STATUS_PASSWORD_EXPIRED = 2 }
 Authentication status. More...
 
enum  SshChannelFlags {
  SSH_FLAG_EOF = 0x0100 , SSH_FLAG_WAIT_ALL = 0x0800 , SSH_FLAG_BREAK_CHAR = 0x1000 , SSH_FLAG_BREAK_CRLF = 0x100A ,
  SSH_FLAG_NO_DELAY = 0x4000 , SSH_FLAG_DELAY = 0x8000
}
 Flags used by read and write functions. More...
 
enum  SshMessageType {
  SSH_MSG_INVALID = 0 , SSH_MSG_DISCONNECT = 1 , SSH_MSG_IGNORE = 2 , SSH_MSG_UNIMPLEMENTED = 3 ,
  SSH_MSG_DEBUG = 4 , SSH_MSG_SERVICE_REQUEST = 5 , SSH_MSG_SERVICE_ACCEPT = 6 , SSH_MSG_EXT_INFO = 7 ,
  SSH_MSG_NEWCOMPRESS = 8 , SSH_MSG_KEXINIT = 20 , SSH_MSG_NEWKEYS = 21 , SSH_MSG_KEX_MIN = 30 ,
  SSH_MSG_KEX_MAX = 49 , SSH_MSG_KEXRSA_PUBKEY = 30 , SSH_MSG_KEXRSA_SECRET = 31 , SSH_MSG_KEXRSA_DONE = 32 ,
  SSH_MSG_KEX_DH_INIT = 30 , SSH_MSG_KEX_DH_REPLY = 31 , SSH_MSG_KEX_DH_GEX_REQUEST_OLD = 30 , SSH_MSG_KEX_DH_GEX_REQUEST = 34 ,
  SSH_MSG_KEX_DH_GEX_GROUP = 31 , SSH_MSG_KEX_DH_GEX_INIT = 32 , SSH_MSG_KEX_DH_GEX_REPLY = 33 , SSH_MSG_KEX_ECDH_INIT = 30 ,
  SSH_MSG_KEX_ECDH_REPLY = 31 , SSH_MSG_KEX_HYBRID_INIT = 30 , SSH_MSG_KEX_HYBRID_REPLY = 31 , SSH_MSG_USERAUTH_REQUEST = 50 ,
  SSH_MSG_USERAUTH_FAILURE = 51 , SSH_MSG_USERAUTH_SUCCESS = 52 , SSH_MSG_USERAUTH_BANNER = 53 , SSH_MSG_USERAUTH_MIN = 60 ,
  SSH_MSG_USERAUTH_MAX = 79 , SSH_MSG_USERAUTH_PK_OK = 60 , SSH_MSG_USERAUTH_PASSWD_CHANGEREQ = 60 , SSH_MSG_USERAUTH_INFO_REQUEST = 60 ,
  SSH_MSG_USERAUTH_INFO_RESPONSE = 61 , SSH_MSG_GLOBAL_REQUEST = 80 , SSH_MSG_REQUEST_SUCCESS = 81 , SSH_MSG_REQUEST_FAILURE = 82 ,
  SSH_MSG_CHANNEL_OPEN = 90 , SSH_MSG_CHANNEL_OPEN_CONFIRMATION = 91 , SSH_MSG_CHANNEL_OPEN_FAILURE = 92 , SSH_MSG_CHANNEL_WINDOW_ADJUST = 93 ,
  SSH_MSG_CHANNEL_DATA = 94 , SSH_MSG_CHANNEL_EXTENDED_DATA = 95 , SSH_MSG_CHANNEL_EOF = 96 , SSH_MSG_CHANNEL_CLOSE = 97 ,
  SSH_MSG_CHANNEL_REQUEST = 98 , SSH_MSG_CHANNEL_SUCCESS = 99 , SSH_MSG_CHANNEL_FAILURE = 100 , SSH_MSG_PING = 192 ,
  SSH_MSG_PONG = 193
}
 SSH message types. More...
 
enum  SshDisconnectReasonCode {
  SSH_DISCONNECT_HOST_NOT_ALLOWED_TO_CONNECT = 1 , SSH_DISCONNECT_PROTOCOL_ERROR = 2 , SSH_DISCONNECT_KEY_EXCHANGE_FAILED = 3 , SSH_DISCONNECT_RESERVED = 4 ,
  SSH_DISCONNECT_MAC_ERROR = 5 , SSH_DISCONNECT_COMPRESSION_ERROR = 6 , SSH_DISCONNECT_SERVICE_NOT_AVAILABLE = 7 , SSH_DISCONNECT_PROTOCOL_VERSION_NOT_SUPPORTED = 8 ,
  SSH_DISCONNECT_HOST_KEY_NOT_VERIFIABLE = 9 , SSH_DISCONNECT_CONNECTION_LOST = 10 , SSH_DISCONNECT_BY_APPLICATION = 11 , SSH_DISCONNECT_TOO_MANY_CONNECTIONS = 12 ,
  SSH_DISCONNECT_AUTH_CANCELLED_BY_USER = 13 , SSH_DISCONNECT_NO_MORE_AUTH_METHODS_AVAILABLE = 14 , SSH_DISCONNECT_ILLEGAL_USER_NAME = 15
}
 Disconnection messages reason codes. More...
 
enum  SshOpenFailureReasonCode { SSH_OPEN_ADMINISTRATIVELY_PROHIBITED = 1 , SSH_OPEN_CONNECT_FAILED = 2 , SSH_OPEN_UNKNOWN_CHANNEL_TYPE = 3 , SSH_OPEN_RESOURCE_SHORTAGE = 4 }
 Channel connection failure reason codes. More...
 
enum  SshConnectionState {
  SSH_CONN_STATE_CLOSED = 0 , SSH_CONN_STATE_CLIENT_ID = 1 , SSH_CONN_STATE_SERVER_ID = 2 , SSH_CONN_STATE_CLIENT_KEX_INIT = 3 ,
  SSH_CONN_STATE_SERVER_KEX_INIT = 4 , SSH_CONN_STATE_KEX_RSA_PUB_KEY = 5 , SSH_CONN_STATE_KEX_RSA_SECRET = 6 , SSH_CONN_STATE_KEX_RSA_DONE = 7 ,
  SSH_CONN_STATE_KEX_DH_INIT = 8 , SSH_CONN_STATE_KEX_DH_REPLY = 9 , SSH_CONN_STATE_KEX_DH_GEX_REQUEST = 10 , SSH_CONN_STATE_KEX_DH_GEX_GROUP = 11 ,
  SSH_CONN_STATE_KEX_DH_GEX_INIT = 12 , SSH_CONN_STATE_KEX_DH_GEX_REPLY = 13 , SSH_CONN_STATE_KEX_ECDH_INIT = 14 , SSH_CONN_STATE_KEX_ECDH_REPLY = 15 ,
  SSH_CONN_STATE_KEX_HYBRID_INIT = 16 , SSH_CONN_STATE_KEX_HYBRID_REPLY = 17 , SSH_CONN_STATE_CLIENT_NEW_KEYS = 18 , SSH_CONN_STATE_SERVER_NEW_KEYS = 19 ,
  SSH_CONN_STATE_CLIENT_EXT_INFO = 20 , SSH_CONN_STATE_SERVER_EXT_INFO_1 = 21 , SSH_CONN_STATE_SERVER_EXT_INFO_2 = 22 , SSH_CONN_STATE_SERVICE_REQUEST = 23 ,
  SSH_CONN_STATE_SERVICE_ACCEPT = 24 , SSH_CONN_STATE_USER_AUTH_BANNER = 25 , SSH_CONN_STATE_USER_AUTH_REQUEST = 26 , SSH_CONN_STATE_USER_AUTH_REPLY = 27 ,
  SSH_CONN_STATE_USER_AUTH_SUCCESS = 28 , SSH_CONN_STATE_OPEN = 29 , SSH_CONN_STATE_DISCONNECT = 30
}
 SSH connection state. More...
 
enum  SshChannelState { SSH_CHANNEL_STATE_UNUSED = 0 , SSH_CHANNEL_STATE_RESERVED = 1 , SSH_CHANNEL_STATE_OPEN = 2 , SSH_CHANNEL_STATE_CLOSED = 3 }
 SSH channel state. More...
 
enum  SshRequestState { SSH_REQUEST_STATE_IDLE = 0 , SSH_REQUEST_STATE_PENDING = 1 , SSH_REQUEST_STATE_SUCCESS = 2 , SSH_REQUEST_STATE_FAILURE = 3 }
 SSH request states. More...
 
enum  SshChannelEvent {
  SSH_CHANNEL_EVENT_TIMEOUT = 0x0000 , SSH_CHANNEL_EVENT_CONNECTED = 0x0001 , SSH_CHANNEL_EVENT_CLOSED = 0x0002 , SSH_CHANNEL_EVENT_TX_READY = 0x0004 ,
  SSH_CHANNEL_EVENT_TX_DONE = 0x0008 , SSH_CHANNEL_EVENT_TX_ACKED = 0x0010 , SSH_CHANNEL_EVENT_TX_SHUTDOWN = 0x0020 , SSH_CHANNEL_EVENT_RX_READY = 0x0040 ,
  SSH_CHANNEL_EVENT_RX_SHUTDOWN = 0x0080
}
 SSH channel events. 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...
 
SshChannelsshCreateChannel (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-2024 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.

Author
Oryx Embedded SARL (www.oryx-embedded.com)
Version
2.4.0

Definition in file ssh.h.

Macro Definition Documentation

◆ CYCLONE_SSH_MAJOR_VERSION

#define CYCLONE_SSH_MAJOR_VERSION   2

Definition at line 79 of file ssh.h.

◆ CYCLONE_SSH_MINOR_VERSION

#define CYCLONE_SSH_MINOR_VERSION   4

Definition at line 81 of file ssh.h.

◆ CYCLONE_SSH_REV_NUMBER

#define CYCLONE_SSH_REV_NUMBER   0

Definition at line 83 of file ssh.h.

◆ CYCLONE_SSH_VERSION_STRING

#define CYCLONE_SSH_VERSION_STRING   "2.4.0"

Definition at line 77 of file ssh.h.

◆ SSH_3DES_SUPPORT

#define SSH_3DES_SUPPORT   DISABLED

Definition at line 367 of file ssh.h.

◆ SSH_AES_128_SUPPORT

#define SSH_AES_128_SUPPORT   ENABLED

Definition at line 374 of file ssh.h.

◆ SSH_AES_192_SUPPORT

#define SSH_AES_192_SUPPORT   ENABLED

Definition at line 381 of file ssh.h.

◆ SSH_AES_256_SUPPORT

#define SSH_AES_256_SUPPORT   ENABLED

Definition at line 388 of file ssh.h.

◆ SSH_BLOWFISH_SUPPORT

#define SSH_BLOWFISH_SUPPORT   DISABLED

Definition at line 360 of file ssh.h.

◆ SSH_BUFFER_SIZE

#define SSH_BUFFER_SIZE   (SSH_MAX_PACKET_SIZE + SSH_MAX_PACKET_OVERHEAD)

Definition at line 875 of file ssh.h.

◆ SSH_CAMELLIA_128_SUPPORT

#define SSH_CAMELLIA_128_SUPPORT   DISABLED

Definition at line 437 of file ssh.h.

◆ SSH_CAMELLIA_192_SUPPORT

#define SSH_CAMELLIA_192_SUPPORT   DISABLED

Definition at line 444 of file ssh.h.

◆ SSH_CAMELLIA_256_SUPPORT

#define SSH_CAMELLIA_256_SUPPORT   DISABLED

Definition at line 451 of file ssh.h.

◆ SSH_CAST128_SUPPORT

#define SSH_CAST128_SUPPORT   DISABLED

Definition at line 346 of file ssh.h.

◆ SSH_CBC_CIPHER_SUPPORT

#define SSH_CBC_CIPHER_SUPPORT   DISABLED

Definition at line 290 of file ssh.h.

◆ SSH_CERT_SUPPORT

#define SSH_CERT_SUPPORT   DISABLED

Definition at line 129 of file ssh.h.

◆ SSH_CHACHA20_POLY1305_SUPPORT

#define SSH_CHACHA20_POLY1305_SUPPORT   DISABLED

Definition at line 318 of file ssh.h.

◆ SSH_CHANNEL_BUFFER_SIZE

#define SSH_CHANNEL_BUFFER_SIZE   2048

Definition at line 241 of file ssh.h.

◆ SSH_CLIENT_SUPPORT

#define SSH_CLIENT_SUPPORT   ENABLED

Definition at line 94 of file ssh.h.

◆ SSH_COOKIE_SIZE

#define SSH_COOKIE_SIZE   16

Definition at line 868 of file ssh.h.

◆ SSH_CTR_CIPHER_SUPPORT

#define SSH_CTR_CIPHER_SUPPORT   ENABLED

Definition at line 297 of file ssh.h.

◆ SSH_CURVE25519_SUPPORT

#define SSH_CURVE25519_SUPPORT   ENABLED

Definition at line 619 of file ssh.h.

◆ SSH_CURVE448_SUPPORT

#define SSH_CURVE448_SUPPORT   DISABLED

Definition at line 626 of file ssh.h.

◆ SSH_DH_GEX_KEX_SUPPORT

#define SSH_DH_GEX_KEX_SUPPORT   DISABLED

Definition at line 542 of file ssh.h.

◆ SSH_DH_KEX_SUPPORT

#define SSH_DH_KEX_SUPPORT   ENABLED

Definition at line 535 of file ssh.h.

◆ SSH_DSA_SIGN_SUPPORT

#define SSH_DSA_SIGN_SUPPORT   ENABLED

Definition at line 570 of file ssh.h.

◆ SSH_ECDH_CALLBACK_SUPPORT

#define SSH_ECDH_CALLBACK_SUPPORT   DISABLED

Definition at line 171 of file ssh.h.

◆ SSH_ECDH_KEX_SUPPORT

#define SSH_ECDH_KEX_SUPPORT   ENABLED

Definition at line 549 of file ssh.h.

◆ SSH_ECDSA_SIGN_SUPPORT

#define SSH_ECDSA_SIGN_SUPPORT   ENABLED

Definition at line 577 of file ssh.h.

◆ SSH_ED25519_SIGN_SUPPORT

#define SSH_ED25519_SIGN_SUPPORT   ENABLED

Definition at line 584 of file ssh.h.

◆ SSH_ED448_SIGN_SUPPORT

#define SSH_ED448_SIGN_SUPPORT   DISABLED

Definition at line 591 of file ssh.h.

◆ SSH_ENCRYPTED_KEY_SUPPORT

#define SSH_ENCRYPTED_KEY_SUPPORT   DISABLED

Definition at line 122 of file ssh.h.

◆ SSH_ETM_SUPPORT

#define SSH_ETM_SUPPORT   DISABLED

Definition at line 276 of file ssh.h.

◆ SSH_EXT_INFO_SUPPORT

#define SSH_EXT_INFO_SUPPORT   DISABLED

Definition at line 136 of file ssh.h.

◆ SSH_FLAG_BREAK

#define SSH_FLAG_BREAK (   c)    (SSH_FLAG_BREAK_CHAR | LSB(c))

Definition at line 934 of file ssh.h.

◆ SSH_GCM_CIPHER_SUPPORT

#define SSH_GCM_CIPHER_SUPPORT   ENABLED

Definition at line 304 of file ssh.h.

◆ SSH_GLOBAL_REQ_OK_EXT_SUPPORT

#define SSH_GLOBAL_REQ_OK_EXT_SUPPORT   DISABLED

Definition at line 150 of file ssh.h.

◆ SSH_HMAC_SUPPORT

#define SSH_HMAC_SUPPORT   ENABLED

Definition at line 741 of file ssh.h.

◆ SSH_HYBRID_KEX_SUPPORT

#define SSH_HYBRID_KEX_SUPPORT   DISABLED

Definition at line 556 of file ssh.h.

◆ SSH_IDEA_SUPPORT

#define SSH_IDEA_SUPPORT   DISABLED

Definition at line 353 of file ssh.h.

◆ SSH_KEX_STRICT_SUPPORT

#define SSH_KEX_STRICT_SUPPORT   ENABLED

Definition at line 157 of file ssh.h.

◆ SSH_KEY_LOG_SUPPORT

#define SSH_KEY_LOG_SUPPORT   DISABLED

Definition at line 661 of file ssh.h.

◆ SSH_KYBER1024_SUPPORT

#define SSH_KYBER1024_SUPPORT   DISABLED

Definition at line 654 of file ssh.h.

◆ SSH_KYBER512_SUPPORT

#define SSH_KYBER512_SUPPORT   DISABLED

Definition at line 640 of file ssh.h.

◆ SSH_KYBER768_SUPPORT

#define SSH_KYBER768_SUPPORT   DISABLED

Definition at line 647 of file ssh.h.

◆ SSH_MAX_AUTH_ATTEMPTS

#define SSH_MAX_AUTH_ATTEMPTS   10

Definition at line 227 of file ssh.h.

◆ SSH_MAX_CHANNEL_OPEN_CALLBACKS

#define SSH_MAX_CHANNEL_OPEN_CALLBACKS   1

Definition at line 206 of file ssh.h.

◆ SSH_MAX_CHANNEL_REQ_CALLBACKS

#define SSH_MAX_CHANNEL_REQ_CALLBACKS   3

Definition at line 199 of file ssh.h.

◆ SSH_MAX_CIPHER_BLOCK_SIZE

#define SSH_MAX_CIPHER_BLOCK_SIZE   AES_BLOCK_SIZE

Definition at line 759 of file ssh.h.

◆ SSH_MAX_CONN_CLOSE_CALLBACKS

#define SSH_MAX_CONN_CLOSE_CALLBACKS   1

Definition at line 220 of file ssh.h.

◆ SSH_MAX_CONN_OPEN_CALLBACKS

#define SSH_MAX_CONN_OPEN_CALLBACKS   1

Definition at line 213 of file ssh.h.

◆ SSH_MAX_CONNECTIONS

#define SSH_MAX_CONNECTIONS   10

Definition at line 185 of file ssh.h.

◆ SSH_MAX_DH_GEX_GROUPS

#define SSH_MAX_DH_GEX_GROUPS   2

Definition at line 675 of file ssh.h.

◆ SSH_MAX_DH_MODULUS_SIZE

#define SSH_MAX_DH_MODULUS_SIZE   3072

Definition at line 696 of file ssh.h.

◆ SSH_MAX_DH_SHARED_SECRET_LEN

#define SSH_MAX_DH_SHARED_SECRET_LEN   ((SSH_MAX_DH_MODULUS_SIZE + 47) / 8)

Definition at line 818 of file ssh.h.

◆ SSH_MAX_DSA_MODULUS_SIZE

#define SSH_MAX_DSA_MODULUS_SIZE   4096

Definition at line 724 of file ssh.h.

◆ SSH_MAX_ECDH_SHARED_SECRET_LEN

#define SSH_MAX_ECDH_SHARED_SECRET_LEN   71

Definition at line 825 of file ssh.h.

◆ SSH_MAX_ENC_KEY_SIZE

#define SSH_MAX_ENC_KEY_SIZE   64

Definition at line 752 of file ssh.h.

◆ SSH_MAX_GLOBAL_REQ_CALLBACKS

#define SSH_MAX_GLOBAL_REQ_CALLBACKS   3

Definition at line 192 of file ssh.h.

◆ SSH_MAX_HASH_DIGEST_SIZE

#define SSH_MAX_HASH_DIGEST_SIZE   SHA512_DIGEST_SIZE

Definition at line 796 of file ssh.h.

◆ SSH_MAX_HOST_KEYS

#define SSH_MAX_HOST_KEYS   3

Definition at line 178 of file ssh.h.

◆ SSH_MAX_HYBRID_SHARED_SECRET_LEN

#define SSH_MAX_HYBRID_SHARED_SECRET_LEN   68

Definition at line 836 of file ssh.h.

◆ SSH_MAX_ID_LEN

#define SSH_MAX_ID_LEN   80

Definition at line 248 of file ssh.h.

◆ SSH_MAX_MPINT_OVERHEAD

#define SSH_MAX_MPINT_OVERHEAD   5

Definition at line 870 of file ssh.h.

◆ SSH_MAX_PACKET_OVERHEAD

#define SSH_MAX_PACKET_OVERHEAD   128

Definition at line 872 of file ssh.h.

◆ SSH_MAX_PACKET_SIZE

#define SSH_MAX_PACKET_SIZE   2048

Definition at line 234 of file ssh.h.

◆ SSH_MAX_PASSWORD_CHANGE_PROMPT_LEN

#define SSH_MAX_PASSWORD_CHANGE_PROMPT_LEN   0

Definition at line 269 of file ssh.h.

◆ SSH_MAX_PASSWORD_LEN

#define SSH_MAX_PASSWORD_LEN   32

Definition at line 262 of file ssh.h.

◆ SSH_MAX_RSA_KEYS

#define SSH_MAX_RSA_KEYS   2

Definition at line 668 of file ssh.h.

◆ SSH_MAX_RSA_MODULUS_SIZE

#define SSH_MAX_RSA_MODULUS_SIZE   4096

Definition at line 710 of file ssh.h.

◆ SSH_MAX_RSA_SHARED_SECRET_LEN

#define SSH_MAX_RSA_SHARED_SECRET_LEN   ((SSH_MAX_RSA_MODULUS_SIZE + 47) / 8)

Definition at line 811 of file ssh.h.

◆ SSH_MAX_SHARED_SECRET_LEN

#define SSH_MAX_SHARED_SECRET_LEN   SSH_MAX_RSA_SHARED_SECRET_LEN

Definition at line 851 of file ssh.h.

◆ SSH_MAX_USERNAME_LEN

#define SSH_MAX_USERNAME_LEN   32

Definition at line 255 of file ssh.h.

◆ SSH_MD5_96_SUPPORT

#define SSH_MD5_96_SUPPORT   DISABLED

Definition at line 472 of file ssh.h.

◆ SSH_MD5_SUPPORT

#define SSH_MD5_SUPPORT   DISABLED

Definition at line 465 of file ssh.h.

◆ SSH_MIN_DH_MODULUS_SIZE

#define SSH_MIN_DH_MODULUS_SIZE   1024

Definition at line 682 of file ssh.h.

◆ SSH_MIN_DSA_MODULUS_SIZE

#define SSH_MIN_DSA_MODULUS_SIZE   1024

Definition at line 717 of file ssh.h.

◆ SSH_MIN_RSA_MODULUS_SIZE

#define SSH_MIN_RSA_MODULUS_SIZE   1024

Definition at line 703 of file ssh.h.

◆ SSH_NISTP256_SUPPORT

#define SSH_NISTP256_SUPPORT   ENABLED

Definition at line 598 of file ssh.h.

◆ SSH_NISTP384_SUPPORT

#define SSH_NISTP384_SUPPORT   ENABLED

Definition at line 605 of file ssh.h.

◆ SSH_NISTP521_SUPPORT

#define SSH_NISTP521_SUPPORT   ENABLED

Definition at line 612 of file ssh.h.

◆ SSH_PASSWORD_AUTH_SUPPORT

#define SSH_PASSWORD_AUTH_SUPPORT   ENABLED

Definition at line 115 of file ssh.h.

◆ SSH_PORT

#define SSH_PORT   22

Definition at line 865 of file ssh.h.

◆ SSH_PREFERRED_DH_MODULUS_SIZE

#define SSH_PREFERRED_DH_MODULUS_SIZE   2048

Definition at line 689 of file ssh.h.

◆ SSH_PUBLIC_KEY_AUTH_SUPPORT

#define SSH_PUBLIC_KEY_AUTH_SUPPORT   ENABLED

Definition at line 108 of file ssh.h.

◆ SSH_RC4_128_SUPPORT

#define SSH_RC4_128_SUPPORT   DISABLED

Definition at line 332 of file ssh.h.

◆ SSH_RC4_256_SUPPORT

#define SSH_RC4_256_SUPPORT   DISABLED

Definition at line 339 of file ssh.h.

◆ SSH_RC4_SUPPORT

#define SSH_RC4_SUPPORT   DISABLED

Definition at line 325 of file ssh.h.

◆ SSH_RFC5647_SUPPORT

#define SSH_RFC5647_SUPPORT   DISABLED

Definition at line 311 of file ssh.h.

◆ SSH_RIPEMD160_SUPPORT

#define SSH_RIPEMD160_SUPPORT   DISABLED

Definition at line 479 of file ssh.h.

◆ SSH_RSA_KEX_SUPPORT

#define SSH_RSA_KEX_SUPPORT   DISABLED

Definition at line 528 of file ssh.h.

◆ SSH_RSA_SIGN_SUPPORT

#define SSH_RSA_SIGN_SUPPORT   ENABLED

Definition at line 563 of file ssh.h.

◆ SSH_SEED_SUPPORT

#define SSH_SEED_SUPPORT   DISABLED

Definition at line 458 of file ssh.h.

◆ SSH_SERPENT_128_SUPPORT

#define SSH_SERPENT_128_SUPPORT   DISABLED

Definition at line 416 of file ssh.h.

◆ SSH_SERPENT_192_SUPPORT

#define SSH_SERPENT_192_SUPPORT   DISABLED

Definition at line 423 of file ssh.h.

◆ SSH_SERPENT_256_SUPPORT

#define SSH_SERPENT_256_SUPPORT   DISABLED

Definition at line 430 of file ssh.h.

◆ SSH_SERVER_SIG_ALGS_EXT_SUPPORT

#define SSH_SERVER_SIG_ALGS_EXT_SUPPORT   ENABLED

Definition at line 143 of file ssh.h.

◆ SSH_SERVER_SUPPORT

#define SSH_SERVER_SUPPORT   ENABLED

Definition at line 101 of file ssh.h.

◆ SSH_SHA1_96_SUPPORT

#define SSH_SHA1_96_SUPPORT   DISABLED

Definition at line 493 of file ssh.h.

◆ SSH_SHA1_SUPPORT

#define SSH_SHA1_SUPPORT   ENABLED

Definition at line 486 of file ssh.h.

◆ SSH_SHA224_SUPPORT

#define SSH_SHA224_SUPPORT   DISABLED

Definition at line 500 of file ssh.h.

◆ SSH_SHA256_SUPPORT

#define SSH_SHA256_SUPPORT   ENABLED

Definition at line 507 of file ssh.h.

◆ SSH_SHA384_SUPPORT

#define SSH_SHA384_SUPPORT   ENABLED

Definition at line 514 of file ssh.h.

◆ SSH_SHA512_SUPPORT

#define SSH_SHA512_SUPPORT   ENABLED

Definition at line 521 of file ssh.h.

◆ SSH_SIGN_CALLBACK_SUPPORT

#define SSH_SIGN_CALLBACK_SUPPORT   DISABLED

Definition at line 164 of file ssh.h.

◆ SSH_SNTRUP761_SUPPORT

#define SSH_SNTRUP761_SUPPORT   DISABLED

Definition at line 633 of file ssh.h.

◆ SSH_STREAM_CIPHER_SUPPORT

#define SSH_STREAM_CIPHER_SUPPORT   DISABLED

Definition at line 283 of file ssh.h.

◆ SSH_SUPPORT

#define SSH_SUPPORT   ENABLED

Definition at line 87 of file ssh.h.

◆ SSH_TWOFISH_128_SUPPORT

#define SSH_TWOFISH_128_SUPPORT   DISABLED

Definition at line 395 of file ssh.h.

◆ SSH_TWOFISH_192_SUPPORT

#define SSH_TWOFISH_192_SUPPORT   DISABLED

Definition at line 402 of file ssh.h.

◆ SSH_TWOFISH_256_SUPPORT

#define SSH_TWOFISH_256_SUPPORT   DISABLED

Definition at line 409 of file ssh.h.

◆ sshAllocMem

#define sshAllocMem (   size)    osAllocMem(size)

Definition at line 731 of file ssh.h.

◆ SshChannel

#define SshChannel   struct _SshChannel

Definition at line 887 of file ssh.h.

◆ SshConnection

#define SshConnection   struct _SshConnection

Definition at line 883 of file ssh.h.

◆ SshContext

#define SshContext   struct _SshContext

Definition at line 879 of file ssh.h.

◆ sshFreeMem

#define sshFreeMem (   p)    osFreeMem(p)

Definition at line 736 of file ssh.h.

Typedef Documentation

◆ SshCaPublicKeyVerifyCallback

typedef error_t(* SshCaPublicKeyVerifyCallback) (SshConnection *connection, const uint8_t *publicKey, size_t publicKeyLen)

CA public key verification callback function.

Definition at line 1197 of file ssh.h.

◆ SshCertAuthCallback

typedef error_t(* SshCertAuthCallback) (SshConnection *connection, const char_t *user, const SshCertificate *cert)

Certificate authentication callback function.

Definition at line 1213 of file ssh.h.

◆ SshCertVerifyCallback

typedef error_t(* SshCertVerifyCallback) (SshConnection *connection, const SshCertificate *cert)

Certificate verification callback function.

Definition at line 1189 of file ssh.h.

◆ SshChannelOpenCallback

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.

Definition at line 1291 of file ssh.h.

◆ SshChannelReqCallback

typedef error_t(* SshChannelReqCallback) (SshChannel *channel, const SshString *type, const uint8_t *data, size_t length, void *param)

Channel request callback function.

Definition at line 1283 of file ssh.h.

◆ SshConnectionCloseCallback

typedef void(* SshConnectionCloseCallback) (SshConnection *connection, void *param)

Connection close callback function.

Definition at line 1308 of file ssh.h.

◆ SshConnectionOpenCallback

typedef error_t(* SshConnectionOpenCallback) (SshConnection *connection, void *param)

Connection open callback function.

Definition at line 1300 of file ssh.h.

◆ SshEcdhKeyPairGenCallback

typedef error_t(* SshEcdhKeyPairGenCallback) (SshConnection *connection, const char_t *kexAlgo, EcPublicKey *publicKey)

ECDH key pair generation callback.

Definition at line 1258 of file ssh.h.

◆ SshEcdhSharedSecretCalcCallback

typedef error_t(* SshEcdhSharedSecretCalcCallback) (SshConnection *connection, const char_t *kexAlgo, const EcPublicKey *publicKey, uint8_t *output, size_t *outputLen)

ECDH shared secret calculation callback.

Definition at line 1266 of file ssh.h.

◆ SshGlobalReqCallback

typedef error_t(* SshGlobalReqCallback) (SshConnection *connection, const SshString *name, const uint8_t *data, size_t length, void *param)

Global request callback function.

Definition at line 1275 of file ssh.h.

◆ SshHostKeyVerifyCallback

typedef error_t(* SshHostKeyVerifyCallback) (SshConnection *connection, const uint8_t *hostKey, size_t hostKeyLen)

Host key verification callback function.

Definition at line 1181 of file ssh.h.

◆ SshKeyLogCallback

typedef void(* SshKeyLogCallback) (SshConnection *connection, const char_t *key)

Key logging callback function (for debugging purpose only)

Definition at line 1316 of file ssh.h.

◆ SshPasswordAuthCallback

typedef SshAuthStatus(* SshPasswordAuthCallback) (SshConnection *connection, const char_t *user, const char_t *password, size_t passwordLen)

Password authentication callback function.

Definition at line 1221 of file ssh.h.

◆ SshPasswordChangeCallback

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.

Definition at line 1229 of file ssh.h.

◆ SshPublicKeyAuthCallback

typedef error_t(* SshPublicKeyAuthCallback) (SshConnection *connection, const char_t *user, const uint8_t *publicKey, size_t publicKeyLen)

Public key authentication callback function.

Definition at line 1205 of file ssh.h.

◆ 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)

Signature generation callback function.

Definition at line 1238 of file ssh.h.

◆ SshSignVerifyCallback

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.

Definition at line 1248 of file ssh.h.

Enumeration Type Documentation

◆ SshAuthStatus

Authentication status.

Enumerator
SSH_AUTH_STATUS_FAILURE 
SSH_AUTH_STATUS_SUCCESS 
SSH_AUTH_STATUS_PASSWORD_EXPIRED 

Definition at line 910 of file ssh.h.

◆ SshChannelEvent

SSH channel events.

Enumerator
SSH_CHANNEL_EVENT_TIMEOUT 
SSH_CHANNEL_EVENT_CONNECTED 
SSH_CHANNEL_EVENT_CLOSED 
SSH_CHANNEL_EVENT_TX_READY 
SSH_CHANNEL_EVENT_TX_DONE 
SSH_CHANNEL_EVENT_TX_ACKED 
SSH_CHANNEL_EVENT_TX_SHUTDOWN 
SSH_CHANNEL_EVENT_RX_READY 
SSH_CHANNEL_EVENT_RX_SHUTDOWN 

Definition at line 1106 of file ssh.h.

◆ SshChannelFlags

Flags used by read and write functions.

Enumerator
SSH_FLAG_EOF 
SSH_FLAG_WAIT_ALL 
SSH_FLAG_BREAK_CHAR 
SSH_FLAG_BREAK_CRLF 
SSH_FLAG_NO_DELAY 
SSH_FLAG_DELAY 

Definition at line 922 of file ssh.h.

◆ SshChannelState

SSH channel state.

Enumerator
SSH_CHANNEL_STATE_UNUSED 
SSH_CHANNEL_STATE_RESERVED 
SSH_CHANNEL_STATE_OPEN 
SSH_CHANNEL_STATE_CLOSED 

Definition at line 1080 of file ssh.h.

◆ SshConnectionState

SSH connection state.

Enumerator
SSH_CONN_STATE_CLOSED 
SSH_CONN_STATE_CLIENT_ID 
SSH_CONN_STATE_SERVER_ID 
SSH_CONN_STATE_CLIENT_KEX_INIT 
SSH_CONN_STATE_SERVER_KEX_INIT 
SSH_CONN_STATE_KEX_RSA_PUB_KEY 
SSH_CONN_STATE_KEX_RSA_SECRET 
SSH_CONN_STATE_KEX_RSA_DONE 
SSH_CONN_STATE_KEX_DH_INIT 
SSH_CONN_STATE_KEX_DH_REPLY 
SSH_CONN_STATE_KEX_DH_GEX_REQUEST 
SSH_CONN_STATE_KEX_DH_GEX_GROUP 
SSH_CONN_STATE_KEX_DH_GEX_INIT 
SSH_CONN_STATE_KEX_DH_GEX_REPLY 
SSH_CONN_STATE_KEX_ECDH_INIT 
SSH_CONN_STATE_KEX_ECDH_REPLY 
SSH_CONN_STATE_KEX_HYBRID_INIT 
SSH_CONN_STATE_KEX_HYBRID_REPLY 
SSH_CONN_STATE_CLIENT_NEW_KEYS 
SSH_CONN_STATE_SERVER_NEW_KEYS 
SSH_CONN_STATE_CLIENT_EXT_INFO 
SSH_CONN_STATE_SERVER_EXT_INFO_1 
SSH_CONN_STATE_SERVER_EXT_INFO_2 
SSH_CONN_STATE_SERVICE_REQUEST 
SSH_CONN_STATE_SERVICE_ACCEPT 
SSH_CONN_STATE_USER_AUTH_BANNER 
SSH_CONN_STATE_USER_AUTH_REQUEST 
SSH_CONN_STATE_USER_AUTH_REPLY 
SSH_CONN_STATE_USER_AUTH_SUCCESS 
SSH_CONN_STATE_OPEN 
SSH_CONN_STATE_DISCONNECT 

Definition at line 1040 of file ssh.h.

◆ SshDisconnectReasonCode

Disconnection messages reason codes.

Enumerator
SSH_DISCONNECT_HOST_NOT_ALLOWED_TO_CONNECT 
SSH_DISCONNECT_PROTOCOL_ERROR 
SSH_DISCONNECT_KEY_EXCHANGE_FAILED 
SSH_DISCONNECT_RESERVED 
SSH_DISCONNECT_MAC_ERROR 
SSH_DISCONNECT_COMPRESSION_ERROR 
SSH_DISCONNECT_SERVICE_NOT_AVAILABLE 
SSH_DISCONNECT_PROTOCOL_VERSION_NOT_SUPPORTED 
SSH_DISCONNECT_HOST_KEY_NOT_VERIFIABLE 
SSH_DISCONNECT_CONNECTION_LOST 
SSH_DISCONNECT_BY_APPLICATION 
SSH_DISCONNECT_TOO_MANY_CONNECTIONS 
SSH_DISCONNECT_AUTH_CANCELLED_BY_USER 
SSH_DISCONNECT_NO_MORE_AUTH_METHODS_AVAILABLE 
SSH_DISCONNECT_ILLEGAL_USER_NAME 

Definition at line 1003 of file ssh.h.

◆ SshMessageType

SSH message types.

Enumerator
SSH_MSG_INVALID 
SSH_MSG_DISCONNECT 
SSH_MSG_IGNORE 
SSH_MSG_UNIMPLEMENTED 
SSH_MSG_DEBUG 
SSH_MSG_SERVICE_REQUEST 
SSH_MSG_SERVICE_ACCEPT 
SSH_MSG_EXT_INFO 
SSH_MSG_NEWCOMPRESS 
SSH_MSG_KEXINIT 
SSH_MSG_NEWKEYS 
SSH_MSG_KEX_MIN 
SSH_MSG_KEX_MAX 
SSH_MSG_KEXRSA_PUBKEY 
SSH_MSG_KEXRSA_SECRET 
SSH_MSG_KEXRSA_DONE 
SSH_MSG_KEX_DH_INIT 
SSH_MSG_KEX_DH_REPLY 
SSH_MSG_KEX_DH_GEX_REQUEST_OLD 
SSH_MSG_KEX_DH_GEX_REQUEST 
SSH_MSG_KEX_DH_GEX_GROUP 
SSH_MSG_KEX_DH_GEX_INIT 
SSH_MSG_KEX_DH_GEX_REPLY 
SSH_MSG_KEX_ECDH_INIT 
SSH_MSG_KEX_ECDH_REPLY 
SSH_MSG_KEX_HYBRID_INIT 
SSH_MSG_KEX_HYBRID_REPLY 
SSH_MSG_USERAUTH_REQUEST 
SSH_MSG_USERAUTH_FAILURE 
SSH_MSG_USERAUTH_SUCCESS 
SSH_MSG_USERAUTH_BANNER 
SSH_MSG_USERAUTH_MIN 
SSH_MSG_USERAUTH_MAX 
SSH_MSG_USERAUTH_PK_OK 
SSH_MSG_USERAUTH_PASSWD_CHANGEREQ 
SSH_MSG_USERAUTH_INFO_REQUEST 
SSH_MSG_USERAUTH_INFO_RESPONSE 
SSH_MSG_GLOBAL_REQUEST 
SSH_MSG_REQUEST_SUCCESS 
SSH_MSG_REQUEST_FAILURE 
SSH_MSG_CHANNEL_OPEN 
SSH_MSG_CHANNEL_OPEN_CONFIRMATION 
SSH_MSG_CHANNEL_OPEN_FAILURE 
SSH_MSG_CHANNEL_WINDOW_ADJUST 
SSH_MSG_CHANNEL_DATA 
SSH_MSG_CHANNEL_EXTENDED_DATA 
SSH_MSG_CHANNEL_EOF 
SSH_MSG_CHANNEL_CLOSE 
SSH_MSG_CHANNEL_REQUEST 
SSH_MSG_CHANNEL_SUCCESS 
SSH_MSG_CHANNEL_FAILURE 
SSH_MSG_PING 
SSH_MSG_PONG 

Definition at line 941 of file ssh.h.

◆ SshOpenFailureReasonCode

Channel connection failure reason codes.

Enumerator
SSH_OPEN_ADMINISTRATIVELY_PROHIBITED 
SSH_OPEN_CONNECT_FAILED 
SSH_OPEN_UNKNOWN_CHANNEL_TYPE 
SSH_OPEN_RESOURCE_SHORTAGE 

Definition at line 1027 of file ssh.h.

◆ SshOperationMode

Mode of operation.

Enumerator
SSH_OPERATION_MODE_CLIENT 
SSH_OPERATION_MODE_SERVER 

Definition at line 899 of file ssh.h.

◆ SshRequestState

SSH request states.

Enumerator
SSH_REQUEST_STATE_IDLE 
SSH_REQUEST_STATE_PENDING 
SSH_REQUEST_STATE_SUCCESS 
SSH_REQUEST_STATE_FAILURE 

Definition at line 1093 of file ssh.h.

Function Documentation

◆ sshCloseChannel()

error_t sshCloseChannel ( SshChannel channel)

Close channel.

Parameters
[in]channelSSH channel handle
Returns
Error code

Definition at line 2465 of file ssh.c.

◆ sshCreateChannel()

SshChannel* sshCreateChannel ( SshConnection connection)

Create a new SSH channel.

Parameters
[in]connectionPointer to the SSH connection
Returns
Handle referencing the newly created SSH channel

Definition at line 1964 of file ssh.c.

◆ sshDeinit()

void sshDeinit ( SshContext context)

Release SSH context.

Parameters
[in]contextPointer to the SSH context

Definition at line 2556 of file ssh.c.

◆ sshDeleteChannel()

void sshDeleteChannel ( SshChannel channel)

Release channel.

Parameters
[in]channelSSH channel handle

Definition at line 2536 of file ssh.c.

◆ sshInit()

error_t sshInit ( SshContext context,
SshConnection connections,
uint_t  numConnections,
SshChannel channels,
uint_t  numChannels 
)

SSH context initialization.

Parameters
[in]contextPointer to the SSH context
[in]connectionsSSH connections
[in]numConnectionsMaximum number of SSH connections
[in]channelsSSH channels
[in]numChannelsMaximum number of SSH channels
Returns
Error code

Definition at line 58 of file ssh.c.

◆ 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]contextPointer to the SSH context
[in]indexZero-based index identifying a slot
[in]certCertificate (OpenSSH format). This parameter is taken as reference
[in]certLenLength of the certificate
[in]privateKeyPrivate key (PEM or OpenSSH format). This parameter is taken as reference
[in]privateKeyLenLength of the private key
[in]passwordNULL-terminated string containing the password. This parameter is required if the private key is encrypted
Returns
Error code

Definition at line 1682 of file ssh.c.

◆ sshLoadDhGexGroup()

error_t sshLoadDhGexGroup ( SshContext context,
uint_t  index,
const char_t dhParams,
size_t  dhParamsLen 
)

Load Diffie-Hellman group.

Parameters
[in]contextPointer to the SSH context
[in]indexZero-based index identifying a slot
[in]dhParamsDiffie-Hellman parameters (PEM format). This parameter is taken as reference
[in]dhParamsLenLength of the Diffie-Hellman parameters
Returns
Error code

Definition at line 1234 of file ssh.c.

◆ 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]contextPointer to the SSH context
[in]indexZero-based index identifying a slot
[in]publicKeyPublic key (PEM, SSH2 or OpenSSH format). This parameter is taken as reference
[in]publicKeyLenLength of the public key
[in]privateKeyPrivate key (PEM or OpenSSH format). This parameter is taken as reference
[in]privateKeyLenLength of the private key
[in]passwordNULL-terminated string containing the password. This parameter is required if the private key is encrypted
Returns
Error code

Definition at line 1353 of file ssh.c.

◆ 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]contextPointer to the SSH context
[in]indexZero-based index identifying a slot
[in]publicKeyRSA public key (PEM, SSH2 or OpenSSH format). This parameter is taken as reference
[in]publicKeyLenLength of the RSA public key
[in]privateKeyRSA private key (PEM or OpenSSH format). This parameter is taken as reference
[in]passwordNULL-terminated string containing the password. This parameter is required if the private key is encrypted
[in]privateKeyLenLength of the RSA private key
Returns
Error code

Definition at line 1087 of file ssh.c.

◆ 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]eventDescSet of entries specifying the events the user is interested in
[in]sizeNumber of entries in the descriptor set
[in]extEventExternal event that can abort the wait if necessary (optional)
[in]timeoutMaximum time to wait before returning
Returns
Error code

Definition at line 2376 of file ssh.c.

◆ 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]channelSSH channel handle
[out]dataBuffer where to store the incoming data
[in]sizeMaximum number of bytes that can be received
[out]receivedNumber of bytes that have been received
[in]flagsSet of flags that influences the behavior of this function
Returns
Error code

Definition at line 2180 of file ssh.c.

◆ sshRegisterCaPublicKeyVerifyCallback()

error_t sshRegisterCaPublicKeyVerifyCallback ( SshContext context,
SshCaPublicKeyVerifyCallback  callback 
)

Register CA public key verification callback function.

Parameters
[in]contextPointer to the SSH context
[in]callbackCA public key verification callback function
Returns
Error code

Definition at line 338 of file ssh.c.

◆ sshRegisterCertAuthCallback()

error_t sshRegisterCertAuthCallback ( SshContext context,
SshCertAuthCallback  callback 
)

Register certificate authentication callback function.

Parameters
[in]contextPointer to the SSH context
[in]callbackCertificate authentication callback function
Returns
Error code

Definition at line 400 of file ssh.c.

◆ sshRegisterCertVerifyCallback()

error_t sshRegisterCertVerifyCallback ( SshContext context,
SshCertVerifyCallback  callback 
)

Register certificate verification callback function.

Parameters
[in]contextPointer to the SSH context
[in]callbackCertificate verification callback function
Returns
Error code

Definition at line 307 of file ssh.c.

◆ sshRegisterChannelOpenCallback()

error_t sshRegisterChannelOpenCallback ( SshContext context,
SshChannelOpenCallback  callback,
void *  param 
)

Register channel open callback function.

Parameters
[in]contextPointer to the SSH context
[in]callbackChannel open callback function
[in]paramAn opaque pointer passed to the callback function
Returns
Error code

Definition at line 792 of file ssh.c.

◆ sshRegisterChannelRequestCallback()

error_t sshRegisterChannelRequestCallback ( SshContext context,
SshChannelReqCallback  callback,
void *  param 
)

Register channel request callback function.

Parameters
[in]contextPointer to the SSH context
[in]callbackChannel request callback function
[in]paramAn opaque pointer passed to the callback function
Returns
Error code

Definition at line 705 of file ssh.c.

◆ sshRegisterConnectionCloseCallback()

error_t sshRegisterConnectionCloseCallback ( SshContext context,
SshConnectionCloseCallback  callback,
void *  param 
)

Register connection close callback function.

Parameters
[in]contextPointer to the SSH context
[in]callbackConnection close callback function
[in]paramAn opaque pointer passed to the callback function
Returns
Error code

Definition at line 966 of file ssh.c.

◆ sshRegisterConnectionOpenCallback()

error_t sshRegisterConnectionOpenCallback ( SshContext context,
SshConnectionOpenCallback  callback,
void *  param 
)

Register connection open callback function.

Parameters
[in]contextPointer to the SSH context
[in]callbackConnection open callback function
[in]paramAn opaque pointer passed to the callback function
Returns
Error code

Definition at line 879 of file ssh.c.

◆ sshRegisterEcdhKeyPairGenCallback()

error_t sshRegisterEcdhKeyPairGenCallback ( SshContext context,
SshEcdhKeyPairGenCallback  callback 
)

Register ECDH key pair generation callback function.

Parameters
[in]contextPointer to the SSH context
[in]callbackECDH key pair generation callback function
Returns
Error code

Definition at line 555 of file ssh.c.

◆ sshRegisterEcdhSharedSecretCalcCallback()

error_t sshRegisterEcdhSharedSecretCalcCallback ( SshContext context,
SshEcdhSharedSecretCalcCallback  callback 
)

Register ECDH shared secret calculation callback function.

Parameters
[in]contextPointer to the SSH context
[in]callbackECDH shared secret calculation callback function
Returns
Error code

Definition at line 586 of file ssh.c.

◆ sshRegisterGlobalRequestCallback()

error_t sshRegisterGlobalRequestCallback ( SshContext context,
SshGlobalReqCallback  callback,
void *  param 
)

Register global request callback function.

Parameters
[in]contextPointer to the SSH context
[in]callbackGlobal request callback function
[in]paramAn opaque pointer passed to the callback function
Returns
Error code

Definition at line 618 of file ssh.c.

◆ sshRegisterHostKeyVerifyCallback()

error_t sshRegisterHostKeyVerifyCallback ( SshContext context,
SshHostKeyVerifyCallback  callback 
)

Register host key verification callback function.

Parameters
[in]contextPointer to the SSH context
[in]callbackHost key verification callback function
Returns
Error code

Definition at line 281 of file ssh.c.

◆ sshRegisterKeyLogCallback()

error_t sshRegisterKeyLogCallback ( SshContext context,
SshKeyLogCallback  callback 
)

Register key logging callback function (for debugging purpose only)

Parameters
[in]contextPointer to the SSH context
[in]callbackKey logging callback function
Returns
Error code

Definition at line 1052 of file ssh.c.

◆ sshRegisterPasswordAuthCallback()

error_t sshRegisterPasswordAuthCallback ( SshContext context,
SshPasswordAuthCallback  callback 
)

Register password authentication callback function.

Parameters
[in]contextPointer to the SSH context
[in]callbackPassword authentication callback function
Returns
Error code

Definition at line 431 of file ssh.c.

◆ sshRegisterPasswordChangeCallback()

error_t sshRegisterPasswordChangeCallback ( SshContext context,
SshPasswordChangeCallback  callback 
)

Register password change callback function.

Parameters
[in]contextPointer to the SSH context
[in]callbackPassword change callback function
Returns
Error code

Definition at line 462 of file ssh.c.

◆ sshRegisterPublicKeyAuthCallback()

error_t sshRegisterPublicKeyAuthCallback ( SshContext context,
SshPublicKeyAuthCallback  callback 
)

Register public key authentication callback function.

Parameters
[in]contextPointer to the SSH context
[in]callbackPublic key authentication callback function
Returns
Error code

Definition at line 369 of file ssh.c.

◆ sshRegisterSignGenCallback()

error_t sshRegisterSignGenCallback ( SshContext context,
SshSignGenCallback  callback 
)

Register signature generation callback function.

Parameters
[in]contextPointer to the SSH context
[in]callbackSignature generation callback function
Returns
Error code

Definition at line 493 of file ssh.c.

◆ sshRegisterSignVerifyCallback()

error_t sshRegisterSignVerifyCallback ( SshContext context,
SshSignVerifyCallback  callback 
)

Register signature verification callback function.

Parameters
[in]contextPointer to the SSH context
[in]callbackSignature verification callback function
Returns
Error code

Definition at line 524 of file ssh.c.

◆ sshSetChannelTimeout()

error_t sshSetChannelTimeout ( SshChannel channel,
systime_t  timeout 
)

Set timeout for read/write operations.

Parameters
[in]channelSSH channel handle
[in]timeoutMaximum time to wait
Returns
Error code

Definition at line 2027 of file ssh.c.

◆ sshSetOperationMode()

error_t sshSetOperationMode ( SshContext context,
SshOperationMode  mode 
)

Set operation mode (client or server)

Parameters
[in]contextPointer to the SSH context
[in]modeSpecifies whether this entity is considered a client or a server
Returns
Error code

Definition at line 167 of file ssh.c.

◆ sshSetPassword()

error_t sshSetPassword ( SshContext context,
const char_t password 
)

Set the password to be used for authentication.

Parameters
[in]contextPointer to the SSH context
[in]passwordNULL-terminated string containing the password
Returns
Error code

Definition at line 251 of file ssh.c.

◆ sshSetPasswordChangePrompt()

error_t sshSetPasswordChangePrompt ( SshConnection connection,
const char_t prompt 
)

Set password change prompt message.

Parameters
[in]connectionPointer to the SSH connection
[in]promptNULL-terminated string containing the prompt message
Returns
Error code

Definition at line 1934 of file ssh.c.

◆ sshSetPrng()

error_t sshSetPrng ( SshContext context,
const PrngAlgo prngAlgo,
void *  prngContext 
)

Set the pseudo-random number generator to be used.

Parameters
[in]contextPointer to the SSH context
[in]prngAlgoPRNG algorithm
[in]prngContextPointer to the PRNG context
Returns
Error code

Definition at line 193 of file ssh.c.

◆ sshSetUsername()

error_t sshSetUsername ( SshContext context,
const char_t username 
)

Set the user name to be used for authentication.

Parameters
[in]contextPointer to the SSH context
[in]usernameNULL-terminated string containing the user name
Returns
Error code

Definition at line 221 of file ssh.c.

◆ sshUnloadCertificate()

error_t sshUnloadCertificate ( SshContext context,
uint_t  index 
)

Unload entity's certificate.

Parameters
[in]contextPointer to the SSH context
[in]indexZero-based index identifying a slot
Returns
Error code

Definition at line 1874 of file ssh.c.

◆ sshUnloadDhGexGroup()

error_t sshUnloadDhGexGroup ( SshContext context,
uint_t  index 
)

Unload Diffie-Hellman group.

Parameters
[in]contextPointer to the SSH context
[in]indexZero-based index identifying a slot
Returns
Error code

Definition at line 1311 of file ssh.c.

◆ sshUnloadHostKey()

error_t sshUnloadHostKey ( SshContext context,
uint_t  index 
)

Unload entity's host key.

Parameters
[in]contextPointer to the SSH context
[in]indexZero-based index identifying a slot
Returns
Error code

Definition at line 1619 of file ssh.c.

◆ sshUnloadRsaKey()

error_t sshUnloadRsaKey ( SshContext context,
uint_t  index 
)

Unload transient RSA key (for RSA key exchange)

Parameters
[in]contextPointer to the SSH context
[in]indexZero-based index identifying a slot
Returns
Error code

Definition at line 1197 of file ssh.c.

◆ sshUnregisterChannelOpenCallback()

error_t sshUnregisterChannelOpenCallback ( SshContext context,
SshChannelOpenCallback  callback 
)

Unregister channel open callback function.

Parameters
[in]contextPointer to the SSH context
[in]callbackPreviously registered callback function
Returns
Error code

Definition at line 839 of file ssh.c.

◆ sshUnregisterChannelRequestCallback()

error_t sshUnregisterChannelRequestCallback ( SshContext context,
SshChannelReqCallback  callback 
)

Unregister channel request callback function.

Parameters
[in]contextPointer to the SSH context
[in]callbackPreviously registered callback function
Returns
Error code

Definition at line 752 of file ssh.c.

◆ sshUnregisterConnectionCloseCallback()

error_t sshUnregisterConnectionCloseCallback ( SshContext context,
SshConnectionCloseCallback  callback 
)

Unregister connection close callback function.

Parameters
[in]contextPointer to the SSH context
[in]callbackPreviously registered callback function
Returns
Error code

Definition at line 1013 of file ssh.c.

◆ sshUnregisterConnectionOpenCallback()

error_t sshUnregisterConnectionOpenCallback ( SshContext context,
SshConnectionOpenCallback  callback 
)

Unregister connection open callback function.

Parameters
[in]contextPointer to the SSH context
[in]callbackPreviously registered callback function
Returns
Error code

Definition at line 926 of file ssh.c.

◆ sshUnregisterGlobalRequestCallback()

error_t sshUnregisterGlobalRequestCallback ( SshContext context,
SshGlobalReqCallback  callback 
)

Unregister global request callback function.

Parameters
[in]contextPointer to the SSH context
[in]callbackPreviously registered callback function
Returns
Error code

Definition at line 665 of file ssh.c.

◆ 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]channelSSH channel handle
[in]dataPointer to the buffer containing the data to be transmitted
[in]lengthNumber of data bytes to send
[out]writtenActual number of bytes written (optional parameter)
[in]flagsSet of flags that influences the behavior of this function
Returns
Error code

Definition at line 2051 of file ssh.c.