]> git.ipfire.org Git - thirdparty/curl.git/log
thirdparty/curl.git
4 years agotool_operate: don't discard failed parallel transfer result 6921/head
Jay Satiro [Tue, 20 Apr 2021 05:51:56 +0000 (01:51 -0400)] 
tool_operate: don't discard failed parallel transfer result

- Save a parallel transfer's result code only when it fails and the
  transfer is not being retried.

Prior to this change the result code was always set which meant that a
failed result could be erroneously discarded if a different transfer
later had a successful result (CURLE_OK).

Before:

> curl --fail -Z https://httpbin.org/status/404 https://httpbin.org/delay/10
> echo %ERRORLEVEL%
0

After:

> curl --fail -Z https://httpbin.org/status/404 https://httpbin.org/delay/10
> echo %ERRORLEVEL%
22

Closes #xxxx

4 years agoopenssl: fix build error with OpenSSL < 1.0.2
Georeth Zhou [Tue, 20 Apr 2021 03:11:56 +0000 (11:11 +0800)] 
openssl: fix build error with OpenSSL < 1.0.2

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

4 years agoREADME.md: delete Codacy UTM parameters & follow permanent redirect [ci skip]
Viktor Szakats [Mon, 19 Apr 2021 22:26:48 +0000 (22:26 +0000)] 
README.md: delete Codacy UTM parameters & follow permanent redirect [ci skip]

UTM parameters leak referrer and various marketing/tracking information
even if these would normally be stripped by website or client policy.
This link also works fine without them. Also took the opportunity to
update the URL to the one pointed to by the previous one via permanent
redirect.

Reviewed-by: Daniel Stenberg
Closes #6919

4 years agourlapi: "normalize" numerical IPv4 host names
Daniel Stenberg [Mon, 19 Apr 2021 06:34:52 +0000 (08:34 +0200)] 
urlapi: "normalize" numerical IPv4 host names

When the host name in a URL is given as an IPv4 numerical address, the
address can be specified with dotted numericals in four different ways:
a32, a.b24, a.b.c16 or a.b.c.d and each part can be specified in
decimal, octal (0-prefixed) or hexadecimal (0x-prefixed).

Instead of passing on the name as-is and leaving the handling to the
underlying name functions, which made them not work with c-ares but work
with getaddrinfo, this change now makes the curl URL API itself detect
and "normalize" host names specified as IPv4 numericals.

The WHATWG URL Spec says this is an okay way to specify a host name in a
URL. RFC 3896 does not allow them, but curl didn't prevent them before
and it seems other RFC 3896-using tools have not either. Host names used
like this are widely supported by other tools as well due to the
handling being done by getaddrinfo and friends.

I decided to add the functionality into the URL API itself so that all
users of these functions get the benefits, when for example wanting to
compare two URLs. Also, it makes curl built to use c-ares now support
them as well and make curl builds more consistent.

The normalization makes HTTPS and virtual hosted HTTP work fine even
when curl gets the address specified using one of the "obscure" formats.

Test 1560 is extended to verify.

Fixes #6863
Closes #6871

4 years agolibssh: fix "empty expression statement has no effect" warnings
Daniel Stenberg [Sat, 17 Apr 2021 17:00:15 +0000 (19:00 +0200)] 
libssh: fix "empty expression statement has no effect" warnings

... by fixing macros to do-while constructs and moving out the calls to
"break" outside of the actual macro. It also fixes the problem where the
macro was used witin a loop and the break didn't do right.

Reported-by: Emil Engler
Fixes #6847
Closes #6909

4 years agohsts: enable by default
Daniel Stenberg [Mon, 8 Mar 2021 07:30:32 +0000 (08:30 +0100)] 
hsts: enable by default

No longer considered experimental.

Closes #6700

4 years agovtls: refuse setting any SSL version
Daniel Stenberg [Mon, 22 Mar 2021 12:39:37 +0000 (13:39 +0100)] 
vtls: refuse setting any SSL version

... previously they were supported if a TLS library would (unexpectedly)
still support them, but from this change they will be refused already in
curl_easy_setopt(). SSLv2 and SSLv3 have been known to be insecure for
many years now.

Closes #6773

4 years agocurl: ignore options asking for SSLv2 or SSLv3
Daniel Stenberg [Mon, 22 Mar 2021 10:55:27 +0000 (11:55 +0100)] 
curl: ignore options asking for SSLv2 or SSLv3

Instead output a warning about it and continue with the defaults.

These SSL versions are typically not supported by the TLS libraries since a
long time back already since they are inherently insecure and broken. Asking
for them to be used will just cause an error to be returned slightly later.

In the unlikely event that a user's TLS library actually still supports these
protocol versions, this change might make the request a little less insecure.

Closes #6772

4 years agotest972: verify the json output with jsonlint 6906/head
Daniel Stenberg [Fri, 16 Apr 2021 21:53:22 +0000 (23:53 +0200)] 
test972: verify the json output with jsonlint

Make sure one of the azure jobs has jsonlint installed so that the test
runs there.

Ref: #6905

4 years agotool_writeout: fix the HTTP_CODE json output
Jay Satiro [Fri, 16 Apr 2021 22:34:48 +0000 (00:34 +0200)] 
tool_writeout: fix the HTTP_CODE json output

Update test 970 accordingly.

Reported-by: Michal Rus
Fixes #6905
Closes #6906

4 years agoopenldap: protect SSL-specific code with proper #ifdef
Daniel Stenberg [Thu, 15 Apr 2021 20:47:09 +0000 (22:47 +0200)] 
openldap: protect SSL-specific code with proper #ifdef

Closes #6901

4 years agolibssh2: fix Value stored to 'sshp' is never read
Daniel Stenberg [Thu, 15 Apr 2021 15:46:24 +0000 (17:46 +0200)] 
libssh2: fix Value stored to 'sshp' is never read

Pointed out by scan-build

Closes #6900

4 years agotool_getparam: replace (in-place) '%20' by '+' according to RFC1866
Victor Vieux [Thu, 15 Apr 2021 04:45:21 +0000 (21:45 -0700)] 
tool_getparam: replace (in-place) '%20' by '+' according to RFC1866

Signed-off-by: Victor Vieux <victorvieux@gmail.com>
Closes #6895

4 years agoconfigure: provide --with-openssl, deprecate --with-ssl
Daniel Stenberg [Tue, 13 Apr 2021 16:11:43 +0000 (18:11 +0200)] 
configure: provide --with-openssl, deprecate --with-ssl

Makes the option more explicit.

Closes #6887

4 years agoRELEASE-NOTES: synced
Daniel Stenberg [Thu, 15 Apr 2021 06:23:42 +0000 (08:23 +0200)] 
RELEASE-NOTES: synced

and bumped curlver to 7.77.0

4 years agorustls: only return CURLE_AGAIN when TLS session is fully drained
Javier Blazquez [Wed, 14 Apr 2021 21:55:12 +0000 (14:55 -0700)] 
rustls: only return CURLE_AGAIN when TLS session is fully drained

The code in cr_recv was returning prematurely as soon as the socket
reported no more data to read. However, this could be leaving some
unread plaintext data in the rustls session from a previous call,
causing causing the transfer to hang if the socket never receives
further data.

We need to ensure that the session is fully drained of plaintext data
before returning CURLE_AGAIN to the caller.

Reviewed-by: Jacob Hoffman-Andrews
Closes #6894

4 years agocookie: CURLOPT_COOKIEFILE set to NULL switches off cookies
Daniel Stenberg [Wed, 14 Apr 2021 07:15:19 +0000 (09:15 +0200)] 
cookie: CURLOPT_COOKIEFILE set to NULL switches off cookies

Add test 676 to verify that setting CURLOPT_COOKIEFILE to NULL again clears
the cookiejar from memory.

Reported-by: Stefan Karpinski
Fixes #6889
Closes #6891

4 years agoRELEASE-NOTES: synced curl-7_76_1
Daniel Stenberg [Fri, 9 Apr 2021 13:30:43 +0000 (15:30 +0200)] 
RELEASE-NOTES: synced

curl 7.76.1 release

4 years agoTHANKS: add names from 7.76.1
Daniel Stenberg [Tue, 13 Apr 2021 05:53:32 +0000 (07:53 +0200)] 
THANKS: add names from 7.76.1

4 years agomisc: update copyright year ranges to match latest updates
Daniel Stenberg [Sat, 10 Apr 2021 09:45:23 +0000 (11:45 +0200)] 
misc: update copyright year ranges to match latest updates

4 years agongtcp2: Use ALPN h3-29 for now
Tatsuhiro Tsujikawa [Tue, 13 Apr 2021 12:01:20 +0000 (21:01 +0900)] 
ngtcp2: Use ALPN h3-29 for now

Fixes #6864
Cloes #6886

4 years agoTODO: remove 18.22 --fail-with-body
Jay Satiro [Sun, 11 Apr 2021 04:36:13 +0000 (00:36 -0400)] 
TODO: remove 18.22 --fail-with-body

--fail-with-body was added in 8a964cb (precedes curl-7_76_0).

4 years agosrc/tool_vms.c: remove duplicated word in comment
Jürgen Gmach [Sat, 10 Apr 2021 08:15:29 +0000 (10:15 +0200)] 
src/tool_vms.c: remove duplicated word in comment

Closes #6881

4 years agoconfigure: fix CURL_DARWIN_CFLAGS use
Daniel Stenberg [Fri, 9 Apr 2021 14:08:32 +0000 (16:08 +0200)] 
configure: fix CURL_DARWIN_CFLAGS use

The macro name change was not completely done.

Follow-up to 5d2c384452543c
Bug: https://github.com/curl/curl/commit/5d2c384452543c7b6c9fb02eaa0afc84fd5ab941#commitcomment-49315187
Reported-by: Marcel Raad
Closes #6878

4 years agogithub/workflow: add "security-extended" to codeql-analysis.yml
Anthony Shaw [Tue, 30 Mar 2021 23:06:03 +0000 (10:06 +1100)] 
github/workflow: add "security-extended" to codeql-analysis.yml

Extends the CodeQL code scan.

Closes #6815

4 years agoexamples/hiperfifo.c: check event_initialized before delete
Jochem Broekhoff [Fri, 9 Apr 2021 09:03:30 +0000 (11:03 +0200)] 
examples/hiperfifo.c: check event_initialized before delete

If event_del is called with the event struct (still) zeroed out, a
segmentation fault may occur.  event_initialized checks whether the
event struct is nonzero.

Closes #6876

4 years agontlm: fix negotiated flags usage
Patrick Monnerat [Tue, 6 Apr 2021 17:32:21 +0000 (19:32 +0200)] 
ntlm: fix negotiated flags usage

According to Microsoft document MS-NLMP, current flags usage is not
accurate: flag NTLMFLAG_NEGOTIATE_NTLM2_KEY controls the use of
extended security in an NTLM authentication message and NTLM version 2
cannot be negotiated within the protocol.

The solution implemented here is: if the extended security flag is set,
prefer using NTLM version 2 (as a server featuring extended security
should also support version 2). If version 2 has been disabled at
compile time, use extended security.

Tests involving NTLM are adjusted to this new behavior.

Fixes #6813
Closes #6849

4 years agontlm: support version 2 on 32-bit platforms
Patrick Monnerat [Tue, 6 Apr 2021 17:31:03 +0000 (19:31 +0200)] 
ntlm: support version 2 on 32-bit platforms

Closes #6849

4 years agocurl_ntlm_core.h: simplify conditionals for USE_NTLM2SESSION
Patrick Monnerat [Fri, 2 Apr 2021 23:22:28 +0000 (01:22 +0200)] 
curl_ntlm_core.h: simplify conditionals for USE_NTLM2SESSION

... as !defined(CURL_DISABLE_CRYPTO_AUTH) is a prerequisite for the
whole NTLM.

Closes #6849

4 years agolib: remove unused HAVE_INET_NTOA_R* defines
Daniel Stenberg [Wed, 7 Apr 2021 22:36:57 +0000 (00:36 +0200)] 
lib: remove unused HAVE_INET_NTOA_R* defines

Closes #6867

4 years agoconfigure: include <time.h> unconditionally
Michael Forney [Wed, 7 Apr 2021 07:32:47 +0000 (00:32 -0700)] 
configure: include <time.h> unconditionally

In 2682e5f5, several instances of AC_HEADER_TIME were removed since
it is a deprecated autoconf macro. However, this was the macro that
defined TIME_WITH_SYS_TIME, which was used to indicate that <time.h>
can be included alongside <sys/time.h>. TIME_WITH_SYS_TIME is still
used in the configure test body and since it is no longer defined,
<time.h> is *not* included on systems that have <sys/time.h>.

In particular, at least on musl libc and glibc, <sys/time.h> does
not implicitly include <time.h> and does not declare clock_gettime,
gmtime_r, or localtime_r. This causes configure to fail to detect
those functions.

The AC_HEADER_TIME macro deprecation text says

> All current systems provide time.h; it need not be checked for.
> Not all systems provide sys/time.h, but those that do, all allow
> you to include it and time.h simultaneously.

So, to fix this issue, simply include <time.h> unconditionally when
testing for time-related functions and in libcurl, and don't bother
checking for it.

Closes #6859

4 years agoconfigure: remove use of RETSIGTYPE
Michael Forney [Wed, 7 Apr 2021 09:37:15 +0000 (02:37 -0700)] 
configure: remove use of RETSIGTYPE

This was previously defined by the obsolete AC_TYPE_SIGNAL macro,
which was removed in 2682e5f5. The deprecation text says

> Your code may safely assume C89 semantics that RETSIGTYPE is void.

So, remove it and just use void instead.

Closes #6861

4 years agoinstall: add instructions for Apple Darwin platforms
Muhammed Yavuz Nuzumlalı [Wed, 7 Apr 2021 09:05:47 +0000 (12:05 +0300)] 
install: add instructions for Apple Darwin platforms

Closes #6860

4 years agoconfigure: disable min version set for Darwin
Muhammed Yavuz Nuzumlalı [Sat, 3 Apr 2021 10:20:33 +0000 (13:20 +0300)] 
configure: disable min version set for Darwin

Fixes #6838
Closes #6860

4 years agodocs/HTTP3.md: update the build instruction using gnutls
David Hu [Wed, 7 Apr 2021 01:45:01 +0000 (01:45 +0000)] 
docs/HTTP3.md: update the build instruction using gnutls

In ngtcp2 the `with-gnutls` option is disabled by default, which will
cause `curl` unable to be `make` because of lacking the libraries
needed.

Closes #6857

4 years agoRELEASE-NOTES: synced
Daniel Stenberg [Wed, 7 Apr 2021 06:32:50 +0000 (08:32 +0200)] 
RELEASE-NOTES: synced

4 years agotypecheck-gcc: make the ssl-ctx-cb check use SSL_CTX pointers
Daniel Stenberg [Wed, 31 Mar 2021 14:01:35 +0000 (16:01 +0200)] 
typecheck-gcc: make the ssl-ctx-cb check use SSL_CTX pointers

... and not values.

Reported-by: locpyl-tidnyd on github
Fixes #6818
Closes #6819

4 years agongtcp2+gnutls: clear credentials when freed
Daniel Stenberg [Tue, 6 Apr 2021 15:24:31 +0000 (17:24 +0200)] 
ngtcp2+gnutls: clear credentials when freed

... to avoid double-free.

Reported-by: Kenneth Davidson
Fixes #6824
Closes #6856

4 years agotool_progress: Fix progress meter in parallel mode
Cherish98 [Fri, 2 Apr 2021 10:57:38 +0000 (10:57 +0000)] 
tool_progress: Fix progress meter in parallel mode

Make sure the total amount of DL/UL bytes are counted before the
transfer finalizes. Otherwise if a transfer finishes too quick, its
total numbers are not added, and results in a DL%/UL% that goes above
100%.

Detail:

progress_meter() is called periodically, and it may not catch a
transfer's total bytes if the value was unknown during the last call,
and the transfer is finished and deleted (i.e., lost) during the next
call.

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

4 years agolibssh: get rid of PATH_MAX
Emil Engler [Thu, 1 Apr 2021 16:24:53 +0000 (18:24 +0200)] 
libssh: get rid of PATH_MAX

This removes the last occurrence of PATH_MAX inside our libssh
implementation by calculating the path length from the string length of
the two components.

Closes #6829

4 years agohttp_proxy: only loop on 407 + close if we have credentials
Daniel Stenberg [Mon, 5 Apr 2021 10:11:30 +0000 (12:11 +0200)] 
http_proxy: only loop on 407 + close if we have credentials

... to fix the retry-loop.

Add test 718 to verify.

Reported-by: Daniel Kurečka
Fixes #6828
Closes #6850

4 years agoh2: allow 100 streams by default
Daniel Stenberg [Mon, 5 Apr 2021 15:51:19 +0000 (17:51 +0200)] 
h2: allow 100 streams by default

instead of 13, before the server has told how many streams it
accepts. The server can always reject new streams anyway if we go above
what it accepts.

Ref: #6826
Closes #6852

4 years agofile: support GETing directories again
Luke Granger-Brown [Sat, 3 Apr 2021 19:12:48 +0000 (19:12 +0000)] 
file: support GETing directories again

After 957bc1881e686f9714c4e6a01bf33535091f0e21, we no longer compute an
expected_size for directories. This has the upshot that when we compare
even an empty Range with the available size, we fail.

This brings back the previous behaviour, which was to succeed, but with
empty content. This also removes the "Accept-ranges: bytes" header,
which is nonsensical on directories.

Adds test 3016
Fixes #6845
Closes #6846

4 years agoRELEASE-NOTES: synced
Daniel Stenberg [Sun, 4 Apr 2021 21:53:02 +0000 (23:53 +0200)] 
RELEASE-NOTES: synced

and bumped to 7.76.1

4 years agoTLS: fix HTTP/2 selection
Daniel Stenberg [Thu, 1 Apr 2021 14:25:19 +0000 (16:25 +0200)] 
TLS: fix HTTP/2 selection

for GnuTLS, BearSSL, mbedTLS, NSS, SChannnel, Secure Transport and
wolfSSL...

Regression since 88dd1a8a115b1f5ece (shipped in 7.76.0)
Reported-by: Kenneth Davidson
Reported-by: romamik om github
Fixes #6825
Closes #6827

4 years agohostip: Fix for builds that disable all asynchronous DNS
Jay Satiro [Thu, 1 Apr 2021 19:15:01 +0000 (15:15 -0400)] 
hostip: Fix for builds that disable all asynchronous DNS

- Define Curl_resolver_error function only when USE_CURL_ASYNC.

Prior to this change building curl without an asynchronous resolver
backend (c-ares or threaded) and without DoH (DNS-over-HTTPS, which is
also asynchronous but independent of resolver backend) would cause a
build error since Curl_resolver_error is called by and evaluates
variables only available in asynchronous builds.

Reported-by: Benbuck Nason
Fixes https://github.com/curl/curl/issues/6831
Closes https://github.com/curl/curl/pull/6832

4 years agoopenssl: Fix CURLOPT_SSLCERT_BLOB without CURLOPT_SSLCERT_KEY
Gilles Vollant [Wed, 31 Mar 2021 19:46:43 +0000 (21:46 +0200)] 
openssl: Fix CURLOPT_SSLCERT_BLOB without CURLOPT_SSLCERT_KEY

Reported-by: Christian Schmitz
Fixes #6816
Closes #6820

4 years agoRELEASE-NOTES: synced curl-7_76_0
Daniel Stenberg [Tue, 30 Mar 2021 22:08:25 +0000 (00:08 +0200)] 
RELEASE-NOTES: synced

curl 7.76.0 release

4 years agoTHANKS: added names from 7.76.0
Daniel Stenberg [Tue, 30 Mar 2021 22:08:24 +0000 (00:08 +0200)] 
THANKS: added names from 7.76.0

4 years agoCURLOPT_AUTOREFERER.3: clarify that it sets the full URL
Daniel Stenberg [Tue, 30 Mar 2021 12:47:14 +0000 (14:47 +0200)] 
CURLOPT_AUTOREFERER.3: clarify that it sets the full URL

... some users may not want that!

4 years agodefine: remove CURL_DISABLE_NTLM ifdefs 6809/head
Daniel Stenberg [Sun, 28 Mar 2021 21:12:23 +0000 (23:12 +0200)] 
define: remove CURL_DISABLE_NTLM ifdefs

It was never defined anywhere. Fixed disable-scan (test 1165) to also
scan headers, which found this issue.

Closes #6809

4 years agovtls: fix addsessionid for non-proxy builds
Daniel Stenberg [Mon, 29 Mar 2021 10:50:57 +0000 (12:50 +0200)] 
vtls: fix addsessionid for non-proxy builds

Follow-up to b09c8ee15771c61
Fixes #6812
Closes #6811

4 years agocmake: support WinIDN
Li Xinwei [Mon, 29 Mar 2021 04:58:17 +0000 (12:58 +0800)] 
cmake: support WinIDN

Closes #6807

4 years agotransfer: clear 'referer' in declaration
Daniel Stenberg [Mon, 29 Mar 2021 07:32:14 +0000 (09:32 +0200)] 
transfer: clear 'referer' in declaration

To silence (false positive) compiler warnings about it.

Follow-up to 7214288898f5625

Reviewed-by: Marcel Raad
Closes #6810

4 years agoconfig: fix SSPI enabling NTLM if crypto auth is disabled
Marc Hoersken [Sun, 28 Mar 2021 18:46:54 +0000 (20:46 +0200)] 
config: fix SSPI enabling NTLM if crypto auth is disabled

Avoid enabling NTLM feature based upon Windows SSPI
being enabled in case that crypto auth is disabled.

Reported-by: Marcel Raad
Follow-up to #6277
Fixes #6803
Closes #6808

4 years agoHISTORY: add two 2021 events
Daniel Stenberg [Mon, 29 Mar 2021 07:05:02 +0000 (09:05 +0200)] 
HISTORY: add two 2021 events

4 years agovtls: add 'isproxy' argument to Curl_ssl_get/addsessionid()
Daniel Stenberg [Fri, 19 Mar 2021 11:38:49 +0000 (12:38 +0100)] 
vtls: add 'isproxy' argument to Curl_ssl_get/addsessionid()

To make sure we set and extract the correct session.

Reported-by: Mingtao Yang
Bug: https://curl.se/docs/CVE-2021-22890.html

CVE-2021-22890

4 years agotransfer: strip credentials from the auto-referer header field
Viktor Szakats [Tue, 23 Feb 2021 13:54:46 +0000 (14:54 +0100)] 
transfer: strip credentials from the auto-referer header field

Added test 2081 to verify.

CVE-2021-22876

Bug: https://curl.se/docs/CVE-2021-22876.html

4 years agocurl_sasl: fix compiler error with --disable-crypto-auth
Daniel Stenberg [Sun, 28 Mar 2021 15:08:44 +0000 (17:08 +0200)] 
curl_sasl: fix compiler error with --disable-crypto-auth

... if libgsasl was found.

Closes #6806

4 years agoldap: only set the callback ptr for TLS context when TLS is used
Patrick Monnerat [Sun, 28 Mar 2021 09:43:11 +0000 (11:43 +0200)] 
ldap: only set the callback ptr for TLS context when TLS is used

Follow-up to a5eee22e594c2460f
Fixes #6804
Closes #6805

4 years agocopyright: update copyright year ranges to 2021
Daniel Stenberg [Sat, 27 Mar 2021 11:52:25 +0000 (12:52 +0100)] 
copyright: update copyright year ranges to 2021

Reviewed-by: Emil Engler
Closes #6802

4 years agosend_speed: simplify the checks for if a speed limit is set
Daniel Stenberg [Fri, 26 Mar 2021 12:08:44 +0000 (13:08 +0100)] 
send_speed: simplify the checks for if a speed limit is set

... as we know the value cannot be set to negative: enforced by
setopt()

4 years agohttp: cap body data amount during send speed limiting
Daniel Stenberg [Fri, 26 Mar 2021 09:06:51 +0000 (10:06 +0100)] 
http: cap body data amount during send speed limiting

By making sure never to send off more than the allowed number of bytes
per second the speed limit logic is given more room to actually work.

Reported-by: Fabian Keil
Bug: https://curl.se/mail/lib-2021-03/0042.html
Closes #6797

4 years agourldata: merge "struct DynamicStatic" into "struct UrlState"
Daniel Stenberg [Fri, 26 Mar 2021 13:25:45 +0000 (14:25 +0100)] 
urldata: merge "struct DynamicStatic" into "struct UrlState"

Both were used for the same purposes and there was no logical separation
between them. Combined, this also saves 16 bytes in less holes in my
test build.

Closes #6798

4 years agotests/README.md: mentioned that en_US.UTF-8 is required
Daniel Stenberg [Fri, 26 Mar 2021 16:54:12 +0000 (17:54 +0100)] 
tests/README.md: mentioned that en_US.UTF-8 is required

Reported-by: Oumph on github
Fixes #6768

4 years agoHISTORY: fixed the Mac OS X 10.1 release date
Daniel Stenberg [Fri, 26 Mar 2021 08:08:10 +0000 (09:08 +0100)] 
HISTORY: fixed the Mac OS X 10.1 release date

Based on what Wikipedia says

4 years agoexamples: Remove threaded-shared-conn.c due to bug
Jay Satiro [Fri, 26 Mar 2021 03:53:46 +0000 (23:53 -0400)] 
examples: Remove threaded-shared-conn.c due to bug

Known bug 11.11 is the shared object's connection cache is not thread
safe, so we should not have an example for it.

Ref: https://github.com/curl/curl/issues/4915
Ref: https://curl.se/docs/knownbugs.html#A_shared_connection_cache_is_not

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

4 years agoKNOWN_BUGS: Update 11.9 - DoH option inheritance
Jay Satiro [Fri, 26 Mar 2021 07:14:28 +0000 (03:14 -0400)] 
KNOWN_BUGS: Update 11.9 - DoH option inheritance

- Add description: Explain that some options aren't inherited because
  they are not relevant for the DoH SSL connections or may result in
  unexpected behavior.

- Remove the reference to #4578 (SSL verify options not inherited) since
  that was fixed by #6597 (separate DoH-specific options for verify).

- Explain that DoH-specific options (those created by #6597) are
  available: CURLOPT_DOH_SSL_VERIFYHOST, CURLOPT_DOH_SSL_VERIFYPEER and
  CURLOPT_DOH_SSL_VERIFYSTATUS.

- Add a reference to #6605 and explain that the user's debug function is
  not inherited because it would be unexpected to pass internal handles
  (ie DoH handles) to the user's callback.

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

4 years agocurl_easy_setopt.3: add curl_easy_option* functions to SEE ALSO
Daniel Stenberg [Fri, 26 Mar 2021 06:56:22 +0000 (07:56 +0100)] 
curl_easy_setopt.3: add curl_easy_option* functions to SEE ALSO

4 years agoopenssl: ensure to check SSL_CTX_set_alpn_protos return values
Jean-Philippe Menil [Thu, 25 Mar 2021 16:21:24 +0000 (17:21 +0100)] 
openssl: ensure to check SSL_CTX_set_alpn_protos return values

SSL_CTX_set_alpn_protos() return 0 on success, and non-0 on failure

Signed-off-by: Jean-Philippe Menil <jpmenil@gmail.com>
Closes #6794

4 years agomulti: close the connection when h2=>h1 downgrading
Daniel Stenberg [Thu, 25 Mar 2021 12:13:18 +0000 (13:13 +0100)] 
multi: close the connection when h2=>h1 downgrading

Otherwise libcurl is likely to reuse the connection again in the next
attempt since the connection reuse logic doesn't take downgrades into
account.

Reported-by: Anthony Ramine
Fixes #6788
Closes #6793

4 years agoopenssl: set the transfer pointer for logging early
Daniel Stenberg [Thu, 25 Mar 2021 10:06:01 +0000 (11:06 +0100)] 
openssl: set the transfer pointer for logging early

Otherwise, the transfer will be NULL in the trace function when the
early handshake details arrive and then curl won't show them.

Regresssion in 7.75.0

Reported-by: David Hu
Fixes #6783
Closes #6792

4 years agoRELEASE-NOTES: synced
Daniel Stenberg [Thu, 25 Mar 2021 08:32:02 +0000 (09:32 +0100)] 
RELEASE-NOTES: synced

4 years agoTODO: Custom progress meter update interval
Daniel Stenberg [Thu, 25 Mar 2021 08:22:52 +0000 (09:22 +0100)] 
TODO: Custom progress meter update interval

Ref: https://stackoverflow.com/q/66789977/93747

4 years agodocs/ABI: tighten up the language
Daniel Stenberg [Wed, 24 Mar 2021 12:56:48 +0000 (13:56 +0100)] 
docs/ABI: tighten up the language

Make the promises more firm

Closes #6786

4 years agoopenldap: disconnect better
Daniel Stenberg [Wed, 24 Mar 2021 13:57:19 +0000 (14:57 +0100)] 
openldap: disconnect better

Instead of clearing the callback argument in disconnect, set it to the
(new) transfer to make sure the correct data is passed to the callbacks.

Follow-up to e467ea3bd937f38
Assisted-by: Patrick Monnerat
Closes #6787

4 years agolibssh2: kdb_callback: get the right struct pointer
Daniel Stenberg [Tue, 23 Mar 2021 10:17:32 +0000 (11:17 +0100)] 
libssh2: kdb_callback: get the right struct pointer

After the recent conn/data refactor in this source file, this function
was mistakenly still getting the old struct pointer which would lead to
crash on servers with keyboard-interactive auth enabled.

Follow-up to a304051620b92e12b (shipped in 7.75.0)

Reported-by: Christian Schmitz
Fixes #6691
Closes #6782

4 years agotftp: remove unused struct fields
Daniel Stenberg [Tue, 23 Mar 2021 08:41:50 +0000 (09:41 +0100)] 
tftp: remove unused struct fields

Follow-up to d3d90ad9c00530d

Closes #6781

4 years agoopenldap: avoid NULL pointer dereferences
Daniel Stenberg [Tue, 23 Mar 2021 08:28:07 +0000 (09:28 +0100)] 
openldap: avoid NULL pointer dereferences

Follow-up to a59c33ceffb8f78
Reported-by: Patrick Monnerat
Fixes #6676
Closes #6780

4 years agohttp: strip default port from URL sent to proxy
Daniel Stenberg [Mon, 22 Mar 2021 23:24:59 +0000 (00:24 +0100)] 
http: strip default port from URL sent to proxy

To make sure the Host: header and the URL provide the same authority
portion when sent to the proxy, strip the default port number from the
URL if one was provided.

Reported-by: Michael Brown
Fixes #6769
Closes #6778

4 years agoazure: disable test 433 on azure-ubuntu
Daniel Stenberg [Mon, 22 Mar 2021 15:07:36 +0000 (16:07 +0100)] 
azure: disable test 433 on azure-ubuntu

Something in that environment sets XDG_CONFIG_HOME for us in a way that
breaks the test.

Reported-by: Marc Hörsken
Fixes #6739
Closes #6777

4 years agotftp: remove the 3600 second default timeout
Daniel Stenberg [Mon, 22 Mar 2021 14:39:27 +0000 (15:39 +0100)] 
tftp: remove the 3600 second default timeout

... it was never meant to be there.

Reported-by: Tomas Berger
Fixes #6774
Closes #6776

4 years agodocs: make gen.pl support *italic* and **bold**
Daniel Stenberg [Mon, 22 Mar 2021 15:50:57 +0000 (16:50 +0100)] 
docs: make gen.pl support *italic* and **bold**

Remove some nroffisms from the cmdline doc files to simplify editing,
and instead support this markdown style.

Closes #6771

4 years agongtcp2: sync with recent API updates
Daniel Stenberg [Mon, 22 Mar 2021 09:01:13 +0000 (10:01 +0100)] 
ngtcp2: sync with recent API updates

Closes #6770

4 years agoRELEASE-NOTES: synced
Daniel Stenberg [Sun, 21 Mar 2021 10:27:12 +0000 (11:27 +0100)] 
RELEASE-NOTES: synced

4 years agolibssh2:ssh_connect: clear session pointer after free
Daniel Stenberg [Sat, 20 Mar 2021 23:10:04 +0000 (00:10 +0100)] 
libssh2:ssh_connect: clear session pointer after free

If libssh2_knownhost_init() returns NULL, like in an OOM situation, the
ssh session was freed but the pointer wasn't cleared which made libcurl
later call libssh2 to cleanup using the stale pointer.

Fixes #6764
Closes #6766

4 years agodocs: document version of crustls dependency
Jacob Hoffman-Andrews [Wed, 17 Mar 2021 00:09:47 +0000 (17:09 -0700)] 
docs: document version of crustls dependency

This also pins a specific release in the Travis test so future
API-breaking changins in crustls won't break curl builds.

Add RUSTLS documentation to release tarball.

Enable running tests for rustls, minus FTP tests (require
connect_blocking, which rustls doesn't implement) and 313 (requires CRL
handling).

Closes #6763

4 years agorustls: Handle close_notify.
Jacob Hoffman-Andrews [Thu, 18 Mar 2021 04:27:12 +0000 (21:27 -0700)] 
rustls: Handle close_notify.

If we get a close_notify, treat that as EOF. If we get an EOF from the
TCP stream, treat that as an error (because we should have ended the
connection earlier, when we got a close_notify).

Closes #6763

4 years agodocs: clarify timeouts for queued transfers in multi API
Daniel Stenberg [Wed, 17 Mar 2021 22:33:12 +0000 (23:33 +0100)] 
docs: clarify timeouts for queued transfers in multi API

Closes #6758

4 years agoftpserver: only load the preprocessed test file
Daniel Stenberg [Thu, 18 Mar 2021 08:08:55 +0000 (09:08 +0100)] 
ftpserver: only load the preprocessed test file

We always preprocess and tests are no longer sensible to load "raw"

Closes #6738

4 years agotests: use %TESTNUMBER instead of fixed number
Daniel Stenberg [Fri, 12 Mar 2021 16:38:26 +0000 (17:38 +0100)] 
tests: use %TESTNUMBER instead of fixed number

This makes the tests easier to copy and relocate to other test numbers
without having to update content.

Closes #6738

4 years agoKNOWN_BUGS: CURLOPT_OPENSOCKETPAIRFUNCTION is missing
Daniel Stenberg [Thu, 18 Mar 2021 11:53:28 +0000 (12:53 +0100)] 
KNOWN_BUGS: CURLOPT_OPENSOCKETPAIRFUNCTION is missing

Closes #5747

4 years agoTODO: provide timing info for each redirect
Daniel Stenberg [Thu, 18 Mar 2021 07:39:59 +0000 (08:39 +0100)] 
TODO: provide timing info for each redirect

Closes #6743

4 years agodocs: Add SSL backend names to CURL_SSL_BACKEND
Jay Satiro [Wed, 17 Mar 2021 05:38:10 +0000 (01:38 -0400)] 
docs: Add SSL backend names to CURL_SSL_BACKEND

- Document the names that can be used with CURL_SSL_BACKEND:
  bearssl, gnutls, gskit, mbedtls, mesalink, nss, openssl, rustls,
  schannel, secure-transport, wolfssl

Ref: https://github.com/curl/curl/issues/2209#issuecomment-360623286
Ref: https://github.com/curl/curl/issues/6717#issuecomment-800745201

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

4 years agodocs: Explain DOH transfers inherit some SSL settings
Jay Satiro [Thu, 4 Mar 2021 05:55:53 +0000 (00:55 -0500)] 
docs: Explain DOH transfers inherit some SSL settings

- Document in DOH that some SSL settings are inherited but DOH hostname
  and peer verification are not and are controlled separately.

- Document that CURLOPT_SSL_CTX_FUNCTION is inherited by DOH handles but
  we're considering changing behavior to no longer inherit it. Request
  feedback.

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

4 years agohttp: make 416 not fail with resume + CURLOPT_FAILONERRROR
Daniel Stenberg [Tue, 16 Mar 2021 13:41:06 +0000 (14:41 +0100)] 
http: make 416 not fail with resume + CURLOPT_FAILONERRROR

When asked to resume a download, libcurl will convert that to HTTP logic
and if then the entire file is already transferred it will result in a
416 response from the HTTP server. With CURLOPT_FAILONERRROR set in that
scenario, it should *not* lead to an error return.

Updated test 1156, added test 1273

Reported-by: Jonathan Watt
Fixes #6740
Closes #6753

4 years agoCurl_timeleft: check both timeouts during connect 6745/head
Daniel Stenberg [Mon, 15 Mar 2021 07:11:26 +0000 (08:11 +0100)] 
Curl_timeleft: check both timeouts during connect

The duration of a connect and the total transfer are calculated from two
different time-stamps. It can end up with the total timeout triggering
before the connect timeout expires and we should make sure to
acknowledge whichever timeout that is reached first.

This is especially notable when a transfer first sits in PENDING, as
that time is counted in the total time but the connect timeout is based
on the time since the handle changed to the CONNECT state.

The CONNECTTIMEOUT is per connect attempt. The TIMEOUT is for the entire
operation.

Fixes #6744
Closes #6745
Reported-by: Andrei Bica
Assisted-by: Jay Satiro
4 years agoconfigure: remove use of deprecated macros
Daniel Stenberg [Mon, 15 Mar 2021 17:16:36 +0000 (18:16 +0100)] 
configure: remove use of deprecated macros

AC_HEADER_TIME, AC_HEADER_STDC and AC_TYPE_SIGNAL

4 years agoconfigure: make AC_TRY_* into AC_*_IFELSE
Daniel Stenberg [Mon, 15 Mar 2021 22:11:29 +0000 (23:11 +0100)] 
configure: make AC_TRY_* into AC_*_IFELSE

... as the former versions are deprecated.

4 years agoconfigure: s/AC_HELP_STRING/AS_HELP_STRING
Daniel Stenberg [Mon, 15 Mar 2021 16:32:26 +0000 (17:32 +0100)] 
configure: s/AC_HELP_STRING/AS_HELP_STRING

AC_HELP_STRING is deprecated in 2.70+ and I believe AS_HELP_STRING works
already since 2.59 so bump the minimum required version to that.

Reported-by: Emil Engler
Fixes #6647
Closes #6748