summaryrefslogtreecommitdiff
path: root/lib/version.c
diff options
context:
space:
mode:
authorNikos Mavrogiannopoulos <nmav@redhat.com>2017-10-23 13:49:23 +0200
committerDaniel Stenberg <daniel@haxx.se>2017-12-01 17:35:14 +0100
commitc92d2e14cfb0db662f958effd2ac86f995cf1b5a (patch)
treea5352cc296c3f7230dc0e34391262941b070feda /lib/version.c
parent3973ee6a654e96c027afee86037680334b24e709 (diff)
downloadgnurl-c92d2e14cfb0db662f958effd2ac86f995cf1b5a.tar.gz
gnurl-c92d2e14cfb0db662f958effd2ac86f995cf1b5a.tar.bz2
gnurl-c92d2e14cfb0db662f958effd2ac86f995cf1b5a.zip
Added support for libssh SSH SCP back-end
libssh is an alternative library to libssh2. https://www.libssh.org/ That patch set also introduces support for ECDSA ed25519 keys, as well as gssapi authentication. Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
Diffstat (limited to 'lib/version.c')
-rw-r--r--lib/version.c15
1 files changed, 12 insertions, 3 deletions
diff --git a/lib/version.c b/lib/version.c
index 79cc0bba4..f0861ea7a 100644
--- a/lib/version.c
+++ b/lib/version.c
@@ -26,6 +26,7 @@
#include "urldata.h"
#include "vtls/vtls.h"
#include "http2.h"
+#include "ssh.h"
#include "curl_printf.h"
#ifdef USE_ARES
@@ -176,6 +177,11 @@ char *curl_version(void)
left -= len;
ptr += len;
#endif
+#ifdef USE_LIBSSH
+ len = snprintf(ptr, left, " libssh/%s", CURL_LIBSSH_VERSION);
+ left -= len;
+ ptr += len;
+#endif
#ifdef USE_NGHTTP2
len = Curl_http2_ver(ptr, left);
left -= len;
@@ -264,7 +270,7 @@ static const char * const protocols[] = {
#ifndef CURL_DISABLE_RTSP
"rtsp",
#endif
-#ifdef USE_LIBSSH2
+#if defined(USE_LIBSSH) || defined(USE_LIBSSH2)
"scp",
#endif
#ifdef USE_LIBSSH2
@@ -379,7 +385,7 @@ static curl_version_info_data version_info = {
curl_version_info_data *curl_version_info(CURLversion stamp)
{
static bool initialized;
-#ifdef USE_LIBSSH2
+#if defined(USE_LIBSSH) || defined(USE_LIBSSH2)
static char ssh_buffer[80];
#endif
#ifdef USE_SSL
@@ -431,9 +437,12 @@ curl_version_info_data *curl_version_info(CURLversion stamp)
#endif /* _LIBICONV_VERSION */
#endif
-#ifdef USE_LIBSSH2
+#if defined(USE_LIBSSH2)
snprintf(ssh_buffer, sizeof(ssh_buffer), "libssh2/%s", LIBSSH2_VERSION);
version_info.libssh_version = ssh_buffer;
+#elif defined(USE_LIBSSH)
+ snprintf(ssh_buffer, sizeof(ssh_buffer), "libssh/%s", CURL_LIBSSH_VERSION);
+ version_info.libssh_version = ssh_buffer;
#endif
#ifdef HAVE_BROTLI