Skip to content
Snippets Groups Projects
Commit 5ff13620 authored by Deucе's avatar Deucе :ok_hand_tone4:
Browse files

And add the hooks for the rest of the transport stuff

Should be possible to implement the hard stuff now, though it won't
actually be testable until the KEX bits exist too.

Smooth sailing after that though.
parent abac966e
No related branches found
No related tags found
No related merge requests found
Pipeline #7344 passed
......@@ -9,14 +9,52 @@ typedef struct deuce_ssh_transport_global_config {
atomic_bool used;
const char *software_version;
const char *version_comment;
size_t kex_entries;
char **kex_name;
deuce_ssh_kex_handler_t *kex_handler;
deuce_ssh_kex_cleanup_t *kex_cleanup;
int (*tx)(uint8_t *buf, size_t bufsz, atomic_bool *terminate, void *cbdata);
int (*rx)(uint8_t *buf, size_t bufsz, atomic_bool *terminate, void *cbdata);
int (*rx_line)(uint8_t *buf, size_t bufsz, size_t *bytes_received, atomic_bool *terminate, void *cbdata);
int (*extra_line_cb)(uint8_t *buf, size_t bufsz, void *cbdata);
size_t kex_entries;
char **kex_name;
uint32_t *kex_flags;
deuce_ssh_kex_handler_t *kex_handler;
deuce_ssh_kex_cleanup_t *kex_cleanup;
size_t key_algo_entries;
char **key_algo_name;
uint32_t *key_algo_flags;
deuce_ssh_key_algo_sign_t *key_algo_sign;
deuce_ssh_key_algo_haskey_t *key_algo_haskey;
deuce_ssh_key_algo_cleanup_t *key_algo_cleanup;
size_t enc_entries;
char **enc_name;
uint32_t *enc_flags;
uint16_t *enc_blocksize;
uint16_t *enc_key_size;
deuce_ssh_enc_encrypt_t *enc_encrypt;
deuce_ssh_enc_decrypt_t *enc_decrypt;
deuce_ssh_enc_cleanup_t *enc_cleanup;
size_t mac_entries;
char **mac_name;
uint16_t *mac_digest_size;
uint16_t *mac_key_size;
deuce_ssh_mac_generate_t *mac_generate;
deuce_ssh_mac_cleanup_t *mac_cleanup;
size_t comp_entries;
char **comp_name;
uint32_t *comp_flags;
uint16_t *comp_blocksize;
uint16_t *comp_key_size;
deuce_ssh_comp_compress_t *comp_compress;
deuce_ssh_comp_uncompress_t *comp_uncompress;
deuce_ssh_comp_cleanup_t *comp_cleanup;
size_t lang_entries;
char **lang_name;
} *deuce_ssh_transport_global_config_t;
static const char * const sw_ver = "DeuceSSH-0.0";
......@@ -175,10 +213,36 @@ deuce_ssh_transport_cleanup(deuce_ssh_session_t sess)
gconf.kex_cleanup[sess->trans->kex_selected](sess);
sess->trans->kex_selected = SIZE_MAX;
}
if (sess->trans->key_algo_selected != SIZE_MAX) {
if (gconf.key_algo_cleanup[sess->trans->key_algo_selected] != NULL)
gconf.key_algo_cleanup[sess->trans->key_algo_selected](sess);
sess->trans->key_algo_selected = SIZE_MAX;
}
if (sess->trans->enc_selected != SIZE_MAX) {
if (gconf.enc_cleanup[sess->trans->enc_selected] != NULL)
gconf.enc_cleanup[sess->trans->enc_selected](sess);
sess->trans->enc_selected = SIZE_MAX;
}
if (sess->trans->mac_selected != SIZE_MAX) {
if (gconf.mac_cleanup[sess->trans->mac_selected] != NULL)
gconf.mac_cleanup[sess->trans->mac_selected](sess);
sess->trans->mac_selected = SIZE_MAX;
}
if (sess->trans->comp_selected != SIZE_MAX) {
if (gconf.comp_cleanup[sess->trans->comp_selected] != NULL)
gconf.comp_cleanup[sess->trans->comp_selected](sess);
sess->trans->comp_selected = SIZE_MAX;
}
free(sess->remote_software_version);
sess->remote_software_version = NULL;
free(sess->remote_version_comment);
sess->remote_version_comment = NULL;
if (sess->remote_languages) {
for (size_t i = 0; sess->remote_languages[i]; i++)
free(sess->remote_languages[i]);
free(sess->remote_languages);
sess->remote_languages = NULL;
}
}
int
......@@ -202,45 +266,253 @@ deuce_ssh_transport_init(deuce_ssh_session_t sess)
return res;
}
sess->trans->kex_selected = SIZE_MAX;
sess->trans->kex_state = 0;
sess->trans->key_algo_selected = SIZE_MAX;
sess->trans->transport_thread = thrd;
return 0;
}
int
deuce_ssh_transport_register_kex(const char *name, deuce_ssh_kex_handler_t kex_handler, deuce_ssh_kex_cleanup_t kex_cleanup)
deuce_ssh_transport_register_kex(const char *name, uint32_t kex_flags, deuce_ssh_kex_handler_t kex_handler, deuce_ssh_kex_cleanup_t kex_cleanup)
{
if (gconf.used)
return DEUCE_SSH_ERROR_TOOLATE;
if (gconf.kex_entries + 1 == SIZE_MAX)
return DEUCE_SSH_ERROR_TOOMANY;
char **newnames = realloc(gconf.kex_name, sizeof(gconf.kex_name[0]) * (gconf.kex_entries + 1));
if (newnames == NULL)
uint32_t *newflags = realloc(gconf.kex_flags, sizeof(gconf.kex_flags[0]) * (gconf.kex_entries + 1));
if (newflags == NULL)
return DEUCE_SSH_ERROR_ALLOC;
gconf.kex_name = newnames;
gconf.kex_name[gconf.kex_entries] = strdup(name);
gconf.kex_flags = newflags;
gconf.kex_flags[gconf.kex_entries] = kex_flags;
deuce_ssh_kex_handler_t *newhandlers = realloc(gconf.kex_handler, sizeof(gconf.kex_handler[0]) * (gconf.kex_entries + 1));
if (newhandlers == NULL) {
free(gconf.kex_name[gconf.kex_entries]);
if (newhandlers == NULL)
return DEUCE_SSH_ERROR_ALLOC;
}
gconf.kex_handler = newhandlers;
gconf.kex_handler[gconf.kex_entries] = kex_handler;
deuce_ssh_kex_cleanup_t *newcleanup = realloc(gconf.kex_cleanup, sizeof(gconf.kex_cleanup[0]) * (gconf.kex_entries + 1));
if (newcleanup == NULL) {
free(gconf.kex_name[gconf.kex_entries]);
if (newcleanup == NULL)
return DEUCE_SSH_ERROR_ALLOC;
}
gconf.kex_cleanup = newcleanup;
gconf.kex_cleanup[gconf.kex_entries] = kex_cleanup;
char **newnames = realloc(gconf.kex_name, sizeof(gconf.kex_name[0]) * (gconf.kex_entries + 1));
if (newnames == NULL)
return DEUCE_SSH_ERROR_ALLOC;
gconf.kex_name = newnames;
gconf.kex_name[gconf.kex_entries] = strdup(name);
if (gconf.kex_name[gconf.kex_entries] == NULL)
return DEUCE_SSH_ERROR_ALLOC;
gconf.kex_entries++;
return 0;
}
int
deuce_ssh_transport_register_key_algo(const char *name, uint32_t key_algo_flags, deuce_ssh_key_algo_sign_t key_algo_sign, deuce_ssh_key_algo_haskey_t key_algo_haskey, deuce_ssh_key_algo_cleanup_t key_algo_cleanup)
{
if (gconf.used)
return DEUCE_SSH_ERROR_TOOLATE;
if (gconf.key_algo_entries + 1 == SIZE_MAX)
return DEUCE_SSH_ERROR_TOOMANY;
uint32_t *newflags = realloc(gconf.key_algo_flags, sizeof(gconf.key_algo_flags[0]) * (gconf.key_algo_entries + 1));
if (newflags == NULL)
return DEUCE_SSH_ERROR_ALLOC;
gconf.key_algo_flags = newflags;
gconf.key_algo_flags[gconf.key_algo_entries] = key_algo_flags;
deuce_ssh_key_algo_sign_t *newsigns = realloc(gconf.key_algo_sign, sizeof(gconf.key_algo_sign[0]) * (gconf.key_algo_entries + 1));
if (newsigns == NULL)
return DEUCE_SSH_ERROR_ALLOC;
gconf.key_algo_sign = newsigns;
gconf.key_algo_sign[gconf.key_algo_entries] = key_algo_sign;
deuce_ssh_key_algo_haskey_t *newhaskeys = realloc(gconf.key_algo_haskey, sizeof(gconf.key_algo_haskey[0]) * (gconf.key_algo_entries + 1));
if (newhaskeys == NULL)
return DEUCE_SSH_ERROR_ALLOC;
gconf.key_algo_haskey = newhaskeys;
gconf.key_algo_haskey[gconf.key_algo_entries] = key_algo_haskey;
deuce_ssh_key_algo_cleanup_t *newcleanup = realloc(gconf.key_algo_cleanup, sizeof(gconf.key_algo_cleanup[0]) * (gconf.key_algo_entries + 1));
if (newcleanup == NULL)
return DEUCE_SSH_ERROR_ALLOC;
gconf.key_algo_cleanup = newcleanup;
gconf.key_algo_cleanup[gconf.key_algo_entries] = key_algo_cleanup;
char **newnames = realloc(gconf.key_algo_name, sizeof(gconf.key_algo_name[0]) * (gconf.key_algo_entries + 1));
if (newnames == NULL)
return DEUCE_SSH_ERROR_ALLOC;
gconf.key_algo_name = newnames;
gconf.key_algo_name[gconf.key_algo_entries] = strdup(name);
if (gconf.key_algo_name[gconf.key_algo_entries] == NULL)
return DEUCE_SSH_ERROR_ALLOC;
gconf.key_algo_entries++;
return 0;
}
int
deuce_ssh_transport_register_enc(const char *name, uint32_t enc_flags, uint16_t enc_blocksize, uint16_t enc_key_size, deuce_ssh_enc_encrypt_t enc_encrypt, deuce_ssh_enc_decrypt_t enc_decrypt, deuce_ssh_key_algo_cleanup_t enc_cleanup)
{
if (gconf.used)
return DEUCE_SSH_ERROR_TOOLATE;
if (gconf.enc_entries + 1 == SIZE_MAX)
return DEUCE_SSH_ERROR_TOOMANY;
uint32_t *newflags = realloc(gconf.enc_flags, sizeof(gconf.enc_flags[0]) * (gconf.enc_entries + 1));
if (newflags == NULL)
return DEUCE_SSH_ERROR_ALLOC;
gconf.enc_flags = newflags;
gconf.enc_flags[gconf.enc_entries] = enc_flags;
uint16_t *newbss = realloc(gconf.enc_blocksize, sizeof(gconf.enc_blocksize[0]) * (gconf.enc_entries + 1));
if (newbss == NULL)
return DEUCE_SSH_ERROR_ALLOC;
gconf.enc_blocksize = newbss;
gconf.enc_blocksize[gconf.enc_entries] = enc_blocksize;
uint16_t *newkss = realloc(gconf.enc_key_size, sizeof(gconf.enc_key_size[0]) * (gconf.enc_entries + 1));
if (newkss == NULL)
return DEUCE_SSH_ERROR_ALLOC;
gconf.enc_key_size = newkss;
gconf.enc_key_size[gconf.enc_entries] = enc_key_size;
deuce_ssh_enc_encrypt_t *newencrypts = realloc(gconf.enc_encrypt, sizeof(gconf.enc_encrypt[0]) * (gconf.enc_entries + 1));
if (newencrypts == NULL)
return DEUCE_SSH_ERROR_ALLOC;
gconf.enc_encrypt = newencrypts;
gconf.enc_encrypt[gconf.enc_entries] = enc_encrypt;
deuce_ssh_enc_decrypt_t *newdecrypts = realloc(gconf.enc_decrypt, sizeof(gconf.enc_decrypt[0]) * (gconf.enc_entries + 1));
if (newdecrypts == NULL)
return DEUCE_SSH_ERROR_ALLOC;
gconf.enc_decrypt = newdecrypts;
gconf.enc_decrypt[gconf.enc_entries] = enc_decrypt;
deuce_ssh_enc_cleanup_t *newcleanup = realloc(gconf.enc_cleanup, sizeof(gconf.enc_cleanup[0]) * (gconf.enc_entries + 1));
if (newcleanup == NULL)
return DEUCE_SSH_ERROR_ALLOC;
gconf.enc_cleanup = newcleanup;
gconf.enc_cleanup[gconf.enc_entries] = enc_cleanup;
char **newnames = realloc(gconf.enc_name, sizeof(gconf.enc_name[0]) * (gconf.enc_entries + 1));
if (newnames == NULL)
return DEUCE_SSH_ERROR_ALLOC;
gconf.enc_name = newnames;
gconf.enc_name[gconf.enc_entries] = strdup(name);
if (gconf.enc_name[gconf.enc_entries] == NULL)
return DEUCE_SSH_ERROR_ALLOC;
gconf.enc_entries++;
return 0;
}
int
deuce_ssh_transport_register_mac(const char *name, uint16_t mac_digest_size, uint16_t mac_key_size, deuce_ssh_mac_generate_t mac_generate, deuce_ssh_key_algo_cleanup_t mac_cleanup)
{
if (gconf.used)
return DEUCE_SSH_ERROR_TOOLATE;
if (gconf.mac_entries + 1 == SIZE_MAX)
return DEUCE_SSH_ERROR_TOOMANY;
uint16_t *newdss = realloc(gconf.mac_digest_size, sizeof(gconf.mac_digest_size[0]) * (gconf.mac_entries + 1));
if (newdss == NULL)
return DEUCE_SSH_ERROR_ALLOC;
gconf.mac_digest_size = newdss;
gconf.mac_digest_size[gconf.mac_entries] = mac_digest_size;
uint16_t *newkss = realloc(gconf.mac_key_size, sizeof(gconf.mac_key_size[0]) * (gconf.mac_entries + 1));
if (newkss == NULL)
return DEUCE_SSH_ERROR_ALLOC;
gconf.mac_key_size = newkss;
gconf.mac_key_size[gconf.mac_entries] = mac_key_size;
deuce_ssh_mac_generate_t *newgens = realloc(gconf.mac_generate, sizeof(gconf.mac_generate[0]) * (gconf.mac_entries + 1));
if (newgens == NULL)
return DEUCE_SSH_ERROR_ALLOC;
gconf.mac_generate = newgens;
gconf.mac_generate[gconf.mac_entries] = mac_generate;
deuce_ssh_mac_cleanup_t *newcleanup = realloc(gconf.mac_cleanup, sizeof(gconf.mac_cleanup[0]) * (gconf.mac_entries + 1));
if (newcleanup == NULL)
return DEUCE_SSH_ERROR_ALLOC;
gconf.mac_cleanup = newcleanup;
gconf.mac_cleanup[gconf.mac_entries] = mac_cleanup;
char **newnames = realloc(gconf.mac_name, sizeof(gconf.mac_name[0]) * (gconf.mac_entries + 1));
if (newnames == NULL)
return DEUCE_SSH_ERROR_ALLOC;
gconf.mac_name = newnames;
gconf.mac_name[gconf.mac_entries] = strdup(name);
if (gconf.mac_name[gconf.mac_entries] == NULL)
return DEUCE_SSH_ERROR_ALLOC;
gconf.mac_entries++;
return 0;
}
int
deuce_ssh_transport_register_comp(const char *name, deuce_ssh_comp_compress_t comp_compress, deuce_ssh_comp_uncompress_t comp_uncompress, deuce_ssh_key_algo_cleanup_t comp_cleanup)
{
if (gconf.used)
return DEUCE_SSH_ERROR_TOOLATE;
if (gconf.comp_entries + 1 == SIZE_MAX)
return DEUCE_SSH_ERROR_TOOMANY;
deuce_ssh_comp_compress_t *newcompress = realloc(gconf.comp_compress, sizeof(gconf.comp_compress[0]) * (gconf.comp_entries + 1));
if (newcompress == NULL)
return DEUCE_SSH_ERROR_ALLOC;
gconf.comp_compress = newcompress;
gconf.comp_compress[gconf.comp_entries] = comp_compress;
deuce_ssh_comp_uncompress_t *newuncompress = realloc(gconf.comp_uncompress, sizeof(gconf.comp_uncompress[0]) * (gconf.comp_entries + 1));
if (newuncompress == NULL)
return DEUCE_SSH_ERROR_ALLOC;
gconf.comp_uncompress = newuncompress;
gconf.comp_uncompress[gconf.comp_entries] = comp_uncompress;
deuce_ssh_comp_cleanup_t *newcleanup = realloc(gconf.comp_cleanup, sizeof(gconf.comp_cleanup[0]) * (gconf.comp_entries + 1));
if (newcleanup == NULL)
return DEUCE_SSH_ERROR_ALLOC;
gconf.comp_cleanup = newcleanup;
gconf.comp_cleanup[gconf.comp_entries] = comp_cleanup;
char **newnames = realloc(gconf.comp_name, sizeof(gconf.comp_name[0]) * (gconf.comp_entries + 1));
if (newnames == NULL)
return DEUCE_SSH_ERROR_ALLOC;
gconf.comp_name = newnames;
gconf.comp_name[gconf.comp_entries] = strdup(name);
if (gconf.comp_name[gconf.comp_entries] == NULL)
return DEUCE_SSH_ERROR_ALLOC;
gconf.comp_entries++;
return 0;
}
int
deuce_ssh_transport_register_lang(const char *name)
{
if (gconf.used)
return DEUCE_SSH_ERROR_TOOLATE;
if (gconf.lang_entries + 1 == SIZE_MAX)
return DEUCE_SSH_ERROR_TOOMANY;
char **newnames = realloc(gconf.lang_name, sizeof(gconf.lang_name[0]) * (gconf.lang_entries + 1));
if (newnames == NULL)
return DEUCE_SSH_ERROR_ALLOC;
gconf.lang_name = newnames;
gconf.lang_name[gconf.lang_entries] = strdup(name);
if (gconf.lang_name[gconf.lang_entries] == NULL)
return DEUCE_SSH_ERROR_ALLOC;
gconf.lang_entries++;
return 0;
}
int
deuce_ssh_transport_set_callbacks(deuce_ssh_transport_io_cb_t tx, deuce_ssh_transport_io_cb_t rx, deuce_ssh_transport_rxline_cb_t rx_line, deuce_ssh_transport_extra_line_cb_t extra_line_cb)
{
......
......@@ -7,32 +7,38 @@
#define DEUCE_SSH_TRANS_H
/* Transport layer generic */
#define SSH_MSG_DISCONNECT 1
#define SSH_MSG_IGNORE 2
#define SSH_MSG_UNIMPLEMENTED 3
#define SSH_MSG_DEBUG 4
#define SSH_MSG_SERVICE_REQUEST 5
#define SSH_MSG_SERVICE_ACCEPT 6
#define SSH_MSG_DISCONNECT UINT8_C(1)
#define SSH_MSG_IGNORE UINT8_C(2)
#define SSH_MSG_UNIMPLEMENTED UINT8_C(3)
#define SSH_MSG_DEBUG UINT8_C(4)
#define SSH_MSG_SERVICE_REQUEST UINT8_C(5)
#define SSH_MSG_SERVICE_ACCEPT UINT8_C(6)
/* Transport layer Algorithm negotiation */
#define SSH_MSG_KEXINIT 20
#define SSH_MSG_NEWKEYS 21
#define SSH_MSG_KEXINIT UINT8_C(20)
#define SSH_MSG_NEWKEYS UINT8_C(21)
/* SSH_MSG_DISCONNECT reason codes */
#define SSH_DISCONNECT_HOST_NOT_ALLOWED_TO_CONNECT 1
#define SSH_DISCONNECT_PROTOCOL_ERROR 2
#define SSH_DISCONNECT_KEY_EXCHANGE_FAILED 3
#define SSH_DISCONNECT_RESERVED 4
#define SSH_DISCONNECT_MAC_ERROR 5
#define SSH_DISCONNECT_COMPRESSION_ERROR 6
#define SSH_DISCONNECT_SERVICE_NOT_AVAILABLE 7
#define SSH_DISCONNECT_PROTOCOL_VERSION_NOT_SUPPORTED 8
#define SSH_DISCONNECT_HOST_KEY_NOT_VERIFIABLE 9
#define SSH_DISCONNECT_CONNECTION_LOST 10
#define SSH_DISCONNECT_BY_APPLICATION 11
#define SSH_DISCONNECT_TOO_MANY_CONNECTIONS 12
#define SSH_DISCONNECT_AUTH_CANCELLED_BY_USER 13
#define SSH_DISCONNECT_NO_MORE_AUTH_METHODS_AVAILABLE 14
#define SSH_DISCONNECT_ILLEGAL_USER_NAME 15
#define SSH_DISCONNECT_HOST_NOT_ALLOWED_TO_CONNECT UINT32_C(1)
#define SSH_DISCONNECT_PROTOCOL_ERROR UINT32_C(2)
#define SSH_DISCONNECT_KEY_EXCHANGE_FAILED UINT32_C(3)
#define SSH_DISCONNECT_RESERVED UINT32_C(4)
#define SSH_DISCONNECT_MAC_ERROR UINT32_C(5)
#define SSH_DISCONNECT_COMPRESSION_ERROR UINT32_C(6)
#define SSH_DISCONNECT_SERVICE_NOT_AVAILABLE UINT32_C(7)
#define SSH_DISCONNECT_PROTOCOL_VERSION_NOT_SUPPORTED UINT32_C(8)
#define SSH_DISCONNECT_HOST_KEY_NOT_VERIFIABLE UINT32_C(9)
#define SSH_DISCONNECT_CONNECTION_LOST UINT32_C(10)
#define SSH_DISCONNECT_BY_APPLICATION UINT32_C(11)
#define SSH_DISCONNECT_TOO_MANY_CONNECTIONS UINT32_C(12)
#define SSH_DISCONNECT_AUTH_CANCELLED_BY_USER UINT32_C(13)
#define SSH_DISCONNECT_NO_MORE_AUTH_METHODS_AVAILABLE UINT32_C(14)
#define SSH_DISCONNECT_ILLEGAL_USER_NAME UINT32_C(15)
#define DEUCE_SSH_KEX_FLAG_NEEDS_ENCRYPTION_CAPABLE UINT32_C(1<<0)
#define DEUCE_SSH_KEX_FLAG_NEEDS_SIGNATURE_CAPABLE UINT32_C(1<<1)
#define DEUCE_SSH_KEY_ALGO_FLAG_ENCRYPTION_CAPABLE UINT32_C(1<<0)
#define DEUCE_SSH_KEY_ALGO_FLAG_SIGNATURE_CAPABLE UINT32_C(1<<1)
typedef struct deuce_ssh_transport_packet {
deuce_ssh_string_t payload;
......@@ -45,6 +51,21 @@ typedef struct deuce_ssh_transport_packet {
typedef int (*deuce_ssh_kex_handler_t)(deuce_ssh_transport_packet_t pkt, deuce_ssh_session_t sess);
typedef void (*deuce_ssh_kex_cleanup_t)(deuce_ssh_session_t sess);
typedef int (*deuce_ssh_key_algo_sign_t)(uint8_t *buf, uint8_t *bufsz, deuce_ssh_session_t sess);
typedef int (*deuce_ssh_key_algo_haskey_t)(deuce_ssh_session_t sess);
typedef void (*deuce_ssh_key_algo_cleanup_t)(deuce_ssh_session_t sess);
typedef int (*deuce_ssh_enc_encrypt_t)(uint8_t *buf, uint8_t *bufsz, deuce_ssh_session_t sess);
typedef int (*deuce_ssh_enc_decrypt_t)(uint8_t *buf, uint8_t *bufsz, deuce_ssh_session_t sess);
typedef void (*deuce_ssh_enc_cleanup_t)(deuce_ssh_session_t sess);
typedef int (*deuce_ssh_mac_generate_t)(uint8_t *key, uint8_t *buf, uint8_t *bufsz, uint8_t *outbuf, deuce_ssh_session_t sess);
typedef void (*deuce_ssh_mac_cleanup_t)(deuce_ssh_session_t sess);
typedef int (*deuce_ssh_comp_compress_t)(uint8_t *buf, uint8_t *bufsz, deuce_ssh_session_t sess);
typedef int (*deuce_ssh_comp_uncompress_t)(uint8_t *buf, uint8_t *bufsz, deuce_ssh_session_t sess);
typedef void (*deuce_ssh_comp_cleanup_t)(deuce_ssh_session_t sess);
typedef struct deuce_ssh_transport_state {
uint32_t tx_seq;
uint32_t rx_seq;
......@@ -55,7 +76,6 @@ typedef struct deuce_ssh_transport_state {
/* KEX options */
void *kex_cbdata;
uint32_t kex_state;
size_t kex_selected;
/* KEX outputs */
......@@ -64,8 +84,15 @@ typedef struct deuce_ssh_transport_state {
size_t exchange_hash_sz;
uint8_t *exchange_hash;
/* Public Key Algorithms */
void *key_algo_cbdata;
size_t key_algo_selected;
void *enc_cbdata;
size_t enc_selected;
void *mac_cbdata;
size_t mac_selected;
void *comp_cbdata;
size_t comp_selected;
} *deuce_ssh_transport_state_t;
......
......@@ -34,10 +34,12 @@ typedef struct deuce_ssh_session {
mtx_t mtx;
atomic_bool initialized;
atomic_bool terminate;
bool is_server;
/* Transport Remote information */
char *remote_software_version;
char *remote_version_comment;
char **remote_languages;
void *tx_cbdata;
void *rx_cbdata;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment