1
0
mirror of https://github.com/moparisthebest/curl synced 2024-11-05 00:55:04 -05:00
Commit Graph

22702 Commits

Author SHA1 Message Date
Daniel Stenberg
0c65678e71
curl-config: add --ssl-backends
Lists all SSL backends that were enabled at build-time.

Suggested-by: Oleg Pudeyev
Fixes #2128
2017-12-06 00:12:48 +01:00
Daniel Stenberg
ea3a5d07dc
conncache: only allow multiplexing within same multi handle
Connections that are used for HTTP/1.1 Pipelining or HTTP/2 multiplexing
only get additional transfers added to them if the existing connection
is held by the same multi or easy handle. libcurl does not support doing
HTTP/2 streams in different threads using a shared connection.

Closes #2152
2017-12-05 23:36:08 +01:00
Daniel Stenberg
415b8dff8e
threaded-shared-conn.c: fixed typo in commenta 2017-12-05 23:35:08 +01:00
Daniel Stenberg
5254d8bf27
threaded-shared-conn.c: new example 2017-12-05 23:31:47 +01:00
Daniel Stenberg
07cb27c98e
conncache: fix several lock issues
If the lock is released before the dealings with the bundle is over, it may
have changed by another thread in the mean time.

Fixes #2132
Fixes #2151
Closes #2139
2017-12-05 23:21:02 +01:00
Daniel Stenberg
85f0133ea1
libssh: remove dead code in sftp_qoute
... by removing a superfluous NULL pointer check that also confuses
Coverity.

Fixes #2143
Closes #2153
2017-12-05 17:08:08 +01:00
Daniel Stenberg
615edc1f73
sasl_getmesssage: make sure we have a long enough string to pass
For pop3/imap/smtp, added test 891 to somewhat verify the pop3
case.

For this, I enhanced the pingpong test server to be able to send back
responses with LF-only instead of always using CRLF.

Closes #2150
2017-12-05 17:05:44 +01:00
Daniel Stenberg
4401409468
libssh2: remove dead code from SSH_SFTP_QUOTE
Figured out while reviewing code in the libssh backend. The pointer was
checked for NULL after having been dereferenced, so we know it would
always equal true or it would've crashed.

Pointed-out-by: Nikos Mavrogiannopoulos

Bug #2143
Closes #2148
2017-12-04 13:23:12 +01:00
Daniel Stenberg
6401ddad44
ssh-libssh.c: please checksrc 2017-12-04 10:48:01 +01:00
Nikos Mavrogiannopoulos
9185307522 libssh: fixed dereference in statvfs access
The behavior is now equivalent to ssh.c when SSH_SFTP_QUOTE_STATVFS
handling fails.

Fixes #2142
2017-12-04 09:24:45 +01:00
Guitared
8dad32bcfb
RESOURCES: update spec names
Closes #2145
2017-12-04 09:15:39 +01:00
Nikos Mavrogiannopoulos
a08f5a77cc libssh: corrected use of sftp_statvfs() in SSH_SFTP_QUOTE_STATVFS
The previous code was incorrectly following the libssh2 error detection
for libssh2_sftp_statvfs, which is not correct for libssh's sftp_statvfs.

Fixes #2142

Signed-off-by: Nikos Mavrogiannopoulos <nmav@gnutls.org>
2017-12-03 12:35:44 +01:00
Nikos Mavrogiannopoulos
8843c0939e libssh: no need to call sftp_get_error as ssh_get_error is sufficient
Fixes #2141

Signed-off-by: Nikos Mavrogiannopoulos <nmav@gnutls.org>
2017-12-03 12:34:39 +01:00
Daniel Stenberg
3cef6f22ea
libssh: fix minor static code analyzer nits
- remove superfluous NULL check which otherwise tricks the static code
analyzers to assume NULL pointer dereferences.

- fix fallthrough in switch()

- indent mistake
2017-12-02 23:36:07 +01:00
Daniel Stenberg
10bb0b4719
openssl: pkcs12 is supported by boringssl
Removes another #ifdef for BoringSSL

Pointed-out-by: David Benjamin

Closes #2134
2017-12-02 11:55:01 +01:00
Jay Satiro
8eff32f0bf
travis: use pip2 instead of pip
.. since now mac osx image expects pip2 or pip3, and doesn't know pip:

0.01s$ pip install --user cpp-coveralls
/Users/travis/.travis/job_stages: line 57: pip: command not found

Ref: https://github.com/travis-ci/travis-ci/issues/8829

Closes https://github.com/curl/curl/pull/2133
2017-12-02 11:53:11 +01:00
Nikos Mavrogiannopoulos
b7f5345976
lib582: do not verify host for SFTP
This SFTP test fails with libssh back-end due to failure to verify
the peer. Disable peer verification in the test as there seems to
be the intention of the test.

Note that the libssh back-end automatically verifies the peer's
host using the default known_hosts file.

Signed-off-by: Nikos Mavrogiannopoulos <nmav@gnutls.org>
2017-12-01 17:40:14 +01:00
Nikos Mavrogiannopoulos
a2f3966800
libssh: added SFTP support
The SFTP back-end supports asynchronous reading only, limited
to 32-bit file length. Writing is synchronous with no other
limitations.

This also brings keyboard-interactive authentication.

Signed-off-by: Nikos Mavrogiannopoulos <nmav@gnutls.org>
2017-12-01 17:38:37 +01:00
Nikos Mavrogiannopoulos
c75c9d4fbc
symbols-in-versions: added new symbols with 7.56.3 version
Signed-off-by: Nikos Mavrogiannopoulos <nmav@gnutls.org>
2017-12-01 17:38:37 +01:00
Nikos Mavrogiannopoulos
05675ab5a3
.travis.yml: added build --with-libssh
Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
2017-12-01 17:35:15 +01:00
Nikos Mavrogiannopoulos
38aef6dc45
libssh2: return CURLE_UPLOAD_FAILED on failure to upload
This brings its in sync with the error code returned by the
libssh backend.

Signed-off-by: Nikos Mavrogiannopoulos <nmav@gnutls.org>
2017-12-01 17:35:15 +01:00
Nikos Mavrogiannopoulos
75427291e5
libssh2: send the correct CURLE error code on scp file not found
That also updates tests to expect the right error code

libssh2 back-end returns CURLE_SSH error if the remote file
is not found. Expect instead CURLE_REMOTE_FILE_NOT_FOUND
which is sent by the libssh backend.

Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
2017-12-01 17:35:15 +01:00
Nikos Mavrogiannopoulos
c92d2e14cf
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>
2017-12-01 17:35:14 +01:00
Daniel Stenberg
3973ee6a65
RELEASE-NOTES: synced with af8cc7a69 2017-12-01 10:37:05 +01:00
Daniel Stenberg
af8cc7a693
curlver: towards 7.57.1 2017-12-01 10:36:48 +01:00
W. Mark Kubacki
4b41424910
lib: don't export all symbols, just everything curl_*
Absent any 'symbol map' or script to limit what gets exported, static
linking of libraries previously resulted in a libcurl with curl's and
those other symbols being (re-)exported.

This did not happen if 'versioned symbols' were enabled (which is not
the default) because then a version script is employed.

This limits exports to everything starting in 'curl_*'., which is
what "libcurl.vers" exports.

This avoids strange side-effects such as with mixing methods
from system libraries and those erroneously offered by libcurl.

Closes #2127
2017-12-01 10:32:28 +01:00
Johannes Schindelin
9194a9959b
SSL: Avoid magic allocation of SSL backend specific data
Originally, my idea was to allocate the two structures (or more
precisely, the connectdata structure and the four SSL backend-specific
strucutres required for ssl[0..1] and proxy_ssl[0..1]) in one go, so
that they all could be free()d together.

However, getting the alignment right is tricky. Too tricky.

So let's just bite the bullet and allocate the SSL backend-specific
data separately.

As a consequence, we now have to be very careful to release the memory
allocated for the SSL backend-specific data whenever we release any
connectdata.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>

Closes #2119
2017-12-01 10:28:31 +01:00
Daniel Stenberg
744ee58386
examples/xmlstream.c: don't switch off CURL_GLOBAL_SSL
Reported-by: Dima Tisnek
2017-12-01 07:52:24 +01:00
Daniel Stenberg
270494e1a0
travis: add boringssl build
Uses a separate build without --enable-debug and no valgrind.

The debug option causes far too many warnings in boringssl's headers
(C++ comments, trailing commas etc).  Valgrind triggers some false
positive errors in thread-local data used by boringssl.

Closes #2118
2017-11-30 08:16:32 +01:00
Daniel Stenberg
62c07b5743
RELEASE-NOTES: curl 7.57.0 2017-11-29 10:27:26 +01:00
Daniel Stenberg
d05b8ff1f4
THANKS: added contributors from 7.57.0 release 2017-11-29 10:27:26 +01:00
Daniel Stenberg
cd276c3cca
openssl: fix boringssl build again
commit d3ab7c5a21 broke the boringssl build since it doesn't have
RSA_flags(), so we disable that code block for boringssl builds.

Reported-by: W. Mark Kubacki
Fixes #2117
2017-11-27 19:39:09 +01:00
Daniel Stenberg
014887c50a
curl_ntlm_core.c: use the limits.h's SIZE_T_MAX if provided 2017-11-27 10:40:31 +01:00
Daniel Stenberg
59657f53f9
libcurl-share.3: the connection cache is shareable now 2017-11-27 09:42:39 +01:00
Daniel Stenberg
d661b0afb5
global_init: ignore CURL_GLOBAL_SSL's absense
This bit is no longer used. It is not clear what it meant for users to
"init the TLS" in a world with different TLS backends and since the
introduction of multissl, libcurl didn't properly work if inited without
this bit set.

Not a single user responded to the call for users of it:
https://curl.haxx.se/mail/lib-2017-11/0072.html

Reported-by: Evgeny Grin
Assisted-by: Jay Satiro

Fixes #2089
Fixes #2083
Closes #2107
2017-11-27 08:50:33 +01:00
Daniel Stenberg
7f2a1df6f5
ntlm: avoid integer overflow for malloc size
Reported-by: Alex Nichols
Assisted-by: Kamil Dudka and Max Dymond

CVE-2017-8816

Bug: https://curl.haxx.se/docs/adv_2017-11e7.html
2017-11-27 08:19:34 +01:00
Daniel Stenberg
0b664ba968
wildcardmatch: fix heap buffer overflow in setcharset
The code would previous read beyond the end of the pattern string if the
match pattern ends with an open bracket when the default pattern
matching function is used.

Detected by OSS-Fuzz:
https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=4161

CVE-2017-8817

Bug: https://curl.haxx.se/docs/adv_2017-ae72.html
2017-11-27 08:19:34 +01:00
Jay Satiro
9b5e12a549
url: fix alignment of ssl_backend_data struct
- Align the array of ssl_backend_data on a max 32 byte boundary.

8 is likely to be ok but I went with 32 for posterity should one of
the ssl_backend_data structs change to contain a larger sized variable
in the future.

Prior to this change (since dev 70f1db3, release 7.56) the connectdata
structure was undersized by 4 bytes in 32-bit builds with ssl enabled
because long long * was mistakenly used for alignment instead of
long long, with the intention being an 8 byte boundary. Also long long
may not be an available type.

The undersized connectdata could lead to oob read/write past the end in
what was expected to be the last 4 bytes of the connection's secondary
socket https proxy ssl_backend_data struct (the secondary socket in a
connection is used by ftp, others?).

Closes https://github.com/curl/curl/issues/2093

CVE-2017-8818

Bug: https://curl.haxx.se/docs/adv_2017-af0a.html
2017-11-27 08:19:25 +01:00
Daniel Stenberg
c79b2ca03d
ssh: remove check for a NULL pointer (!)
With this check present, scan-build warns that we might dereference this
point in other places where it isn't first checked for NULL. Thus, if it
*can* be NULL we have a problem on a few places. However, this pointer
should not be possible to be NULL here so I remove the check and thus
also three different scan-build warnings.

Closes #2111
2017-11-25 22:52:36 +01:00
Matthew Kerwin
3da4ebad30
test: add test for bad UNC/SMB path in file: URL 2017-11-24 23:13:16 +01:00
Matthew Kerwin
d7c103746c
test: add tests to ensure basic file: URLs 2017-11-24 23:13:16 +01:00
Matthew Kerwin
25634611f9
URL: update "file:" URL handling
* LOTS of comment updates
* explicit error for SMB shares (e.g. "file:////share/path/file")
* more strict handling of authority (i.e. "//localhost/")
* now accepts dodgy old "C:|" drive letters
* more precise handling of drive letters in and out of Windows
  (especially recognising both "file:c:/" and "file:/c:/")

Closes #2110
2017-11-24 23:12:55 +01:00
Daniel Stenberg
d6ec96f7ff
metalink: fix memory-leak and NULL pointer dereference
Reported by scan-build

Closes #2109
2017-11-24 13:30:38 +01:00
Alessandro Ghedini
979b012eeb
connect: add support for new TCP Fast Open API on Linux
The new API added in Linux 4.11 only requires setting a socket option
before connecting, without the whole sento() machinery.

Notably, this makes it possible to use TFO with SSL connections on Linux
as well, without the need to mess around with OpenSSL (or whatever other
SSL library) internals.

Closes #2056
2017-11-24 10:49:59 +01:00
Daniel Stenberg
9f691be3d4
make: fix "make distclean"
Fixes #2097
Closes #2108
2017-11-24 08:38:29 +01:00
Daniel Stenberg
6b9dd0d409
RELEASE-NOTES: synced with 31f18d272 2017-11-23 10:26:52 +01:00
Jay Satiro
31f18d2722 connect: improve the bind error message
eg consider a non-existent interface eth8, curl --interface eth8

Before: curl: (45) Could not resolve host: eth8
After: curl: (45) Couldn't bind to 'eth8'

Bug: https://github.com/curl/curl/issues/2104
Reported-by: Alfonso Martone
2017-11-23 02:47:26 -05:00
Daniel Stenberg
ed22d8654b
examples/rtsp: clear RANGE again after use
Fixes #2106
Reported-by: youngchopin on github
2017-11-23 08:06:44 +01:00
Michael Kaufmann
914f4ed279
test1264: verify URL with space in host name being rejected 2017-11-22 11:14:44 +01:00
Daniel Stenberg
fa939220df
url: reject ASCII control characters and space in host names
Host names like "127.0.0.1 moo" would otherwise be accepted by some
getaddrinfo() implementations.

Updated test 1034 and 1035 accordingly.

Fixes #2073
Closes #2092
2017-11-22 11:14:06 +01:00