Skip to content
Permalink
Browse files

Merge branch 'master' of git://github.com/curl/curl into pkcs12mem/pk…

…cs12mem
  • Loading branch information
gvollant committed Jan 13, 2020
2 parents 10975b0 + f128c00 commit 8b9b313230aad3e962fa050a2401b597548fe4a7
@@ -8,12 +8,24 @@ curl and libcurl 7.69.0

This release includes the following changes:

o
o wolfSSH: new support SSH backend [5]

This release includes the following bugfixes:

o cmake: Enable SMB for Windows builds [12]
o cmake: Improve libssh2 check on Windows [8]
o connection reuse: respect the max_concurrent_streams limits [3]
o curl: make #0 not output the full URL [4]
o curl: remove 'config' field from OutStruct [6]
o hostip: move code to resolve IP address literals to `Curl_resolv` [13]
o include: remove non-curl prefixed defines [15]
o libssh2: add support for forcing a hostkey type [7]
o multi: Change curl_multi_wait/poll to error on negative timeout [11]
o ngtcp2: Add an error code for QUIC connection errors [10]
o runtests: make random seed fixed for a month [1]
o schannel: Make CURLOPT_CAINFO work better on Windows 7 [9]
o tool_dirhie: Allow directory traversal during creation [2]
o vtls: Refactor Curl_multissl_version to make the code clearer [14]

This release includes the following known bugs:

@@ -22,12 +34,28 @@ This release includes the following known bugs:
This release would not have looked like this without help, code, reports and
advice from friends like these:

Daniel Stenberg, mbeifuss on github, Ray Satiro,
(3 contributors)
Brian Carpenter, Daniel Stenberg, Emil Engler, Faizur Rahman,
hamstergene on github, Jeroen Ooms, Johannes Schindelin, Kunal Ekawde,
Marc Aldorasi, Marcel Raad, mbeifuss on github, Ray Satiro, Santino Keupp,
vshmuk on hackerone,
(14 contributors)

Thanks! (and sorry if I forgot to mention someone)

References to bug reports and discussions on issues:

[1] = https://curl.haxx.se/bug/?i=4734
[2] = https://curl.haxx.se/bug/?i=4796
[3] = https://curl.haxx.se/bug/?i=4779
[4] = https://curl.haxx.se/bug/?i=4812
[5] = https://daniel.haxx.se/blog/2020/01/12/curl-even-more-wolfed/
[6] = https://curl.haxx.se/bug/?i=4807
[7] = https://curl.haxx.se/bug/?i=4747
[8] = https://curl.haxx.se/bug/?i=4804
[9] = https://curl.haxx.se/bug/?i=3711
[10] = https://curl.haxx.se/bug/?i=4754
[11] = https://curl.haxx.se/bug/?i=4763
[12] = https://curl.haxx.se/bug/?i=4717
[13] = https://curl.haxx.se/bug/?i=4798
[14] = https://curl.haxx.se/bug/?i=4803
[15] = https://curl.haxx.se/bug/?i=4793
@@ -2795,17 +2795,23 @@ dnl **********************************************************************
dnl Default to compiler & linker defaults for LIBSSH2 files & libraries.
OPT_LIBSSH2=off
AC_ARG_WITH(libssh2,dnl
AC_HELP_STRING([--with-libssh2=PATH],[Where to look for libssh2, PATH points to the LIBSSH2 installation; when possible, set the PKG_CONFIG_PATH environment variable instead of using this option])
AC_HELP_STRING([--with-libssh2], [enable LIBSSH2]),
AC_HELP_STRING([--with-libssh2=PATH],[Where to look for libssh2, PATH points to the libssh2 installation; when possible, set the PKG_CONFIG_PATH environment variable instead of using this option])
AC_HELP_STRING([--with-libssh2], [enable libssh2]),
OPT_LIBSSH2=$withval, OPT_LIBSSH2=no)


OPT_LIBSSH=off
AC_ARG_WITH(libssh,dnl
AC_HELP_STRING([--with-libssh=PATH],[Where to look for libssh, PATH points to the LIBSSH installation; when possible, set the PKG_CONFIG_PATH environment variable instead of using this option])
AC_HELP_STRING([--with-libssh], [enable LIBSSH]),
AC_HELP_STRING([--with-libssh=PATH],[Where to look for libssh, PATH points to the libssh installation; when possible, set the PKG_CONFIG_PATH environment variable instead of using this option])
AC_HELP_STRING([--with-libssh], [enable libssh]),
OPT_LIBSSH=$withval, OPT_LIBSSH=no)

OPT_WOLFSSH=off
AC_ARG_WITH(wolfssh,dnl
AC_HELP_STRING([--with-wolfssh=PATH],[Where to look for wolfssh, PATH points to the wolfSSH installation; when possible, set the PKG_CONFIG_PATH environment variable instead of using this option])
AC_HELP_STRING([--with-wolfssh], [enable wolfssh]),
OPT_WOLFSSH=$withval, OPT_WOLFSSH=no)

if test X"$OPT_LIBSSH2" != Xno; then
dnl backup the pre-libssh2 variables
CLEANLDFLAGS="$LDFLAGS"
@@ -2952,6 +2958,28 @@ elif test X"$OPT_LIBSSH" != Xno; then
CPPFLAGS=$CLEANCPPFLAGS
LIBS=$CLEANLIBS
fi
elif test X"$OPT_WOLFSSH" != Xno; then
dnl backup the pre-wolfssh variables
CLEANLDFLAGS="$LDFLAGS"
CLEANCPPFLAGS="$CPPFLAGS"
CLEANLIBS="$LIBS"


if test "$OPT_WOLFSSH" != yes; then
WOLFCONFIG="$OPT_WOLFSSH/bin/wolfssh-config"
LDFLAGS="$LDFLAGS `$WOLFCONFIG --libs`"
CPPFLAGS="$CPPFLAGS `$WOLFCONFIG --cflags`"
fi

AC_CHECK_LIB(wolfssh, wolfSSH_Init)

AC_CHECK_HEADERS(wolfssh/ssh.h,
curl_ssh_msg="enabled (wolfSSH)"
WOLFSSH_ENABLED=1
AC_DEFINE(USE_WOLFSSH, 1, [if wolfSSH is in use])
AC_SUBST(USE_WOLFSSH, [1])
)

fi

dnl **********************************************************************
@@ -4761,6 +4789,10 @@ if test "x$USE_LIBSSH" = "x1"; then
SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS SCP"
SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS SFTP"
fi
if test "x$USE_WOLFSSH" = "x1"; then
SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS SCP"
SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS SFTP"
fi
if test "x$CURL_DISABLE_RTSP" != "x1"; then
SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS RTSP"
fi
@@ -42,7 +42,7 @@ LIB_VQUIC_CFILES = vquic/ngtcp2.c vquic/quiche.c

LIB_VQUIC_HFILES = vquic/ngtcp2.h vquic/quiche.h

LIB_VSSH_CFILES = vssh/libssh2.c vssh/libssh.c
LIB_VSSH_CFILES = vssh/libssh2.c vssh/libssh.c vssh/wolfssh.c

LIB_VSSH_HFILES = vssh/ssh.h

@@ -5,7 +5,7 @@
* | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____|
*
* Copyright (C) 1998 - 2019, Daniel Stenberg, <daniel@haxx.se>, et al.
* Copyright (C) 1998 - 2020, Daniel Stenberg, <daniel@haxx.se>, et al.
*
* This software is licensed as described in the file COPYING, which
* you should have received as part of this distribution. The terms
@@ -215,6 +215,13 @@ static CURLcode global_init(long flags, bool memoryfuncs)
}
#endif

#ifdef USE_WOLFSSH
if(WS_SUCCESS != wolfSSH_Init()) {
DEBUGF(fprintf(stderr, "Error: wolfSSH_Init failed\n"));
return CURLE_FAILED_INIT;
}
#endif

if(flags & CURL_GLOBAL_ACK_EINTR)
Curl_ack_eintr = 1;

@@ -294,6 +301,10 @@ void curl_global_cleanup(void)

Curl_ssh_cleanup();

#ifdef USE_WOLFSSH
(void)wolfSSH_Cleanup();
#endif

init_flags = 0;
}

@@ -5,7 +5,7 @@
* | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____|
*
* Copyright (C) 1998 - 2019, Daniel Stenberg, <daniel@haxx.se>, et al.
* Copyright (C) 1998 - 2020, Daniel Stenberg, <daniel@haxx.se>, et al.
*
* This software is licensed as described in the file COPYING, which
* you should have received as part of this distribution. The terms
@@ -1158,7 +1158,7 @@ static void populate_settings(struct connectdata *conn,
nghttp2_settings_entry *iv = httpc->local_settings;

iv[0].settings_id = NGHTTP2_SETTINGS_MAX_CONCURRENT_STREAMS;
iv[0].value = (uint32_t)Curl_multi_max_concurrent_streams(conn->data->multi);
iv[0].value = Curl_multi_max_concurrent_streams(conn->data->multi);

iv[1].settings_id = NGHTTP2_SETTINGS_INITIAL_WINDOW_SIZE;
iv[1].value = HTTP2_HUGE_WINDOW_SIZE;
@@ -369,6 +369,7 @@ struct Curl_multi *Curl_multi_handle(int hashsize, /* socket hash */

/* -1 means it not set by user, use the default value */
multi->maxconnects = -1;
multi->max_concurrent_streams = 100;

#ifdef ENABLE_WAKEUP
if(Curl_socketpair(AF_UNIX, SOCK_STREAM, 0, multi->wakeup_pair) < 0) {
@@ -2900,8 +2901,8 @@ CURLMcode curl_multi_setopt(struct Curl_multi *multi,
if(streams < 1)
streams = 100;
multi->max_concurrent_streams =
(streams > (long)INITIAL_MAX_CONCURRENT_STREAMS)?
(long)INITIAL_MAX_CONCURRENT_STREAMS : streams;
(streams > (long)INITIAL_MAX_CONCURRENT_STREAMS)?
INITIAL_MAX_CONCURRENT_STREAMS : (unsigned int)streams;
}
break;
default:
@@ -3343,8 +3344,8 @@ void Curl_multi_dump(struct Curl_multi *multi)
}
#endif

size_t Curl_multi_max_concurrent_streams(struct Curl_multi *multi)
unsigned int Curl_multi_max_concurrent_streams(struct Curl_multi *multi)
{
return multi ? ((size_t)multi->max_concurrent_streams ?
(size_t)multi->max_concurrent_streams : 100) : 0;
DEBUGASSERT(multi);
return multi->max_concurrent_streams;
}
@@ -142,7 +142,7 @@ struct Curl_multi {
struct curltime timer_lastcall; /* the fixed time for the timeout for the
previous callback */
bool in_callback; /* true while executing a callback */
long max_concurrent_streams; /* max concurrent streams client to support */
unsigned int max_concurrent_streams;

#ifdef ENABLE_WAKEUP
curl_socket_t wakeup_pair[2]; /* socketpair() used for wakeup
@@ -7,7 +7,7 @@
* | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____|
*
* Copyright (C) 1998 - 2019, Daniel Stenberg, <daniel@haxx.se>, et al.
* Copyright (C) 1998 - 2020, Daniel Stenberg, <daniel@haxx.se>, et al.
*
* This software is licensed as described in the file COPYING, which
* you should have received as part of this distribution. The terms
@@ -90,9 +90,7 @@ CURLMcode Curl_multi_add_perform(struct Curl_multi *multi,
struct connectdata *conn);


/* Return the value of the CURLMOPT_MAX_CONCURRENT_STREAMS option
* If not specified or 0, default would be 100
*/
size_t Curl_multi_max_concurrent_streams(struct Curl_multi *multi);
/* Return the value of the CURLMOPT_MAX_CONCURRENT_STREAMS option */
unsigned int Curl_multi_max_concurrent_streams(struct Curl_multi *multi);

#endif /* HEADER_CURL_MULTIIF_H */
@@ -5,7 +5,7 @@
* | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____|
*
* Copyright (C) 1998 - 2019, Daniel Stenberg, <daniel@haxx.se>, et al.
* Copyright (C) 1998 - 2020, Daniel Stenberg, <daniel@haxx.se>, et al.
*
* This software is licensed as described in the file COPYING, which
* you should have received as part of this distribution. The terms
@@ -187,7 +187,7 @@ static const struct Curl_handler * const protocols[] = {
&Curl_handler_tftp,
#endif

#if defined(USE_SSH)
#if defined(USE_SSH) && !defined(USE_WOLFSSH)
&Curl_handler_scp,
#endif

@@ -1073,7 +1073,7 @@ ConnectionExists(struct Curl_easy *data,
curr = bundle->conn_list.head;
while(curr) {
bool match = FALSE;
size_t multiplexed;
size_t multiplexed = 0;

/*
* Note that if we use a HTTP proxy in normal mode (no tunneling), we
@@ -1086,8 +1086,8 @@ ConnectionExists(struct Curl_easy *data,
/* connect-only or to-be-closed connections will not be reused */
continue;

multiplexed = CONN_INUSE(check) &&
(bundle->multiuse == BUNDLE_MULTIPLEX);
if(bundle->multiuse == BUNDLE_MULTIPLEX)
multiplexed = CONN_INUSE(check);

if(canmultiplex) {
;
@@ -1347,6 +1347,13 @@ ConnectionExists(struct Curl_easy *data,
multiplexed);
continue;
}
else if(multiplexed >=
Curl_multi_max_concurrent_streams(needle->data->multi)) {
infof(data, "client side MAX_CONCURRENT_STREAMS reached"
", skip (%zu)\n",
multiplexed);
continue;
}
}
#endif
/* When not multiplexed, we have a match here! */
@@ -5,7 +5,7 @@
* | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____|
*
* Copyright (C) 1998 - 2019, Daniel Stenberg, <daniel@haxx.se>, et al.
* Copyright (C) 1998 - 2020, Daniel Stenberg, <daniel@haxx.se>, et al.
*
* This software is licensed as described in the file COPYING, which
* you should have received as part of this distribution. The terms
@@ -265,8 +265,10 @@ static const char * const protocols[] = {
#ifndef CURL_DISABLE_RTSP
"rtsp",
#endif
#if defined(USE_SSH)
#if defined(USE_SSH) && !defined(USE_WOLFSSH)
"scp",
#endif
#ifdef USE_SSH
"sftp",
#endif
#if !defined(CURL_DISABLE_SMB) && defined(USE_NTLM) && \
@@ -7,7 +7,7 @@
* | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____|
*
* Copyright (C) 1998 - 2019, Daniel Stenberg, <daniel@haxx.se>, et al.
* Copyright (C) 1998 - 2020, Daniel Stenberg, <daniel@haxx.se>, et al.
*
* This software is licensed as described in the file COPYING, which
* you should have received as part of this distribution. The terms
@@ -30,7 +30,10 @@
#elif defined(HAVE_LIBSSH_LIBSSH_H)
#include <libssh/libssh.h>
#include <libssh/sftp.h>
#endif /* HAVE_LIBSSH2_H */
#elif defined(USE_WOLFSSH)
#include <wolfssh/ssh.h>
#include <wolfssh/wolfsftp.h>
#endif

/****************************************************************************
* SSH unique setup
@@ -188,16 +191,19 @@ struct ssh_conn {
#ifdef HAVE_LIBSSH2_KNOWNHOST_API
LIBSSH2_KNOWNHOSTS *kh;
#endif
#elif defined(USE_WOLFSSH)
WOLFSSH *ssh_session;
WOLFSSH_CTX *ctx;
word32 handleSz;
byte handle[WOLFSSH_MAX_HANDLE];
curl_off_t offset;
#endif /* USE_LIBSSH */
};

#if defined(USE_LIBSSH)

#define CURL_LIBSSH_VERSION ssh_version(0)

extern const struct Curl_handler Curl_handler_scp;
extern const struct Curl_handler Curl_handler_sftp;

#elif defined(USE_LIBSSH2)

/* Feature detection based on version numbers to better work with
@@ -237,11 +243,13 @@ extern const struct Curl_handler Curl_handler_sftp;
#define CURL_LIBSSH2_VERSION LIBSSH2_VERSION
#endif

extern const struct Curl_handler Curl_handler_scp;
extern const struct Curl_handler Curl_handler_sftp;
#endif /* USE_LIBSSH2 */

#ifdef USE_SSH

extern const struct Curl_handler Curl_handler_scp;
extern const struct Curl_handler Curl_handler_sftp;

/* generic SSH backend functions */
CURLcode Curl_ssh_init(void);
void Curl_ssh_cleanup(void);

0 comments on commit 8b9b313

Please sign in to comment.
You can’t perform that action at this time.