]> git.ipfire.org Git - thirdparty/curl.git/log
thirdparty/curl.git
4 years agoCURLOPT_IPRESOLVE: preventing wrong IP version from being used
Lucas Clemente Vella [Sat, 24 Apr 2021 19:04:53 +0000 (20:04 +0100)] 
CURLOPT_IPRESOLVE: preventing wrong IP version from being used

In some situations, it was possible that a transfer was setup to
use an specific IP version, but due do DNS caching or connection
reuse, it ended up using a different IP version from requested.

This commit changes the effect of CURLOPT_IPRESOLVE from simply
restricting address resolution to preventing the wrong connection
type being used, when choosing a connection from the pool, and
to restricting what addresses could be used when establishing
a new connection.

It is important that all addresses versions are resolved, even if
not used in that transfer in particular, because the result is
cached, and could be useful for a different transfer with a
different CURLOPT_IPRESOLVE setting.

Closes #6853

4 years agoAmigaOS: add functions definitions for SHA256
Oliver Urbann [Thu, 20 May 2021 08:34:43 +0000 (10:34 +0200)] 
AmigaOS: add functions definitions for SHA256

AmiSSL replaces many functions with macros. Curl requires pointer
to some of these functions. Thus, we have to encapsulate these macros:
SHA256_Init, SHA256_Update, SHA256_Final, X509_INFO_free.

Bug: https://github.com/jens-maus/amissl/issues/15
Co-authored-by: Daniel Stenberg <daniel@haxx.se>
Closes #7099

4 years agotest2100: make it run with and require IPv6
Daniel Stenberg [Mon, 17 May 2021 12:29:19 +0000 (14:29 +0200)] 
test2100: make it run with and require IPv6

Closes #7083

4 years agotests/getpart: generate output URL encoded for better diffs
Daniel Stenberg [Wed, 19 May 2021 07:37:01 +0000 (09:37 +0200)] 
tests/getpart: generate output URL encoded for better diffs

Closes #7083

4 years agodocs/TheArtOfHttpScripting: fix markdown links
Ryan Beck-Buysse [Wed, 19 May 2021 00:56:31 +0000 (19:56 -0500)] 
docs/TheArtOfHttpScripting: fix markdown links

extra parens cause the links to be incorrectly formatted
and inconsistent with the rest of the document.

Signed-off-by: Ryan Beck-Buysse <rbuysse@gmail.com>
Closes #7097

4 years agoRELEASE-NOTES: synced
Daniel Stenberg [Tue, 18 May 2021 22:50:14 +0000 (00:50 +0200)] 
RELEASE-NOTES: synced

4 years agodocs: replace dots with dashes in markdown enums
Emil Engler [Tue, 18 May 2021 16:55:55 +0000 (18:55 +0200)] 
docs: replace dots with dashes in markdown enums

We use dashes instead of dots nearly everywhere except for those few
cases. This commit addresses this issues and brings more coherency into
it.

Closes #7093

4 years agodocs: improve INTERNALS.md regarding getsock cb
Emil Engler [Tue, 18 May 2021 16:35:23 +0000 (18:35 +0200)] 
docs: improve INTERNALS.md regarding getsock cb

This adds the I/O prefix to indicate that those "actions" are kind-of
related to those found in select(2) or poll(2) (reading/writing).

It also adds a note where the prototypes of those functions can be found
in the source code.

Closes #7092

4 years agodocs: document attach in INTERNALS.md
Emil Engler [Tue, 18 May 2021 16:05:54 +0000 (18:05 +0200)] 
docs: document attach in INTERNALS.md

The new field in the Curl_handler struct still lacks documentation. This
adds it it from the information extracted from lib/urldata.h:797

Closes #7091

4 years agoconfig: remove now-unused macros
Marc Aldorasi [Tue, 18 May 2021 17:35:00 +0000 (13:35 -0400)] 
config: remove now-unused macros

Closes #7094

4 years agohostip.h: remove declaration of unimplemented function
Marc Aldorasi [Tue, 18 May 2021 17:19:08 +0000 (13:19 -0400)] 
hostip.h: remove declaration of unimplemented function

Closes #7094

4 years agoh3: add 'attach' callback to protocol handlers
Daniel Stenberg [Tue, 18 May 2021 14:21:08 +0000 (16:21 +0200)] 
h3: add 'attach' callback to protocol handlers

Follow-up to 0c55fbab45be

Reviewed-by: Emil Engler
Closes #7090

4 years agowolfssl: remove SSLv3 support leftovers
Daniel Stenberg [Tue, 18 May 2021 08:05:36 +0000 (10:05 +0200)] 
wolfssl: remove SSLv3 support leftovers

Closes #7088

4 years agocurl-wolfssl.m4: without custom include path, assume /usr/include
Daniel Stenberg [Tue, 18 May 2021 07:55:02 +0000 (09:55 +0200)] 
curl-wolfssl.m4: without custom include path, assume /usr/include

... so that we can point out the root of the OpenSSL emulation headers.
Previously this used the '$includedir' variable which is wrong since
that defaults to the dir where the current configure invoke will install
the built libcurl headers: /usr/local by default.

Fixes #7085
Reported-by: Joel Jakobsson
Closes #7087

4 years agodata_pending: check only SECONDARY socket for FTP(S) transfers
Joel Depooter [Fri, 14 May 2021 21:44:07 +0000 (14:44 -0700)] 
data_pending: check only SECONDARY socket for FTP(S) transfers

Check the FIRST for all other protocols.

This fixes a timeout in an ftps download. The server sends a TLS
close_notify message in the same packet as the file data. The
close_notify seems to not be handled in the schannel_recv function, so
libcurl is not aware that the server has closed the connection. Thus
libcurl ends up waiting for action on the socket until a timeout is
reached. With the secondary socket check added to the data_pending
function, the close_notify is properly handled, and the ftps transfer
terminates as expected.

Fixes #7068
Closes #7069

4 years agogithub: inhibit deprecated declarations for clang on macOS
Daniel Stenberg [Mon, 17 May 2021 11:20:54 +0000 (13:20 +0200)] 
github: inhibit deprecated declarations for clang on macOS

... as they otherwise cause ldap build errors in the CI.

Fixes #7081
Closes #7082

4 years agoconn: add 'attach' to protocol handler, make libssh2 use it
Daniel Stenberg [Mon, 17 May 2021 06:54:00 +0000 (08:54 +0200)] 
conn: add 'attach' to protocol handler, make libssh2 use it

The libssh2 backend has SSH session associated with the connection but
the callback context is the easy handle, so when a connection gets
attached to a transfer, the protocol handler now allows for a custom
function to get used to set things up correctly.

Reported-by: Michael O'Farrell
Fixes #6898
Closes #7078

4 years agohttp2: make sure pause is done on HTTP
Daniel Stenberg [Mon, 17 May 2021 07:05:39 +0000 (09:05 +0200)] 
http2: make sure pause is done on HTTP

Since the function is called for any protocol, we can't assume that the
HTTP struct is there without first making sure it is HTTP.

Reported-by: Denis Goleshchikhin
Fixes #7079
Closes #7080

4 years agodocs: cookies from HTTP headers need domain set
Daniel Stenberg [Sun, 16 May 2021 21:38:35 +0000 (23:38 +0200)] 
docs: cookies from HTTP headers need domain set

... or the cookies won't get sent. Push users to using the "Netscape"
format instead, which curl uses when saving a cookie "jar".

Reported-by: Martin Dorey
Reviewed-by: Daniel Gustafsson
Fixes #6723
Closes #7077

4 years agoRELEASE-NOTES: synced
Daniel Stenberg [Sun, 16 May 2021 21:25:25 +0000 (23:25 +0200)] 
RELEASE-NOTES: synced

4 years agogithub: add a workflow with libssh2 on macOS using cmake
Daniel Stenberg [Tue, 11 May 2021 12:37:37 +0000 (14:37 +0200)] 
github: add a workflow with libssh2 on macOS using cmake

Closes #7047

4 years agosws: allow HTTP requests up to 2MB in size
Daniel Stenberg [Sat, 15 May 2021 21:59:29 +0000 (23:59 +0200)] 
sws: allow HTTP requests up to 2MB in size

To allow tests with slightly larger payloads. Like #7071 ...

Closes #7075

4 years agoCI/azure: increase verbosity and fix outdated task names
Marc Hoersken [Sat, 15 May 2021 18:55:42 +0000 (20:55 +0200)] 
CI/azure: increase verbosity and fix outdated task names

Closes #7063

4 years agoCI/cirrus: add shared and static Windows release builds
Marc Hoersken [Sat, 15 May 2021 18:54:57 +0000 (20:54 +0200)] 
CI/cirrus: add shared and static Windows release builds

Azure Pipelines is currently being used for debug builds,
let's also run some non-debug (release) Windows builds and
make use of previously underutilized Cirrus CI for that.

Reviewed-by: Marcel Raad
Closes #6991

4 years agoCURLOPT_CAPATH.3: defaults to a path, not NULL
Daniel Stenberg [Fri, 14 May 2021 15:08:19 +0000 (17:08 +0200)] 
CURLOPT_CAPATH.3: defaults to a path, not NULL

Reported-by: Andrew Barnert
Closes #7062

4 years agoc-hyper: handle body on HYPER_TASK_EMPTY
Jacob Hoffman-Andrews [Sat, 15 May 2021 03:52:17 +0000 (20:52 -0700)] 
c-hyper: handle body on HYPER_TASK_EMPTY

Some of the time, we get a HYPER_TASK_EMPTY response before the status
line, headers, and body have been read. Previously, that would cause us
to poll again, leading to a 1 second timeout.

The HYPER_TASK_EMPTY docs say:

   The value of this task is null (does not imply an error).

So, if we receive a HYPER_TASK_EMPTY, continue on with processing the
response.

Reported-by: Kevin Burke
Fixes #7064
Closes #7070

4 years agotool_getparam: fix comment typo in tool_getparam.c
Ikko Ashimine [Sat, 15 May 2021 16:43:07 +0000 (01:43 +0900)] 
tool_getparam: fix comment typo in tool_getparam.c

enfore -> enforce

Closes #7074

4 years agomem-include-scan.pl: require a non-word letter before memory funcs
Daniel Stenberg [Fri, 14 May 2021 21:11:00 +0000 (23:11 +0200)] 
mem-include-scan.pl: require a non-word letter before memory funcs

... so that ldap_memfree() for example doesn't match the scan for free.

Closes #7061

4 years agoversion: free the openldap info correctly
Daniel Stenberg [Fri, 14 May 2021 14:22:28 +0000 (16:22 +0200)] 
version: free the openldap info correctly

... to avoid memory leaks.

Follow-up to: bf0feae7768d9
Closes #7061

4 years agodupset: remove totally off comment
Daniel Stenberg [Fri, 14 May 2021 22:36:05 +0000 (00:36 +0200)] 
dupset: remove totally off comment

Closes #7067

4 years agoconfigure: if asked for, fail if ldap is not found
Daniel Stenberg [Wed, 12 May 2021 09:15:51 +0000 (11:15 +0200)] 
configure: if asked for, fail if ldap is not found

Reported-by: Jakub Zakrzewski
Fixes #7053
Closes #7055

4 years agoversion: add OpenLDAP version in the output
Daniel Stenberg [Wed, 12 May 2021 09:09:12 +0000 (11:09 +0200)] 
version: add OpenLDAP version in the output

Assisted-by: Howard Chu
Closes #7054

4 years agoschannel: Ensure the security context request flags are always set
Joel Depooter [Wed, 12 May 2021 02:45:59 +0000 (19:45 -0700)] 
schannel: Ensure the security context request flags are always set

As of commit 54e7475, these flags would only be set when using a new
credential handle. When re-using an existing credential handle, the
flags would not be set.

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

4 years agotests: Fix some tag matching issues in a number of tests
Dan Fandrich [Wed, 12 May 2021 08:15:31 +0000 (01:15 -0700)] 
tests: Fix some tag matching issues in a number of tests

4 years agosasl: use 'unsigned short' to store mechanism
Daniel Stenberg [Tue, 11 May 2021 09:11:40 +0000 (11:11 +0200)] 
sasl: use 'unsigned short' to store mechanism

... saves a few bytes of struct size in memory and it only uses
10 bits anyway.

Closes #7045

4 years agohostip: remove the debug code for LocalHost
Daniel Stenberg [Tue, 11 May 2021 07:49:31 +0000 (09:49 +0200)] 
hostip: remove the debug code for LocalHost

The Curl_resolv() had special code (when built in debug mode) for when
resolving the host name "LocalHost" (using that exact casing). It would
then get the host name from the --interface option instead.

This development-only feature was not used by anything (anymore) and we
have the --resolve feature if we want to play similar tricks properly
going forward.

Closes #7044

4 years agoprogress: reset limit_size variables at transfer start
Daniel Stenberg [Tue, 11 May 2021 07:09:11 +0000 (09:09 +0200)] 
progress: reset limit_size variables at transfer start

Otherwise the old value would linger from a previous use and would mess
up the network speed cap logic.

Reported-by: Ymir1711 on github
Fixes #7042
Closes #7043

4 years agoRELEASE-NOTES: synced
Daniel Stenberg [Tue, 11 May 2021 07:00:57 +0000 (09:00 +0200)] 
RELEASE-NOTES: synced

4 years agocookies: use CURLcode for cookie_output reporting
Daniel Gustafsson [Mon, 15 Mar 2021 02:08:31 +0000 (03:08 +0100)] 
cookies: use CURLcode for cookie_output reporting

Writing the cookie file has multiple error conditions, and was using an
int with magic numbers to report the different error (which in turn were
disregarded anyways). This moves reporting to use a CURLcode value.

Lightly-touched-by: Daniel Stenberg
Closes #7037
Closes #6749

4 years agocookies: make use of string duplication function
Daniel Gustafsson [Fri, 12 Mar 2021 16:36:08 +0000 (17:36 +0100)] 
cookies: make use of string duplication function

strstore() is defined as a strdup which ensures to free the target
pointer before duping the source char * into it. Make use of it in
two more cases where it can simplify the code.

4 years agocookies: refactor comments
Daniel Gustafsson [Fri, 12 Mar 2021 16:20:28 +0000 (17:20 +0100)] 
cookies: refactor comments

Comments in the cookie code were a bit all over the place in terms of
style and wording. This takes a stab at cleaning them up by keeping to
a single style and overall shape. Some comments are moved a little and
some removed alltogether due to being redundant. No functional changes
have been made,

4 years agohttp2: skip immediate parsing of payload following protocol switch
Peng-Yu Chen [Mon, 10 May 2021 22:05:36 +0000 (23:05 +0100)] 
http2: skip immediate parsing of payload following protocol switch

This is considered not harmful as a following http2_recv shall be
called very soon.

This is considered helpful in the specific situation where some
servers (e.g. nghttpx v1.43.0) may fulfill stream 1 immediately
following the return of HTTP status 101, other than waiting for
the client-side connection preface to arrive.

Fixes #7036
Closes #7040

4 years agohttp2: use nghttp2_session_upgrade2 instead of nghttp2_session_upgrade
Peng-Yu Chen [Mon, 10 May 2021 22:50:27 +0000 (23:50 +0100)] 
http2: use nghttp2_session_upgrade2 instead of nghttp2_session_upgrade

Following the upstream deprecation of nghttp2_session_upgrade.

Also provides further checks for requests with the HEAD method.

Closes #7041

4 years agoprogress/trspeed: use a local convenient pointer to beautify code
Daniel Stenberg [Sat, 8 May 2021 11:14:42 +0000 (13:14 +0200)] 
progress/trspeed: use a local convenient pointer to beautify code

The function becomes easier to read and understand with less repetition.

4 years agotrspeed: use long double for transfer speed calculation
Daniel Stenberg [Sat, 8 May 2021 11:10:06 +0000 (13:10 +0200)] 
trspeed: use long double for transfer speed calculation

4 years agoprogress: move transfer speed calc into function
Daniel Stenberg [Sat, 8 May 2021 10:28:38 +0000 (12:28 +0200)] 
progress: move transfer speed calc into function

This silences two scan-build-11 warnings: "The result of the '/'
expression is undefined"

Bug: https://curl.se/mail/lib-2021-05/0022.html
Closes #7035

4 years agoopenssl: remove unneeded cast for CertOpenSystemStore()
Cameron Cawley [Thu, 6 May 2021 16:50:31 +0000 (17:50 +0100)] 
openssl: remove unneeded cast for CertOpenSystemStore()

Closes #7025

4 years agotravis: disable the libssh build
Daniel Stenberg [Sat, 8 May 2021 09:10:22 +0000 (11:10 +0200)] 
travis: disable the libssh build

It can't run on focal and causes warnings on bionic. Since the focal
failure started rather suddenly a while ago, we can suspect it might be
temporary.

Added "bring back the build" to the TODO document.

Fixes #7011
Closes #7012

4 years agohttp: use calculated offsets inst of integer literals for header parsing
Peng-Yu Chen [Fri, 7 May 2021 23:35:45 +0000 (00:35 +0100)] 
http: use calculated offsets inst of integer literals for header parsing

Assumed to be a minor coding style improvement with no behavior change.

A modern compiler is expected to have the calculation optimized during
compilation. It may be deemed okay even if that's not the case, since
the added overhead is considered very low.

Closes #7032

4 years agoGIT-INFO: suggest using autoreconf instead of buildconf
Peng-Yu Chen [Sat, 8 May 2021 01:20:29 +0000 (02:20 +0100)] 
GIT-INFO: suggest using autoreconf instead of buildconf

Follow-up to 85868537d

Closes #7033

4 years agohttp: deal with partial CONNECT sends
Daniel Stenberg [Thu, 6 May 2021 11:04:03 +0000 (13:04 +0200)] 
http: deal with partial CONNECT sends

Also added 'CURL_SMALLSENDS' to make Curl_write() send short packets,
which helped verifying this even more.

Add test 363 to verify.

Reported-by: ustcqidi on github
Fixes #6950
Closes #7024

4 years agoHTTP3: make the ngtcp2 build use the quictls fork
Daniel Stenberg [Fri, 7 May 2021 15:21:17 +0000 (17:21 +0200)] 
HTTP3: make the ngtcp2 build use the quictls fork

... as ngtcp2 itself documents the build this way.

Closes #7031

4 years agohttp: limit the initial send amount to used upload buffer size
Daniel Stenberg [Thu, 6 May 2021 08:25:56 +0000 (10:25 +0200)] 
http: limit the initial send amount to used upload buffer size

Previously this logic would cap the send to CURL_MAX_WRITE_SIZE bytes,
but for the situations where a larger upload buffer has been set, this
function can benefit from sending more bytes. With default size used,
this does the same as before.

Also changed the storage of the size to an 'unsigned int' as it is not
allowed to be set larger than 2M.

Also added cautions to the man pages about changing buffer sizes in
run-time.

Closes #7022

4 years agoRELEASE-NOTES: synced
Daniel Stenberg [Fri, 7 May 2021 06:44:03 +0000 (08:44 +0200)] 
RELEASE-NOTES: synced

4 years agongtcp2: fix the cb_acked_stream_data_offset proto
Daniel Stenberg [Thu, 6 May 2021 20:55:15 +0000 (22:55 +0200)] 
ngtcp2: fix the cb_acked_stream_data_offset proto

The 'datalen' value should be 64 bit, not size_t!

Reported-by: Dmitry Karpov
Bug: https://curl.se/mail/lib-2021-05/0019.html
Closes #7027

4 years agoprogress: when possible, calculate transfer speeds with microseconds
Daniel Stenberg [Thu, 6 May 2021 07:06:24 +0000 (09:06 +0200)] 
progress: when possible, calculate transfer speeds with microseconds

... this improves precision, especially for transfers in the few or even
sub millisecond range.

Reported-by: J. Bromley
Fixes #7017
Closes #7020

4 years agohttp: reset the header buffer when sending the request
Daniel Stenberg [Thu, 6 May 2021 07:35:18 +0000 (09:35 +0200)] 
http: reset the header buffer when sending the request

A reused transfer handle could otherwise reuse the previous leftover
buffer and havoc would ensue.

Reported-by: sergio-nsk on github
Fixes #7018
Closes #7021

4 years agocurl_mprintf.3: add description
Daniel Stenberg [Wed, 5 May 2021 09:07:40 +0000 (11:07 +0200)] 
curl_mprintf.3: add description

These functions have existed in the API since the dawn of time. It is
about time we describe how they work, even if we discourage users from
using them.

Closes #7010

4 years agoURL-SYNTAX: update IDNA section for WHATWG spec changes
Timothy Gu [Thu, 6 May 2021 18:22:57 +0000 (14:22 -0400)] 
URL-SYNTAX: update IDNA section for WHATWG spec changes

WHATWG URL has dictated the use of Nontransitional Processing (IDNA
2008) for several years now. Chrome (and derivatives) still use
Transitional Processing, but Firefox and Safari have both switched.

Also document the fact that winidn functions differently from libidn2
here.

Closes #7026

4 years agoINSTALL: add IBM i specific quirks
Calvin Buckley [Wed, 5 May 2021 14:39:37 +0000 (11:39 -0300)] 
INSTALL: add IBM i specific quirks

Fixes #6830
Closes #7013

4 years agolibcurl.3: mention the URL API
Daniel Stenberg [Wed, 5 May 2021 07:17:24 +0000 (09:17 +0200)] 
libcurl.3: mention the URL API

To make it easier to find. Also a minor polish of libcurl-url.3

Closes #7009

4 years agoGnuTLS: don't allow TLS 1.3 for versions that don't support it
Daniel Stenberg [Wed, 5 May 2021 21:26:01 +0000 (23:26 +0200)] 
GnuTLS: don't allow TLS 1.3 for versions that don't support it

Follow-up to 781864bedbc5

... as they don't understand it and will return error at us!

Closes #7014

4 years agotool_getparam: handle failure of curlx_convert_tchar_to_UTF8() 7023/head
Kamil Dudka [Thu, 6 May 2021 12:26:58 +0000 (14:26 +0200)] 
tool_getparam: handle failure of curlx_convert_tchar_to_UTF8()

Reported by GCC analyzer:

Error: GCC_ANALYZER_WARNING (CWE-476):
src/tool_getparam.c: scope_hint: In function 'parse_args'
src/tool_getparam.c:2318:38: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL 'orig_opt'
lib/curlx.h:56: included_from: Included from here.
src/tool_getparam.c:28: included_from: Included from here.
lib/curl_multibyte.h:70:51: note: in definition of macro 'curlx_convert_tchar_to_UTF8'
src/tool_getparam.c:2316:16: note: in expansion of macro 'curlx_convert_tchar_to_UTF8'

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

4 years agoscripts/delta: also show total number of days
Daniel Stenberg [Thu, 6 May 2021 08:00:36 +0000 (10:00 +0200)] 
scripts/delta: also show total number of days

4 years agosockfilt: fix invalid increment of handles index variable nfd
Marc Hoersken [Sun, 2 May 2021 18:44:35 +0000 (20:44 +0200)] 
sockfilt: fix invalid increment of handles index variable nfd

Only increment the array index if we actually stored a handle.

Follow up to e917492048f4b85a0fd58a033d10072fc7666c3b
Closes #6992

4 years agosockfilt: avoid getting stuck waiting for writable socket
Marc Hoersken [Sun, 2 May 2021 18:42:11 +0000 (20:42 +0200)] 
sockfilt: avoid getting stuck waiting for writable socket

Reset FD_WRITE event using the same approach as in multi.c

Follow up to b36442b24305f3cda7c13cc64b46838995a4985b
Closes #6992

4 years agotest678: Fix for Windows multibyte builds
Jay Satiro [Wed, 5 May 2021 20:24:36 +0000 (16:24 -0400)] 
test678: Fix for Windows multibyte builds

Follow-up to 77fc385 from yesterday.

Bug: https://github.com/curl/curl/pull/6662#issuecomment-832966557
Reported-by: Marc Hörsken
4 years agobuild: fix compilation for Windows UWP platform
dmitrykos [Tue, 4 May 2021 14:54:21 +0000 (17:54 +0300)] 
build: fix compilation for Windows UWP platform

- Include afunix.h which is necessary for sockaddr_un when
  USE_UNIX_SOCKETS is defined on Windows.

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

4 years agognutls: make setting only the MAX TLS allowed version work
Daniel Stenberg [Tue, 4 May 2021 11:34:14 +0000 (13:34 +0200)] 
gnutls: make setting only the MAX TLS allowed version work

Previously, settting only the max allowed TLS version, leaving the
minimum one at default, didn't actually set it and left it to default
(TLS 1.3) too!

As a bonus, this change also removes the dead code handling of SSLv3
since that version can't be set anymore (since eff614fb0242cb).

Reported-by: Daniel Carpenter
Fixes #6998
Closes #7000

4 years agoopenldap: replace ldap_ prefix on private functions
Daniel Stenberg [Tue, 4 May 2021 14:14:13 +0000 (16:14 +0200)] 
openldap: replace ldap_ prefix on private functions

Since openldap itself uses that prefix and with OpenĹDAP 2.5.4 (at
least) there's a symbol collision because of that.

The private functions now use the 'oldap_' prefix where it previously
used 'ldap_'.

Reported-by: 3eka on github
Fixes #7004
Closes #7005

4 years agohttp2: fix potentially uninitialized variable
Jay Satiro [Wed, 5 May 2021 07:16:06 +0000 (03:16 -0400)] 
http2: fix potentially uninitialized variable

introduced several days ago in 3193170. caught by visual studio linker.

4 years agoSSL: support in-memory CA certs for some backends
Gilles Vollant [Mon, 13 Jul 2020 01:17:56 +0000 (03:17 +0200)] 
SSL: support in-memory CA certs for some backends

- New options CURLOPT_CAINFO_BLOB and CURLOPT_PROXY_CAINFO_BLOB to
  specify in-memory PEM certificates for OpenSSL, Schannel (Windows)
  and Secure Transport (Apple) SSL backends.

Prior to this change PEM certificates could only be imported from a file
and not from memory.

Co-authored-by: moparisthebest@users.noreply.github.com
Ref: https://github.com/curl/curl/pull/4679
Ref: https://github.com/curl/curl/pull/5677
Ref: https://github.com/curl/curl/pull/6109

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

4 years agotests: ignore case of chunked hex numbers in tests
David Cook [Tue, 4 May 2021 00:29:40 +0000 (19:29 -0500)] 
tests: ignore case of chunked hex numbers in tests

When hyper is used, it emits uppercase hexadecimal numbers for chunked
encoding lengths. Without hyper, lowercase hexadecimal numbers are used.
This change adds preprocessor statements to tests where this is an
issue, and adapts the fixtures to match.

Closes #6987

4 years agocmake: check for getppid and utimes
Daniel Stenberg [Tue, 4 May 2021 09:03:30 +0000 (11:03 +0200)] 
cmake: check for getppid and utimes

... as they're checked for in the configure script and are used by
source code.

Removed checks for perror, setvbuf and strlcat since those defines are
not checked for in source code.

Bonus: removed HAVE_STRLCPY from a few config-*.h files since that
symbol is not used in source code.

Closes #6997

4 years agolibtest: remove lib530.c
Daniel Stenberg [Tue, 4 May 2021 09:50:45 +0000 (11:50 +0200)] 
libtest: remove lib530.c

Follow up from e50a877df when test 530 was removed. Since then this
source file has not been used/needed.

Closes #6999

4 years agoFILEFORMAT: mention sectransp as a feature
Daniel Stenberg [Tue, 4 May 2021 12:07:01 +0000 (14:07 +0200)] 
FILEFORMAT: mention sectransp as a feature

Been supported since at least 40259ca65

Closes #7001

4 years agoRELEASE-NOTES: synced
Daniel Stenberg [Tue, 4 May 2021 08:27:35 +0000 (10:27 +0200)] 
RELEASE-NOTES: synced

4 years agolibssh2: ignore timeout during disconnect
Daniel Stenberg [Mon, 3 May 2021 11:21:15 +0000 (13:21 +0200)] 
libssh2: ignore timeout during disconnect

... to avoid memory leaks!

libssh2 is tricky as we have to deal with the non-blockiness even in
close and shutdown cases. In the cases when we shutdown after a timeout
already expired, it is crucial that curl doen't let the timeout abort
the shutdown process as that then leaks memory!

Reported-by: Benjamin Riefenstahl
Fixes #6990

4 years agoKNOWN_BUGS: add two HTTP/2 bugs
Daniel Stenberg [Mon, 3 May 2021 15:27:35 +0000 (17:27 +0200)] 
KNOWN_BUGS: add two HTTP/2 bugs

4 years agoKNOWN_BUGS: add three HTTP/3 issues
Daniel Stenberg [Mon, 3 May 2021 15:22:52 +0000 (17:22 +0200)] 
KNOWN_BUGS: add three HTTP/3 issues

... and moved the HTTP/2 issues to its own section

Closes #6606
Closes #6510
Closes #6494

4 years agoCURLcode: add CURLE_SSL_CLIENTCERT
ejanchivdorj [Thu, 11 Mar 2021 07:50:13 +0000 (23:50 -0800)] 
CURLcode: add CURLE_SSL_CLIENTCERT

When a TLS server requests a client certificate during handshake and
none can be provided, libcurl now returns this new error code
CURLE_SSL_CLIENTCERT

Only supported by Secure Transport and OpenSSL for TLS 1.3 so far.

Closes #6721

4 years ago.github/FUNDING: add link to GitHub sponsors
Tobias Gabriel [Fri, 30 Apr 2021 13:17:00 +0000 (15:17 +0200)] 
.github/FUNDING: add link to GitHub sponsors

Closes #6985

4 years agokrb5/name_to_level: replace checkprefix with curl_strequal
Harry Sintonen [Sun, 2 May 2021 21:13:41 +0000 (00:13 +0300)] 
krb5/name_to_level: replace checkprefix with curl_strequal

Closes #6993

4 years agoCurl_input_digest: require space after Digest
Harry Sintonen [Sun, 2 May 2021 21:07:57 +0000 (00:07 +0300)] 
Curl_input_digest: require space after Digest

Closes #6993

4 years agoCurl_http_header: check for colon when matching Persistent-Auth
Harry Sintonen [Sun, 2 May 2021 21:06:41 +0000 (00:06 +0300)] 
Curl_http_header: check for colon when matching Persistent-Auth

Closes #6993

4 years agoCurl_http_input_auth: require valid separator after negotiation type
Harry Sintonen [Sun, 2 May 2021 21:04:39 +0000 (00:04 +0300)] 
Curl_http_input_auth: require valid separator after negotiation type

Closes #6993

4 years agohttp: fix the check for 'Authorization' with Bearer
Daniel Stenberg [Sat, 1 May 2021 21:38:15 +0000 (23:38 +0200)] 
http: fix the check for 'Authorization' with Bearer

The code would wrongly check for it using an additional colon.

Reported-by: Blake Burkhart
Closes #6988

4 years agohttp2: fix a resource leak in push_promise()
Kamil Dudka [Fri, 30 Apr 2021 16:18:02 +0000 (18:18 +0200)] 
http2: fix a resource leak in push_promise()

... detected by Coverity:

Error: RESOURCE_LEAK (CWE-772):
lib/http2.c:532: alloc_fn: Storage is returned from allocation function "duphandle".
lib/http2.c:532: var_assign: Assigning: "newhandle" = storage returned from "duphandle(data)".
lib/http2.c:552: noescape: Resource "newhandle" is not freed or pointed-to in "set_transfer_url".
lib/http2.c:555: leaked_storage: Variable "newhandle" going out of scope leaks the storage it points to.

Closes #6986

4 years agohttp2: fix resource leaks in set_transfer_url()
Kamil Dudka [Fri, 30 Apr 2021 16:14:45 +0000 (18:14 +0200)] 
http2: fix resource leaks in set_transfer_url()

... detected by Coverity:

Error: RESOURCE_LEAK (CWE-772):
lib/http2.c:480: alloc_fn: Storage is returned from allocation function "curl_url". [Note: The source code implementation of the function has been overridden by a builtin model.]
lib/http2.c:480: var_assign: Assigning: "u" = storage returned from "curl_url()".
lib/http2.c:486: noescape: Resource "u" is not freed or pointed-to in "curl_url_set". [Note: The source code implementation of the function has been overridden by a builtin model.]
lib/http2.c:488: leaked_storage: Variable "u" going out of scope leaks the storage it points to.

Error: RESOURCE_LEAK (CWE-772):
lib/http2.c:480: alloc_fn: Storage is returned from allocation function "curl_url". [Note: The source code implementation of the function has been overridden by a builtin model.]
lib/http2.c:480: var_assign: Assigning: "u" = storage returned from "curl_url()".
lib/http2.c:493: noescape: Resource "u" is not freed or pointed-to in "curl_url_set". [Note: The source code implementation of the function has been overridden by a builtin model.]
lib/http2.c:495: leaked_storage: Variable "u" going out of scope leaks the storage it points to.

Error: RESOURCE_LEAK (CWE-772):
lib/http2.c:480: alloc_fn: Storage is returned from allocation function "curl_url". [Note: The source code implementation of the function has been overridden by a builtin model.]
lib/http2.c:480: var_assign: Assigning: "u" = storage returned from "curl_url()".
lib/http2.c:500: noescape: Resource "u" is not freed or pointed-to in "curl_url_set". [Note: The source code implementation of the function has been overridden by a builtin model.]
lib/http2.c:502: leaked_storage: Variable "u" going out of scope leaks the storage it points to.

Error: RESOURCE_LEAK (CWE-772):
lib/http2.c:480: alloc_fn: Storage is returned from allocation function "curl_url". [Note: The source code implementation of the function has been overridden by a builtin model.]
lib/http2.c:480: var_assign: Assigning: "u" = storage returned from "curl_url()".
lib/http2.c:505: noescape: Resource "u" is not freed or pointed-to in "curl_url_get". [Note: The source code implementation of the function has been overridden by a builtin model.]
lib/http2.c:507: leaked_storage: Variable "u" going out of scope leaks the storage it points to.

Closes #6986

4 years agorustls: use ALPN
Jacob Hoffman-Andrews [Sun, 25 Apr 2021 01:02:24 +0000 (18:02 -0700)] 
rustls: use ALPN

Update required rustls to 0.5.0

Closes #6960

4 years agogskit: fix CURL_DISABLE_PROXY build
MAntoniak [Thu, 29 Apr 2021 11:25:35 +0000 (13:25 +0200)] 
gskit: fix CURL_DISABLE_PROXY build

Removed localfd and remotefd from ssl_backend_data (ued only with proxy
connection). Function pipe_ssloverssl return always 0, when proxy is not
used.

Closes #6981

4 years agogskit: fix undefined reference to 'conn'
MAntoniak [Thu, 29 Apr 2021 11:23:03 +0000 (13:23 +0200)] 
gskit: fix undefined reference to 'conn'

Closes #6980

4 years agotls: add USE_HTTP2 define
Jacob Hoffman-Andrews [Sun, 25 Apr 2021 01:05:15 +0000 (18:05 -0700)] 
tls: add USE_HTTP2 define

This abstracts across the two HTTP/2 backends: nghttp2 and Hyper.

Add our own define for the "h2" ALPN protocol, so TLS backends can use
it without depending on a specific HTTP backend.

Closes #6959

4 years agolib: fix 0-length Curl_client_write calls
Jacob Hoffman-Andrews [Tue, 27 Apr 2021 22:48:01 +0000 (15:48 -0700)] 
lib: fix 0-length Curl_client_write calls

Closes #6954

4 years agolib: remove strlen call from Curl_client_write
Jacob Hoffman-Andrews [Sat, 24 Apr 2021 17:33:56 +0000 (10:33 -0700)] 
lib: remove strlen call from Curl_client_write

At all call sites with an explicit 0 len, pass an appropriate nonzero
len.

Closes #6954

4 years agodocs: camelcase it like GitHub everywhere
Ayushman Singh Chauhan [Tue, 27 Apr 2021 17:53:43 +0000 (23:23 +0530)] 
docs: camelcase it like GitHub everywhere

Closes #6979

4 years agodocs: fix typo in fail-with-body doc
Lucas Servén Marín [Tue, 27 Apr 2021 15:53:39 +0000 (17:53 +0200)] 
docs: fix typo in fail-with-body doc

This commit fixes a small typo in the documentation for the
--fail-with-body flag.

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

4 years agolib: fix some misuse of curlx_convert_UTF8_to_tchar
Jay Satiro [Fri, 23 Apr 2021 04:21:16 +0000 (00:21 -0400)] 
lib: fix some misuse of curlx_convert_UTF8_to_tchar

curlx_convert_UTF8_to_tchar must be freed by curlx_unicodefree, but
prior to this change some uses mistakenly called free.

I've reviewed all other uses of curlx_convert_UTF8_to_tchar and
curlx_convert_tchar_to_UTF8.

Bug: https://github.com/curl/curl/pull/6602#issuecomment-825236763
Reported-by: sergio-nsk@users.noreply.github.com
Closes https://github.com/curl/curl/pull/6938

4 years agontlm: precaution against super huge type2 offsets
Daniel Stenberg [Tue, 27 Apr 2021 09:12:23 +0000 (11:12 +0200)] 
ntlm: precaution against super huge type2 offsets

... which otherwise caused an integer overflow and circumvented the if()
conditional size check.

Detected by OSS-Fuzz
Bug: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=33720
Assisted-by: Max Dymond
Closes #6975

4 years agoc-hyper: fix unused variable ‘wrote’
Daniel Stenberg [Tue, 27 Apr 2021 14:00:48 +0000 (16:00 +0200)] 
c-hyper: fix unused variable ‘wrote’