]> git.ipfire.org Git - thirdparty/curl.git/log
thirdparty/curl.git
5 years agotimeouts: change millisecond timeouts to timediff_t from time_t
Daniel Stenberg [Thu, 28 May 2020 22:08:03 +0000 (00:08 +0200)] 
timeouts: change millisecond timeouts to timediff_t from time_t

For millisecond timers we like timediff_t better. Also, time_t can be
unsigned so returning a negative value doesn't work then.

Closes #5479

5 years agoselect: add overflow checks for timeval conversions
Marc Hoersken [Wed, 27 May 2020 15:24:21 +0000 (17:24 +0200)] 
select: add overflow checks for timeval conversions

Using time_t and suseconds_t if suseconds_t is available,
long on Windows (maybe others in the future) and int elsewhere.

Also handle case of ULONG_MAX being greater or equal to INFINITE.

Assisted-by: Jay Satiro
Reviewed-by: Daniel Stenberg
Part of #5343

5 years agoselect: use timediff_t instead of time_t and int for timeout_ms
Marc Hoersken [Tue, 5 May 2020 19:39:39 +0000 (21:39 +0200)] 
select: use timediff_t instead of time_t and int for timeout_ms

Make all functions in select.[ch] take timeout_ms as timediff_t
which should always be large enough and signed on all platforms
to take all possible timeout values and avoid type conversions.

Reviewed-by: Jay Satiro
Reviewed-by: Daniel Stenberg
Replaces #5107 and partially #5262
Related to #5240 and #5286
Closes #5343

5 years agounit1604.c: fix implicit conv from 'SANITIZEcode' to 'CURLcode'
Marc Hoersken [Thu, 28 May 2020 19:51:25 +0000 (21:51 +0200)] 
unit1604.c: fix implicit conv from 'SANITIZEcode' to 'CURLcode'

GCC 10 warns about this with warning: implicit conversion
  from 'SANITIZEcode' to 'CURLcode' [-Wenum-conversion]

Since 'expected_result' is not really of type 'CURLcode' and
it is not exposed in any way, we can just use 'SANITIZEcode'.

Reviewed-by: Daniel Stenberg
Reviewed-by: Marcel Raad
Closes #5476

5 years agotests/libtest: fix undefined reference to 'curlx_win32_fopen'
Marc Hoersken [Thu, 28 May 2020 19:04:07 +0000 (21:04 +0200)] 
tests/libtest: fix undefined reference to 'curlx_win32_fopen'

Since curl_setup.h now makes use of curlx_win32_fopen for Win32
builds with USE_WIN32_LARGE_FILES or USE_WIN32_SMALL_FILES defined,
we need to include the relevant files for tests using fopen,
because the libtest sources are also including curl_setup.h

Reviewed-by: Marcel Raad
Reviewed-by: Daniel Stenberg
Follow up to #3784 (ffdddb45d9)
Closes #5475

5 years agoappveyor: add non-debug plain autotools-based build
Marc Hoersken [Sat, 30 May 2020 07:46:04 +0000 (09:46 +0200)] 
appveyor: add non-debug plain autotools-based build

This should enable us to catch linking issues with the
testsuite early, like the one described/fixed in #5475.

Reviewed-by: Daniel Stenberg
Reviewed-by: Marcel Raad
Closes #5477

5 years agoRELEASE-NOTES: synced
Daniel Stenberg [Fri, 29 May 2020 21:59:44 +0000 (23:59 +0200)] 
RELEASE-NOTES: synced

5 years agoRevert "buildconf: use find -execdir"
Daniel Stenberg [Fri, 29 May 2020 15:34:06 +0000 (17:34 +0200)] 
Revert "buildconf: use find -execdir"

This partially reverts commit c712009838f44211958854de431315586995bc61.

Keep the ares_ files removed but bring back the older way to run find,
to make it work with busybox's find, as apparently that's being used.

Reported-by: Max Peal
Fixes #5483
Closes #5484

5 years agoserver/sws: fix asan warning on use of uninitialized variable
Daniel Stenberg [Fri, 29 May 2020 11:04:25 +0000 (13:04 +0200)] 
server/sws: fix asan warning on use of uninitialized variable

5 years agolibssh2: improved error output for wrong quote syntax
Daniel Stenberg [Thu, 28 May 2020 18:34:20 +0000 (20:34 +0200)] 
libssh2: improved error output for wrong quote syntax

Reported-by: Werner Stolz
Closes #5474

5 years agomk-lib1521: generate code for testing BLOB options as well
Daniel Stenberg [Thu, 28 May 2020 20:42:49 +0000 (22:42 +0200)] 
mk-lib1521: generate code for testing BLOB options as well

Follow-up to cac5374298b3

Closes #5478

5 years agoconfigure: repair the check if argv can be written to
Daniel Stenberg [Thu, 28 May 2020 14:32:07 +0000 (16:32 +0200)] 
configure: repair the check if argv can be written to

Due to bad escaping of the test code, the test wouldn't build and thus
result in a negative test result, which would lead to the unconditional
assumption that overwriting the arguments doesn't work and thus curl
would never hide credentials given in the command line, even when it
would otherwise be possible.

Regression from commit 2d4c2152c (7.60.0)

Reported-by: huzunhao on github
Fixes #5470
Closes #5471

5 years agoCMake: rebuild Makefile.inc.cmake when Makefile.inc changes
Peter Wu [Wed, 27 May 2020 20:36:22 +0000 (22:36 +0200)] 
CMake: rebuild Makefile.inc.cmake when Makefile.inc changes

Otherwise the build might fail due to missing source files, as
demonstrated by the recent keylog.c addition on an existing build dir.

Closes #5469

5 years agourldata: fix comments: Curl_done() is called multi_done() now
Daniel Stenberg [Thu, 28 May 2020 08:12:05 +0000 (10:12 +0200)] 
urldata: fix comments: Curl_done() is called multi_done() now

... since 575e885db

5 years agongtcp2: use common key log routine for better thread-safety
Peter Wu [Sun, 3 May 2020 23:41:46 +0000 (01:41 +0200)] 
ngtcp2: use common key log routine for better thread-safety

Tested with ngtcp2 built against the OpenSSL library. Additionally
tested with MultiSSL (NSS for TLS and ngtcp2+OpenSSL for QUIC).

The TLS backend (independent of QUIC) may or may not already have opened
the keylog file before. Therefore Curl_tls_keylog_open is always called
to ensure the file is open.

5 years agowolfssl: add SSLKEYLOGFILE support
Peter Wu [Sun, 3 May 2020 22:16:40 +0000 (00:16 +0200)] 
wolfssl: add SSLKEYLOGFILE support

Tested following the same curl and tshark commands as in commit
"vtls: Extract and simplify key log file handling from OpenSSL" using
WolfSSL v4.4.0-stable-128-g5179503e8 from git master built with
`./configure --enable-all --enable-debug CFLAGS=-DHAVE_SECRET_CALLBACK`.

Full support for this feature requires certain wolfSSL build options,
see "Availability note" in lib/vtls/wolfssl.c for details.

Closes #5327

5 years agovtls: Extract and simplify key log file handling from OpenSSL
Peter Wu [Sun, 3 May 2020 15:10:40 +0000 (17:10 +0200)] 
vtls: Extract and simplify key log file handling from OpenSSL

Create a set of routines for TLS key log file handling to enable reuse
with other TLS backends. Simplify the OpenSSL backend as follows:

 - Drop the ENABLE_SSLKEYLOGFILE macro as it is unconditionally enabled.
 - Do not perform dynamic memory allocation when preparing a log entry.
   Unless the TLS specifications change we can suffice with a reasonable
   fixed-size buffer.
 - Simplify state tracking when SSL_CTX_set_keylog_callback is
   unavailable. My original sslkeylog.c code included this tracking in
   order to handle multiple calls to SSL_connect and detect new keys
   after renegotiation (via SSL_read/SSL_write). For curl however we can
   be sure that a single master secret eventually becomes available
   after SSL_connect, so a simple flag is sufficient. An alternative to
   the flag is examining SSL_state(), but this seems more complex and is
   not pursued. Capturing keys after server renegotiation was already
   unsupported in curl and remains unsupported.

Tested with curl built against OpenSSL 0.9.8zh, 1.0.2u, and 1.1.1f
(`SSLKEYLOGFILE=keys.txt curl -vkso /dev/null https://localhost:4433`)
against an OpenSSL 1.1.1f server configured with:

    # Force non-TLSv1.3, use TLSv1.0 since 0.9.8 fails with 1.1 or 1.2
    openssl s_server -www -tls1
    # Likewise, but fail the server handshake.
    openssl s_server -www -tls1 -Verify 2
    # TLS 1.3 test. No need to test the failing server handshake.
    openssl s_server -www -tls1_3

Verify that all secrets (1 for TLS 1.0, 4 for TLS 1.3) are correctly
written using Wireshark. For the first and third case, expect four
matches per connection (decrypted Server Finished, Client Finished, HTTP
Request, HTTP Response). For the second case where the handshake fails,
expect a decrypted Server Finished only.

    tshark -i lo -pf tcp -otls.keylog_file:keys.txt -Tfields \
        -eframe.number -eframe.time -etcp.stream -e_ws.col.Info \
        -dtls.port==4433,http -ohttp.desegment_body:FALSE \
        -Y 'tls.handshake.verify_data or http'

A single connection can easily be identified via the `tcp.stream` field.

5 years agoFILEFORMAT: add more features that tests can depend on
Daniel Stenberg [Wed, 27 May 2020 12:28:51 +0000 (14:28 +0200)] 
FILEFORMAT: add more features that tests can depend on

5 years agotransfer: close connection after excess data has been read
Michael Kaufmann [Thu, 21 May 2020 11:10:04 +0000 (13:10 +0200)] 
transfer: close connection after excess data has been read

For HTTP 1.x, it's a protocol error when the server sends more bytes
than announced. If this happens, don't reuse the connection, because the
start position of the next response is undefined.

Closes #5440

5 years agoRevert "ssh: ignore timeouts during disconnect"
Estanislau Augé-Pujadas [Tue, 26 May 2020 22:59:33 +0000 (15:59 -0700)] 
Revert "ssh: ignore timeouts during disconnect"

This reverts commit f31760e63b4e9ef1eb25f8f211390f8239388515. Shipped in
curl 7.54.1.

Bug: https://curl.haxx.se/mail/lib-2020-05/0068.html
Closes #5465

5 years agourldata: connect related booleans live in struct ConnectBits
Daniel Stenberg [Tue, 26 May 2020 12:42:47 +0000 (14:42 +0200)] 
urldata: connect related booleans live in struct ConnectBits

And remove a few unused booleans!

Closes #5461

5 years agohostip: on macOS avoid DoH when given a numerical IP address
Daniel Stenberg [Tue, 26 May 2020 09:07:06 +0000 (11:07 +0200)] 
hostip: on macOS avoid DoH when given a numerical IP address

When USE_RESOLVE_ON_IPS is set (defined on macOS), it means that
numerical IP addresses still need to get "resolved" - but not with DoH.

Reported-by: Viktor Szakats
Fixes #5454
Closes #5459

5 years agongtcp2: cleanup memory when failing to connect
Daniel Stenberg [Mon, 25 May 2020 15:55:16 +0000 (17:55 +0200)] 
ngtcp2: cleanup memory when failing to connect

Reported-by: Peter Wu
Fixes #5447 (the ngtcp2 side of it)
Closes #5451

5 years agoquiche: clean up memory properly when failing to connect
Daniel Stenberg [Mon, 25 May 2020 15:24:36 +0000 (17:24 +0200)] 
quiche: clean up memory properly when failing to connect

Addresses the quiche side of #5447
Reported-by: Peter Wu
Closes #5450

5 years agocleanup: use a single space after equals sign in assignments
Daniel Stenberg [Tue, 26 May 2020 06:26:20 +0000 (08:26 +0200)] 
cleanup: use a single space after equals sign in assignments

5 years agourl: accept "any length" credentials for proxy auth
Daniel Stenberg [Mon, 25 May 2020 13:38:36 +0000 (15:38 +0200)] 
url: accept "any length" credentials for proxy auth

They're only limited to the maximum string input restrictions, not to
256 bytes.

Added test 1178 to verify

Reported-by: Will Roberts
Fixes #5448
Closes #5449

5 years agotest1167: fixes in badsymbols.pl
Maksim Stsepanenka [Mon, 25 May 2020 13:13:20 +0000 (16:13 +0300)] 
test1167: fixes in badsymbols.pl

Closes #5442

5 years agoaltsvc: fix parser for lines ending with CRLF
Daniel Stenberg [Mon, 25 May 2020 06:31:08 +0000 (08:31 +0200)] 
altsvc: fix parser for lines ending with CRLF

Fixed the alt-svc parser to treat a newline as end of line.

The unit tests in test 1654 were done without CRLF and thus didn't quite
match the real world. Now they use CRLF as well.

Reported-by: Peter Wu
Assisted-by: Peter Wu
Assisted-by: Jay Satiro
Fixes #5445
Closes #5446

5 years agoall: fix codespell errors
Viktor Szakats [Mon, 25 May 2020 19:44:04 +0000 (19:44 +0000)] 
all: fix codespell errors

Reviewed-by: Jay Satiro
Reviewed-by: Daniel Stenberg
Closes https://github.com/curl/curl/pull/5452

5 years agongtcp2: fix build with current ngtcp2 master implementing draft 28
Peter Wu [Sat, 23 May 2020 13:41:25 +0000 (15:41 +0200)] 
ngtcp2: fix build with current ngtcp2 master implementing draft 28

Based on client.cc changes from ngtcp2. Tested with current git master,
ngtcp2 commit c77d5731ce92, nghttp3 commit 65ff479d4380.

Fixes #5444
Closes #5443

5 years agoRELEASE-NOTES: synced
Daniel Stenberg [Mon, 25 May 2020 07:40:25 +0000 (09:40 +0200)] 
RELEASE-NOTES: synced

moved the new setopts up to a "change"

5 years agoRELEASE-NOTES: synced
Daniel Stenberg [Mon, 25 May 2020 07:38:28 +0000 (09:38 +0200)] 
RELEASE-NOTES: synced

5 years agocopyright: updated year ranges out of sync
Daniel Stenberg [Sat, 23 May 2020 22:02:33 +0000 (00:02 +0200)] 
copyright: updated year ranges out of sync

... and whitelisted a few more files in the the copyright.pl script.

5 years agosetopt: add CURLOPT_PROXY_ISSUERCERT(_BLOB) for coherency
Gilles Vollant [Tue, 19 May 2020 20:45:37 +0000 (22:45 +0200)] 
setopt: add CURLOPT_PROXY_ISSUERCERT(_BLOB) for coherency

Closes #5431

5 years agocurl: remove -J "informational" written on stdout
Daniel Stenberg [Wed, 20 May 2020 11:21:00 +0000 (13:21 +0200)] 
curl: remove -J "informational" written on stdout

curl would previously show "curl: Saved to filename 'name from header'"
if -J was used and a name was picked from the Content-Disposition
header. That output could interfer with other stdout output, such as -w.

This commit removes that output line.
Bug: https://curl.haxx.se/mail/archive-2020-05/0044.html
Reported-by: Коваленко Анатолий Викторович
Closes #5435

5 years agotravis: simplify quiche build instructions wrt boringssl
Peter Wu [Sun, 10 May 2020 14:53:00 +0000 (16:53 +0200)] 
travis: simplify quiche build instructions wrt boringssl

quiche builds boringssl as static library, reuse that instead of
building another shared library.

Closes #5438

5 years agoconfigure: fix pthread check with static boringssl
Peter Wu [Wed, 20 May 2020 21:36:21 +0000 (23:36 +0200)] 
configure: fix pthread check with static boringssl

A shared boringssl/OpenSSL library requires -lcrypto only for linking.
A static build additionally requires `-ldl -lpthread`. In the latter
case `-lpthread` is added to LIBS which prevented `-pthread` from being
added to CFLAGS. Clear LIBS to fix linking failures for libtest tests.

5 years agoRevert "sendf: make failf() use the mvsnprintf() return code"
Daniel Stenberg [Thu, 21 May 2020 21:53:19 +0000 (23:53 +0200)] 
Revert "sendf: make failf() use the mvsnprintf() return code"

This reverts commit 74623551f306990e70c7c5515b88972005604a74.

Instead mark the function call with (void). Getting the return code and
using it instead triggered Coverity warning CID 1463596 because
snprintf() can return a negative value...

Closes #5441

5 years agotypecheck-gcc.h: CURLINFO_PRIVATE does not need a 'char *'
Daniel Stenberg [Wed, 20 May 2020 14:51:54 +0000 (16:51 +0200)] 
typecheck-gcc.h: CURLINFO_PRIVATE does not need a 'char *'

Reported-by: Billyzou0741326 on github
Fixes #5432
Closes #5436

5 years agotests/server/util.h: add extern to silence compiler warning
Daniel Stenberg [Wed, 20 May 2020 13:36:20 +0000 (15:36 +0200)] 
tests/server/util.h: add extern to silence compiler warning

Follow-up from a3b0699d5c1

5 years agotypecheck-gcc.h: fix the OFF_T check
Daniel Stenberg [Wed, 20 May 2020 08:07:58 +0000 (10:07 +0200)] 
typecheck-gcc.h: fix the OFF_T check

The option number also needs to be less than CURLOPTTYPE_BLOB.

Follow-up to cac5374298
Reported-by: Jeroen Ooms
Bug: https://github.com/curl/curl/pull/5365#issuecomment-631084114

5 years agoTODO: --dry-run
Daniel Stenberg [Tue, 19 May 2020 07:46:50 +0000 (09:46 +0200)] 
TODO: --dry-run

Closes #5426

5 years agoTODO: Ratelimit or wait between serial requests
Daniel Stenberg [Tue, 19 May 2020 07:42:11 +0000 (09:42 +0200)] 
TODO: Ratelimit or wait between serial requests

Closes #5406

5 years agotool_paramhlp: fixup C89 mistake
Daniel Stenberg [Tue, 19 May 2020 06:58:09 +0000 (08:58 +0200)] 
tool_paramhlp: fixup C89 mistake

Follow-up to c5f0a9db22.

5 years agotool_paramhlp: fixed potentially uninitialized strtol() variable
Siva Sivaraman [Mon, 18 May 2020 15:59:58 +0000 (08:59 -0700)] 
tool_paramhlp: fixed potentially uninitialized strtol() variable

Seems highly unlikely to actually be possible, but better safe than
sorry.

Closes #5417

5 years agotool_operate: fixed potentially uninitialized variables
Siva Sivaraman [Mon, 18 May 2020 15:59:47 +0000 (08:59 -0700)] 
tool_operate: fixed potentially uninitialized variables

... in curl_easy_getinfo() calls. They're harmless but clearing the
variables makes the code safer and comforts the reader.

Closes #5416

5 years agosha256: move assign to the declaration line
Daniel Stenberg [Tue, 19 May 2020 06:51:31 +0000 (08:51 +0200)] 
sha256: move assign to the declaration line

Follow-up to fae30656. Should've been squashed with that commit...

5 years agosha256: fixed potentially uninitialized variable
Siva Sivaraman [Mon, 18 May 2020 15:59:31 +0000 (08:59 -0700)] 
sha256: fixed potentially uninitialized variable

Closes #5414

5 years agosendf: make failf() use the mvsnprintf() return code
Daniel Stenberg [Mon, 18 May 2020 16:51:37 +0000 (18:51 +0200)] 
sendf: make failf() use the mvsnprintf() return code

... and avoid a strlen() call. Fixes a MonocleAI warning.

Reported-by: MonocleAI
Fixes #5413
Closes #5420

5 years agohostip: make Curl_printable_address not return anything
Daniel Stenberg [Mon, 18 May 2020 16:41:20 +0000 (18:41 +0200)] 
hostip: make Curl_printable_address not return anything

It was not used much anyway and instead we let it store a blank buffer
in case of failure.

Reported-by: MonocleAI
Fixes #5411
Closes #5418

5 years agoftp: mark return-ignoring calls to Curl_GetFTPResponse with (void)
Daniel Stenberg [Mon, 18 May 2020 16:44:54 +0000 (18:44 +0200)] 
ftp: mark return-ignoring calls to Curl_GetFTPResponse with (void)

They're done on purpose, make that visible in the code.
Reported-by: MonocleAI
Fixes #5412
Closes #549

5 years agoTODO: forbid TLS post-handshake auth and do TLS record padding
Daniel Stenberg [Mon, 18 May 2020 15:59:18 +0000 (17:59 +0200)] 
TODO: forbid TLS post-handshake auth and do TLS record padding

Closes #5396
Closes #5398

5 years agoRELEASE-NOTES: synced
Daniel Stenberg [Mon, 18 May 2020 09:38:02 +0000 (11:38 +0200)] 
RELEASE-NOTES: synced

5 years agodynbuf: return NULL when there's no buffer length
Daniel Stenberg [Sun, 17 May 2020 17:47:45 +0000 (19:47 +0200)] 
dynbuf: return NULL when there's no buffer length

... as returning a "" is not a good idea as the string is supposed to be
allocated and returning a const string will cause issues.

Reported-by: Brian Carpenter
Follow-up to ed35d6590e72c
Closes #5405

5 years agotravis: upgrade to bionic, clang-9, improve readability
Peter Wu [Sun, 10 May 2020 10:07:38 +0000 (12:07 +0200)] 
travis: upgrade to bionic, clang-9, improve readability

Changes, partially to reduce build failures from external dependencies:
 - Upgrade Ubuntu and drop unnecessary third-party repos.
 - Properly clone apt config to ensure retries.
 - Upgrade to clang-9 from the standard repos.
 - Use Ubuntu 20.04 focal for the libssh build, use of ssh_get_publickey
   fails on -Werror=deprecated-declarations in Ubuntu 18.04. Do not use
   focal everywhere yet since Travis CI has not documented this option.
   In focal, python-impacket (Py2.7) has been removed, leaving only
   python3-impacket. Since it is only needed for SMB tests and not SSH,
   skip it for the libssh job since it might need more work.
 - apt: Remove gcc-8 and libstdc++-8-dev, already installed via g++-8.

Non-functional cleanups:
 - Simplify test matrix, drop redundant os and compiler keys.
 - Deprecation fixes: remove sudo, rename matrix -> jobs.
 - Every job has an 'env' key, put this key first in a list item.

Closes #5370

5 years agotravis: whitespace-only changes for consistency
Peter Wu [Tue, 12 May 2020 20:38:29 +0000 (22:38 +0200)] 
travis: whitespace-only changes for consistency

Automatically apply a consistent indentation with:

    python3 -c 'from ruamel.yaml import YAML;y=YAML();d=y.load(open(".travis.yml"));y.width=500;y.dump(d,open(".travis.yml.new","w"))'

followed by manually re-indenting three comments.

Closes #5370

5 years agoCMake: add libssh build support
Peter Wu [Sun, 10 May 2020 14:23:30 +0000 (16:23 +0200)] 
CMake: add libssh build support

Closes #5372

5 years agoKNOWN_BUGS: wolfssh: publickey auth doesn't work
Daniel Stenberg [Fri, 15 May 2020 15:01:32 +0000 (17:01 +0200)] 
KNOWN_BUGS: wolfssh: publickey auth doesn't work

Closes #4820

5 years agoKNOWN_BUGS: OS400 port requires deprecated IBM library
Daniel Stenberg [Fri, 15 May 2020 14:58:45 +0000 (16:58 +0200)] 
KNOWN_BUGS: OS400 port requires deprecated IBM library

Closes #5176

5 years agohttp2: keep trying to send pending frames after req.upload_done
Vyron Tsingaras [Fri, 15 May 2020 06:30:18 +0000 (08:30 +0200)] 
http2: keep trying to send pending frames after req.upload_done

Fixes #1410
Closes #5401

5 years agosetopt: support certificate options in memory with struct curl_blob
Gilles Vollant [Fri, 15 May 2020 08:47:46 +0000 (10:47 +0200)] 
setopt: support certificate options in memory with struct curl_blob

This change introduces a generic way to provide binary data in setopt
options, called BLOBs.

This change introduces these new setopts:

CURLOPT_ISSUERCERT_BLOB, CURLOPT_PROXY_SSLCERT_BLOB,
CURLOPT_PROXY_SSLKEY_BLOB, CURLOPT_SSLCERT_BLOB and CURLOPT_SSLKEY_BLOB.

Reviewed-by: Daniel Stenberg
Closes #5357

5 years agosource cleanup: remove all custom typedef structs
Daniel Stenberg [Wed, 13 May 2020 22:05:04 +0000 (00:05 +0200)] 
source cleanup: remove all custom typedef structs

 - Stick to a single unified way to use structs
 - Make checksrc complain on 'typedef struct {'
 - Allow them in tests, public headers and examples

 - Let MD4_CTX, MD5_CTX, and SHA256_CTX typedefs remain as they actually
   typedef different types/structs depending on build conditions.

Closes #5338

5 years agotravis: remove the .checksrc fiddling
Daniel Stenberg [Wed, 13 May 2020 22:05:03 +0000 (00:05 +0200)] 
travis: remove the .checksrc fiddling

5 years agoftp: make domore_getsock() return the secondary socket properly
Daniel Stenberg [Thu, 14 May 2020 22:40:25 +0000 (00:40 +0200)] 
ftp: make domore_getsock() return the secondary socket properly

Previously, after PASV and immediately after the data connection has
connected, the function would only return the control socket to wait for
which then made the data connection simply timeout and not get polled
correctly. This become obvious when running test 1631 and 1632 event-
based.

5 years agotest1632: verify FTP through HTTPS-proxy with connection re-use
Daniel Stenberg [Thu, 14 May 2020 15:52:40 +0000 (17:52 +0200)] 
test1632: verify FTP through HTTPS-proxy with connection re-use

5 years agotest1631: verify FTP download through HTTPS-proxy
Daniel Stenberg [Thu, 14 May 2020 15:47:36 +0000 (17:47 +0200)] 
test1631: verify FTP download through HTTPS-proxy

5 years agosws: as last resort, get test number from server cmd file
Daniel Stenberg [Thu, 14 May 2020 15:45:40 +0000 (17:45 +0200)] 
sws: as last resort, get test number from server cmd file

If it can't be found in the request. Also support --cmdfile to set it to
a custom file name.

runtests.pl always writes this file with the test number in it since a
while back.

5 years agoftp: shut down the secondary connection properly when SSL is used
Daniel Stenberg [Wed, 13 May 2020 10:22:49 +0000 (12:22 +0200)] 
ftp: shut down the secondary connection properly when SSL is used

Reported-by: Neal Poole
Fixes #5340
Closes #5385

5 years agoKNOWN_BUGS: adapt 5.5 to recent changes
Marcel Raad [Thu, 2 Jan 2020 22:07:34 +0000 (23:07 +0100)] 
KNOWN_BUGS: adapt 5.5 to recent changes

It only applies to non-Unicode builds now.
Also merge 5.10 into it as it's effectively a duplicate.

Closes https://github.com/curl/curl/pull/3784

5 years agocurl_setup: support Unicode functions to open files on Windows
Marcel Raad [Thu, 2 Jan 2020 21:47:33 +0000 (22:47 +0100)] 
curl_setup: support Unicode functions to open files on Windows

Use them only if `_UNICODE` is defined, in which case command-line
arguments have been converted to UTF-8.

Closes https://github.com/curl/curl/pull/3784

5 years agotool: support UTF-16 command line on Windows
Marcel Raad [Fri, 12 Apr 2019 20:59:40 +0000 (22:59 +0200)] 
tool: support UTF-16 command line on Windows

- use `wmain` instead of `main` when `_UNICODE` is defined [0]
- define `argv_item_t` as `wchar_t *` in this case
- use the curl_multibyte gear to convert the command-line arguments to
  UTF-8

This makes it possible to pass parameters with characters outside of
the current locale on Windows, which is required for some tests, e.g.
the IDN tests. Out of the box, this currently only works with the
Visual Studio project files, which default to Unicode, and winbuild
with the `ENABLE_UNICODE` option.

[0] https://devblogs.microsoft.com/oldnewthing/?p=40643

Ref: https://github.com/curl/curl/issues/3747
Closes https://github.com/curl/curl/pull/3784

5 years agocurl_multibyte: add to curlx
Marcel Raad [Sat, 13 Apr 2019 20:55:51 +0000 (22:55 +0200)] 
curl_multibyte: add to curlx

This will also be needed in the tool and tests.

Ref: https://github.com/curl/curl/pull/3758#issuecomment-482197512
Closes https://github.com/curl/curl/pull/3784

5 years agourl: make the updated credentials URL-encoded in the URL
Daniel Stenberg [Thu, 14 May 2020 12:37:12 +0000 (14:37 +0200)] 
url: make the updated credentials URL-encoded in the URL

Found-by: Gregory Jefferis
Reported-by: Jeroen Ooms
Added test 1168 to verify. Bug spotted when doing a redirect.
Bug: https://github.com/jeroen/curl/issues/224
Closes #5400

5 years agotests: add https-proxy support to the test suite
Daniel Stenberg [Thu, 14 May 2020 07:44:17 +0000 (09:44 +0200)] 
tests: add https-proxy support to the test suite

Initial test 1630 added with basic HTTPS-proxy use. HTTPS-proxy is like
HTTP proxy but with a full TLS connection to the proxy.

Closes #5399

5 years agomailmap: James Fuller
Daniel Stenberg [Thu, 14 May 2020 06:55:00 +0000 (08:55 +0200)] 
mailmap: James Fuller

5 years agovauth/cleartext: fix theoretical integer overflow
Major_Tom [Wed, 13 May 2020 19:41:27 +0000 (21:41 +0200)] 
vauth/cleartext: fix theoretical integer overflow

Fix theoretical integer overflow in Curl_auth_create_plain_message.

The security impact of the overflow was discussed on hackerone. We
agreed this is more of a theoretical vulnerability, as the integer
overflow would only be triggerable on systems using 32-bits size_t with
over 4GB of available memory space for the process.

Closes #5391

5 years agocurl.1: Quote globbed URLs
Jay Satiro [Wed, 13 May 2020 18:02:44 +0000 (14:02 -0400)] 
curl.1: Quote globbed URLs

- Quote the globbing example URLs that contain characters [] {} since
  otherwise they may be interpreted as shell metacharacters.

Bug: https://github.com/curl/curl/issues/5388
Reported-by: John Simpson
Closes https://github.com/curl/curl/pull/5394

5 years agochecksrc: enhance the ASTERISKSPACE and update code accordingly
Daniel Stenberg [Wed, 13 May 2020 10:56:53 +0000 (12:56 +0200)] 
checksrc: enhance the ASTERISKSPACE and update code accordingly

Fine: "struct hello *world"

Not fine: "struct hello* world" (and variations)

Closes #5386

5 years agodocs/options-in-versions: which version added each cmdline option
Daniel Stenberg [Tue, 12 May 2020 11:29:53 +0000 (13:29 +0200)] 
docs/options-in-versions: which version added each cmdline option

Added test 971 to verify that the list is in sync with the files in
cmdline-opts. The check also verifies that .d-files that uses Added:
specify the same version number as the options-in-versions file does.

Closes #5381

5 years agodocs: unify protocol lists
Daniel Stenberg [Wed, 13 May 2020 12:40:05 +0000 (14:40 +0200)] 
docs: unify protocol lists

We boast support for 25 transfer protocols. Make sure the lists are
consistent

Closes #5384

5 years agoOpenSSL: have CURLOPT_CRLFILE imply CURLSSLOPT_NO_PARTIALCHAIN
Daniel Stenberg [Mon, 11 May 2020 21:00:31 +0000 (23:00 +0200)] 
OpenSSL: have CURLOPT_CRLFILE imply CURLSSLOPT_NO_PARTIALCHAIN

... to avoid an OpenSSL bug that otherwise makes the CRL check to fail.

Reported-by: Michael Kaufmann
Fixes #5374
Closes #5376

5 years agotls13-ciphers.d: shorten the Arg
Daniel Stenberg [Tue, 12 May 2020 22:19:44 +0000 (00:19 +0200)] 
tls13-ciphers.d: shorten the Arg

5 years agosasl-authzid.d: add Arg: and shorten the desc
Daniel Stenberg [Tue, 12 May 2020 22:17:51 +0000 (00:17 +0200)] 
sasl-authzid.d: add Arg: and shorten the desc

5 years agocert-type.d: mention the available types in the desc
Daniel Stenberg [Tue, 12 May 2020 22:17:29 +0000 (00:17 +0200)] 
cert-type.d: mention the available types in the desc

5 years agotool: shorten 3 --help descriptions
Daniel Stenberg [Tue, 12 May 2020 07:13:43 +0000 (09:13 +0200)] 
tool: shorten 3 --help descriptions

--happy-eyeballs-timeout-ms, --resolve and --ssl-revoke-best-effort

gen.pl already warned about these lines but we didn't listen

Closes #5379

5 years agoconfigure: the wolfssh backend does not provide SCP
Daniel Stenberg [Wed, 13 May 2020 12:54:27 +0000 (14:54 +0200)] 
configure: the wolfssh backend does not provide SCP

Closes #5387

5 years agoRELEASE-NOTES: synced
Daniel Stenberg [Wed, 13 May 2020 08:05:49 +0000 (10:05 +0200)] 
RELEASE-NOTES: synced

5 years agourl: reject too long input when parsing credentials
Daniel Stenberg [Tue, 12 May 2020 22:52:34 +0000 (00:52 +0200)] 
url: reject too long input when parsing credentials

Since input passed to libcurl with CURLOPT_USERPWD and
CURLOPT_PROXYUSERPWD circumvents the regular string length check we have
in Curl_setstropt(), the input length limit is enforced in
Curl_parse_login_details too, separately.

Reported-by: Thomas Bouzerar
Closes #5383

5 years agolist-only.d: this option existed already in 4.0
Daniel Stenberg [Tue, 12 May 2020 11:25:47 +0000 (13:25 +0200)] 
list-only.d: this option existed already in 4.0

5 years agoretry-all-errors.d: Shorten the summary line
Jay Satiro [Tue, 12 May 2020 07:12:13 +0000 (03:12 -0400)] 
retry-all-errors.d: Shorten the summary line

Follow-up to b995bb5 from a few moments ago.

Reported-by: Daniel Stenberg
Ref: https://github.com/curl/curl/commit/b995bb5#r39108929

5 years agoeasy: fix dangling pointer on easy_perform fail
denzor [Sat, 9 May 2020 14:52:47 +0000 (17:52 +0300)] 
easy: fix dangling pointer on easy_perform fail

Closes https://github.com/curl/curl/pull/5363

5 years agotool: Add option --retry-all-errors to retry on any error
Jay Satiro [Sat, 4 Apr 2020 20:16:18 +0000 (16:16 -0400)] 
tool: Add option --retry-all-errors to retry on any error

The "sledgehammer" of retrying.

Closes https://github.com/curl/curl/pull/5185

5 years agolibcurl.pc: Merge Libs.private into Libs for static-only builds
James Le Cuirot [Mon, 11 May 2020 19:50:02 +0000 (20:50 +0100)] 
libcurl.pc: Merge Libs.private into Libs for static-only builds

A project being built entirely statically will call pkg-config with
--static, which utilises the Libs.private field. Conversely it will
not use --static when not being built entirely statically, even if
there is only a static build of libcurl available. This will most
likely cause the build to fail due to underlinking unless we merge the
Libs fields.

Consider that this is what the Meson build system does when it
generates pkg-config files.

I have also reflected this in the --libs argument of curl-config even
though REQUIRE_LIB_DEPS always seems to be "yes" anyway.

Closes #5373

5 years agoCMake: fix runtests.pl with CMake, add new test targets
Peter Wu [Sun, 10 May 2020 00:12:12 +0000 (02:12 +0200)] 
CMake: fix runtests.pl with CMake, add new test targets

  * runtests.pl:
    - Fix out-of-tree build under CMake when srcdir is not set. Default
      srcdir to the location of runtests.pl.
    - Add a hack to allow CMake to use the TFLAGS option as documented
      in tests/README and used in scripts/travis/script.sh.
  * Bump CMake version to 3.2 for USES_TERMINAL, dropping Debian Jessie
    support (no one should care, it is already EOL.).
  * Remove CTest since it defines its own 'test' target with no tests
    since all unittests are already broken and not built by default.
  * Add new test targets based on the options from Makefile.am. Since
    new test targets are rarely added, I opted for duplicating the
    runtests.pl options as opposed to creating a new Makefile.inc file.
    Use top-level target names (test-x) instead of x-test since that is
    used by CI and others.

Closes #5358

5 years agoCMake: do not build test programs by default
Peter Wu [Sun, 10 May 2020 00:10:20 +0000 (02:10 +0200)] 
CMake: do not build test programs by default

The default target should only build libcurl and curl. Add a dedicated
'testdeps' target which will be used later when running tests. Note that
unittests are currently broken in CMake and already excluded.

Closes #5368

5 years agoFILEFORMAT: moved up the variables section and further polished
Daniel Stenberg [Mon, 11 May 2020 20:44:58 +0000 (22:44 +0200)] 
FILEFORMAT: moved up the variables section and further polished

5 years agoruntests: remove ftp2 support, not used
Daniel Stenberg [Mon, 11 May 2020 20:29:04 +0000 (22:29 +0200)] 
runtests: remove ftp2 support, not used

We once supported two separate ftp instances in the test suite. Has not
been used the last decade.

Closes #5375

5 years agourl: sort the protocol schemes in rough popularity order
Daniel Stenberg [Mon, 11 May 2020 21:18:01 +0000 (23:18 +0200)] 
url: sort the protocol schemes in rough popularity order

When looking for a protocol match among supported schemes, check the
most "popular" schemes first. It has zero functionality difference and
for all practical purposes a speed difference will not be measureable
but it still think it makes sense to put the least likely matches last.

"Popularity" based on the 2019 user survey.

Closes #5377

5 years agotest1238: avoid tftpd being busy for tests shortly following
Marc Hoersken [Sun, 10 May 2020 16:40:24 +0000 (18:40 +0200)] 
test1238: avoid tftpd being busy for tests shortly following

The tftpd server may still be busy if the total timeout of
25 seconds has not been reached or no sread error was received
during or after the execution of the timeout test 1238.

Once the next TFTP test comes around (eg. 1242 or 1243),
those will fail because the tftpd server is still waiting
on data from curl due to the UDP protocol being stateless
and having no connection close. On Linux this error may not
happen, because ICMP errors generated due to a swrite error
can also be returned async on the next sread call instead.

Therefore we will now just kill the tftpd server after test
1238 to make sure that the following tests are not affected.

This enables us to no longer ignore tests 1242, 1243, 2002
and 2003 on the CI platforms CirrusCI and AppVeyor.

Assisted-by: Peter Wu
Closes #5364

5 years agowrite-out.d: added "response_code"
Daniel Stenberg [Mon, 11 May 2020 15:47:01 +0000 (17:47 +0200)] 
write-out.d: added "response_code"