Peter Wang [Fri, 8 May 2020 00:43:45 +0000 (10:43 +1000)]
*_sspi: fix bad uses of CURLE_NOT_BUILT_IN
Return CURLE_AUTH_ERROR instead of CURLE_NOT_BUILT_IN for other
instances of QuerySecurityPackageInfo failing, as in
commit 2a81439553286f12cd04a4bdcdf66d8e026d8201.
Daniel Stenberg [Wed, 6 May 2020 21:31:43 +0000 (23:31 +0200)]
http2: simplify and clean up trailer handling
Triggered by a crash detected by OSS-Fuzz after the dynbuf introduction in ed35d6590e72. This should make the trailer handling more straight forward and
hopefully less error-prone.
Deliver the trailer header to the callback already at receive-time. No
longer caches the trailers to get delivered at end of stream.
Marc Hoersken [Thu, 7 May 2020 04:45:26 +0000 (06:45 +0200)]
appveyor: disable flaky test 1501 and ignore broken 1056
Test 1501 is flaky on Windows CI due to being time sensitive
and the testsuite relying on taskkill.exe to check for the
existance of processes which can take to much time itself.
Test 1056 is broken in autotools-based Windows builds due
to scope ID support missing in these builds at the moment.
Marc Hoersken [Tue, 5 May 2020 20:05:49 +0000 (22:05 +0200)]
test613.pl: make tests 613 and 614 work with OpenSSH for Windows
OpenSSH for Windows shows group and other/world permissions as *,
because those concepts do not exist on Windows. It also does not
show the current or parent directory, so we just ignore those.
Daniel Stenberg [Mon, 4 May 2020 16:57:34 +0000 (17:57 +0100)]
quiche: enable qlog output
quiche has the potential to log qlog files. To enable this, you must
build quiche with the qlog feature enabled `cargo build --features
qlog`. curl then passes a file descriptor to quiche, which takes
ownership of the file. The FD transfer only works on UNIX.
The convention is to enable logging when the QLOGDIR environment is
set. This should be a path to a folder where files are written with the
naming template <SCID>.qlog.
Co-authored-by: Lucas Pardue
Replaces #5337
Closes #5341
A common set of functions instead of many separate implementations for
creating buffers that can grow when appending data to them. Existing
functionality has been ported over.
In my early basic testing, the total number of allocations seem at
roughly the same amount as before, possibly a few less.
Jay Satiro [Sat, 2 May 2020 18:53:09 +0000 (14:53 -0400)]
asyn-thread: fix cppcheck warning
- Check for NULL entry parameter before attempting to deref entry in
Curl_resolver_is_resolved, like is already done in asyn-ares.
This is to silence cppcheck which does not seem to understand that
asyn-ares and asyn-thread have separate Curl_resolver_is_resolved
and those units are mutually exclusive. Prior to this change it warned
of a scenario where asyn-thread's Curl_resolver_is_resolved is called
with a NULL entry from asyn-ares, but that couldn't happen.
Marc Hoersken [Sat, 18 Apr 2020 19:51:19 +0000 (21:51 +0200)]
tests/server/util.[ch]: add exit event to stop waiting on Windows
This commit adds a global exit event to the test servers that
Windows-specific wait routines can use to get triggered if the
program was signaled to be terminated, eg. select_ws in sockfilt.c
The exit event will be managed by the signal handling code and is
set to not reset automatically to support multiple wait routines.
Daniel Stenberg [Sat, 2 May 2020 09:55:24 +0000 (11:55 +0200)]
examples: remove asiohiper.cpp
This example has repeatedly been reported to contain bugs, and as users
copy and paste code from this into production, I now deem it better to
not provide the example at all.
Daniel Stenberg [Thu, 30 Apr 2020 15:42:18 +0000 (17:42 +0200)]
cirrus: disable SFTP and SCP tests
... as we can't seem to start the sshd server on it. Those problems
existed before d1239b50bececd (running the SSH server on a random port),
but they're more noticable now since there are more failed attempts in
the logs.
Dan Fandrich [Thu, 30 Apr 2020 14:00:31 +0000 (16:00 +0200)]
tests: Stop referring to server ports when they're not used
Several tests referred to specific server ports even when the test
didn't actually use that server or specify that it's needed. In such
cases, the test harness substitutes the text "[not running]" as the port
number which causes many such tests to fail due to the inability to
parse the URL. These tests are changed to use %NOLISTENPORT which will
always be substituted correctly.
Daniel Stenberg [Tue, 21 Apr 2020 07:57:22 +0000 (09:57 +0200)]
tests: tests: run stunnel for HTTPS and FTPS on dynamic ports
As stunnel is an external tool and it has no specific option to export
the actually used port number when asked to listen to 0, runtests
instead iterates over ten randomly picked high number ports and sticks
to the first one stunnel can listen to.
These were commented out in e9dd0998706a when Makefile.inc was included
instead. 11 years have passed since then and the commented code is of
course very outdated. Remove it to avoid confusion.
The code wrongly assigned 'from' instead of 'auth' which probably was a
copy and paste mistake from other code, leading to that auth could
remain NULL and later cause an error to be returned.
Assisted-by: Eric Sauvageau
Fixes #5294
Closes #5295
libssh: avoid options override by configuration files
Previously, options set explicitly through command line options could be
overridden by the configuration files parsed automatically when
ssh_connect() was called.
By calling ssh_options_parse_config() explicitly, the configuration
files are parsed before setting the options, avoiding the options
override. Once the configuration files are parsed, the automatic
configuration parsing is not executed.
Fixes #4972
Closes #5283 Signed-off-by: Anderson Toshiyuki Sasaki <ansasaki@redhat.com>
Daniel Stenberg [Fri, 24 Apr 2020 11:29:48 +0000 (13:29 +0200)]
runtests: when <killserver> mentions http, kill http/2 too
Since the http2 test server is a mere proxy that needs to know about the
dynamic port the HTTP server is using, it too needs to get restarted
when the http server is killed.
Integer handling issues (CONSTANT_EXPRESSION_RESULT) "timeout_ms >
9223372036854775807L" is always false regardless of the values of its
operands. This occurs as the logical second operand of "||".
Jay Satiro [Thu, 16 Apr 2020 18:15:34 +0000 (14:15 -0400)]
transfer: Switch PUT to GET/HEAD on 303 redirect
Prior to this change if there was a 303 reply to a PUT request then
the subsequent request to respond to that redirect would also be a PUT.
It was determined that was most likely incorrect based on the language
of the RFCs. Basically 303 means "see other" resource, which implies it
is most likely not the same resource, therefore we should not try to PUT
to that different resource.
Refer to the discussions in #5237 and #5248 for more information.
Daniel Stenberg [Mon, 20 Apr 2020 20:23:48 +0000 (22:23 +0200)]
gnutls: bump lowest supported version to 3.1.10
GnuTLS 3.1.10 added new functions we want to use. That version was
released on Mar 22, 2013. Removing support for older versions also
greatly simplifies the code.
Daniel Stenberg [Mon, 20 Apr 2020 08:21:57 +0000 (10:21 +0200)]
tests: add %NOLISTENPORT and use it
The purpose with this variable is to provide a port number that is
reasonably likely to not have a listener on the local host so that tests
can try connect failures against it. It uses port 47 - "reserved"
according to IANA.
Updated six tests to use it instead of the previous different ports.
"The same code is executed when the condition result is true or false,
because the code in the if-then branch and after the if statement is
identical."
multi-ssl: reset the SSL backend on `Curl_global_cleanup()`
When cURL is compiled with support for multiple SSL backends, it is
possible to configure an SSL backend via `curl_global_sslset()`, but
only *before* `curl_global_init()` was called.
If another SSL backend should be used after that, a user might be
tempted to call `curl_global_cleanup()` to start over. However, we did
not foresee that use case and forgot to reset the SSL backend in that
cleanup.
Let's allow that use case.
Fixes #5255
Closes #5257 Reported-by: davidedec on github Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>