]> git.ipfire.org Git - thirdparty/curl.git/log
thirdparty/curl.git
4 years agochecksrc: complain on == NULL or != 0 checks in conditions 6912/head
Daniel Stenberg [Mon, 19 Apr 2021 08:45:29 +0000 (10:45 +0200)] 
checksrc: complain on == NULL or != 0 checks in conditions

... to make them all consistenly use if(!var) and if(var)

Also added a few missing warnings to the documentation.

Closes #6912

4 years agotidy-up: make conditional checks more consistent
Daniel Stenberg [Mon, 19 Apr 2021 08:46:11 +0000 (10:46 +0200)] 
tidy-up: make conditional checks more consistent

... remove '== NULL' and '!= 0'

Closes #6912

4 years agovauth: factor base64 conversions out of authentication procedures
Patrick Monnerat [Wed, 17 Mar 2021 19:09:55 +0000 (20:09 +0100)] 
vauth: factor base64 conversions out of authentication procedures

Input challenges and returned messages are now in binary.
Conversions from/to base64 are performed by callers (currently curl_sasl.c
and http_ntlm.c).

Closes #6654

4 years agobufref: buffer reference support
Patrick Monnerat [Tue, 23 Mar 2021 01:02:18 +0000 (02:02 +0100)] 
bufref: buffer reference support

A struct bufref holds a buffer pointer, a data size and a destructor.
When freed or its contents are changed, the previous buffer is implicitly
released by the associated destructor. The data size, although not used
internally, allows binary data support.

A unit test checks its handling methods: test 1661

Closes #6654

4 years agoos400: additional support for options metadata
Patrick Monnerat [Sun, 11 Apr 2021 17:33:09 +0000 (19:33 +0200)] 
os400: additional support for options metadata

New functions curl_easy_option_by_name_ccsid() and
curl_easy_option_get_name_ccsid() allows accessing metadata in alternate
character encoding.

This commit also updates curl_version_info_ccsid() to handle info version 9
and adds recent definitions to the ILE/RPG include file.

Documentation updated accordingly.

Reviewed-by: Jon Rumsey
Closes #6574

4 years agotest server: take care of siginterrupt() deprecation
Patrick Monnerat [Tue, 26 Jan 2021 02:10:48 +0000 (03:10 +0100)] 
test server: take care of siginterrupt() deprecation

Closes #6529

4 years agolib1564.c: enable last wakeup test part on Windows
Marc Hoersken [Thu, 25 Feb 2021 21:18:46 +0000 (22:18 +0100)] 
lib1564.c: enable last wakeup test part on Windows

Suggested-by: Gergely Nagy
Reviewed-by: Jay Satiro
Reviewed-by: Marcel Raad
Closes #6245

4 years agomulti: fix slow write/upload performance on Windows
Marc Hoersken [Tue, 15 Dec 2020 06:22:13 +0000 (07:22 +0100)] 
multi: fix slow write/upload performance on Windows

Reset FD_WRITE by sending zero bytes which is permissible
and will be treated by implementations as successful send.

Without this we won't be notified in case a socket is still
writable if we already received such a notification and did
not send any data afterwards on the socket. This would lead
to waiting forever on a writable socket being writable again.

Assisted-by: Tommy Odom
Reviewed-by: Jay Satiro
Reviewed-by: Marcel Raad
Tested-by: tmkk on github
Bug: #6146
Closes #6245

4 years agomulti: reduce Win32 API calls to improve performance
Marc Hoersken [Sun, 6 Dec 2020 16:28:26 +0000 (17:28 +0100)] 
multi: reduce Win32 API calls to improve performance

1. Consolidate pre-checks into a single Curl_poll call:

This is an attempt to restructure the code in Curl_multi_wait
in such a way that less syscalls are made by removing individual
calls to Curl_socket_check via SOCKET_READABLE/SOCKET_WRITABLE.

2. Avoid resetting the WinSock event multiple times:

We finally call WSAResetEvent anyway, so specifying it as
an optional parameter to WSAEnumNetworkEvents is redundant.

3. Wakeup directly in case no sockets are being monitoring:

Fix the WinSock based implementation to skip extra waiting by
not sleeping in case no sockets are to be waited on and just
the WinSock event is being monitored for wakeup functionality.

Assisted-by: Tommy Odom
Reviewed-by: Jay Satiro
Reviewed-by: Marcel Raad
Bug: #6146
Closes #6245

4 years agoRevert "Revert 'multi: implement wait using winsock events'"
Marc Hoersken [Wed, 9 Dec 2020 06:25:15 +0000 (07:25 +0100)] 
Revert "Revert 'multi: implement wait using winsock events'"

This reverts commit 2260e0ebe6d45529495231b3e37a0c58fb92a6a2,
also restoring previous follow up changes which were reverted.

Authored-by: rcombs on github
Authored-by: Marc Hörsken
Reviewed-by: Jay Satiro
Reviewed-by: Marcel Raad
Restores #5634
Reverts #6281
Part of #6245

4 years agoRevert "cmake: make libcurl library output name configurable"
Daniel Stenberg [Wed, 21 Apr 2021 13:03:04 +0000 (15:03 +0200)] 
Revert "cmake: make libcurl library output name configurable"

This reverts commit 1cba36d2166c396f987eea587cf92671b27acb92.

CMake provides properties that can be set on a target to rename the
output artifact without changing the name of a target.

Ref: #6899

4 years agosectransp: allow cipher name to be specified
Michael Kolechkin [Fri, 15 Jan 2021 20:32:04 +0000 (12:32 -0800)] 
sectransp: allow cipher name to be specified

Add parser for CURLOPT_SSL_CIPHER_LIST option for Secure Transport (ST)
back-end. Similar to NSS and GSKit back-ends, new code parses string
value and configures ST library to use those ciphers for communication.
Create cipher spec data structure and initialize the array of specs with
cipher number, name, alias, and 'weak' flag.

Mark triple-DES ciphers as 'weak', and exclude them from the default
ciphers list.

Closes #6464

4 years agoNSS: add ciphers to map
Michael Kolechkin [Fri, 26 Feb 2021 18:27:49 +0000 (10:27 -0800)] 
NSS: add ciphers to map

Add cipher names to the `cipherlist` map, based on the list of ciphers
implemented by the NSS in the source code file
https://github.com/nss-dev/nss/blob/master/lib/ssl/sslenum.c

Closes #6670

4 years agohttp2: remove DEBUG_HTTP2
Daniel Stenberg [Wed, 21 Apr 2021 09:34:10 +0000 (11:34 +0200)] 
http2: remove DEBUG_HTTP2

Accidentally committed in 605e84235

4 years agocmake: make libcurl library output name configurable
Ralph Langendam [Thu, 15 Apr 2021 14:54:23 +0000 (16:54 +0200)] 
cmake: make libcurl library output name configurable

Closes #6899

4 years agosws: #ifdef S_IFSOCK use
Daniel Stenberg [Tue, 20 Apr 2021 07:29:23 +0000 (09:29 +0200)] 
sws: #ifdef S_IFSOCK use

SCO OpenServer 5.0.7 does not define S_IFSOCK.

Reported-by: Kevin R. Bulgrien
Bug: https://curl.se/mail/lib-2021-04/0074.html
Closes #6926

4 years agocurl_setup: provide the shutdown flags wider
Daniel Stenberg [Tue, 20 Apr 2021 07:21:09 +0000 (09:21 +0200)] 
curl_setup: provide the shutdown flags wider

By using #ifdef on the symbol names to work on anything that don't
provide them. SCO OpenServer 5.0.7, sys/socket.h does not define either
SHUT_RDWR, SHUT_RD, and SHUT_WR.

Reported-by: Kevin R. Bulgrien
Bug: https://curl.se/mail/lib-2021-04/0073.html
Closes #6925

4 years agoconnect: use CURL_SA_FAMILY_T for portability
Daniel Stenberg [Mon, 19 Apr 2021 21:28:12 +0000 (23:28 +0200)] 
connect: use CURL_SA_FAMILY_T for portability

Reported-by: Kevin R. Bulgrien
Bug: https://curl.se/mail/lib-2021-04/0071.html

Closes #6918

4 years agourlapi: make sure no +/- signs are accepted in IPv4 numericals
Daniel Stenberg [Mon, 19 Apr 2021 20:58:54 +0000 (22:58 +0200)] 
urlapi: make sure no +/- signs are accepted in IPv4 numericals

Follow-up to 56a037cc0ad1b2. Extends test 1560 to verify.

Reported-by: Tuomas Siipola
Fixes #6916
Closes #6917

4 years agoConnectionExists: respect requests for h1 connections better
Daniel Stenberg [Tue, 20 Apr 2021 08:44:12 +0000 (10:44 +0200)] 
ConnectionExists: respect requests for h1 connections better

... for situations when multiplexing isn't enabled on the h2 connection
and h1 is explicitly requested for the transfer.

Assisted-by: Gergely Nagy
4 years agomulti: don't close connection HTTP_1_1_REQUIRED
Daniel Stenberg [Mon, 19 Apr 2021 12:49:21 +0000 (14:49 +0200)] 
multi: don't close connection HTTP_1_1_REQUIRED

The ConnectionExists() function will note that the new transfer wants
less then h2 and that it can't multiplex it and therefor opt to open a
new connection instead.

4 years agohttp2: move the stream error field to the per-transfer storage
Daniel Stenberg [Mon, 19 Apr 2021 11:15:05 +0000 (13:15 +0200)] 
http2: move the stream error field to the per-transfer storage

Storing a stream error in the per-connection struct was an error that lead to
race conditions as subsequent stream handling could overwrite the error code
before it was used for the stream with the actual problem.

Closes #6910

4 years agohttp2: call the handle-closed function correctly on closed stream
Daniel Stenberg [Mon, 19 Apr 2021 11:13:47 +0000 (13:13 +0200)] 
http2: call the handle-closed function correctly on closed stream

This was this one condition where the stream could be closed due to an
error and the function would still wrongly just return 0 for it.

Reported-by: Gergely Nagy
Fixes #6862
Closes #6910

4 years agotest1660: check the created HSTS file as text mode
Daniel Stenberg [Tue, 20 Apr 2021 22:18:59 +0000 (00:18 +0200)] 
test1660: check the created HSTS file as text mode

Closes #6922

4 years agoRELEASE-NOTES: synced
Daniel Stenberg [Tue, 20 Apr 2021 09:51:53 +0000 (11:51 +0200)] 
RELEASE-NOTES: synced

4 years agotest 493: require https in curl to run
Daniel Stenberg [Tue, 20 Apr 2021 07:38:31 +0000 (09:38 +0200)] 
test 493: require https in curl to run

Closes #6927

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