session UPDATE rename transport implementations
diff --git a/src/io.c b/src/io.c
index 25a678f..e87da1a 100644
--- a/src/io.c
+++ b/src/io.c
@@ -106,7 +106,7 @@
break;
#ifdef NC_ENABLED_SSH_TLS
- case NC_TI_LIBSSH:
+ case NC_TI_SSH:
/* read via libssh */
r = ssh_channel_read(session->ti.libssh.channel, buf + readd, count - readd, 0);
if (r == SSH_AGAIN) {
@@ -128,7 +128,7 @@
}
break;
- case NC_TI_OPENSSL:
+ case NC_TI_TLS:
r = nc_tls_read_wrap(session, (unsigned char *)buf + readd, count - readd);
if (r < 0) {
/* non-recoverable error */
@@ -396,7 +396,7 @@
switch (session->ti_type) {
#ifdef NC_ENABLED_SSH_TLS
- case NC_TI_LIBSSH:
+ case NC_TI_SSH:
/* EINTR is handled, it resumes waiting */
ret = ssh_channel_poll_timeout(session->ti.libssh.channel, io_timeout, 0);
if (ret == SSH_ERROR) {
@@ -417,7 +417,7 @@
fds.revents = 0;
}
break;
- case NC_TI_OPENSSL:
+ case NC_TI_TLS:
ret = nc_tls_have_pending_wrap(session->ti.tls.session);
if (ret) {
/* some buffered TLS data available */
@@ -523,9 +523,9 @@
fds.fd = session->ti.unixsock.sock;
break;
#ifdef NC_ENABLED_SSH_TLS
- case NC_TI_LIBSSH:
+ case NC_TI_SSH:
return ssh_is_connected(session->ti.libssh.session);
- case NC_TI_OPENSSL:
+ case NC_TI_TLS:
fds.fd = nc_tls_get_fd_wrap(session);
break;
#endif /* NC_ENABLED_SSH_TLS */
@@ -605,7 +605,7 @@
break;
#ifdef NC_ENABLED_SSH_TLS
- case NC_TI_LIBSSH:
+ case NC_TI_SSH:
if (ssh_channel_is_closed(session->ti.libssh.channel) || ssh_channel_is_eof(session->ti.libssh.channel)) {
if (ssh_channel_is_closed(session->ti.libssh.channel)) {
ERR(session, "SSH channel unexpectedly closed.");
@@ -622,7 +622,7 @@
return -1;
}
break;
- case NC_TI_OPENSSL:
+ case NC_TI_TLS:
c = nc_tls_write_wrap(session, (const unsigned char *)(buf + written), count - written);
if (c < 0) {
/* possible client dc, or some socket/TLS communication error */
diff --git a/src/server_config.c b/src/server_config.c
index d7f1f72..e01ee50 100644
--- a/src/server_config.c
+++ b/src/server_config.c
@@ -672,7 +672,7 @@
free(server_opts.endpts[i].referenced_endpt_name);
server_opts.endpts[i].referenced_endpt_name = NULL;
- if (server_opts.endpts[i].ti == NC_TI_LIBSSH) {
+ if (server_opts.endpts[i].ti == NC_TI_SSH) {
server_opts.endpts[i].opts.ssh->referenced_endpt_name = NULL;
} else {
server_opts.endpts[i].opts.tls->referenced_endpt_name = NULL;
@@ -693,7 +693,7 @@
free(server_opts.ch_clients[i].ch_endpts[j].referenced_endpt_name);
server_opts.ch_clients[i].ch_endpts[j].referenced_endpt_name = NULL;
- if (server_opts.ch_clients[i].ch_endpts[j].ti == NC_TI_LIBSSH) {
+ if (server_opts.ch_clients[i].ch_endpts[j].ti == NC_TI_SSH) {
server_opts.ch_clients[i].ch_endpts[j].opts.ssh->referenced_endpt_name = NULL;
} else {
server_opts.ch_clients[i].ch_endpts[j].opts.tls->referenced_endpt_name = NULL;
@@ -880,10 +880,10 @@
switch (ch_endpt->ti) {
#ifdef NC_ENABLED_SSH_TLS
- case NC_TI_LIBSSH:
+ case NC_TI_SSH:
nc_server_config_del_ssh_opts(NULL, ch_endpt->opts.ssh);
break;
- case NC_TI_OPENSSL:
+ case NC_TI_TLS:
nc_server_config_del_tls_opts(NULL, ch_endpt->opts.tls);
break;
#endif /* NC_ENABLED_SSH_TLS */
@@ -980,10 +980,10 @@
for (i = 0; i < endpt_count; i++) {
switch (server_opts.endpts[i].ti) {
#ifdef NC_ENABLED_SSH_TLS
- case NC_TI_LIBSSH:
+ case NC_TI_SSH:
nc_server_config_del_endpt_ssh(&server_opts.endpts[i], &server_opts.binds[i]);
break;
- case NC_TI_OPENSSL:
+ case NC_TI_TLS:
nc_server_config_del_endpt_tls(&server_opts.endpts[i], &server_opts.binds[i]);
break;
#endif /* NC_ENABLED_SSH_TLS */
@@ -1139,10 +1139,10 @@
switch (endpt->ti) {
#ifdef NC_ENABLED_SSH_TLS
- case NC_TI_LIBSSH:
+ case NC_TI_SSH:
nc_server_config_del_endpt_ssh(endpt, bind);
break;
- case NC_TI_OPENSSL:
+ case NC_TI_TLS:
nc_server_config_del_endpt_tls(endpt, bind);
break;
#endif /* NC_ENABLED_SSH_TLS */
@@ -1193,7 +1193,7 @@
static int
nc_server_config_create_ssh(struct nc_endpt *endpt)
{
- endpt->ti = NC_TI_LIBSSH;
+ endpt->ti = NC_TI_SSH;
endpt->opts.ssh = calloc(1, sizeof(struct nc_server_ssh_opts));
NC_CHECK_ERRMEM_RET(!endpt->opts.ssh, 1);
@@ -1203,7 +1203,7 @@
static int
nc_server_config_ch_create_ssh(struct nc_ch_endpt *ch_endpt)
{
- ch_endpt->ti = NC_TI_LIBSSH;
+ ch_endpt->ti = NC_TI_SSH;
ch_endpt->opts.ssh = calloc(1, sizeof(struct nc_server_ssh_opts));
NC_CHECK_ERRMEM_RET(!ch_endpt->opts.ssh, 1);
@@ -1269,7 +1269,7 @@
static int
nc_server_config_create_tls(struct nc_endpt *endpt)
{
- endpt->ti = NC_TI_OPENSSL;
+ endpt->ti = NC_TI_TLS;
endpt->opts.tls = calloc(1, sizeof *endpt->opts.tls);
NC_CHECK_ERRMEM_RET(!endpt->opts.tls, 1);
@@ -1279,7 +1279,7 @@
static int
nc_server_config_ch_create_tls(struct nc_ch_endpt *ch_endpt)
{
- ch_endpt->ti = NC_TI_OPENSSL;
+ ch_endpt->ti = NC_TI_TLS;
ch_endpt->opts.tls = calloc(1, sizeof(struct nc_server_tls_opts));
NC_CHECK_ERRMEM_RET(!ch_endpt->opts.tls, 1);
@@ -2661,7 +2661,7 @@
ERR(NULL, "Endpoint \"%s\" referenced by endpoint \"%s\" has different transport type.",
server_opts.endpts[i].referenced_endpt_name, server_opts.endpts[i].name);
return 1;
- } else if ((referenced_endpt->ti != NC_TI_LIBSSH) && (referenced_endpt->ti != NC_TI_OPENSSL)) {
+ } else if ((referenced_endpt->ti != NC_TI_SSH) && (referenced_endpt->ti != NC_TI_TLS)) {
ERR(NULL, "Endpoint \"%s\" referenced by endpoint \"%s\" has unsupported transport type.",
server_opts.endpts[i].referenced_endpt_name, server_opts.endpts[i].name);
return 1;
@@ -2675,7 +2675,7 @@
}
/* all went well, assign the name to the opts, so we can access it for auth */
- if (server_opts.endpts[i].ti == NC_TI_LIBSSH) {
+ if (server_opts.endpts[i].ti == NC_TI_SSH) {
server_opts.endpts[i].opts.ssh->referenced_endpt_name = referenced_endpt->name;
} else {
server_opts.endpts[i].opts.tls->referenced_endpt_name = referenced_endpt->name;
@@ -2703,7 +2703,7 @@
ERR(NULL, "Endpoint \"%s\" referenced by call home endpoint \"%s\" has different transport type.",
server_opts.ch_clients[i].ch_endpts[j].referenced_endpt_name, server_opts.ch_clients[i].ch_endpts[j].name);
goto ch_fail;
- } else if ((referenced_endpt->ti != NC_TI_LIBSSH) && (referenced_endpt->ti != NC_TI_OPENSSL)) {
+ } else if ((referenced_endpt->ti != NC_TI_SSH) && (referenced_endpt->ti != NC_TI_TLS)) {
ERR(NULL, "Endpoint \"%s\" referenced by call home endpoint \"%s\" has unsupported transport type.",
server_opts.ch_clients[i].ch_endpts[j].referenced_endpt_name, server_opts.ch_clients[i].ch_endpts[j].name);
goto ch_fail;
@@ -2717,7 +2717,7 @@
}
/* all went well, assign the name to the opts, so we can access it for auth */
- if (server_opts.ch_clients[i].ch_endpts[j].ti == NC_TI_LIBSSH) {
+ if (server_opts.ch_clients[i].ch_endpts[j].ti == NC_TI_SSH) {
server_opts.ch_clients[i].ch_endpts[j].opts.ssh->referenced_endpt_name = referenced_endpt->name;
} else {
server_opts.ch_clients[i].ch_endpts[j].opts.tls->referenced_endpt_name = referenced_endpt->name;
@@ -3232,39 +3232,22 @@
nc_server_config_create_cipher_suite(struct nc_server_tls_opts *opts, const char *cipher)
{
int ret = 0;
- char *ssl_cipher = NULL;
- uint16_t i;
- void *tmp;
+ char *processed_cipher = NULL;
- ssl_cipher = malloc(strlen(cipher) + 1);
- NC_CHECK_ERRMEM_GOTO(!ssl_cipher, ret = 1, cleanup);
-
- for (i = 0; cipher[i]; i++) {
- if (cipher[i] == '-') {
- /* OpenSSL requires _ instead of - in cipher names */
- ssl_cipher[i] = '_';
- } else {
- /* and requires uppercase unlike the identities */
- ssl_cipher[i] = toupper(cipher[i]);
- }
+ ret = nc_tls_process_cipher_suite_wrap(cipher, &processed_cipher);
+ if (ret) {
+ ERR(NULL, "Failed to process the cipher suite \"%s\".", cipher);
+ goto cleanup;
}
- ssl_cipher[i] = '\0';
- if (!opts->ciphers) {
- /* first entry */
- opts->ciphers = strdup(ssl_cipher);
- NC_CHECK_ERRMEM_GOTO(!opts->ciphers, ret = 1, cleanup);
- } else {
- /* + 1 because of : between entries */
- tmp = nc_realloc(opts->ciphers, strlen(opts->ciphers) + strlen(ssl_cipher) + 1 + 1);
- NC_CHECK_ERRMEM_GOTO(!tmp, ret = 1, cleanup);
- opts->ciphers = tmp;
- strcat(opts->ciphers, ":");
- strcat(opts->ciphers, ssl_cipher);
+ ret = nc_tls_append_cipher_suite_wrap(opts, processed_cipher);
+ if (ret) {
+ ERR(NULL, "Failed to append the cipher suite \"%s\".", cipher);
+ goto cleanup;
}
cleanup:
- free(ssl_cipher);
+ free(processed_cipher);
return ret;
}
diff --git a/src/server_config_util.c b/src/server_config_util.c
index 9fcea1f..d7c627c 100644
--- a/src/server_config_util.c
+++ b/src/server_config_util.c
@@ -877,11 +877,11 @@
NC_CHECK_ARG_RET(NULL, ctx, endpt_name, address, config, 1);
- if (transport == NC_TI_LIBSSH) {
+ if (transport == NC_TI_SSH) {
/* SSH path */
address_fmt = "/ietf-netconf-server:netconf-server/listen/endpoints/endpoint[name='%s']/ssh/tcp-server-parameters/local-address";
port_fmt = "/ietf-netconf-server:netconf-server/listen/endpoints/endpoint[name='%s']/ssh/tcp-server-parameters/local-port";
- } else if (transport == NC_TI_OPENSSL) {
+ } else if (transport == NC_TI_TLS) {
/* TLS path */
address_fmt = "/ietf-netconf-server:netconf-server/listen/endpoints/endpoint[name='%s']/tls/tcp-server-parameters/local-address";
port_fmt = "/ietf-netconf-server:netconf-server/listen/endpoints/endpoint[name='%s']/tls/tcp-server-parameters/local-port";
@@ -915,11 +915,11 @@
NC_CHECK_ARG_RET(NULL, ctx, client_name, endpt_name, address, port, config, 1);
- if (transport == NC_TI_LIBSSH) {
+ if (transport == NC_TI_SSH) {
/* SSH path */
address_fmt = "/ietf-netconf-server:netconf-server/call-home/netconf-client[name='%s']/endpoints/endpoint[name='%s']/ssh/tcp-client-parameters/remote-address";
port_fmt = "/ietf-netconf-server:netconf-server/call-home/netconf-client[name='%s']/endpoints/endpoint[name='%s']/ssh/tcp-client-parameters/remote-port";
- } else if (transport == NC_TI_OPENSSL) {
+ } else if (transport == NC_TI_TLS) {
/* TLS path */
address_fmt = "/ietf-netconf-server:netconf-server/call-home/netconf-client[name='%s']/endpoints/endpoint[name='%s']/tls/tcp-client-parameters/remote-address";
port_fmt = "/ietf-netconf-server:netconf-server/call-home/netconf-client[name='%s']/endpoints/endpoint[name='%s']/tls/tcp-client-parameters/remote-port";
@@ -993,10 +993,10 @@
NC_CHECK_ARG_RET(NULL, ctx, asym_key_name, privkey_path, config, 1);
/* get the keys as a string from the given files */
- if (ti == NC_TI_LIBSSH) {
+ if (ti == NC_TI_SSH) {
ret = nc_server_config_util_get_asym_key_pair(privkey_path, pubkey_path, NC_PUBKEY_FORMAT_SSH, &privkey,
&privkey_type, &pubkey);
- } else if (ti == NC_TI_OPENSSL) {
+ } else if (ti == NC_TI_TLS) {
ret = nc_server_config_util_get_asym_key_pair(privkey_path, pubkey_path, NC_PUBKEY_FORMAT_X509, &privkey,
&privkey_type, &pubkey);
} else {
@@ -1009,7 +1009,7 @@
}
/* get pubkey format str */
- if (ti == NC_TI_LIBSSH) {
+ if (ti == NC_TI_SSH) {
pubkey_format = "ietf-crypto-types:ssh-public-key-format";
} else {
pubkey_format = "ietf-crypto-types:subject-public-key-info-format";
diff --git a/src/session.c b/src/session.c
index 724d98a..f5d1cc8 100644
--- a/src/session.c
+++ b/src/session.c
@@ -729,7 +729,7 @@
break;
#ifdef NC_ENABLED_SSH_TLS
- case NC_TI_LIBSSH: {
+ case NC_TI_SSH: {
int r;
if (connected) {
@@ -794,7 +794,7 @@
}
break;
}
- case NC_TI_OPENSSL:
+ case NC_TI_TLS:
sock = nc_tls_get_fd_wrap(session);
if (connected) {
diff --git a/src/session.h b/src/session.h
index 59aabe2..daf9e70 100644
--- a/src/session.h
+++ b/src/session.h
@@ -90,9 +90,9 @@
outside the current application */
NC_TI_UNIX, /**< unix socket */
#ifdef NC_ENABLED_SSH_TLS
- NC_TI_LIBSSH, /**< libssh - use libssh library, only for NETCONF over SSH transport */
+ NC_TI_SSH, /**< SSH - use libssh library, only for NETCONF over SSH transport */
- NC_TI_OPENSSL /**< OpenSSL - use OpenSSL library, only for NETCONF over TLS transport TODO: prejmenovat*/
+ NC_TI_TLS /**< TLS - use either OpenSSL or MbedTLS library, only for NETCONF over TLS transport */
#endif /* NC_ENABLED_SSH_TLS */
} NC_TRANSPORT_IMPL;
diff --git a/src/session_client.c b/src/session_client.c
index 22e3313..5aed2dc 100644
--- a/src/session_client.c
+++ b/src/session_client.c
@@ -1851,9 +1851,9 @@
return -1;
}
- if (client_opts.ch_binds_aux[idx].ti == NC_TI_LIBSSH) {
+ if (client_opts.ch_binds_aux[idx].ti == NC_TI_SSH) {
*session = nc_accept_callhome_ssh_sock(sock, host, port, ctx, NC_TRANSPORT_TIMEOUT);
- } else if (client_opts.ch_binds_aux[idx].ti == NC_TI_OPENSSL) {
+ } else if (client_opts.ch_binds_aux[idx].ti == NC_TI_TLS) {
*session = nc_accept_callhome_tls_sock(sock, host, port, ctx, NC_TRANSPORT_TIMEOUT,
client_opts.ch_binds_aux[idx].hostname);
} else {
diff --git a/src/session_client_ssh.c b/src/session_client_ssh.c
index 122f68b..3116b89 100644
--- a/src/session_client_ssh.c
+++ b/src/session_client_ssh.c
@@ -1207,13 +1207,13 @@
API int
nc_client_ssh_ch_add_bind_listen(const char *address, uint16_t port)
{
- return nc_client_ch_add_bind_listen(address, port, NULL, NC_TI_LIBSSH);
+ return nc_client_ch_add_bind_listen(address, port, NULL, NC_TI_SSH);
}
API int
nc_client_ssh_ch_del_bind(const char *address, uint16_t port)
{
- return nc_client_ch_del_bind(address, port, NC_TI_LIBSSH);
+ return nc_client_ch_del_bind(address, port, NC_TI_SSH);
}
/* Establish a secure SSH connection and authenticate.
@@ -1583,7 +1583,7 @@
session = nc_new_session(NC_CLIENT, 0);
NC_CHECK_ERRMEM_RET(!session, NULL);
session->status = NC_STATUS_STARTING;
- session->ti_type = NC_TI_LIBSSH;
+ session->ti_type = NC_TI_SSH;
session->ti.libssh.session = ssh_session;
/* was port set? */
@@ -1742,7 +1742,7 @@
session->status = NC_STATUS_STARTING;
/* transport-specific data */
- session->ti_type = NC_TI_LIBSSH;
+ session->ti_type = NC_TI_SSH;
session->ti.libssh.session = ssh_new();
if (!session->ti.libssh.session) {
ERR(session, "Unable to initialize SSH session.");
@@ -1830,7 +1830,7 @@
new_session->status = NC_STATUS_STARTING;
/* share some parameters including the IO lock (we are using one socket for both sessions) */
- new_session->ti_type = NC_TI_LIBSSH;
+ new_session->ti_type = NC_TI_SSH;
new_session->ti.libssh.session = session->ti.libssh.session;
new_session->io_lock = session->io_lock;
diff --git a/src/session_client_tls.c b/src/session_client_tls.c
index ff5c0b3..d7d54ee 100644
--- a/src/session_client_tls.c
+++ b/src/session_client_tls.c
@@ -257,19 +257,19 @@
API int
nc_client_tls_ch_add_bind_listen(const char *address, uint16_t port)
{
- return nc_client_ch_add_bind_listen(address, port, NULL, NC_TI_OPENSSL);
+ return nc_client_ch_add_bind_listen(address, port, NULL, NC_TI_TLS);
}
API int
nc_client_tls_ch_add_bind_hostname_listen(const char *address, uint16_t port, const char *hostname)
{
- return nc_client_ch_add_bind_listen(address, port, hostname, NC_TI_OPENSSL);
+ return nc_client_ch_add_bind_listen(address, port, hostname, NC_TI_TLS);
}
API int
nc_client_tls_ch_del_bind(const char *address, uint16_t port)
{
- return nc_client_ch_del_bind(address, port, NC_TI_OPENSSL);
+ return nc_client_ch_del_bind(address, port, NC_TI_TLS);
}
static int
@@ -433,7 +433,7 @@
}
/* fill the session */
- session->ti_type = NC_TI_OPENSSL;
+ session->ti_type = NC_TI_TLS;
if (!(session->ti.tls.session = nc_client_tls_session_new(sock, host, NC_TRANSPORT_TIMEOUT, &tls_opts, &tls_cfg, &tls_ctx))) {
goto fail;
}
@@ -492,7 +492,7 @@
session->status = NC_STATUS_STARTING;
/* fill the session */
- session->ti_type = NC_TI_OPENSSL;
+ session->ti_type = NC_TI_TLS;
if (!(session->ti.tls.session = nc_client_tls_session_new(sock, peername, timeout, &tls_ch_opts, &tls_cfg, &tls_ctx))) {
goto fail;
}
diff --git a/src/session_server.c b/src/session_server.c
index f152cd6..35f2746 100644
--- a/src/session_server.c
+++ b/src/session_server.c
@@ -1601,7 +1601,7 @@
switch (session->ti_type) {
#ifdef NC_ENABLED_SSH_TLS
- case NC_TI_LIBSSH:
+ case NC_TI_SSH:
ssh_msg = ssh_message_get(session->ti.libssh.session);
if (ssh_msg) {
nc_session_ssh_msg(session, NULL, ssh_msg, NULL);
@@ -1650,7 +1650,7 @@
ret = NC_PSPOLL_RPC;
}
break;
- case NC_TI_OPENSSL:
+ case NC_TI_TLS:
r = nc_tls_have_pending_wrap(session->ti.tls.session);
if (!r) {
/* no data pending in the SSL buffer, poll fd */
@@ -2000,10 +2000,10 @@
VRB(NULL, "Listening on %s for UNIX connections.", endpt->opts.unixsock->address);
break;
#ifdef NC_ENABLED_SSH_TLS
- case NC_TI_LIBSSH:
+ case NC_TI_SSH:
VRB(NULL, "Listening on %s:%u for SSH connections.", address, port);
break;
- case NC_TI_OPENSSL:
+ case NC_TI_TLS:
VRB(NULL, "Listening on %s:%u for TLS connections.", address, port);
break;
#endif /* NC_ENABLED_SSH_TLS */
@@ -2292,7 +2292,7 @@
/* sock gets assigned to session or closed */
#ifdef NC_ENABLED_SSH_TLS
- if (server_opts.endpts[bind_idx].ti == NC_TI_LIBSSH) {
+ if (server_opts.endpts[bind_idx].ti == NC_TI_SSH) {
ret = nc_accept_ssh_session(*session, server_opts.endpts[bind_idx].opts.ssh, sock, NC_TRANSPORT_TIMEOUT);
sock = -1;
if (ret < 0) {
@@ -2302,7 +2302,7 @@
msgtype = NC_MSG_WOULDBLOCK;
goto cleanup;
}
- } else if (server_opts.endpts[bind_idx].ti == NC_TI_OPENSSL) {
+ } else if (server_opts.endpts[bind_idx].ti == NC_TI_TLS) {
(*session)->data = server_opts.endpts[bind_idx].opts.tls;
ret = nc_accept_tls_session(*session, server_opts.endpts[bind_idx].opts.tls, sock, NC_TRANSPORT_TIMEOUT);
sock = -1;
@@ -2482,7 +2482,7 @@
(*session)->port = endpt->port;
/* sock gets assigned to session or closed */
- if (endpt->ti == NC_TI_LIBSSH) {
+ if (endpt->ti == NC_TI_SSH) {
ret = nc_accept_ssh_session(*session, endpt->opts.ssh, sock, NC_TRANSPORT_TIMEOUT);
(*session)->data = NULL;
@@ -2493,7 +2493,7 @@
msgtype = NC_MSG_WOULDBLOCK;
goto fail;
}
- } else if (endpt->ti == NC_TI_OPENSSL) {
+ } else if (endpt->ti == NC_TI_TLS) {
(*session)->data = endpt->opts.tls;
ret = nc_accept_tls_session(*session, endpt->opts.tls, sock, NC_TRANSPORT_TIMEOUT);
(*session)->data = NULL;
diff --git a/src/session_server_ssh.c b/src/session_server_ssh.c
index 8d80815..c31b7f1 100644
--- a/src/session_server_ssh.c
+++ b/src/session_server_ssh.c
@@ -1265,7 +1265,7 @@
session->ti.libssh.next = new_session;
new_session->status = NC_STATUS_STARTING;
- new_session->ti_type = NC_TI_LIBSSH;
+ new_session->ti_type = NC_TI_SSH;
new_session->io_lock = session->io_lock;
new_session->ti.libssh.channel = channel;
new_session->ti.libssh.session = session->ti.libssh.session;
@@ -1711,7 +1711,7 @@
const char *err_msg;
/* other transport-specific data */
- session->ti_type = NC_TI_LIBSSH;
+ session->ti_type = NC_TI_SSH;
session->ti.libssh.session = ssh_new();
if (!session->ti.libssh.session) {
ERR(NULL, "Failed to initialize a new SSH session.");
@@ -1815,7 +1815,7 @@
NC_CHECK_ARG_RET(orig_session, orig_session, session, NC_MSG_ERROR);
- if ((orig_session->status == NC_STATUS_RUNNING) && (orig_session->ti_type == NC_TI_LIBSSH) &&
+ if ((orig_session->status == NC_STATUS_RUNNING) && (orig_session->ti_type == NC_TI_SSH) &&
orig_session->ti.libssh.next) {
for (new_session = orig_session->ti.libssh.next;
new_session != orig_session;
@@ -1873,7 +1873,7 @@
for (i = 0; i < ps->session_count; ++i) {
cur_session = ps->sessions[i]->session;
- if ((cur_session->status == NC_STATUS_RUNNING) && (cur_session->ti_type == NC_TI_LIBSSH) &&
+ if ((cur_session->status == NC_STATUS_RUNNING) && (cur_session->ti_type == NC_TI_SSH) &&
cur_session->ti.libssh.next) {
/* an SSH session with more channels */
for (new_session = cur_session->ti.libssh.next;
diff --git a/tests/test_server_thread.c b/tests/test_server_thread.c
index 2af23de..836ddd1 100644
--- a/tests/test_server_thread.c
+++ b/tests/test_server_thread.c
@@ -113,7 +113,7 @@
int ret;
pthread_barrier_wait(&barrier);
- ret = nc_server_add_endpt("tertiary", NC_TI_LIBSSH);
+ ret = nc_server_add_endpt("tertiary", NC_TI_SSH);
nc_assert(!ret);
return NULL;
@@ -687,7 +687,7 @@
nc_server_ssh_set_hostkey_clb(clb_hostkeys, NULL, NULL);
/* do first, so that client can connect on SSH */
- ret = nc_server_add_endpt("main_ssh", NC_TI_LIBSSH);
+ ret = nc_server_add_endpt("main_ssh", NC_TI_SSH);
nc_assert(!ret);
ret = nc_server_endpt_set_address("main_ssh", "0.0.0.0");
nc_assert(!ret);
@@ -707,7 +707,7 @@
ret = nc_server_ssh_add_authkey_path(TESTS_DIR "/data/key_ecdsa.pub", "test2");
nc_assert(!ret);
- ret = nc_server_add_endpt("secondary", NC_TI_LIBSSH);
+ ret = nc_server_add_endpt("secondary", NC_TI_SSH);
nc_assert(!ret);
#endif
@@ -717,7 +717,7 @@
nc_server_tls_set_trusted_cert_list_clb(clb_trusted_cert_lists, NULL, NULL);
/* do first, so that client can connect on TLS */
- ret = nc_server_add_endpt("main_tls", NC_TI_OPENSSL);
+ ret = nc_server_add_endpt("main_tls", NC_TI_TLS);
nc_assert(!ret);
ret = nc_server_endpt_set_address("main_tls", "0.0.0.0");
nc_assert(!ret);
@@ -739,7 +739,7 @@
ret = nc_server_tls_endpt_add_ctn("main_tls", 1, "02:00:11:22:33:44:55:66:77:88:99:AA:BB:CC:DD:EE:FF:A0:A1:A2:A3", NC_TLS_CTN_SAN_ANY, NULL);
nc_assert(!ret);
- ret = nc_server_add_endpt("quaternary", NC_TI_OPENSSL);
+ ret = nc_server_add_endpt("quaternary", NC_TI_TLS);
nc_assert(!ret);
#endif