]> git.ipfire.org Git - thirdparty/curl.git/log
thirdparty/curl.git
5 years agolibssh2: keep sftp errors as 'unsigned long'
Daniel Stenberg [Sat, 6 Jun 2020 22:30:50 +0000 (00:30 +0200)] 
libssh2: keep sftp errors as 'unsigned long'

Remove weird work-around for storing the SFTP errors as int instead of
the "unsigned long" that libssh2 actually returns for SFTP errors.

Closes #5534

5 years agotimeouts: move ms timeouts to timediff_t from int and long
Marc Hoersken [Mon, 1 Jun 2020 06:49:20 +0000 (08:49 +0200)] 
timeouts: move ms timeouts to timediff_t from int and long

Now that all functions in select.[ch] take timediff_t instead
of the limited int or long, we can remove type conversions
and related preprocessor checks to silence compiler warnings.

Avoiding conversions from time_t was already done in 842f73de.

Based upon #5262
Supersedes #5214, #5220 and #5221
Follow up to #5343 and #5479
Closes #5490

5 years agoopenssl: set FLAG_TRUSTED_FIRST unconditionally
François Rigault [Fri, 5 Jun 2020 20:00:58 +0000 (22:00 +0200)] 
openssl: set FLAG_TRUSTED_FIRST unconditionally

On some systems, openssl 1.0.x is still the default, but it has been
patched to contain all the recent security fixes. As a result of this
patching, it is possible for macro X509_V_FLAG_NO_ALT_CHAINS to be
defined, while the previous behavior of openssl to not look at trusted
chains first, remains.

Fix it: ensure X509_V_FLAG_TRUSTED_FIRST is always set, do not try to
probe for the behavior of openssl based on the existence ofmacros.

Closes #5530

5 years agoserver/util: fix logmsg format using curl_off_t argument
Daniel Stenberg [Fri, 5 Jun 2020 21:03:04 +0000 (23:03 +0200)] 
server/util: fix logmsg format using curl_off_t argument

... this caused segfaults on armv7.

Regression added in dd0365d560aea5a (7.70.0)

Reviewed-by: Jay Satiro
Closes #5529

5 years agoRELEASE-NOTES: synced
Daniel Stenberg [Fri, 5 Jun 2020 21:25:43 +0000 (23:25 +0200)] 
RELEASE-NOTES: synced

5 years agosocks: fix expected length of SOCKS5 reply
Cherish98 [Fri, 5 Jun 2020 17:36:11 +0000 (17:36 +0000)] 
socks: fix expected length of SOCKS5 reply

Commit 4a4b63d forgot to set the expected SOCKS5 reply length when the
reply ATYP is X'01'. This resulted in erroneously expecting more bytes
when the request length is greater than the reply length (e.g., when
remotely resolving the hostname).

Closes #5527

5 years ago.gitignore: add directory containing the stats repo
Marc Hoersken [Fri, 5 Jun 2020 17:54:34 +0000 (19:54 +0200)] 
.gitignore: add directory containing the stats repo

Since the new curl/stats repository is designed to be
checked out into the curl repository working tree as stats/
it should be on the ignore list to aid in commit staging.

5 years agoHTTP3.md: clarify cargo build directory
Adnan Khan [Thu, 4 Jun 2020 17:18:00 +0000 (13:18 -0400)] 
HTTP3.md: clarify cargo build directory

Cargo needs to be called from within the 'quiche' directory.

Closes #5522

5 years agouser-agent.d: spell out what happens given a blank argument
Daniel Stenberg [Fri, 5 Jun 2020 12:10:52 +0000 (14:10 +0200)] 
user-agent.d: spell out what happens given a blank argument

Closes #5525

5 years agotrailers: switch h1-trailer logic to use dynbuf
Daniel Stenberg [Fri, 5 Jun 2020 12:04:22 +0000 (14:04 +0200)] 
trailers: switch h1-trailer logic to use dynbuf

In the continued effort to remove "manual" realloc schemes.

Closes #5524

5 years agoCURLINFO_ACTIVESOCKET.3: clarify the description
Daniel Stenberg [Thu, 4 Jun 2020 15:20:17 +0000 (17:20 +0200)] 
CURLINFO_ACTIVESOCKET.3: clarify the description

Reported-by: Jay Satiro
Fixes #5299
Closes #5520

5 years agomailmap: Don J Olmstead
Daniel Stenberg [Thu, 4 Jun 2020 21:53:44 +0000 (23:53 +0200)] 
mailmap: Don J Olmstead

5 years agoconfigure: only strip first -L from LDFLAGS
Daniel Stenberg [Thu, 4 Jun 2020 16:11:36 +0000 (18:11 +0200)] 
configure: only strip first -L from LDFLAGS

In the logic that works out if a given OpenSSL path works, it stripped
off a possibly leading -L flag using an incorrect sed pattern which
would remove all instances of -L in the string, including if the path
itself contained that two-letter sequence!

The same pattern was used and is now updated in multiple places. Now it
only removes -L if it starts the strings.

Reported-by: Mohamed Osama
Fixes #5519
Closes #5521

5 years agoquiche: advertise draft 28 support
Peter Wu [Thu, 4 Jun 2020 09:54:01 +0000 (11:54 +0200)] 
quiche: advertise draft 28 support

Fix the verbose message while at it, quiche currently supports draft
27 and draft 28 simultaneously.

Closes #5518

5 years agoKNOWN_BUGS: RTSP authentication breaks without redirect support
Daniel Stenberg [Thu, 4 Jun 2020 08:40:32 +0000 (10:40 +0200)] 
KNOWN_BUGS: RTSP authentication breaks without redirect support

Closes #4750

5 years agoprojects: Add crypt32.lib to dependencies for all OpenSSL configs
Jay Satiro [Thu, 4 Jun 2020 05:21:28 +0000 (01:21 -0400)] 
projects: Add crypt32.lib to dependencies for all OpenSSL configs

Windows project configurations that use OpenSSL with USE_WIN32_CRYPTO
need crypt32.

Follow-up to 148534d which added CURLSSLOPT_NATIVE_CA for 7.71.0.

The changes that are in this commit were made by script.

Ref: https://gist.github.com/jay/a1861b50ecce2b32931237180f856e28

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

5 years agoCI/macos: fix 'is already installed' errors by using bundle
Marc Hoersken [Wed, 3 Jun 2020 17:58:14 +0000 (19:58 +0200)] 
CI/macos: fix 'is already installed' errors by using bundle

Avoid failing CI builds due to nghttp2 being already installed.

Closes #5513

5 years agoaltsvc: fix 'dsthost' may be used uninitialized in this function
Daniel Stenberg [Wed, 3 Jun 2020 14:28:41 +0000 (16:28 +0200)] 
altsvc: fix 'dsthost' may be used uninitialized in this function

5 years agoRELEASE-NOTES: synced
Daniel Stenberg [Tue, 2 Jun 2020 15:00:54 +0000 (17:00 +0200)] 
RELEASE-NOTES: synced

5 years agourldata: let the HTTP method be in the set.* struct
Daniel Stenberg [Mon, 1 Jun 2020 20:58:46 +0000 (22:58 +0200)] 
urldata: let the HTTP method be in the set.* struct

When the method is updated inside libcurl we must still not change the
method as set by the user as then repeated transfers with that same
handle might not execute the same operation anymore!

This fixes the libcurl part of #5462

Test 1633 added to verify.

Closes #5499

5 years agohostip: fix the memory-leak introduced in 67d2802
Daniel Stenberg [Tue, 2 Jun 2020 08:45:35 +0000 (10:45 +0200)] 
hostip: fix the memory-leak introduced in 67d2802

Fixes #5503
Closes #5504

5 years agotest970: make it require proxy support
Daniel Stenberg [Tue, 2 Jun 2020 07:21:03 +0000 (09:21 +0200)] 
test970: make it require proxy support

This test verifies the -w %json output and the test case includes a full
generated "blob". If there's no proxy support built into libcurl, it
will return an error for proxy related info variables and they will not
be included in the json, thus causing a mismatch and this test fails.

Reported-by: Marc Hörsken
Fixes #5501
Closes #5502

5 years agoexamples/http2-down/upload: add error checks
Radoslav Georgiev [Tue, 26 May 2020 16:42:07 +0000 (19:42 +0300)] 
examples/http2-down/upload: add error checks

If `index.html` does not exist in the directory from which the example
is invoked, the fopen(upload, "rb") invocation in `setup` would fail,
returning NULL.  This value is subsequently passed as the FILE* argument
of the `fread` invocation in the `read_callback` function, which is the
actual cause of the crash (apparently `fread` assumes that argument to
be non-null).

In addition, mitigate some possible crashes of similar origin.

Closes #5463

5 years agoexamples/ephiperfifo: turn off interval when setting timerfd
kotoriのねこ [Mon, 1 Jun 2020 17:51:34 +0000 (10:51 -0700)] 
examples/ephiperfifo: turn off interval when setting timerfd

Reported-by: therealhirudo on github
Fixes #5485
Closes #5497

5 years agovtls: repair the build with `CURL_DISABLE_PROXY`
Saleem Abdulrasool [Mon, 1 Jun 2020 18:20:47 +0000 (11:20 -0700)] 
vtls: repair the build with `CURL_DISABLE_PROXY`

`http_proxy` will not be available in `conndata` if `CURL_DISABLE_PROXY`
is enabled.  Repair the build with that configuration.

Follow-up to f3d501dc67

Closes #5498

5 years agotransfer: remove k->str NULL check
Daniel Stenberg [Mon, 1 Jun 2020 07:34:36 +0000 (09:34 +0200)] 
transfer: remove k->str NULL check

"Null-checking k->str suggests that it may be null, but it has already
been dereferenced on all paths leading to the check" - and it can't
legally be NULL at this point. Remove check.

Detected by Coverity CID 1463884

Closes #5495

5 years agoselect: always use Sleep in Curl_wait_ms on Win32
Marc Hoersken [Mon, 1 Jun 2020 06:32:21 +0000 (08:32 +0200)] 
select: always use Sleep in Curl_wait_ms on Win32

Since Win32 almost always will also have USE_WINSOCK,
we can reduce complexity and always use Sleep there.

Assisted-by: Jay Satiro
Reviewed-by: Daniel Stenberg
Follow up to #5343
Closes #5489

5 years agoconncache: download buffer needs +1 size for trailing zero
Daniel Stenberg [Sun, 31 May 2020 15:44:47 +0000 (17:44 +0200)] 
conncache: download buffer needs +1 size for trailing zero

Follow-up to c4e6968127e
Detected by OSS-Fuzz: https://oss-fuzz.com/testcase-detail/5727799779524608

5 years agoazure: use matrix strategy to avoid configuration redundancy
Marc Hoersken [Thu, 28 May 2020 20:11:32 +0000 (22:11 +0200)] 
azure: use matrix strategy to avoid configuration redundancy

This also includes the following changes:

- Use the same timeout for all jobs on Linux (60 minutes)
  and Windows (90 minutes)
- Use CLI stable apt-get install -y instead of apt install
  which warns about that and run apt-get update first
- Enable MQTT for Windows msys2 builds instead of
  legacy msys1 builds
- Add ./configure --prefix parameter to the msys2 builds
- The MSYSTEM environment variable is now preset inside
  the container images for the msys2 builds

Note: on Azure Pipelines the matrix strategy is basically
just a simple list of job copies and not really a matrix.

Closes #5468

5 years agobuild: disable more code/data when built without proxy support
Daniel Stenberg [Wed, 27 May 2020 09:51:34 +0000 (11:51 +0200)] 
build: disable more code/data when built without proxy support

Added build to travis to verify

Closes #5466

5 years agourl: alloc the download buffer at transfer start
Daniel Stenberg [Thu, 28 May 2020 16:30:47 +0000 (18:30 +0200)] 
url: alloc the download buffer at transfer start

... and free it as soon as the transfer is done. It removes the extra
alloc when a new size is set with setopt() and reduces memory for unused
easy handles.

In addition: the closure_handle now doesn't use an allocated buffer at
all but the smallest supported size as a stack based one.

Closes #5472

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