blob: 9bc3b76c831d7702599cf21c172b6ef58637153f [file] [log] [blame]
_ _ ____ _
___| | | | _ \| |
/ __| | | | |_) | |
| (__| |_| | _ <| |___
\___|\___/|_| \_\_____|
Version 7.58.0 (23 Jan 2018)
Daniel Stenberg (23 Jan 2018)
- RELEASE: 7.58.0
- [Gisle Vanem brought this change]
progress-bar: get screen width on windows
- test1454: --connect-to with IPv6 address w/o IPv6 support!
- CONNECT_TO: fail attempt to set an IPv6 numerical without IPv6 support
Reported-by: John Hascall
Closes #2257
- docs: fix man page syntax to make test 1140 OK again
- http: prevent custom Authorization headers in redirects
... unless CURLOPT_UNRESTRICTED_AUTH is set to allow them. This matches how
curl already handles Authorization headers created internally.
Note: this changes behavior slightly, for the sake of reducing mistakes.
Added test 317 and 318 to verify.
Reported-by: Craig de Stigter
- curl: progress bar refresh, get width using ioctl()
Get screen width from the environment variable COLUMNS first, if set. If
not, use ioctl(). If nether works, assume 79.
Closes #2242
The "refresh" is for the -# output when no total transfer size is
known. It will now only use a single updated line even for this case:
The "-=O=-" ship moves when data is transferred. The four flying
"hashes" move (on a sine wave) on each refresh, independent of data.
- RELEASE-NOTES: synced with bb0ffcc36
- libcurl-env.3: first take
- TODO: two possible name resolver improvements
- [Kartik Mahajan brought this change]
http2: don't close connection when single transfer is stopped
Fixes #2237
Closes #2249
- test558: fix for multissl builds
vtls.c:multissl_init() might do a curl_free() call so strip that out to
make this work with more builds. We just want to verify that
memorytracking works so skipping one line is no harm.
- examples/url2file.c: add missing curl_global_cleanup() call
Reported-by: XhstormR on github
Fixes #2245
- [Michael Gmelin brought this change]
SSH: Fix state machine for ssh-agent authentication
In case an identity didn't match[0], the state machine would fail in
state SSH_AUTH_AGENT instead of progressing to the next identity in
ssh-agent. As a result, ssh-agent authentication only worked if the
identity required happened to be the first added to ssh-agent.
This was introduced as part of commit c4eb10e2f06fbd6cc904f1d78e4, which
stated that the "else" statement was required to prevent getting stuck
in state SSH_AUTH_AGENT. Given the state machine's logic and libssh2's
interface I couldn't see how this could happen or reproduce it and I
also couldn't find a more detailed description of the problem which
would explain a test case to reproduce the problem this was supposed to
[0] libssh2_agent_userauth returning LIBSSH2_ERROR_AUTHENTICATION_FAILED
Closes #2248
- openssl: fix potential memory leak in SSLKEYLOGFILE logic
Coverity CID 1427646.
- openssl: fix the libressl build again
Follow-up to 84fcaa2e7. libressl does not have the API even if it says it is
late OpenSSL version...
Fixes #2246
Closes #2247
Reported-by: jungle-boogie on github
- unit1307: test many wildcards too
- curl_fnmatch: only allow 5 '*' sections in a single pattern
... to avoid excessive recursive calls. The number 5 is totally
arbitrary and could be modified if someone has a good motivation.
- ftp-wildcard: fix matching an empty string with "*[^a]"
.... and avoid advancing the pointer to trigger an out of buffer read.
Detected by OSS-fuzz
Assisted-by: Max Dymond
- SMB: fix numeric constant suffix and variable types
1. don't use "ULL" suffix since unsupported in older MSVC
2. use curl_off_t instead of custom long long ifdefs
3. make get_posix_time() not do unaligned data access
Fixes #2211
Closes #2240
Reported-by: Chester Liu
- [rouzier brought this change]
Closes #2239
- smtp/pop3/imap_get_message: decrease the data length too...
Follow-up commit to 615edc1f73 which was incomplete.
Assisted-by: Max Dymond
Detected by OSS-fuzz
- openssl: enable SSLKEYLOGFILE support by default
Fixes #2210
Closes #2236
Patrick Monnerat (14 Jan 2018)
- mime: clone mime tree upon easy handle duplication.
A mime tree attached to an easy handle using CURLOPT_MIMEPOST is
strongly bound to the handle: there is a pointer to the easy handle in
each item of the mime tree and following the parent pointer list
of mime items ends in a dummy part stored within the handle.
Because of this binding, a mime tree cannot be shared between different
easy handles, thus it needs to be cloned upon easy handle duplication.
There is no way for the caller to get the duplicated mime tree
handle: it is then set to be automatically destroyed upon freeing the
new easy handle.
New test 654 checks proper mime structure duplication/release.
Add a warning note in curl_mime_data_cb() documentation about sharing
user data between duplicated handles.
Closes #2235
- docs: comment about CURLE_READ_ERROR returned by curl_mime_filedata
Daniel Stenberg (13 Jan 2018)
- test395: HTTP with overflow Content-Length value
- test394: verify abort of rubbish in Content-Length: value
- test393: verify --max-filesize with excessive Content-Length
- HTTP: bail out on negative Content-Length: values
... and make the max filesize check trigger if the value is too big.
Updates test 178.
Reported-by: Brad Spencer
Fixes #2212
Closes #2223
Marcel Raad (13 Jan 2018)
- [Dan Johnson brought this change] append extra linker flags instead of prepending them.
Link order should list libraries after the libraries that use them,
so when we're guessing that we might also need to add -ldl in order
to use -lssl, we should add -ldl after -lssl.
Daniel Stenberg (13 Jan 2018)
- RELEASE-NOTES: synced with 6fa10c8fa
Jay Satiro (13 Jan 2018)
- setopt: fix SSLVERSION to allow CURL_SSLVERSION_MAX_ values
Broken since f121575 (precedes 7.56.1).
Patrick Monnerat (13 Jan 2018)
- setopt: reintroduce non-static Curl_vsetopt() for OS400 support
This also upgrades ILE/RPG bindings with latest setopt options.
Reported-By: jonrumsey on github
Fixes #2230
Closes #2233
Jay Satiro (11 Jan 2018)
- [Zhouyihai Ding brought this change]
http2: fix incorrect trailer buffer size
Prior to this change the stored byte count of each trailer was
miscalculated and 1 less than required. It appears any trailer
after the first that was passed to Curl_client_write would be truncated
or corrupted as well as the size. Potentially the size of some
subsequent trailer could be erroneously extracted from the contents of
that trailer, and since that size is used by client write an
out-of-bounds read could occur and cause a crash or be otherwise
processed by client write.
The bug appears to have been born in 0761a51 (precedes 7.49.0).
- [Basuke Suzuki brought this change]
easy: fix connection ownership in curl_easy_pause
Before calling Curl_client_chop_write(), change the owner of connection
to the current Curl_easy handle. This will fix the issue #2217.
Daniel Stenberg (9 Jan 2018)
- [Dimitrios Apostolou brought this change]
system.h: Additionally check __LONG_MAX__ for defining curl_off_t
__SIZEOF_LONG__ was introduced in GCC 4.4, __LONG_MAX__ was introduced
in GCC 3.3.
Closes #2216
- COPYING: it's 2018!
- progress: calculate transfer speed on milliseconds if possible
to increase accuracy for quick transfers
Fixes #2200
Closes #2206
Jay Satiro (7 Jan 2018)
- scripts: allow all perl scripts to be run directly
- Enable execute permission (chmod +x)
- Change interpreter to /usr/bin/env perl
- mail-rcpt.d: fix short-text description
- build: remove HAVE_LIMITS_H check
.. because limits.h presence isn't optional, it's required by C89.
- openssl: fix memory leak of SSLKEYLOGFILE filename
- Free the copy of SSLKEYLOGFILE env returned by curl_getenv during ossl
Caught by ASAN.
- Revert "curl/system.h: fix compilation with gcc on AIX PPC and IA64 HP-UX"
This reverts commit c97648b55080343bb371522bf4233e94a2a13a99.
SIZEOF_LONG should not be checked in system.h since that macro is only
defined when building libcurl.
Michael Kaufmann (30 Dec 2017)
- test1554: improve the error handling
- test1554: add global initialization and cleanup
Daniel Stenberg (29 Dec 2017)
- curl_version_info.3: call the argument 'age'
Reported-by: Pete Lomax
Patrick Monnerat (27 Dec 2017)
- [Mikalai Ananenka brought this change]
brotli: data at the end of content can be lost
Decoding loop implementation did not concern the case when all
received data is consumed by Brotli decoder and the size of decoded
data internally hold by Brotli decoder is greater than CURL_MAX_WRITE_SIZE.
For content with unencoded length greater than CURL_MAX_WRITE_SIZE this
can result in the loss of data at the end of content.
Closes #2194
Jay Satiro (26 Dec 2017)
- examples/cacertinmem: ignore cert-already-exists error
- Ignore X509_R_CERT_ALREADY_IN_HASH_TABLE errors in the CTX callback
since it's possible the cert may have already been loaded by libcurl.
- Remove the EXAMPLE code in the CURLOPT_SSL_CTX_FUNCTION.3 doc.
Instead have it direct the reader to this cacertinmem.c example.
- Fix the CA certificate to use the right CA for, Digicert.
Reported-by: Thomas van Hesteren
- [Gisle Vanem brought this change]
tool_getparam: Support size modifiers for --max-filesize
- Move the size modifier detection code from limit-rate to its own
function so that it can also be used with max-filesize.
Size modifiers are the suffixes such as G (gigabyte), M (megabyte) etc.
For example --max-filesize 1G
Steve Holme (22 Dec 2017)
- build: Fixed incorrect script termination from commit ad1dc10e61
- Added our standard copyright header
- winbuild: Added support for VC15
- build: Added Visual Studio 2017 project files
- build-wolfssl.bat: Added support for VC15
- build-openssl.bat: Added support for VC15
Jay Satiro (22 Dec 2017)
- [Dimitrios Apostolou brought this change]
curl/system.h: fix compilation with gcc on AIX PPC and IA64 HP-UX
- [Mattias Fornander brought this change]
examples/rtsp: fix error handling macros
Patrick Monnerat (20 Dec 2017)
- curl_easy_reset: release mime-related data.
Move curl_mime_initpart() and curl_mime_cleanpart() calls to lower-level
functions dealing with UserDefined structure contents.
This avoids memory leakages on curl-generated part mime headers.
New test 2073 checks this using the cli tool --next option: it
triggers a valgrind error if bug is present.
Reported-by: Martin Galvan
- content_encoding: rework zlib_inflate
- When zlib version is <, process gzip trailer before considering
extra data as an error.
- Inflate with Z_BLOCK instead of Z_SYNC_FLUSH to maximize correct data
and minimize corrupt data output.
- Do not try to restart deflate decompression in raw mode if output has
started or if the leading data is not available anymore.
- New test 232 checks inflating raw-deflated content.
Closes #2068
- brotli: allow compiling with version 0.6.0.
Some error codes were not yet defined in brotli 0.6.0: do not issue code
for them in this case.
Daniel Stenberg (13 Dec 2017)
- CURLOPT_READFUNCTION.3: refer to argument with correct name
Bug: #2175
[ci skip]
- rand: add a clang-analyzer work-around
scan-build would warn on a potential access of an uninitialized
buffer. I deem it a false positive and had to add this somewhat ugly
work-around to silence it.
- krb5: fix a potential access of uninitialized memory
A scan-build warning.
- conncache: fix a return code [regression]
This broke in 07cb27c98e. Make sure to return 'result' properly. Pointed
out by scan-build!
- curl: support >256 bytes warning messsages
Bug: #2174
Michael Kaufmann (12 Dec 2017)
- libssh: fix a syntax error in
Follow-up to c92d2e1
Closes #2172
Daniel Stenberg (12 Dec 2017)
- examples/smtp-mail.c: use separate defines for options and mail
... to make it clearer that the options want address-only, while the
headers in an email can also have the real name.
Assisted-by: Sean MacLennan
- THANKS: added missing names
... as I reran the contrithanks script after the mailmap name fixups.
- mailmap: added/clarified several names
- setopt: less *or equal* than INT_MAX/1000 should be fine
Reported-by: Dominik Hölzl
Closes #2173
- [Dmitry Kostjuchenko brought this change]
vtls: replaced getenv() with curl_getenv()
Fixed undefined symbol of getenv() which does not exist when compiling
for Windows 10 App (CURL_WINDOWS_APP). Replaced getenv() with
curl_getenv() which is aware of getenv() absence when CURL_WINDOWS_APP
is defined.
Closes #2171
- RELEASE-NOTES: synced with 3b9ea70ee
- TODO: Expose tried IP addresses that failed
Suggested-by: Rainer Canavan
Closes #2126
- curl.1: mention http:// and https:// as valid proxy prefixes
- curl.1: documented two missing valid exit codes
- CURLOPT_DNS_LOCAL_IP4.3: fixed the seel also to not self-reference
- Revert "curl: don't set CURLOPT_INTERLEAVEDATA"
This reverts commit 9ffad8eb1329bb35c8988115ac7ed85cf91ef955.
It was actually added rather recently in 8e8afa82cbb629 due to a crash
that would otherwise happen in the RTSP code. As I don't think we've
fixed that behavior yet, we better keep this work-around until we have
fixed it better.
Michael Kaufmann (10 Dec 2017)
- tests: mark data files as non-executable in git
- tests: update .gitignore for libtests
Daniel Stenberg (10 Dec 2017)
- multi_done: prune DNS cache
Prune the DNS cache immediately after the dns entry is unlocked in
multi_done. Timed out entries will then get discarded in a more orderly
Test506 is updated
Reported-by: Oleg Pudeyev
Fixes #2169
Closes #2170
- mailmap: fixup two old git Author "aliases"
Jay Satiro (10 Dec 2017)
- openssl: Disable file buffering for Win32 SSLKEYLOGFILE
Prior to this change SSLKEYLOGFILE used line buffering on WIN32 just
like it does for other platforms. However, the Windows CRT does not
actually support line buffering (_IOLBF) and will use full buffering
(_IOFBF) instead. We can't use full buffering because multiple processes
may be writing to the file and that could lead to corruption, and since
full buffering is the only buffering available this commit disables
buffering for Windows SSLKEYLOGFILE entirely (_IONBF).
Daniel Stenberg (10 Dec 2017)
- RESOLVE: output verbose text when trying to set a duplicate name
... to help users understand what is or isn't done!
- [John DeHelian brought this change]
sftp: allow quoted commands to use relative paths
Closes #1900
Jay Satiro (8 Dec 2017)
- [Richard Alcock brought this change]
CURLOPT_PRIVATE.3: fix grammar
- Change "never does nothing" double-negative to "never does anything".
Daniel Stenberg (8 Dec 2017)
- curl: remove __EMX__ #ifdefs
These are OS/2-specific things added to the code in the year 2000. They
were always ugly. If there's any user left, they still don't need it
done this way.
Closes #2166
Jay Satiro (8 Dec 2017)
- openssl: improve data-pending check for https proxy
- Allow proxy_ssl to be checked for pending data even when connssl does
not yet have an SSL handle.
This change is for posterity. Currently there doesn't seem to be a code
path that will cause a pending data check when proxyssl could have
pending data and the connssl handle doesn't yet exist [1].
[1]: Recall that an https proxy connection starts out in connssl but if
the destination is also https then the proxy SSL backend data is moved
from connssl to proxyssl, which means connssl handle is temporarily
empty until an SSL handle for the destination can be created.
Daniel Stenberg (8 Dec 2017)
That data is only ever used by the CURLOPT_INTERLEAVEFUNCTION callback
and that option isn't set or used by the curl tool!
Updates the 9 tests that verify --libcurl
Closes #2167
- curl.h: remove incorrect comment about ERRORBUFFER
... error messages are _not_ sent to stderr if this is not set.
- [Michael Felt brought this change]
configure: add AX_CODE_COVERAGE only if using gcc
Fixes #2076
Closes #2125
- curl: limit -# update frequency for unknown total size
Make it use a max 10Hz update frequency for this case as well. Return
early if the "point" hasn't moved since last invoke.
Reported-by: Elliot Saba
Fixes #2158
Closes #2163
- BINDINGS: another PostgreSQL client
...the former link is dead.
Reported-by: Frank Gevaerts
- [Zachary Seguin brought this change]
CONNECT: keep close connection flag in http_connect_state struct
Fixes #2088
Closes #2157
- [Per Malmberg brought this change]
include: get netinet/in.h before linux/tcp.h
... to allow build on older Linux dists (specifically CentOS 4.8 on gcc
Closes #2160
- openldap: fix checksrc nits
- [Stepan Broz brought this change]
openldap: add commented out debug possibilities
... to aid debugging openldap library using its built-in debug messages.
Closes #2159
- examples: move threaded-shared-conn.c to the "complicated" ones
... due it relying on pthreads to link.
- RELEASE-NOTES: synced with b261c44e8
... and bump next release version to 7.58.0
- [Jan Ehrhardt brought this change]
URL: tolerate backslash after drive letter for FILE:
... as in "file://c:\some\path\curl.out"
Reviewed-by: Matthew Kerwin
Closes #2154
- [Randall S. Becker brought this change]
tests: added netinet/in6.h includes in test servers
- [Randall S. Becker brought this change]
configure: check for netinet/in6.h
Needed by HPE NonStop NSE and NSX systems
Fixes #2146
Closes #2155
- curl-config: add --ssl-backends
Lists all SSL backends that were enabled at build-time.
Suggested-by: Oleg Pudeyev
Fixes #2128
- 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
- threaded-shared-conn.c: fixed typo in commenta
- threaded-shared-conn.c: new example
- 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
- libssh: remove dead code in sftp_qoute
... by removing a superfluous NULL pointer check that also confuses
Fixes #2143
Closes #2153
- sasl_getmesssage: make sure we have a long enough string to pass
For pop3/imap/smtp, added test 891 to somewhat verify the pop3
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
- 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
- ssh-libssh.c: please checksrc
Nikos Mavrogiannopoulos (4 Dec 2017)
- libssh: fixed dereference in statvfs access
The behavior is now equivalent to ssh.c when SSH_SFTP_QUOTE_STATVFS
handling fails.
Fixes #2142
Daniel Stenberg (4 Dec 2017)
- [Guitared brought this change]
RESOURCES: update spec names
Closes #2145
Nikos Mavrogiannopoulos (3 Dec 2017)
- 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 <>
- libssh: no need to call sftp_get_error as ssh_get_error is sufficient
Fixes #2141
Signed-off-by: Nikos Mavrogiannopoulos <>
Daniel Stenberg (2 Dec 2017)
- 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
- openssl: pkcs12 is supported by boringssl
Removes another #ifdef for BoringSSL
Pointed-out-by: David Benjamin
Closes #2134
- [Jay Satiro brought this change]
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
- [Nikos Mavrogiannopoulos brought this change]
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 <>
- [Nikos Mavrogiannopoulos brought this change]
libssh: added SFTP support
The SFTP back-end supports asynchronous reading only, limited
to 32-bit file length. Writing is synchronous with no other
This also brings keyboard-interactive authentication.
Signed-off-by: Nikos Mavrogiannopoulos <>
- [Nikos Mavrogiannopoulos brought this change]
symbols-in-versions: added new symbols with 7.56.3 version
Signed-off-by: Nikos Mavrogiannopoulos <>
- [Nikos Mavrogiannopoulos brought this change]
.travis.yml: added build --with-libssh
Signed-off-by: Nikos Mavrogiannopoulos <>
- [Nikos Mavrogiannopoulos brought this change]
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 <>
- [Nikos Mavrogiannopoulos brought this change]
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 <>
- [Nikos Mavrogiannopoulos brought this change]
Added support for libssh SSH SCP back-end
libssh is an alternative library to libssh2.
That patch set also introduces support for ECDSA
ed25519 keys, as well as gssapi authentication.
Signed-off-by: Nikos Mavrogiannopoulos <>
- RELEASE-NOTES: synced with af8cc7a69
- curlver: towards 7.57.1
- [W. Mark Kubacki brought this change]
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
- [Johannes Schindelin brought this change]
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
Signed-off-by: Johannes Schindelin <>
Closes #2119
- examples/xmlstream.c: don't switch off CURL_GLOBAL_SSL
Reported-by: Dima Tisnek
- 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
Version 7.57.0 (29 Nov 2017)
Daniel Stenberg (29 Nov 2017)
- RELEASE-NOTES: curl 7.57.0
- THANKS: added contributors from 7.57.0 release
- openssl: fix boringssl build again
commit d3ab7c5a21e 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
- curl_ntlm_core.c: use the limits.h's SIZE_T_MAX if provided
- libcurl-share.3: the connection cache is shareable now
- 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:
Reported-by: Evgeny Grin
Assisted-by: Jay Satiro
Fixes #2089
Fixes #2083
Closes #2107
- ntlm: avoid integer overflow for malloc size
Reported-by: Alex Nichols
Assisted-by: Kamil Dudka and Max Dymond
- 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:
- [Jay Satiro brought this change]
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?).
- 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
- [Matthew Kerwin brought this change]
test: add test for bad UNC/SMB path in file: URL
- [Matthew Kerwin brought this change]
test: add tests to ensure basic file: URLs
- [Matthew Kerwin brought this change]
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
- metalink: fix memory-leak and NULL pointer dereference
Reported by scan-build
Closes #2109
- [Alessandro Ghedini brought this change]
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
- make: fix "make distclean"
Fixes #2097
Closes #2108
- RELEASE-NOTES: synced with 31f18d272
Jay Satiro (23 Nov 2017)
- 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'
Reported-by: Alfonso Martone
Daniel Stenberg (23 Nov 2017)
- examples/rtsp: clear RANGE again after use
Fixes #2106
Reported-by: youngchopin on github
- [Michael Kaufmann brought this change]
test1264: verify URL with space in host name being rejected
- url: reject ASCII control characters and space in host names
Host names like " moo" would otherwise be accepted by some
getaddrinfo() implementations.
Updated test 1034 and 1035 accordingly.
Fixes #2073
Closes #2092
- Curl_open: fix OOM return error correctly
Closes #2098
- http2: fix "Value stored to 'end' is never read" scan-build error
- http2: fix "Value stored to 'hdbuf' is never read" scan-build error
- openssl: fix "Value stored to 'rc' is never read" scan-build error
- mime: fix "Value stored to 'sz' is never read" scan-build error
- Curl_llist_remove: fix potential NULL pointer deref
Fixes a scan-build warning.
- ntlm: remove unnecessary NULL-check to please scan-build
- BUGS: spellchecked
Jay Satiro (18 Nov 2017)
- [fmmedeiros brought this change]
examples/curlx: Fix code style
- Add braces around multi-line if statement.
Daniel Stenberg (17 Nov 2017)
- resolve: allow IP address within [] brackets
... so that IPv6 addresses can be passed like they can for connect-to
and how they're used in URLs.
Added test 1324 to verify
Reported-by: Alex Malinovich
Fixes #2087
Closes #2091
- [Pavol Markovic brought this change]
macOS: Fix missing connectx function with Xcode version older than 9.0
The previous fix worked just for
Xcode 9. This commit extends the fix to older Xcode versions effectively
by not using connectx function.
Closes #2082
- [Dirk Feytons brought this change]
openssl: fix too broad use of HAVE_OPAQUE_EVP_PKEY
Fixes #2079
Closes #2081
- TODO: ignore private IP addresses in PASV response
Closes #1455
- RELEASE-NOTES: synced with ae7369b6d
Michael Kaufmann (14 Nov 2017)
- URL: return error on malformed URLs with junk after IPv6 bracket
Follow-up to aadb7c7. Verified by new test 1263.
Closes #2072
Daniel Stenberg (14 Nov 2017)
- INTERNALS: we may use libidn2 now, not libidn
Patrick Monnerat (13 Nov 2017)
- zlib/brotli: only include header files in modules needing them
There is a conflict on symbol 'free_func' between openssl/crypto.h and
zlib.h on AIX. This is an attempt to resolve it.
Reported-By: Michael Felt
Daniel Stenberg (13 Nov 2017)
- SMB: fix uninitialized local variable
Reported-by: Brian Carpenter
- [Orgad Shaneh brought this change]
connect.c: remove executable bit on file
Closes #2071
- [hsiao yi brought this change] fixed layout
Closes #2069
- setopt: split out curl_easy_setopt() to its own file
... to make url.c smaller.
Closes #1944
Jay Satiro (10 Nov 2017)
- [John Starks brought this change]
cmake: Add missing setmode check
Ensure HAVE_SETMODE is set to 1 on OSes that have setmode. Without this,
curl will corrupt binary files when writing them to stdout on Windows.
Daniel Stenberg (10 Nov 2017)
- curl_share_setopt: va_end was not called if conncache errors
CID 984459, detected by Coverity
Sergei Nikulov (10 Nov 2017)
- [John Starks brought this change]
cmake: Correctly include curl.rc in Windows builds (#2064)
Update CMakeLists.txt to add curl.rc to the correct list.
Daniel Stenberg (9 Nov 2017)
- RELEASE-NOTES: synced with 32828cc4f
- [Luca Boccassi brought this change]
--interface: add support for Linux VRF
The --interface command (CURLOPT_INTERFACE option) already uses
SO_BINDTODEVICE on Linux, but it tries to parse it as an interface or IP
address first, which fails in case the user passes a VRF.
Try to use the socket option immediately and parse it as a fallback
instead. Update the documentation to mention this feature, and that it
requires the binary to be ran by root or with CAP_NET_RAW capabilities
for this to work.
Closes #2024
- curl_share_setopt.3: document CURL_LOCK_DATA_CONNECT
Closes #2043
- examples: add shared-connection-cache
- test1554: verify connection cache sharing
- share: add support for sharing the connection cache
- imap: deal with commands case insensitively
As documented in RFC 3501 section 9:
Closes #2061
- connect: store IPv6 connection status after valid connection
... previously it would store it already in the happy eyeballs stage
which could lead to the IPv6 bit being set for an IPv4 connection,
leading to curl not wanting to do EPSV=>PASV for FTP transfers.
Closes #2053
- curl_multi_fdset.3: emphasize curl_multi_timeout
... even when there's no socket to wait for, the timeout can still be
very short.
Jay Satiro (9 Nov 2017)
- content_encoding: fix inflate_stream for no bytes available
- Don't call zlib's inflate() when avail_in stream bytes is 0.
This is a follow up to the parent commit 19e66e5. Prior to that change
libcurl's inflate_stream could call zlib's inflate even when no bytes
were available, causing inflate to return Z_BUF_ERROR, and then
inflate_stream would treat that as a hard error and return
According to the zlib FAQ, Z_BUF_ERROR is not fatal.
This bug would happen randomly since packet sizes are arbitrary. A test
of 10,000 transfers had 55 fail (ie 0.55%).
Patrick Monnerat (7 Nov 2017)
- content_encoding: do not write 0 length data
Daniel Stenberg (6 Nov 2017)
- fnmatch: remove dead code
There was a duplicate check for backslashes in the setcharset()
Coverity CID 1420611
- url: remove unncessary NULL-check
Since 'conn' won't be NULL in there and we also access the pointer in
there without the check.
Coverity CID 1420610
Viktor Szakáts (6 Nov 2017)
- src/Makefile.m32: fix typo in brotli lib customization
Ref cc1f4436099decb9d1a7034b2bb773a9f8379d31
- Makefile.m32: allow to customize brotli libs
It adds the ability to link against static brotli libs.
Also fix brotli include path.
Patrick Monnerat (5 Nov 2017)
- travis: add a job with brotli enabled
- [Viktor Szakáts brought this change]
Makefile.m32: add brotli support
- HTTP: implement Brotli content encoding
This uses the brotli external library (
Brotli becomes a feature: additional curl_version_info() bit and
structure fields are provided for it and CURLVERSION_NOW bumped.
Tests 314 and 315 check Brotli content unencoding with correct and
erroneous data.
Some tests are updated to accomodate with the now configuration dependent
parameters of the Accept-Encoding header.
- HTTP: support multiple Content-Encodings
This is implemented as an output streaming stack of unencoders, the last
calling the client write procedure.
New test 230 checks this feature.
Reported-By: Daniel Bankhead
Jay Satiro (4 Nov 2017)
- url: remove arg value check from CURLOPT_SSH_AUTH_TYPES
Since CURLSSH_AUTH_ANY (aka CURLSSH_AUTH_DEFAULT) is ~0 an arg value
check on this option is incorrect; we have to accept any value.
Prior to this change since f121575 (7.56.1+) CURLOPT_SSH_AUTH_TYPES
Daniel Stenberg (4 Nov 2017)
- ntlm: avoid malloc(0) for zero length passwords
It triggers an assert() when built with memdebug since malloc(0) may
return NULL *or* a valid pointer.
Detected by OSS-Fuzz:
Assisted-by: Max Dymond
Closes #2054
- RELEASE-NOTES: synced with ee8016b3d
- curl: speed up handling of many URLs
By properly keeping track of the last entry in the list of URLs/uploads
to handle, curl now avoids many meaningless traverses of the list which
speeds up many-URL handling *MASSIVELY* (several magnitudes on 100K
Added test 1291, to verify that it doesn't take ages - but we don't have
any detection of "too slow" command in the test suite.
Reported-by: arainchik on github
Fixes #1959
Closes #2052
- curl: pass through [] in URLs instead of calling globbing error
Assisted-by: Per Lundberg
Fixes #2044
Closes #2046
Closes #2048
Regression since f121575
Reported-by: Petr Voytsik
Fixes #2047
Jay Satiro (2 Nov 2017)
- url: fix CURLOPT_DNS_CACHE_TIMEOUT arg value check to allow -1
Prior to this change since f121575 (7.56.1+) CURLOPT_DNS_CACHE_TIMEOUT
erroneously rejected -1 with CURLE_BAD_FUNCTION_ARGUMENT.
Dan Fandrich (1 Nov 2017)
- http2: Fixed OOM handling in upgrade request
This caused the torture tests on test 1800 to fail.
- tests: Fixed torture tests on tests 556 and 650
Test cleanup after OOM wasn't being consistently performed.
Daniel Stenberg (1 Nov 2017)
- CURLOPT_MAXREDIRS: allow -1 as a value
... which is valid according to documentation. Regression since
Verified now in test 501.
Reported-by: cbartl on github
Fixes #2038
Closes #2039
- include: remove conncache.h inclusion from where its not needed
Jay Satiro (1 Nov 2017)
- url: fix CURLOPT_POSTFIELDSIZE arg value check to allow -1
.. also add same arg value check to CURLOPT_POSTFIELDSIZE_LARGE.
Prior to this change since f121575 (7.56.1+) CURLOPT_POSTFIELDSIZE
erroneously rejected -1 value with CURLE_BAD_FUNCTION_ARGUMENT.
Reported-by: Andrew Lambert
Daniel Stenberg (31 Oct 2017)
- cookie: avoid NULL dereference
... when expiring old cookies.
Reported-by: Pavel Gushchin
Fixes #2032
Closes #2035
Marcel Raad (30 Oct 2017)
- memdebug: use send/recv signature for curl_dosend/curl_dorecv
This avoids build errors and warnings caused by implicit casts.
Daniel Stenberg (30 Oct 2017)
- [Juro Bystricky brought this change] support reproducible build
Do not generate line with the current date, such as:
* Generation time: Tue Oct-24 18:01:41 2017
This will improve reproducibility. The generated string is only
part of a comment, so there should be no adverse consequences.
Signed-off-by: Juro Bystricky <>
closes #2026
Dan Fandrich (30 Oct 2017)
- Fixed typo in message
Daniel Stenberg (30 Oct 2017)
- curlx: the timeval functions are no longer provided as curlx_*
Pointed-out-by: Dmitri Tikhonov
Bug: #2034
- select: update comments
- INTERNALS: remove curlx_tv* functions no longer provided
- [Dmitri Tikhonov brought this change]
timeval: use mach time on MacOS
If clock_gettime() is not supported, use mach_absolute_time() on MacOS.
closes #2033
monnerat (29 Oct 2017)
- [Patrick Monnerat brought this change]
cli tool: improve ";type=" handling in -F option arguments
- [Patrick Monnerat brought this change]
cli tool: in -F option arg, comma is a delimiter for files only
Also upgrade test 1133 to cover this case and clarify man page about
form data quoting.
Reported-By: omau on github
Daniel Stenberg (29 Oct 2017)
- timeleft: made two more users of Curl_timeleft use timediff_t
Jakub Zakrzewski (28 Oct 2017)
- cmake: Export libcurl and curl targets to use by other cmake projects
The config files define curl and libcurl targets as imported targets
CURL::curl and CURL::libcurl. For backward compatibility with CMake-
provided find-module the CURL_INCLUDE_DIRS and CURL_LIBRARIES are
also set.
Closes #1879
Daniel Stenberg (28 Oct 2017)
- RELEASE-NOTES: synced with f20cbac97
- [Florin Petriuc brought this change]
auth: Added test cases for RFC7616
Updated docs to include support for RFC7616
Signed-off-by: Florin <>
Closes #1934
- [Florin Petriuc brought this change]
auth: add support for RFC7616 - HTTP Digest access authentication
Signed-off-by: Florin <>
- [Daniel Bankhead brought this change]
TODO: support multiple Content-Encodings
Closes #2002
- ROADMAP: cleanup
Removed done stuff. Removed entries no longer considered for the near
- [Magicansk brought this change] spelling fixes
Closes #2028
- Curl_timeleft: change return type to timediff_t
returning 'time_t' is problematic when that type is unsigned and we
return values less than zero to signal "already expired", used in
several places in the code.
Closes #2021
- appveyor: add a win32 build
- setopt: fix CURLOPT_SSH_AUTH_TYPES option read
Regression since f121575c0b5f
Reported-by: Rob Cotrone
Marcel Raad (27 Oct 2017)
- resolvers: only include anything if needed
This avoids warnings about unused stuff.
Daniel Stenberg (27 Oct 2017)
- HELP-US: rename the subtitle too since the label is changed
"PR-welcome" was the former name.
- curl_setup.h: oops, shorten the too long line
- [Martin Storsjo brought this change]
curl_setup: Improve detection of CURL_WINDOWS_APP
If WINAPI_FAMILY is defined, it should be safe to try to include
winapifamily.h to check what the define evaluates to.
This should fix detection of CURL_WINDOWS_APP if building with
_WIN32_WINNT set to 0x0600.
Closes #2025
Jay Satiro (26 Oct 2017)
- transfer: Fix chunked-encoding upload bug
- When uploading via chunked-encoding don't compare file size to bytes
sent to determine whether the upload has finished.
Chunked-encoding adds its own overhead which why the bytes sent is not
equal to the file size. Prior to this change if a file was uploaded in
chunked-encoding and its size was known it was possible that the upload
could end prematurely without sending the final few chunks. That would
result in a server hang waiting for the remaining data, likely followed
by a disconnect.
The scope of this bug is limited to some arbitrary file sizes which have
not been determined. One size that triggers the bug is 475020.
Daniel Stenberg (26 Oct 2017)
- timeval: make timediff_t also work on 32bit windows
... by using curl_off_t for the typedef if time_t is larger than 4
Reported-by: Gisle Vanem
Closes #2019
- curl_fnmatch: return error on illegal wildcard pattern
... instead of doing an infinite loop!
Added test 1162 to verify.
Reported-by: Max Dymond
Fixes #2015
Closes #2017
- [Max Dymond brought this change]
wildcards: don't use with non-supported protocols
Fixes timeouts in the fuzzing tests for non-FTP protocols.
Closes #2016
- [Max Dymond brought this change]
multi: allow table handle sizes to be overridden
Allow users to specify their own hash define for
CURL_CONNECTION_HASH_SIZE so that both values can be overridden.
Closes #1982
- time: rename Curl_tvnow to Curl_now
... since the 'tv' stood for timeval and this function does not return a
timeval struct anymore.
Also, cleaned up the Curl_timediff*() functions to avoid typecasts and
clean up the descriptive comments.
Closes #2011
- ftplistparser: follow-up cleanup to remove PL_ERROR()
- [Max Dymond brought this change]
ftplistparser: free off temporary memory always
When using the FTP list parser, ensure that the memory that's
allocated is always freed.
Detected by OSS-fuzz:
Closes #2013
- timediff: return timediff_t from the time diff functions
... to cater for systems with unsigned time_t variables.
- Renamed the functions to curlx_timediff and Curl_timediff_us.
- Added overflow protection for both of them in either direction for
both 32 bit and 64 bit time_ts
- Reprefixed the curlx_time functions to use Curl_*
Reported-by: Peter Piekarski
Fixes #2004
Closes #2005
- [Paul Howarth brought this change]
libtest: Add required test libraries for lib1552 and lib1553
They use $(TESTUTIL) and thus should use $(TESTUTIL_LIBS) too.
This fixes build failures on Fedora 13.
Closes #2006
- [Alessandro Ghedini brought this change]
libcurl-tutorial.3: fix typo
closes #2008
Alessandro Ghedini (23 Oct 2017)
- curl_mime_filedata.3: fix typos
Daniel Stenberg (23 Oct 2017)
- RELEASE-NOTES: clean slate towards 7.57.0
- [Max Dymond brought this change]
travis: exit if any steps fail
We don't expect any steps to fail in travis. Exit the script if they do.
Closes #1966
Version 7.56.1 (23 Oct 2017)
Daniel Stenberg (23 Oct 2017)
- THANKS: update at 7.56.1 release time
- [Jon DeVree brought this change]
mk-ca-bundle: Remove URL for aurora
Aurora is no longer used by Mozilla
- [Jon DeVree brought this change]
mk-ca-bundle: Fix URL for NSS
The 'tip' is the most recent branch committed to, this should be
'default' like the URLs for the browser are.
Closes #1998
- imap: if a FETCH response has no size, don't call write callback
Reported-by: Brian Carpenter and 0xd34db347
Also detected by OSS-Fuzz:
- ftp: reject illegal IP/port in PASV 227 response
... by using range checks. Among other things, this avoids an undefined
behavior for a left shift that could happen on negative or very large
Closes #1997
Detected by OSS-fuzz:
Patrick Monnerat (20 Oct 2017)
- test653: check reuse of easy handle after mime data change
See issue #1999
- mime: do not reuse previously computed multipart size
The contents might have changed: size must be recomputed.
Reported-by: moteus on github
Fixes #1999
- test308: disable if MultiSSL feature enabled
Even if OpenSSL is enabled, it might not be the default backend when
multi-ssl is enabled, causing the test to fail.
- runtests: support MultiSSL client feature
- vtls: change struct Curl_ssl `close' field name to `close_one'.
On OS/400, `close' is an ASCII system macro that corrupts the code if
not used in a context not targetting the close() system API.
- os400: add missing symbols in config file.
Also adjust makefile to renamed files and warn about installation dirs mix-up.
- test652: curl_mime_data + base64 encoder with large contents
- mime: limit bas64-encoded lines length to 76 characters
Daniel Stenberg (16 Oct 2017)
- RELEASE-NOTES: synced with f121575c0
- setopt: range check most long options
... filter early instead of risking "funny values" having to be dealt
with elsewhere.
- setopt: avoid integer overflows when setting millsecond values
... that are multiplied by 1000 when stored.
For 32 bit long systems, the max value accepted (2147483 seconds) is >
596 hours which is unlikely to ever be set by a legitimate application -
and previously it didn't work either, it just caused undefined behavior.
Also updated the man pages for these timeout options to mention the
return code.
Closes #1938
Viktor Szakáts (15 Oct 2017)
- makefile.m32: allow to override gcc, ar and ranlib
Allow to ovverride certain build tools, making it possible to
use LLVM/Clang to build curl. The default behavior is unchanged.
To build with clang (as offered by MSYS2), these settings can
be used:
- ldap: silence clang warning
Use memset() to initialize a structure to avoid LLVM/Clang warning:
ldap.c:193:39: warning: missing field 'UserLength' initializer [-Wmissing-field-initializers]
Daniel Stenberg (14 Oct 2017)
- runtests: use valgrind for torture as well
NOTE: it makes them terribly slow. I recommend only using valgrind for
specific torture tests or using lots of patience.
- memdebug: trace send, recv and socket
... to allow them to be included in torture tests too.
closes #1980
- configure: remove the C++ compiler check
... we used it only for the fuzzer, which we now have in a separate git
Closes #1990
Patrick Monnerat (13 Oct 2017)
- mime: do not call failf() if easy handle is NULL.
Daniel Stenberg (13 Oct 2017)
- test651: curl_formadd with huge COPYCONTENTS
- mime: fix the content reader to handle >16K data properly
Reported-by: Jeroen Ooms
Closes #1988
Patrick Monnerat (12 Oct 2017)
- mime: keep "text/plain" content type if user-specified.
Include test cases in 554, 587, 650.
- cli tool: use file2memory() to buffer stdin in -F option.
Closes PR
- cli tool: reimplement stdin buffering in -F option.
If stdin is not a regular file, its content is memory-buffered to enable
a possible data "rewind".
In all cases, stdin data size is determined before real use to avoid
having an unknown part's size.
--libcurl generated code is left as an unbuffered stdin fread/fseek callback
part with unknown data size.
Buffering is not supported in deprecated curl_formadd() API.
Daniel Stenberg (12 Oct 2017)
- winbuild/BUILD.WINDOWS.txt: mention WITH_NGHTTP2
- HELP-US: the label "PR-welcome" is now renamed to "help wanted"
following the new github "standard"
- RELEASE-NOTES: synced with 5505df7d2
Jay Satiro (11 Oct 2017)
- [Artak Galoyan brought this change]
url: Update current connection SSL verify params in setopt
Now VERIFYHOST, VERIFYPEER and VERIFYSTATUS options change during active
connection updates the current connection's (i.e.'connectdata'
structure) appropriate ssl_config (and ssl_proxy_config) structures
variables, making these options effective for ongoing connection.
This functionality was available before and was broken by the
following change:
"proxy: Support HTTPS proxy and SOCKS+HTTP(s)"
CommitId: cb4e2be7c6d42ca0780f8e0a747cecf9ba45f151.
Daniel Stenberg (11 Oct 2017)
- [David Benjamin brought this change]
openssl: don't use old BORINGSSL_YYYYMM macros
Those were temporary things we'd add and remove for our own convenience
long ago. The last few stayed around for too long as an oversight but
have since been removed. These days we have a running
BORINGSSL_API_VERSION counter which is bumped when we find it
convenient, but 2015-11-19 was quite some time ago, so just check
Closes #1979
- test950; verify SMTP with custom request
- ftpserver: support case insensitive commands
- smtp_done: free data before returning (on send failure)
... as otherwise it could leak that memory.
Detected by OSS-fuzz:
Assisted-by: Max Dymond
Closes #1977
- FTP: URL decode path for dir listing in nocwd mode
Reported-by: Zenju on github
Test 244 added to verify
Fixes #1974
Closes #1976
- test298: verify --ftp-method nowcwd with URL encoded path
Ref: #1974
- CURLOPT_XFERINFODATA.3: fix duplicate see also
- CURLOPT_NOPROGRESS.3: also refer to xferinfofunction
- openssl: enable PKCS12 support for !BoringSSL
Enable PKCS12 for all non-boringssl builds without relying on configure
or cmake checks.
Reported-by: Christian Schmitz
Closes #1948
- [Kristiyan Tsaklev brought this change]
curl: don't pass semicolons when parsing Content-Disposition
Test 1422 updated to verify.
Closes #1964
Patrick Monnerat (9 Oct 2017)
- mime: properly unbind mime structure in curl_mime_free().
This allows freeing a mime structure bound to the easy handle before
Fixes #1970.
Daniel Stenberg (9 Oct 2017)
- RTSP: avoid integer overflow on funny RTSP response
... like a very large non-existing RTSP version number.
Added test 577 to verify.
Detected by OSS-fuzz.
Closes #1969
Patrick Monnerat (8 Oct 2017)
- ftpserver: properly reset $ftptargetdir.
- test643: verify curl_mime_subparts() rejects cyclic additions.
- mime: refuse to add subparts to one of their own descendants.
Reported-by: Alexey Melnichuk
Fixes #1962
- mime: avoid resetting a part's encoder when part's contents change.
- mime: improve unbinding top multipart from easy handle.
Also avoid dangling pointers in referencing parts.
Daniel Stenberg (8 Oct 2017)
- RELEASE-NOTES: synced with a4c1c75da30af1
- curlver.h: next expected release is 7.57.0
Patrick Monnerat (8 Oct 2017)
- mime: be tolerant about setting twice the same header list in a part.
- docs: clarify form/mime usage of non-regular data files.
Daniel Stenberg (8 Oct 2017)
- Revert "multi_done: wait for name resolve to finish if still ongoing"
This reverts commit f3e03f6c0ac52a1bf396e03f7d7e9b5b3b7165fe.
Caused memory leaks in the fuzzer, needs to be done differently.
Disable test 1553 for now too, as it causes memory leaks without this
- remove_handle: call multi_done() first, then clear dns cache pointer
Closes #1960
- multi_done: wait for name resolve to finish if still ongoing
... as we must clean up memory.
- pingpong: return error when trying to send without connection
When imap_done() got called before a connection is setup, it would try
to "finish up" and dereffed a NULL pointer.
Test case 1553 managed to reproduce. I had to actually use a host name
to try to resolve to slow it down, as using the normal local server IP
will make libcurl get a connection in the first curl_multi_perform()
loop and then the bug doesn't trigger.
Fixes #1953
Assisted-by: Max Dymond
Dan Fandrich (6 Oct 2017)
- tests: added flaky keyword to tests 587 and 644
These are around 5% flaky in my Linux x86 autobuilds.
Marcel Raad (6 Oct 2017)
- vtls: fix warnings with --disable-crypto-auth
When CURL_DISABLE_CRYPTO_AUTH is defined, Curl_none_md5sum's parameters
are not used.
Daniel Stenberg (6 Oct 2017)
- multi_cleanup: call DONE on handles that never got that
... fixes a memory leak with at least IMAP when remove_handle is never
called and the transfer is abruptly just abandoned early.
Test 1552 added to verify
Detected by OSS-fuzz
Assisted-by: Max Dymond
Closes #1954
- [Benbuck Nason brought this change]
strtoofft: Remove extraneous null check
Fixes #1950: curlx_strtoofft() doesn't fully protect against null 'str'
Closes #1952
- openssl: fix build without HAVE_OPAQUE_EVP_PKEY
Reported-by: Javier Sixto
Fixes #1955
Closes #1956
Viktor Szakáts (6 Oct 2017)
- lib/config-win32.h: let SMB/SMBS be enabled with OpenSSL/NSS
The source code is now prepared to handle the case when both
Win32 Crypto and OpenSSL/NSS crypto backends are enabled
at the same time, making it now possible to enable `USE_WIN32_CRYPTO`
whenever the targeted Windows version supports it. Since this
matches the minimum Windows version supported by curl
(Windows 2000), enable it unconditionally for the Win32 platform.
This in turn enables SMB (and SMBS) protocol support whenever
Win32 Crypto is available, regardless of what other crypto backends
are enabled.
Daniel Stenberg (5 Oct 2017)
- build: fix --disable-crypto-auth
Reported-by: Wyatt O'Day
Fixes #1945
Closes #1947
Jay Satiro (5 Oct 2017)
- [Nick Zitzmann brought this change]
darwinssl: add support for TLSv1.3
Daniel Stenberg (4 Oct 2017)
- [Felix Kaiser brought this change]
docs: fix typo in curl_mime_data_cb man page
Closes #1946
Viktor Szakáts (4 Oct 2017)
- lib/Makefile.m32: allow customizing dll suffixes
- New `CURL_DLL_SUFFIX` envvar will add a suffix to the generated
libcurl dll name. Useful to add `-x64` to 64-bit builds so that
it can live in the same directory as the 32-bit one. By default
this is empty.
- New `CURL_DLL_A_SUFFIX` envvar to customize the suffix of the
generated import library (implib) for libcurl .dll. It defaults
to `dll`, and it's useful to modify that to `.dll` to have the
standard naming scheme for mingw-built .dlls, i.e. `libcurl.dll.a`.
Daniel Stenberg (4 Oct 2017)
- [Max Dymond brought this change]
fuzzer: move to using external curl-fuzzer
Use the external curl-fuzzer repository for fuzzing.
Closes #1923
- failf: skip the sprintf() if there are no consumers
Closes #1936
- ftp: UBsan fixup 'pointer index expression overflowed'
Closes #1939
- RELEASE-PROCEDURE: update the release schedule
Version 7.56.0 (4 Oct 2017)
Daniel Stenberg (4 Oct 2017)
- RELEASE-NOTES: curl 7.56.0
- THANKS: added new 7.56.0 contributors
Jay Satiro (4 Oct 2017)
- build-openssl.bat: Warn OpenSSL 1.1.0 not yet supported
Michael Kaufmann (3 Oct 2017)
- idn: fix source code comment
- vtls: compare and clone ssl configs properly
Compare these settings in Curl_ssl_config_matches():
- random_file (CURLOPT_RANDOM_FILE)
Also copy the setting "verifystatus" in Curl_clone_primary_ssl_config(),
and copy the setting "sessionid" unconditionally.
This means that reusing connections that are secured with a client
certificate is now possible, and the statement "TLS session resumption
is disabled when a client certificate is used" in the old advisory at is obsolete.
Reviewed-by: Daniel Stenberg
Closes #1917
- proxy: read the "no_proxy" variable only if necessary
Reviewed-by: Daniel Stenberg
Closes #1919
Patrick Monnerat (3 Oct 2017)
- libcurl-tutorial: add casts in example to avoid compilation warnings.
Daniel Stenberg (3 Oct 2017)
- examples: bring back curl_formadd-using examples
... now with a -formadd suffix. While the new mime API is introduced in
7.56.0 we must acknowledge that lots of users can't upgrade their curl
versions immediately.
- test1153: verify quoted double-qoutes in PWD response
- FTP: zero terminate the entry path even on bad input
... a single double quote could leave the entry path buffer without a zero
terminating byte. CVE-2017-1000254
Test 1152 added to verify.
Reported-by: Max Dymond
Jay Satiro (2 Oct 2017)
- [Sergei Nikulov brought this change]
cmake: disable tests and man generation if perl/nroff not found
Reported-by: Jay Satiro
Assisted-by: Tom Seddon
Patrick Monnerat (2 Oct 2017)
- libcurl-tutorial: fix two typos.
- TODO: remove deprecated form API items.
- libcurl-tutorial: describe MIME API and deprecate form API.
Include a guide to form/mime API conversion.
Daniel Stenberg (30 Sep 2017)
- cookie: fix memory leak if path was set twice in header
... this will let the second occurance override the first.
Added test 1161 to verify.
Reported-by: Max Dymond
Fixes #1932
Closes #1933
Dan Fandrich (30 Sep 2017)
- test650: Use variable replacement to set the host address and port
Otherwise, the test fails when the -b test option is used to set a
different test port range.
- Set and use more necessary options when some protocols are disabled
When curl and libcurl are built with some protocols disabled, they stop
setting and receiving some options that don't make sense with those
protocols. In particular, when HTTP is disabled many options aren't set
that are used only by HTTP. However, some options that appear to be
HTTP-only are actually used by other protocols as well (some despite
having HTTP in the name) and should be set, but weren't. This change now
causes some of these options to be set and used for more (or for all)
protocols. In particular, this fixes tests 646 through 649 in an
HTTP-disabled build, which use the MIME API in the mail protocols.
Daniel Stenberg (29 Sep 2017)
- test1160: verifies cookie leak for large cookies
The fix done in 20ea22ff735
- cookie: fix memory leak on oversized rejection
Regression brought by 2bc230de63b
Detected by OSS-fuzz:
Assisted-by: Max Dymond
Closes #1930
- [Anders Bakken brought this change]
connect: fix race condition with happy eyeballs timeout
The timer should be started after conn->connecttime is set. Otherwise
the timer could expire without this condition being true:
/* should we try another protocol family? */
if(i == 0 && conn->tempaddr[1] == NULL &&
curlx_tvdiff(now, conn->connecttime) >= HAPPY_EYEBALLS_TIMEOUT) {
Ref: #1928
Michael Kaufmann (28 Sep 2017)
Closes #1922
- docs: clarify the use of environment variables for proxy
Closes #1921
- http: add custom empty headers to repeated requests
Closes #1920
- reuse_conn: don't copy flags that are known to be equal
A connection can only be reused if the flags "conn_to_host" and
"conn_to_port" match. Therefore it is not necessary to copy these flags
in reuse_conn().
Closes #1918
Daniel Stenberg (27 Sep 2017)
- curl.h: include <sys/select.h> on cygwin too
When building with -std=c++14 on cygwin, this header won't be
automatically included as it otherwise is.
The <sys/select.h> include decision should ideally be reversed and be
avoided where that header file doesn't exist.
Reported-by: Ian Fette
Fixes #1925
- RELEASE-NOTES: synced with d8ab5dc50
Michael Kaufmann (24 Sep 2017)
- tests: adjust .gitignore for new tests
Jay Satiro (23 Sep 2017)
- ntlm: move NTLM_NEEDS_NSS_INIT define into core NTLM header
.. and include the core NTLM header in all NTLM-related source files.
Follow up to 6f86022. Since then http_ntlm checks NTLM_NEEDS_NSS_INIT
but did not include vtls.h where it was defined.
Daniel Stenberg (23 Sep 2017)
- file_range: avoid integer overflow when figuring out byte range
When trying to bump the value with one and the value is already at max,
it causes an integer overflow.
Closes #1908
Detected by oss-fuzz:
Assisted-by: Max Dymond
Michael Kaufmann (23 Sep 2017)
- tests: fix a compiler warning in test 643
Jay Satiro (23 Sep 2017)
- symbols-in-versions: fix CURLSSLSET_NO_BACKENDS entry
- Use spaces instead of tabs as the delimiter.
Follow up to 7c52b12 which added the entry. The entry had used tabs but
the symbol-scan parser doesn't recognize tabs and would fail the symbol.
Viktor Szakáts (22 Sep 2017)
- metalink: fix NSS issue in MultiSSL builds
In MultiSSL mode (i.e. when more than one SSL backend is compiled
in), we cannot use the compile time flag `USE_NSS` as indicator that
the NSS backend is in use. As far as Metalink is concerned, the SSL
backend is only used for MD5, SHA-1 and SHA-256 calculations,
therefore one of the available SSL backends is selected at compile
time, in a strict order of preference.
Let's introduce a new `HAVE_NSS_CONTEXT` constant that can be used
to determine whether the SSL backend used for Metalink is the NSS
backend, and use that to guard the code that wants to de-initialize
the NSS-specific data structure.
- ntlm: use strict order for SSL backend #if branches
With the recently introduced MultiSSL support multiple SSL backends
can be compiled into cURL That means that now the order of the SSL
One option would be to use the same SSL backend as was configured
via `curl_global_sslset()`, however, NTLMv2 support would appear
to be available only with some SSL backends. For example, when
eb88d778e (ntlm: Use Windows Crypt API, 2014-12-02) introduced
support for NTLMv1 using Windows' Crypt API, it specifically did
*not* introduce NTLMv2 support using Crypt API at the same time.
So let's select one specific SSL backend for NTLM support when
compiled with multiple SSL backends, using a priority order such
that we support NTLMv2 even if only one compiled-in SSL backend can
be used for that.
Daniel Stenberg (22 Sep 2017)
- symbols-in-versions: add CURLSSLSET_NO_BACKENDS
...fixup from b8e0fe19ec
- imap: quote atoms properly when escaping characters
Updates test 800 to verify
Fixes #1902
Closes #1903
- tests: make the imap server not verify user+password
... as the test cases themselves do that and it makes it easier to add
crazy test cases.
Test 800 updated to use user name + password that need quoting.
Test 856 updated to trigger an auth fail differently.
Ref: #1902
- vtls: provide curl_global_sslset() even in non-SSL builds
... it just returns error:
Reported-by: Marcel Raad
Closes #1906
Patrick Monnerat (22 Sep 2017)
- form/mime: field names are not allowed to contain zero-valued bytes.
Also suppress length argument of curl_mime_name() (names are always
Daniel Stenberg (21 Sep 2017)
- [Dirk Feytons brought this change]
openssl: only verify RSA private key if supported
In some cases the RSA key does not support verifying it because it's
located on a smart card, an engine wants to hide it, ...
Check the flags on the key before trying to verify it.
OpenSSL does the same thing internally; see ssl/ssl_rsa.c
Closes #1904
Marcel Raad (21 Sep 2017)
- examples/post-callback: use long for CURLOPT_POSTFIELDSIZE
Otherwise, typecheck-gcc.h warns on MinGW-w64.
Patrick Monnerat (20 Sep 2017)
- mime: rephrase the multipart output state machine (#1898) ...
... in hope coverity will like it much.
- mime: fix an explicit null dereference (#1899)
Daniel Stenberg (20 Sep 2017)
- curl: check fseek() return code and bail on error
Detected by coverity. CID 1418137.
- smtp: fix memory leak in OOM
Regression since ce0881edee
Coverity CID 1418139 and CID 1418136 found it, but it was also seen in
torture testing.
- RELEASE-NOTES: synced with 5fe85587c
- [Pavel Pavlov brought this change]
cookies: use lock when using CURLINFO_COOKIELIST
Closes #1896
- [Max Dymond brought this change]
ossfuzz: changes before merging the generated corpora
Before merging in the oss-fuzz corpora from Google, there are some changes
to the fuzzer.
- Add a read corpus script, to display corpus files nicely.
- Change the behaviour of the fuzzer so that TLV parse failures all now
go down the same execution paths, which should reduce the size of the
- Make unknown TLVs a failure to parse, which should decrease the size
of the corpora as well.
Closes #1881
- mime:escape_string minor clarification change
... as it also removes a warning with old gcc versions.
Reported-by: Ben Greear
- [Max Dymond brought this change]
ossfuzz: don't write out to stdout
Don't make the fuzzer write out to stdout - instead write some of the
contents to a memory block so we exercise the data output code but
Closes #1885
- cookies: reject oversized cookies
... instead of truncating them.
There's no fixed limit for acceptable cookie names in RFC 6265, but the
entire cookie is said to be less than 4096 bytes (section 6.1). This is
also what browsers seem to implement.
We now allow max 5000 bytes cookie header. Max 4095 bytes length per
cookie name and value. Name + value together may not exceed 4096 bytes.
Added test 1151 to verify
Reported-by: Kevin Smith
Closes #1894
- travis: on mac, don't install openssl or libidn
- openssl is already installed and causes warnings when trying to
install again
- libidn isn't used these days, and homebrew doesn't seem to have a
libidn2 package to replace with easily
Closes #1895
- curl: make str2udouble not return values on error
... previously it would store a return value even when it returned
error, which could make the value get used anyway!
Reported-by: Brian Carpenter
Closes #1893
Jay Satiro (18 Sep 2017)
- socks: fix incorrect port number in SOCKS4 error message
Prior to this change it appears the SOCKS5 port parsing was erroneously
used for the SOCKS4 error message, and as a result an incorrect port
would be shown in the error message.
- [Marc Aldorasi brought this change]
schannel: Support partial send for when data is too large
Schannel can only encrypt a certain amount of data at once. Instead of
failing when too much data is to be sent at once, send as much data as
we can and let the caller send the remaining data by calling send again.
- [David Benjamin brought this change]
openssl: add missing includes
lib/vtls/openssl.c uses OpenSSL APIs from BUF_MEM and BIO APIs. Include
their headers directly rather than relying on other OpenSSL headers
including things.
Daniel Stenberg (15 Sep 2017)
- conversions: fix several compiler warnings
- server/getpart: provide dummy function to build conversion enabled
- non-ascii: use iconv() with 'char **' argument
- escape.c: error: pointer targets differ in signedness
- docs: clarify the CURLOPT_INTERLEAVE* options behavior
- [Max Dymond brought this change]
rtsp: Segfault in rtsp.c when using WRITEDATA
If the INTERLEAVEFUNCTION is defined, then use that plus the
INTERLEAVEDATA information when writing RTP. Otherwise, use
Fixes #1880
Closes #1884
Marcel Raad (15 Sep 2017)
- [Isaac Boukris brought this change]
tests: enable gssapi in travis-ci linux build
- [Isaac Boukris brought this change]
tests: add initial gssapi test using stub implementation
The stub implementation is pre-loaded using LD_PRELOAD
and emulates common gssapi uses (only builds if curl is
initially built with gssapi support).
The initial tests are currently disabled for debug builds
as LD_PRELOAD is not used then.
Daniel Stenberg (15 Sep 2017)
- test1150: verify same host fetch using different ports over proxy
Closes #1889
- URL: on connection re-use, still pick the new remote port
... as when a proxy connection is being re-used, it can still get a
different remote port.
Fixes #1887
Reported-by: Oli Kingshott
- RELEASE-NOTES: synced with 87501e57f
- code style: remove wrong uses of multiple spaces
Closes #1878
- checksrc: detect and warn for multiple spaces
- code style: use space after semicolon
- checksrc: verify space after semicolons
- code style: use spaces around pluses
- checksrc: detect and warn for lack of spaces next to plus signs
- code style: use spaces around equals signs
- checksrc: verify spaces around equals signs
... as the code style mandates.
- Curl_checkheaders: make it available for IMAP and SMTP too
... not only HTTP uses this now.
Closes #1875
- travis: add build without HTTP/SMTP/IMAP
Jay Satiro (10 Sep 2017)
- mbedtls: enable CA path processing
CA path processing was implemented when mbedtls.c was added to libcurl
in fe7590f, but it was never enabled.
Daniel Stenberg (8 Sep 2017)
- rtsp: do not call fwrite() with NULL pointer FILE *
If the default write callback is used and no destination has been set, a
NULL pointer would be passed to fwrite()'s 4th argument.
OSS-fuzz bug
(not publicly open yet)
Detected by OSS-fuzz
Closes #1874
- configure: use -Wno-varargs on clang 3.9[.X] debug builds
... to avoid a clang bug
- [Max Dymond brought this change]
ossfuzz: add some more handled CURL options
MAIL_FROM and uploading data.
- configure: check for C++ compiler after C, to make it non-fatal
The tests for object file/executable file extensions are presumably only
done for the first of these macros in the configure file.
Reported-by: Marcel Raad
Closes #1873
Patrick Monnerat (7 Sep 2017)
- form API: add new test 650.
Now that the form API is deprecated and not used anymore in curl tool,
a lot of its features left untested. Test 650 attempts to check all these
features not tested elsewhere.
Jay Satiro (7 Sep 2017)
- configure: fix curl_off_t check's include order
- Prepend srcdir include path instead of append.
Prior to this change it was possible that during the check for the size
of curl_off_t the include path of a user's already installed curl could
come before the include path of the to-be-built curl, resulting in the
system.h of the former being incorrectly included for that check.
Daniel Stenberg (7 Sep 2017)
- [Jakub Zakrzewski brought this change]
KNOWN_BUGS: Remove CMake symbol hiding issue
It has already been fixed in 6140dfc
- http-proxy: when not doing CONNECT, that phase is done immediately
`conn->connect_state` is NULL when doing a regular non-CONNECT request
over the proxy and should therefor be considered complete at once.
Fixes #1853
Closes #1862
Reported-by: Lawrence Wagerfield
- [Johannes Schindelin brought this change]
OpenSSL: fix yet another mistake while encapsulating SSL backend data
Another mistake in my manual fixups of the largely mechanical
search-and-replace ("connssl->" -> "BACKEND->"), just like the previous
commit concerning HTTPS proxies (and hence not caught during my
earlier testing).
Fixes #1855
Closes #1871
Signed-off-by: Johannes Schindelin <>
- [Johannes Schindelin brought this change]
OpenSSL: fix erroneous SSL backend encapsulation
In d65e6cc4f (vtls: prepare the SSL backends for encapsulated private
data, 2017-06-21), this developer prepared for a separation of the
private data of the SSL backends from the general connection data.
This conversion was partially automated (search-and-replace) and
partially manual (e.g. proxy_ssl's backend data).
Sadly, there was a crucial error in the manual part, where the wrong
handle was used: rather than connecting ssl[sockindex]' BIO to the
proxy_ssl[sockindex]', we reconnected proxy_ssl[sockindex]. The reason
was an incorrect location to paste "BACKEND->"... d'oh.
Reported by Jay Satiro in
Signed-off-by: Johannes Schindelin <>
- [Jay Satiro brought this change]
vtls: fix memory corruption
Ever since 70f1db321 (vtls: encapsulate SSL backend-specific data,
2017-07-28), the code handling HTTPS proxies was broken because the
pointer to the SSL backend data was not swapped between
conn->ssl[sockindex] and conn->proxy_ssl[sockindex] as intended, but
instead set to NULL (causing segmentation faults).
[jes: provided the commit message, tested and verified the patch]
Signed-off-by: Johannes Schindelin <>
- vtls: switch to CURL_SHA256_DIGEST_LENGTH define
... instead of the prefix-less version since WolfSSL 3.12 now uses an
enum with that name that causes build failures for us.
Fixes #1865
Closes #1867
Reported-by: Gisle Vanem
- travis: add c-ares enabled builds linux + osx
Closes #1868
- HISTORY: added some recent items
Jay Satiro (6 Sep 2017)
- SSL: fix unused parameter warnings
Patrick Monnerat (6 Sep 2017)
- mime: drop internal FILE * support.
- The part kind MIMEKIND_FILE and associated code are suppressed.
- Seek data origin offset not used anymore: suppressed.
- MIMEKIND_NAMEDFILE renamed MIMEKIND_FILE; associated fields/functions
renamed accordingly.
- Curl_getformdata() processes stdin via a callback.
Daniel Stenberg (6 Sep 2017)
- configure: remove --enable-soname-bump and SONAME_BUMP
Back in 2008, (and commit 3f3d6ebe665f3) we changed the logic in how we
determine the native type for `curl_off_t`. To really make sure we
didn't break ABI without bumping SONAME, we introduced logic that
attempted to detect that it would use a different size and thus not be
compatible. We also provided a manual switch that allowed users to tell
configure to bump SONAME by force.
Today, we know of no one who ever got a SONAME bump auto-detected and we
don't know of anyone who's using the manual bump feature. The auto-
detection is also no longer working since we introduced defining
curl_off_t in system.h (7.55.0).
Finally, this bumping logic is not present in the cmake build.
Closes #1861
Jay Satiro (6 Sep 2017)
- [Gisle Vanem brought this change]
vtls: select ssl backend case-insensitive (follow-up)
- Do a case-insensitive comparison of CURL_SSL_BACKEND env as well.
- Change Curl_strcasecompare calls to strcasecompare
(maps to the former but shorter).
Follow-up to c290b8f.
Co-authored-by: Jay Satiro
- openssl: Integrate Peter Wu's SSLKEYLOGFILE implementation
This is an adaptation of 2 of Peter Wu's SSLKEYLOGFILE implementations.
The first one, written for old OpenSSL versions:
The second one, written for BoringSSL and new OpenSSL versions:
Note the first one is GPL licensed but the author gave permission to
waive that license for libcurl.
As of right now this feature is disabled by default, and does not have
a configure option to enable it. To enable this feature define
ENABLE_SSLKEYLOGFILE when building libcurl and set environment
variable SSLKEYLOGFILE to a pathname that will receive the keys.
And in Wireshark change your preferences to point to that key file:
Edit > Preferences > Protocols > SSL > Master-Secret
Co-authored-by: Peter Wu
Patrick Monnerat (5 Sep 2017)
- mime: fix a trivial warning.
- mime: replace 'struct Curl_mimepart' by 'curl_mimepart' in encoder code.
mime_state is now a typedef.
- mime: implement encoders.
curl_mime_encoder() is operational and documented.
curl tool -F option is extended with ";encoder=".
curl tool --libcurl option generates calls to curl_mime_encoder().
New encoder tests 648 & 649.
Test 1404 extended with an encoder specification.
- support attribute "nonewline" in part verify/upload.
- [Daniel Stenberg brought this change]
fixup data/test1135
- [Daniel Stenberg brought this change]
mime: unified to use the typedef'd mime structs everywhere
... and slightly edited to follow our code style better.
- [Daniel Stenberg brought this change]
curl.h: use lower case curl_mime* as for all public symbols
- [Daniel Stenberg brought this change]
docs/curl_mime_*.3: use correct variable types in examples
Kamil Dudka (5 Sep 2017)
- openssl: use OpenSSL's default ciphers by default
Up2date versions of OpenSSL maintain the default reasonably secure
without breaking compatibility, so it is better not to override the
default by curl. Suggested at
Closes #1846
Viktor Szakáts (5 Sep 2017)
- examples/mime: minor example code fixes
Daniel Stenberg (5 Sep 2017)
- docs/curl_mime_*.3: added examples
- configure: add MultiSSL to FEATURES when enabled
...for curl-config and its corresponding test 1014
- http-proxy: treat all 2xx as CONNECT success
Added test 1904 to verify.
Reported-by: Lawrence Wagerfield
Fixes #1859
Closes #1860
- MAIL-ETIQUETTE: added "1.9 Your emails are public"
- curl.h: fix "unused checksrc ignore", remove dangling reference
... to a README file that doesn't exist anymore
Viktor Szakáts (4 Sep 2017)
- docs: Update to secure URL versions
- mime: use CURL_ZERO_TERMINATED in examples
and some minor whitespace fixes
Daniel Stenberg (4 Sep 2017)
- schannel: return CURLE_SSL_CACERT on failed verification
... not *CACERT_BADFILE as it isn't really because of a bad file.
Closes #1858
- test1135: fixed after bd8070085f9
- examples/post-callback: stop returning one byte at a time
... since people copy and paste code from this example and thus they get
an inefficient POST operation without a good reason and sometimes
without understanding why.
Instead this now returns as much data as possible.
- RELEASE-NOTES: fixed the function counter script
- curl.h: make the curl_strequal() protos use the same style
... as the other functions. Makes it easier to machine-parse!
- docs: curl_mime_*.3 man page formatting edits
- RELEASE-NOTES: synced with 1ab9e9b50
Patrick Monnerat (4 Sep 2017)
- lib: bump version info (soname). Adapt and reenable test 1135.
Daniel Stenberg (3 Sep 2017)
- headers: move the global_sslset() proto from multi.h to curl.h
As it was added to multi.h simply to not break test 1135, which now has
been disabled due to the mime API addition anyway and su we can now move
the sslset stuff to where the other curl_global_* prototypes are.
Patrick Monnerat (3 Sep 2017)
- mime: fix signed/unsigned conversions.
Use and generate CURL_ZERO_TERMINATED in curl tool and tests.
Jay Satiro (3 Sep 2017)
- tool_formparse: fix some trivial warnings
Patrick Monnerat (3 Sep 2017)
- mime: use size_t instead of ssize_t in public API interface.
To support telling a string is nul-terminated, symbol CURL_ZERO_TERMINATED
has been introduced.
Documentation updated accordingly.
symbols in versions updated. Added form API symbols deprecation info.
- mime: remove support "-" stdin pseudo-file name in curl_mime_filedata().
This feature is badly supported in Windows: as a replacement, a caller has
to use curl_mime_data_cb() with fread, fseek and possibly fclose
callbacks to process opened files.
The cli tool and documentation are updated accordingly.
The feature is however kept internally for form API compatibility, with
the known caveats it always had.
As a side effect, stdin size is not determined by the cli tool even if
possible and this results in a chunked transfer encoding. Test 173 is
updated accordingly.
- mime: fix some implicit curl_off_t --> size_t conversion warnings.
- mime: tests and examples.
Additional mime-specific tests.
Existing tests updated to reflect small differences (Expect: 100-continue,
data size change due to empty lines, etc).
Option -F headers= keyword added to tests.
test1135 disabled until the entry point order change is resolved.
New example smtp-mime.
Examples postit2 and multi-post converted from form API to mime API.
- mime: use in curl cli tool instead of form API.
Extended -F option syntax to support multipart mail messages.
-F keyword headers= added to include custom headers in parts.
Documentation upgraded.
- mime: new MIME API.
Available in HTTP, SMTP and IMAP.
Deprecates the FORM API.
Lib code and associated documentation.
- test564: Add a warning comment about shell profile output.
Shell profile output makes the SSH server failing and this problem reason
is not easy to find when no hint is given.
- checksrc: disable SPACEBEFOREPAREN for case statement.
The case keyword may be followed by a constant expression and thus should
allow it to start with an open parenthesis.
- allow <file[1-4]> tags in client section.
This enables tests to create more than one file on the client side.
- Apply strippart to upload too.
This will allow substitution of boundaries in mail messages.
- Curl_base64_encode: always call with a real data handle.
Some calls in different modules were setting the data handle to NULL, causing
segmentation faults when using builds that enable character code conversions.
- non-ascii: allow conversion functions to be called with a NULL data handle.
- http: fix a memory leakage in checkrtspprefix().
Daniel Stenberg (2 Sep 2017)
- [Max Dymond brought this change]
ossfuzz: Move to C++ for curl_fuzzer.
Automake gets confused if you want to use C++ static libraries with C
code - basically we need to involve the clang++ linker. The easiest way
of achieving this is to rename the C code as C++ code. This gets us a
bit further along the path and ought to be compatible with Google's
version of clang.
- curl_global_sslset: select backend by name case insensitively
Closes #1849
- [Max Dymond brought this change]
ossfuzz: additional seed corpora
Create simple seed corpora for:
- telnet
- dict
- tftp
- imap
- pop3
based off the tests of the same number.
Closes #1842
- [Max Dymond brought this change]
ossfuzz: moving towards the ideal integration
- Start with the basic code from the ossfuzz project.
- Rewrite fuzz corpora to be binary files full of Type-Length-Value
data, and write a glue layer in the fuzzing function to convert
corpora into CURL options.
- Have supporting functions to generate corpora from existing tests
- Integrate with
- strcase: corrected comment header for Curl_strcasecompare()
- unit1301: fix error message on first test
- curl_global_sslset.3: show the struct and enum too
... so that users can actually write code based on the man page alone,
not having to read the header file.
Jay Satiro (31 Aug 2017)
- darwinssl: handle long strings in TLS certs (follow-up)
- Fix handling certificate subjects that are already UTF-8 encoded.
Follow-up to b3b75d1 from two days ago. Since then a copy would be
skipped if the subject was already UTF-8, possibly resulting in a NULL
deref later on.
Daniel Stenberg (31 Aug 2017)
- cyassl: call it the "WolfSSL" backend
... instead of cyassl, as this is the current name for it.
Closes #1844
- polarssl: fix multissl breakage
Reported-by: Dan Fandrich
Closes #1843
- configure: remove the leading comma from the backends list
... when darwinssl is used.
Reported-by: Viktor Szakats
Closes #1845
Kamil Dudka (30 Aug 2017)
- examples/sslbackend.c: fix failure of 'make checksrc'
./sslbackend.c:58:3: warning: else after closing brace on same line (BRACEELSE)
} else if(isdigit(*name)) {
./sslbackend.c:62:3: warning: else after closing brace on same line (BRACEELSE)
} else
Viktor Szakáts (30 Aug 2017)
- makefile.m32: add multissl support
Daniel Stenberg (30 Aug 2017)
- curl.h: CURLSSLBACKEND_WOLFSSL used wrong value
The CURLSSLBACKEND_WOLFSSL is supposed to be an alias for
CURLSSLBACKEND_CYASSL, but used an erronous value. To reduce the risk
for a similar mistake, define the backend aliases to use the enum values
Reported-by: Gisle Vanem
- curl_global_sslset.3: clarify
it is a one time *set*, not necessarily a one time use... it can be
called again if the first call failed or just listed the alternatives.
clarify that the available backends are the ones this build supports
plus add some formatting
Reported-by: Rich Gray
- curl/multi.h: remove duplicated closing c++ brace
Regression since 1328f69d53f2f2e93
Fixes #1841
Reported-by: Andrei Karas
- RELEASE-NOTES: synced with 8c33c963a
- spelling
- "How to get started helping out in the curl project"
Closes #1837
Dan Fandrich (29 Aug 2017)
- asyn-thread: Fixed cleanup after OOM
destroy_async_data() assumes that if the flag "done" is not set yet, the
thread itself will clean up once the request is complete. But if an
error (generally OOM) occurs before the thread even has a chance to
start, it will never get a chance to clean up and memory will be leaked.
By clearing "done" only just before starting the thread, the correct
cleanup sequence will happen in all cases.
Daniel Stenberg (28 Aug 2017)
- curl_global_init.3: mention curl_global_sslset(3)
Dan Fandrich (28 Aug 2017)
- unit1606: Fixed shadowed variable warning
- asyn-thread: Improved cleanup after OOM situations
- asyn-thread: Set errno to the proper value ENOMEM in OOM situation
This used to be set in some configurations to EAI_MEMORY which is not a
valid value for errno and caused Curl_strerror to fail an assertion.
Daniel Stenberg (28 Aug 2017)
- [Johannes Schindelin brought this change]
configure: Handle "MultiSSL" specially When versioning symbols
There is a mode in which libcurl is compiled with versioned symbols,
depending on the active SSL backend.
When multiple SSL backends are active, it does not make sense to favor
one over the others, so let's not: introduce a new prefix for the case
where multiple SSL backends are compiled into cURL.
Signed-off-by: Johannes Schindelin <>
- [Johannes Schindelin brought this change]
configure: allow setting the default SSL backend
Previously, we used as default SSL backend whatever was first in the
`available_backends` array.
However, some users may want to override that default without patching
the source code.
Now they can: with the --with-default-ssl-backend=<backend> option of
the ./configure script.
Signed-off-by: Johannes Schindelin <>
- [Johannes Schindelin brought this change]
vtls: use Curl_ssl_multi pseudo backend only when needed
When only one SSL backend is configured, it is totally unnecessary to
let multissl_init() configure the backend at runtime, we can select the
correct backend at build time already.
Signed-off-by: Johannes Schindelin <>
- [Johannes Schindelin brought this change]
version: if built with more than one SSL backend, report all of them
To discern the active one from the inactive ones, put the latter into
Signed-off-by: Johannes Schindelin <>
- [Johannes Schindelin brought this change]
version: add the CURL_VERSION_MULTI_SSL feature flag
This new feature flag reports When cURL was built with multiple SSL
Signed-off-by: Johannes Schindelin <>
- [Johannes Schindelin brought this change]
metalink: allow compiling with multiple SSL backends
Previously, the code assumed that at most one of the SSL backends would
be compiled in, emulating OpenSSL's functions if the configured backend
was not OpenSSL itself.
However, now we allow building with multiple SSL backends and choosing
one at runtime. Therefore, metalink needs to be adjusted to handle this
scenario, too.
Signed-off-by: Johannes Schindelin <>
- [Johannes Schindelin brought this change]
docs/examples: demonstrate how to select SSL backends
The newly-introduced curl_global_sslset() function deserves to be
Signed-off-by: Johannes Schindelin <>
- [Johannes Schindelin brought this change]
Add a man page for curl_global_sslset()
Signed-off-by: Johannes Schindelin <>
- [Johannes Schindelin brought this change]
vtls: introduce curl_global_sslset()
Let's add a compile time safe API to select an SSL backend. This
function needs to be called *before* curl_global_init(), and can be
called only once.
Side note: we do not explicitly test that it is called before
curl_global_init(), but we do verify that it is not called multiple times
(even implicitly).
If SSL is used before the function was called, it will use whatever the
CURL_SSL_BACKEND environment variable says (or default to the first
available SSL backend), and if a subsequent call to
curl_global_sslset() disagrees with the previous choice, it will fail
The function also accepts an "avail" parameter to point to a (read-only)
NULL-terminated list of available backends. This comes in real handy if
an application wants to let the user choose between whatever SSL backends
the currently available libcurl has to offer: simply call
curl_global_sslset(-1, NULL, &avail);
which will return CURLSSLSET_UNKNOWN_BACKEND and populate the avail
variable to point to the relevant information to present to the user.
Just like with the HTTP/2 push functions, we have to add the function
declaration of curl_global_sslset() function to the header file
*multi.h* because VMS and OS/400 require a stable order of functions
declared in include/curl/*.h (where the header files are sorted
alphabetically). This looks a bit funny, but it cannot be helped.
Signed-off-by: Johannes Schindelin <>
- [Johannes Schindelin brought this change]
vtls: refactor out essential information about the SSL backends
There is information about the compiled-in SSL backends that is really
no concern of any code other than the SSL backend itself, such as which
function (if any) implements SHA-256 summing.
And there is information that is really interesting to the user, such as
the name, or the curl_sslbackend value.
Let's factor out the latter into a publicly visible struct. This
information will be used in the upcoming API to set the SSL backend
Signed-off-by: Johannes Schindelin <>
- [Johannes Schindelin brought this change]
vtls: allow selecting which SSL backend to use at runtime
When building software for the masses, it is sometimes not possible to
decide for all users which SSL backend is appropriate.
Git for Windows, for example, uses cURL to perform clones, fetches and
pushes via HTTPS, and some users strongly prefer OpenSSL, while other
users really need to use Secure Channel because it offers
enterprise-ready tools to manage credentials via Windows' Credential
The current Git for Windows versions use the ugly work-around of
building libcurl once with OpenSSL support and once with Secure Channel
support, and switching out the binaries in the installer depending on
the user's choice.
Needless to say, this is a super ugly workaround that actually only
works in some cases: Git for Windows also comes in a portable form, and
in a form intended for third-party applications requiring Git
functionality, in which cases this "swap out libcurl-4.dll" simply is
not an option.
Therefore, the Git for Windows project has a vested interest in teaching
cURL to make the SSL backend a *runtime* option.
This patch makes that possible.
By running ./configure with multiple --with-<backend> options, cURL will
be built with multiple backends.
For the moment, the backend can be configured using the environment
variable CURL_SSL_BACKEND (valid values are e.g. "openssl" and
Signed-off-by: Johannes Schindelin <>
- [Johannes Schindelin brought this change]
vtls: fold the backend ID into the Curl_ssl structure
Signed-off-by: Johannes Schindelin <>
- [Johannes Schindelin brought this change]
curl_ntlm_core: don't complain but #include OpenSSL header if needed
Signed-off-by: Johannes Schindelin <>
- [Johannes Schindelin brought this change]
vtls: encapsulate SSL backend-specific data
So far, all of the SSL backends' private data has been declared as
part of the ssl_connect_data struct, in one big #if .. #elif .. #endif
This can only work as long as the SSL backend is a compile-time option,
something we want to change in the next commits.
Therefore, let's encapsulate the exact data needed by each SSL backend
into a private struct, and let's avoid bleeding any SSL backend-specific
information into urldata.h. This is also necessary to allow multiple SSL
backends to be compiled in at the same time, as e.g. OpenSSL's and
CyaSSL's headers cannot be included in the same .c file.
To avoid too many malloc() calls, we simply append the private structs
to the connectdata struct in allocate_conn().
This requires us to take extra care of alignment issues: struct fields
often need to be aligned on certain boundaries e.g. 32-bit values need to
be stored at addresses that divide evenly by 4 (= 32 bit / 8
We do that by assuming that no SSL backend's private data contains any
fields that need to be aligned on boundaries larger than `long long`
(typically 64-bit) would need. Under this assumption, we simply add a
dummy field of type `long long` to the `struct connectdata` struct. This
field will never be accessed but acts as a placeholder for the four
instances of ssl_backend_data instead. the size of each ssl_backend_data
struct is stored in the SSL backend-specific metadata, to allow
allocate_conn() to know how much extra space to allocate, and how to
initialize the ssl[sockindex]->backend and proxy_ssl[sockindex]->backend
This would appear to be a little complicated at first, but is really
necessary to encapsulate the private data of each SSL backend correctly.
And we need to encapsulate thusly if we ever want to allow selecting
CyaSSL and OpenSSL at runtime, as their headers cannot be included within
the same .c file (there are just too many conflicting definitions and
declarations for that).
Signed-off-by: Johannes Schindelin <>
- [Johannes Schindelin brought this change]
vtls: prepare the SSL backends for encapsulated private data
At the moment, cURL's SSL backend needs to be configured at build time.
As such, it is totally okay for them to hard-code their backend-specific
data in the ssl_connect_data struct.
In preparation for making the SSL backend a runtime option, let's make
the access of said private data a bit more abstract so that it can be
adjusted later in an easy manner.
Signed-off-by: Johannes Schindelin <>
- [Johannes Schindelin brought this change]
urldata.h: move SSPI-specific #include to correct location
In 86b889485 (sasl_gssapi: Added GSS-API based Kerberos V5 variables,
2014-12-03), an SSPI-specific field was added to the kerberos5data
struct without moving the #include "curl_sspi.h" later in the same file.
This broke the build when SSPI was enabled, unless Secure Channel was
used as SSL backend, because it just so happens that Secure Channel also
requires "curl_sspi.h" to be #included.
In f4739f639 (urldata: include curl_sspi.h when Windows SSPI is enabled,
2017-02-21), this bug was fixed incorrectly: Instead of moving the
appropriate conditional #include, the Secure Channel-conditional part
was now also SSPI-conditional.
Fix this problem by moving the correct #include instead.
This is also required for an upcoming patch that moves all the Secure
Channel-specific stuff out of urldata.h and encapsulates it properly in
vtls/schannel.c instead.
Signed-off-by: Johannes Schindelin <>
- [Johannes Schindelin brought this change]
urldata.h: remove support for obsolete PolarSSL version
Since 5017d5ada (polarssl: now require 1.3.0+, 2014-03-17), we require
a newer PolarSSL version. No need to keep code trying to support any
older version.
Signed-off-by: Johannes Schindelin <>
- [Johannes Schindelin brought this change]
getinfo: access SSL internals via Curl_ssl
In the ongoing endeavor to abstract out all SSL backend-specific
functionality, this is the next step: Instead of hard-coding how the
different SSL backends access their internal data in getinfo.c, let's
implement backend-specific functions to do that task.
This will also allow for switching SSL backends as a runtime option.
Signed-off-by: Johannes Schindelin <>
- [Johannes Schindelin brought this change]
vtls: move SSL backends' private constants out of their header files
Signed-off-by: Johannes Schindelin <>
- [Johannes Schindelin brought this change]
axtls: use Curl_none_* versions of init() and cleanup()
There are convenient no-op versions of the init/cleanup functions now,
no need to define private ones for axTLS.
Signed-off-by: Johannes Schindelin <>
- [Johannes Schindelin brought this change]
vtls: remove obsolete declarations of SSL backend functionality
These functions are all available via the Curl_ssl struct now, no need
to declare them separately anymore.
As the global declarations are removed, the corresponding function
definitions are marked as file-local. The only two exceptions here are
Curl_mbedtls_shutdown() and Curl_polarssl_shutdown(): only the
declarations were removed, there are no function definitions to mark
Please note that Curl_nss_force_init() is *still* declared globally, as
the only SSL backend-specific function, because it was introduced
specifically for the use case where cURL was compiled with
`--without-ssl --with-nss`. For details, see f3b77e561 (http_ntlm: add
support for NSS, 2010-06-27).
Signed-off-by: Johannes Schindelin <>
- [Johannes Schindelin brought this change]
schannel: reorder functions topologically
The _shutdown() function calls the _session_free() function; While this
is not a problem now (because schannel.h declares both functions), a
patch looming in the immediate future with make all of these functions
So let's just move the _session_free() function's definition before it
is called.
Signed-off-by: Johannes Schindelin <>
- [Johannes Schindelin brought this change]
axtls: reorder functions topologically
The connect_finish() function (like many other functions after it) calls
the Curl_axtls_close() function; While this is not a problem now
(because axtls.h declares the latter function), a patch looming in the
immediate future with make all of these functions file-local.
So let's just move the Curl_axtls_close() function's definition before
it is called.
Signed-off-by: Johannes Schindelin <>
- [Johannes Schindelin brought this change]
vtls: move the SUPPORT_HTTPS_PROXY flag into the Curl_ssl struct
That will allow us to choose the SSL backend at runtime.
Signed-off-by: Johannes Schindelin <>
- [Johannes Schindelin brought this change]
vtls: convert the have_curlssl_* constants to runtime flags
The entire idea of introducing the Curl_ssl struct to describe SSL
backends is to prepare for choosing the SSL backend at runtime.
To that end, convert all the #ifdef have_curlssl_* style conditionals
to use bit flags instead.
Signed-off-by: Johannes Schindelin <>
- [Johannes Schindelin brought this change]
vtls: move sha256sum into the Curl_ssl struct
The SHA-256 checksumming is also an SSL backend-specific function.
Let's include it in the struct declaring the functionality of SSL
In contrast to MD5, there is no fall-back code. To indicate this, the
respective entries are NULL for those backends that offer no support for
SHA-256 checksumming.
Signed-off-by: Johannes Schindelin <>
- [Johannes Schindelin brought this change]
vtls: move md5sum into the Curl_ssl struct
The MD5 summing is also an SSL backend-specific function. So let's
include it, offering the previous fall-back code as a separate function
now: Curl_none_md5sum(). To allow for that, the signature had to be
changed so that an error could be returned from the implementation
(Curl_none_md5sum() can run out of memory).
Signed-off-by: Johannes Schindelin <>
- [Johannes Schindelin brought this change]
vtls: use the Curl_ssl struct to access all SSL backends' functionality
This is the first step to unify the SSL backend handling. Now all the
SSL backend-specific functionality is accessed via a global instance of
the Curl_ssl struct.
Signed-off-by: Johannes Schindelin <>
- [Johannes Schindelin brought this change]
vtls: declare Curl_ssl structs for every SSL backend
The idea of introducing the Curl_ssl struct was to unify how the SSL
backends are declared and called. To this end, we now provide an
instance of the Curl_ssl struct for each and every SSL backend.
Signed-off-by: Johannes Schindelin <>
- [Johannes Schindelin brought this change]
vtls: introduce a new struct for SSL backends
This new struct is similar in nature to Curl_handler: it will define the
functions and capabilities of all the SSL backends (where Curl_handler
defines the functions and capabilities of protocol handlers).
Signed-off-by: Johannes Schindelin <>
- [Johannes Schindelin brought this change]
vtls: make sure every _sha256sum()'s first arg is const
This patch makes the signature of the _sha256sum() functions consistent
among the SSL backends, in preparation for unifying the way all SSL
backends are accessed.
Signed-off-by: Johannes Schindelin <>
- [Johannes Schindelin brought this change]
vtls: make sure all _data_pending() functions return bool
This patch makes the signature of the _data_pending() functions
consistent among the SSL backends, in preparation for unifying the way
all SSL backends are accessed.
Signed-off-by: Johannes Schindelin <>
- [Johannes Schindelin brought this change]
vtls: make sure all _cleanup() functions return void
This patch makes the signature of the _cleanup() functions consistent
among the SSL backends, in preparation for unifying the way all SSL
backends are accessed.
Signed-off-by: Johannes Schindelin <>
- [Johannes Schindelin brought this change]
vtls: use consistent signature for _random() implementations
This will make the upcoming multissl backend much easier to implement.
Signed-off-by: Johannes Schindelin <>
- strtooff: fix build for systems with long long but no strtoll option
Closes #1829
Reported-by: Dan Fandrich
- darwinssl: handle long strings in TLS certs