]> git.ipfire.org Git - thirdparty/curl.git/log
thirdparty/curl.git
2 years agolib: use wrapper for curl_mime_data fseek callback
Natanael Copa [Fri, 22 Sep 2023 13:58:49 +0000 (13:58 +0000)] 
lib: use wrapper for curl_mime_data fseek callback

fseek uses long offset which does not match with curl_off_t. This leads
to undefined behavior when calling the callback and caused failure on
arm 32 bit.

Use a wrapper to solve this and use fseeko which uses off_t instead of
long.

Thanks to the nice people at Libera IRC #musl for helping finding this
out.

Fixes #11882
Fixes #11900
Closes #11918

2 years agoconfigure: sort AC_CHECK_FUNCS
Natanael Copa [Mon, 25 Sep 2023 11:03:26 +0000 (13:03 +0200)] 
configure: sort AC_CHECK_FUNCS

No functional changes.

2 years agowarnless: remove unused functions
Daniel Stenberg [Mon, 25 Sep 2023 10:32:07 +0000 (12:32 +0200)] 
warnless: remove unused functions

Previously put there for use with the intel compiler

Closes #11932

2 years agoGHA/linux: run singleuse to detect single-use global functions
Daniel Stenberg [Mon, 25 Sep 2023 07:44:51 +0000 (09:44 +0200)] 
GHA/linux: run singleuse to detect single-use global functions

Use --unit for configure --enable-debug builds

Closes #11932

2 years agosingleuse: add scan for use in other source codes
Daniel Stenberg [Mon, 25 Sep 2023 07:42:12 +0000 (09:42 +0200)] 
singleuse: add scan for use in other source codes

This should reduce false-positive to almost zero. Checks for presence in
unit tests if --unit is specified, which is intended for debug builds
where unit testing is enabled.

Closes #11932

2 years agomulti: remove Curl_multi_dump
Daniel Stenberg [Mon, 25 Sep 2023 07:42:47 +0000 (09:42 +0200)] 
multi: remove Curl_multi_dump

A debug-only function that is basically never used. Removed to ease the
use of the singleuse script to detect non-static functions not used
outside the file where it is defined.

Closes #11931

2 years agotests: fix compiler warnings
Viktor Szakats [Sun, 24 Sep 2023 09:50:39 +0000 (09:50 +0000)] 
tests: fix compiler warnings

Seen with llvm 17 on Windows x64.

```
.../curl/tests/server/rtspd.c:136:13: warning: no previous extern declaration for non-static variable 'logdir' [-Wmissing-variable-declarations]
  136 | const char *logdir = "log";
      |             ^
.../curl/tests/server/rtspd.c:136:7: note: declare 'static' if the variable is not intended to be used outside of this translation unit
  136 | const char *logdir = "log";
      |       ^
.../curl/tests/server/rtspd.c:137:6: warning: no previous extern declaration for non-static variable 'loglockfile' [-Wmissing-variable-declarations]
  137 | char loglockfile[256];
      |      ^
.../curl/tests/server/rtspd.c:137:1: note: declare 'static' if the variable is not intended to be used outside of this translation unit
  137 | char loglockfile[256];
      | ^
.../curl/tests/server/fake_ntlm.c:43:13: warning: no previous extern declaration for non-static variable 'logdir' [-Wmissing-variable-declarations]
   43 | const char *logdir = "log";
      |             ^
.../curl/tests/server/fake_ntlm.c:43:7: note: declare 'static' if the variable is not intended to be used outside of this translation unit
   43 | const char *logdir = "log";
      |       ^
.../curl/src/tool_doswin.c:350:8: warning: possible misuse of comma operator here [-Wcomma]
  350 |     ++d, ++s;
      |        ^
.../curl/src/tool_doswin.c:350:5: note: cast expression to void to silence warning
  350 |     ++d, ++s;
      |     ^~~
      |     (void)( )
```

```
.../curl/tests/libtest/lib540.c:146:27: warning: result of comparison 'long' > 2147483647 is always false [-Wtautological-type-limit-compare]
  146 |         int itimeout = (L > (long)INT_MAX) ? INT_MAX : (int)L;
      |                         ~ ^ ~~~~~~~~~~~~~
1 warning generated.

.../curl/tests/libtest/libntlmconnect.c:195:31: warning: result of comparison 'long' > 2147483647 is always false [-Wtautological-type-limit-compare]
  195 |       int itimeout = (timeout > (long)INT_MAX) ? INT_MAX : (int)timeout;
      |                       ~~~~~~~ ^ ~~~~~~~~~~~~~
1 warning generated.

.../curl/tests/libtest/lib591.c:117:31: warning: result of comparison 'long' > 2147483647 is always false [-Wtautological-type-limit-compare]
  117 |       int itimeout = (timeout > (long)INT_MAX) ? INT_MAX : (int)timeout;
      |                       ~~~~~~~ ^ ~~~~~~~~~~~~~
1 warning generated.
.../curl/tests/libtest/lib597.c:99:31: warning: result of comparison 'long' > 2147483647 is always false [-Wtautological-type-limit-compare]
   99 |       int itimeout = (timeout > (long)INT_MAX) ? INT_MAX : (int)timeout;
      |                       ~~~~~~~ ^ ~~~~~~~~~~~~~
1 warning generated.
```

Seen on macOS Intel:
```
.../curl/tests/server/sws.c:440:64: warning: field precision should have type 'int', but argument has type 'size_t' (aka 'unsigned long') [-Wformat]
          msnprintf(logbuf, sizeof(logbuf), "Got request: %s %.*s HTTP/%d.%d",
                                                             ~~^~
1 warning generated.
```

Closes #11925

2 years agourl: fix netrc info message
Jay Satiro [Wed, 20 Sep 2023 22:59:45 +0000 (18:59 -0400)] 
url: fix netrc info message

- Fix netrc info message to use the generic ".netrc" filename if the
  user did not specify a netrc location.

- Update --netrc doc to add that recent versions of curl on Windows
  prefer .netrc over _netrc.

Before:
* Couldn't find host google.com in the (nil) file; using defaults

After:
* Couldn't find host google.com in the .netrc file; using defaults

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

2 years agowolfssh: do cleanup in Curl_ssh_cleanup
Dan Fandrich [Fri, 22 Sep 2023 17:59:53 +0000 (10:59 -0700)] 
wolfssh: do cleanup in Curl_ssh_cleanup

Closes: #11921
2 years agotool_listhelp: regenerated
Daniel Stenberg [Sat, 23 Sep 2023 09:27:03 +0000 (11:27 +0200)] 
tool_listhelp: regenerated

Polished the --ipfs-gateway description

Fixed the --trace-config description

The script also fixed some other small mistakes

Closes #11923

2 years agoMakefile.mk: always set `CURL_STATICLIB` for lib (Windows)
Viktor Szakats [Fri, 22 Sep 2023 18:52:46 +0000 (18:52 +0000)] 
Makefile.mk: always set `CURL_STATICLIB` for lib (Windows)

Also fix to export all symbols in Windows debug builds, making
`-debug-dyn` builds work with `-DCURL_STATICLIB` set.

Ref: https://github.com/curl/curl/pull/11914 (same for CMake)

Closes #11924

2 years agoquic: set ciphers/curves the same way regular TLS does
Daniel Stenberg [Tue, 12 Sep 2023 06:01:05 +0000 (08:01 +0200)] 
quic: set ciphers/curves the same way regular TLS does

for OpenSSL/BoringSSL

Fixes #11796
Reported-by: Karthikdasari0423 on github
Assisted-by: Jay Satiro
Closes #11836

2 years agotest457: verify --max-filesize with chunked encoding
Daniel Stenberg [Sat, 23 Sep 2023 09:20:00 +0000 (11:20 +0200)] 
test457: verify --max-filesize with chunked encoding

2 years agolib: let the max filesize option stop too big transfers too
Daniel Stenberg [Sat, 23 Sep 2023 09:20:00 +0000 (11:20 +0200)] 
lib: let the max filesize option stop too big transfers too

Previously it would only stop them from getting started if the size is
known to be too big then.

Update the libcurl and curl docs accordingly.

Fixes #11810
Reported-by: Elliot Killick
Assisted-by: Jay Satiro
Closes #11820

2 years agomingw: delete support for legacy mingw.org toolchain
Viktor Szakats [Tue, 8 Aug 2023 11:00:36 +0000 (11:00 +0000)] 
mingw: delete support for legacy mingw.org toolchain

Drop support for "old" / "legacy" / "classic" / "v1" / "mingw32" MinGW:
  https://en.wikipedia.org/wiki/MinGW, https://osdn.net/projects/mingw/
Its homepage used to be http://mingw.org/ [no HTTPS], and broken now.
It supported the x86 CPU only and used a old Windows API header and
implib set, often causing issues. It also misses most modern Windows
features, offering old versions of both binutils and gcc (no llvm/clang
support). It was last updated 2 years ago.

curl now relies on toolchains based on the mingw-w64 project:
https://www.mingw-w64.org/  https://sourceforge.net/projects/mingw-w64/
https://www.msys2.org/  https://github.com/msys2/msys2
https://github.com/mstorsjo/llvm-mingw
(Also available via Linux and macOS package managers.)

Closes #11625

2 years agocurl: add support for the IPFS protocols:
Mark Gaiser [Sun, 27 Mar 2022 00:31:58 +0000 (01:31 +0100)] 
curl: add support for the IPFS protocols:

- ipfs://<cid>
- ipns://<cid>

This allows you tu use ipfs in curl like:
curl ipfs://<cid>
and
curl ipns://<cid>

For more information consult the readme at:
https://curl.se/docs/ipfs.html

Closes #8805

2 years agobufq: remove Curl_bufq_skip_and_shift (unused)
Daniel Stenberg [Fri, 22 Sep 2023 12:01:07 +0000 (14:01 +0200)] 
bufq: remove Curl_bufq_skip_and_shift (unused)

Closes #11915

2 years agoscripts/singleuse.pl: add curl_global_trace
Daniel Stenberg [Fri, 22 Sep 2023 12:13:00 +0000 (14:13 +0200)] 
scripts/singleuse.pl: add curl_global_trace

2 years agocmake: fix unity symbol collisions in h2 builds
Viktor Szakats [Thu, 21 Sep 2023 22:27:57 +0000 (22:27 +0000)] 
cmake: fix unity symbol collisions in h2 builds

Regression from 331b89a319d0067fa1e6441719307cfef9c7960f

Reviewed-by: Daniel Stenberg
Reviewed-by: Jay Satiro
Closes #11912

2 years agoRELEASE-NOTES: synced
Daniel Stenberg [Fri, 22 Sep 2023 08:36:31 +0000 (10:36 +0200)] 
RELEASE-NOTES: synced

2 years agogithub/labeler: improve the match patterns
Dan Fandrich [Thu, 21 Sep 2023 17:50:49 +0000 (10:50 -0700)] 
github/labeler: improve the match patterns

This includes new rules for setting the appleOS and logging labels and
matches on some example files. Also, enable dot mode for wildcard
matches in the .github directory.

2 years agoupload-file.d: describe the file name slash/backslash handling
Daniel Stenberg [Thu, 21 Sep 2023 15:46:12 +0000 (17:46 +0200)] 
upload-file.d: describe the file name slash/backslash handling

Closes #11911

2 years agolibssh: cap SFTP packet size sent
Jakub Jelen [Tue, 5 Sep 2023 15:33:41 +0000 (17:33 +0200)] 
libssh: cap SFTP packet size sent

Due to libssh limitations

Signed-off-by: Jakub Jelen <jjelen@redhat.com>
Closes #11804

2 years agocurl.h: mark CURLSSLBACKEND_NSS as deprecated since 8.3.0
Daniel Stenberg [Thu, 21 Sep 2023 07:34:36 +0000 (09:34 +0200)] 
curl.h: mark CURLSSLBACKEND_NSS as deprecated since 8.3.0

Closes #11905

2 years agomailmap: unify Michael Osipov under a single email
Daniel Stenberg [Thu, 21 Sep 2023 12:18:49 +0000 (14:18 +0200)] 
mailmap: unify Michael Osipov under a single email

2 years agodocs: use CURLSSLBACKEND_NONE
Ted Lyngmo [Thu, 21 Sep 2023 10:44:35 +0000 (12:44 +0200)] 
docs: use CURLSSLBACKEND_NONE

[ssl] use CURLSSLBACKEND_NONE instead of (curl_sslbackend)-1 in
documentation and examples.

Signed-off-by: Ted Lyngmo <ted@lyncon.se>
Closes #11909

2 years agogithub/labeler: give the sync-labels config item a default value
Dan Fandrich [Thu, 21 Sep 2023 08:17:32 +0000 (01:17 -0700)] 
github/labeler: give the sync-labels config item a default value

This shouldn't be necessary and is likely a bug with this beta version
of the labeller.

Also, fix the negative matches for the documentation label.

Follow-up to dd12b452a
Closes #11907

2 years agogithub/labeler: fix up more the labeler config format
Dan Fandrich [Thu, 21 Sep 2023 07:43:04 +0000 (00:43 -0700)] 
github/labeler: fix up more the labeler config format

The new version didn't like the workaround we had for a bug in the
previous labeler version, and it should no longer be needed.

Follow-up to dd12b452a
Closes #11906

2 years agogithub/labeler: fix indenting to try to appease labeller
Dan Fandrich [Thu, 21 Sep 2023 07:03:22 +0000 (00:03 -0700)] 
github/labeler: fix indenting to try to appease labeller

Follow-up to dd12b452a

2 years agolibssh2: fix error message on failed pubkey-from-file
Jay Satiro [Mon, 18 Sep 2023 21:58:23 +0000 (17:58 -0400)] 
libssh2: fix error message on failed pubkey-from-file

- If libssh2_userauth_publickey_fromfile_ex returns -1 then show error
  message "SSH public key authentication failed: Reason unknown (-1)".

When libssh2_userauth_publickey_fromfile_ex returns -1 it does so as a
generic error and therefore doesn't set an error message. AFAICT that is
not documented behavior.

Prior to this change libcurl retrieved the last set error message which
would be from a previous function failing. That resulted in misleading
auth failed error messages in verbose mode.

Bug: https://github.com/curl/curl/issues/11837#issue-1891827355
Reported-by: consulion@users.noreply.github.com
Closes https://github.com/curl/curl/pull/11881

2 years agopytest: exclude test_03_goaway in CI runs due to timing dependency
Stefan Eissing [Fri, 15 Sep 2023 07:21:50 +0000 (09:21 +0200)] 
pytest: exclude test_03_goaway in CI runs due to timing dependency

Closes #11860

2 years agolib: disambiguate Curl_client_write flag semantics
Stefan Eissing [Tue, 19 Sep 2023 10:31:31 +0000 (12:31 +0200)] 
lib: disambiguate Curl_client_write flag semantics

- use CLIENTWRITE_BODY *only* when data is actually body data
- add CLIENTWRITE_INFO for meta data that is *not* a HEADER
- debug assertions that BODY/INFO/HEADER is not used mixed
- move `data->set.include_header` check into Curl_client_write
  so protocol handlers no longer have to care
- add special in FTP for `data->set.include_header` for historic,
  backward compatible reasons
- move unpausing of client writes from easy.c to sendf.c, so that
  code is in one place and can forward flags correctly

Closes #11885

2 years agotftpd: always use curl's own tftp.h
Patrick Monnerat [Wed, 20 Sep 2023 12:02:05 +0000 (14:02 +0200)] 
tftpd: always use curl's own tftp.h

Using the system's provided arpa/tftp.h and optimizing, GCC 12 detects
and reports a stringop-overread warning:

tftpd.c: In function ‘write_behind.isra’:
tftpd.c:485:12: warning: ‘write’ reading between 1 and 2147483647 bytes from a region of size 0 [-Wstringop-overread]
  485 |     return write(test->ofile, writebuf, count);
      |            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from tftpd.c:71:
/usr/include/arpa/tftp.h:58:30: note: source object ‘tu_data’ of size 0
   58 |                         char tu_data[0];        /* data or error string */
      |                              ^~~~~~~

This occurs because writebuf points to this field and the latter
cannot be considered as being of dynamic length because it is not
the last field in the structure. Thus it is bound to its declared
size.

This commit always uses curl's own version of tftp.h where the
target field is last in its structure, effectively avoiding the
warning.

As HAVE_ARPA_TFTP_H is not used anymore, cmake/configure checks for
arpa/tftp.h are removed.

Closes #11897

2 years agotest1474: make precheck more robust on non-Solaris systems
Dan Fandrich [Wed, 20 Sep 2023 21:26:32 +0000 (14:26 -0700)] 
test1474: make precheck more robust on non-Solaris systems

If uname -r returns something odd, perl could return an error code and
the test would be erroneously skipped. The qx// syntax avoid this.

Followup to 08f9b2148

2 years agogithub/labeler: switch to the 5 beta version
Dan Fandrich [Wed, 20 Sep 2023 19:22:46 +0000 (12:22 -0700)] 
github/labeler: switch to the 5 beta version

This version adds an important feature that will allow more PRs to be
labelled. Rather than being limited to labeling PRs with files that
match a single glob, it can now label them if multiple changed files
match any one of a number of globs.

2 years agolib: enable hmac for digest as well
Daniel Stenberg [Wed, 20 Sep 2023 07:56:26 +0000 (09:56 +0200)] 
lib: enable hmac for digest as well

Previously a build that disabled NTLM and aws-sigv4 would fail to build
since the hmac was disabled, but it is also needed for digest auth.

Follow-up to e92edfbef64448ef

Fixes #11890
Reported-by: Aleksander Mazur
Closes #11896

2 years agoidn: if idn2_check_version returns NULL, return error
Daniel Stenberg [Wed, 20 Sep 2023 09:10:16 +0000 (11:10 +0200)] 
idn: if idn2_check_version returns NULL, return error

... this avoids a NULL dereference for this unusual case.

Reported-by: s0urc3_ on hackerone
Closes #11898

2 years agohttp: fix CURL_DISABLE_BEARER_AUTH breakage
Daniel Stenberg [Wed, 20 Sep 2023 06:46:56 +0000 (08:46 +0200)] 
http: fix CURL_DISABLE_BEARER_AUTH breakage

When bearer auth was disabled, the if/else logic got wrong and caused
problems.

Follow-up to e92edfbef64448ef461
Fixes #11892
Reported-by: Aleksander Mazur
Closes #11895

2 years agowolfssl: allow capath with CURLOPT_CAINFO_BLOB
Michael Osipov [Tue, 19 Sep 2023 12:30:29 +0000 (14:30 +0200)] 
wolfssl: allow capath with CURLOPT_CAINFO_BLOB

Remain consistent with OpenSSL. While CAfile is nulled as documented
with CURLOPT_CAINFO_BLOB, CApath remains intact.

Closes #11886

2 years agowolfssl: use ssl_cafile/ssl_capath variables consistent with openssl.c
Michael Osipov [Tue, 19 Sep 2023 12:26:20 +0000 (14:26 +0200)] 
wolfssl: use ssl_cafile/ssl_capath variables consistent with openssl.c

Closes #11886

2 years agotest1474: disable test on NetBSD, OpenBSD and Solaris 10
Dan Fandrich [Tue, 19 Sep 2023 18:09:47 +0000 (11:09 -0700)] 
test1474: disable test on NetBSD, OpenBSD and Solaris 10

These kernels only send a fraction of the requested amount of the first
large block, invalidating the assumptions of the test and causing it to
fail.

Assisted-by: Christian Weisgerber
Ref: https://curl.se/mail/lib-2023-09/0021.html
Closes #11888

2 years agocmake, configure: also link with CoreServices
Ryan Schmidt [Wed, 20 Sep 2023 01:36:39 +0000 (20:36 -0500)] 
cmake, configure: also link with CoreServices

When linking with CoreFoundation, also link with CoreServices which is
apparently required to avoid an NSInvalidArgumentException in software
linking with libcurl on macOS Sonoma 14 and later.

Fixes #11893
Closes #11894

2 years agoCI/azure: remove pip, wheel, cryptography, pyopenssl and impacket
Marc Hoersken [Tue, 19 Sep 2023 18:36:50 +0000 (20:36 +0200)] 
CI/azure: remove pip, wheel, cryptography, pyopenssl and impacket

These dependencies are now already included in the Docker image.

Ref: https://github.com/mback2k/curl-docker-winbuildenv/commit/2607a31bcab544b41d15606e97f38cf312c1ce56

Closes #11889

2 years agowolfssl: if CURLOPT_CAINFO_BLOB is set, ignore the CA files
Daniel Stenberg [Tue, 19 Sep 2023 08:53:44 +0000 (10:53 +0200)] 
wolfssl: if CURLOPT_CAINFO_BLOB is set, ignore the CA files

Ref: #11883
Reported-by: Michael Osipov
Closes #11884

2 years agoRELEASE-NOTES: synced
Daniel Stenberg [Tue, 19 Sep 2023 06:32:38 +0000 (08:32 +0200)] 
RELEASE-NOTES: synced

2 years agotest3103: CURLOPT_COOKIELIST test
Daniel Stenberg [Mon, 18 Sep 2023 06:43:00 +0000 (08:43 +0200)] 
test3103: CURLOPT_COOKIELIST test

2 years agocookie: set ->running in cookie_init even if data is NULL
Daniel Stenberg [Mon, 18 Sep 2023 07:06:53 +0000 (09:06 +0200)] 
cookie: set ->running in cookie_init even if data is NULL

This is a regression introduced in b1b326ec500 (shipped in curl 8.1.0)

Test 3103 verifies.

Fixes #11875
Reported-by: wangp on github
Closes #11876

2 years agotest498: total header size for all redirects is larger than accepted
Daniel Stenberg [Mon, 18 Sep 2023 07:19:21 +0000 (09:19 +0200)] 
test498: total header size for all redirects is larger than accepted

2 years agohttp: use per-request counter to check too large headers
Daniel Stenberg [Sat, 16 Sep 2023 21:54:44 +0000 (23:54 +0200)] 
http: use per-request counter to check too large headers

Not the counter that accumulates all headers over all redirects.

Follow-up to 3ee79c1674fd6

Do a second check for 20 times the limit for the accumulated size for
all headers.

Fixes #11871
Reported-by: Joshix-1 on github
Closes #11872

2 years agoTHANKS: add Eric Murphy
Jay Satiro [Mon, 18 Sep 2023 18:38:43 +0000 (14:38 -0400)] 
THANKS: add Eric Murphy

He reported #11850 (quiche build error) but I forgot to add a
'reported-by' entry in the fix 267e14f1.

2 years agoh2-proxy: remove left-over mistake in drain_tunnel()
Daniel Stenberg [Mon, 18 Sep 2023 07:25:19 +0000 (09:25 +0200)] 
h2-proxy: remove left-over mistake in drain_tunnel()

Left-over from 331b89a319

Reported-by: 南宫雪珊
Closes https://github.com/curl/curl/pull/11877

2 years agolib: failf/infof compiler warnings
vvb2060 [Sun, 17 Sep 2023 05:04:17 +0000 (13:04 +0800)] 
lib: failf/infof compiler warnings

Closes #11874

2 years agorand: fix 'alnum': array is too small to include a terminating null character
Daniel Stenberg [Sat, 16 Sep 2023 20:37:28 +0000 (22:37 +0200)] 
rand: fix 'alnum': array is too small to include a terminating null character

It was that small on purpose, but this change now adds the null byte to
avoid the error.

Follow-up to 3aa3cc9b052353b1

Reported-by: Dan Fandrich
Ref: #11838
Closes #11870

2 years agocmake: fix the help text to the static build option in CMakeLists.txt
Mathias Fuchs [Wed, 13 Sep 2023 12:55:58 +0000 (14:55 +0200)] 
cmake: fix the help text to the static build option in CMakeLists.txt

Closes #11843

2 years agoMANUAL.md: change domain to example.com
John Haugabook [Sat, 16 Sep 2023 00:36:21 +0000 (20:36 -0400)] 
MANUAL.md: change domain to example.com

Closes #11866

2 years agodoh: inherit DEBUGFUNCTION/DATA
Daniel Stenberg [Sat, 16 Sep 2023 09:17:45 +0000 (11:17 +0200)] 
doh: inherit DEBUGFUNCTION/DATA

When creating new transfers for doing DoH, they now inherit the debug
settings from the initiating transfer, so that the application can
redirect and handle the verbose output correctly even for the DoH
transfers.

Reported-by: calvin2021y on github
Fixes #11864
Closes #11869

2 years agohttp_aws_sigv4: fix sorting with empty parts
Dan Fandrich [Sat, 16 Sep 2023 07:08:26 +0000 (00:08 -0700)] 
http_aws_sigv4: fix sorting with empty parts

When comparing with an empty part, the non-empty one is always
considered greater-than. Previously, the two would be considered equal
which would randomly place empty parts amongst non-empty ones. This
showed as a test 439 failure on Solaris as it uses a different
implementation of qsort() that compares parts differently.

Fixes #11855
Closes #11868

2 years agoCI: ignore the "flaky" and "timing-dependent" test results
Dan Fandrich [Fri, 15 Sep 2023 20:42:04 +0000 (13:42 -0700)] 
CI: ignore the "flaky" and "timing-dependent" test results

CI builds will now run these tests, but will ignore the results if they
fail. The relevant tests are ones that are sensitive to timing or
have edge conditions that make them more likely to fail on CI servers,
which are often heavily overloaded and slow.

This change only adds two additional tests to be ignored, since the
others already had the flaky keyword.

Closes #11865

2 years agoruntests: eliminate a warning on old perl versions
Dan Fandrich [Thu, 14 Sep 2023 23:23:08 +0000 (16:23 -0700)] 
runtests: eliminate a warning on old perl versions

The warning "Use of implicit split to @_ is deprecated" showed between
perl versions about 5.8 through 5.11.

2 years agotests: log the test result code after each libtest
Dan Fandrich [Wed, 13 Sep 2023 18:31:16 +0000 (11:31 -0700)] 
tests: log the test result code after each libtest

This makes it easier to determine the test status. Also, capitalize
FAILURE and ABORT messages in log lines to make them easier to spot.

2 years agomisc: better random strings
Harry Sintonen [Tue, 12 Sep 2023 10:51:21 +0000 (13:51 +0300)] 
misc: better random strings

Generate alphanumerical random strings.

Prior this change curl used to create random hex strings. This was
mostly okay, but having alphanumerical random strings is better: The
strings have more entropy in the same space.

The MIME multipart boundary used to be mere 64-bits of randomness due
to being 16 hex chars. With these changes the boundary is 22
alphanumerical chars, or little over 130 bits of randomness.

Closes #11838

2 years agocookie: reduce variable scope, add const
Daniel Stenberg [Fri, 15 Sep 2023 11:43:00 +0000 (13:43 +0200)] 
cookie: reduce variable scope, add const

2 years agocookie: do not store the expire or max-age strings
Daniel Stenberg [Fri, 15 Sep 2023 07:17:34 +0000 (09:17 +0200)] 
cookie: do not store the expire or max-age strings

Convert it to an expire time at once and save memory.

Closes #11862

2 years agocookie: remove unnecessary struct fields
Daniel Stenberg [Thu, 14 Sep 2023 21:28:32 +0000 (23:28 +0200)] 
cookie: remove unnecessary struct fields

Plus: reduce the hash table size from 256 to 63. It seems unlikely to
make much of a speed difference for most use cases but saves 1.5KB of
data per instance.

Closes #11862

2 years agoRELEASE-NOTES: synced
Daniel Stenberg [Fri, 15 Sep 2023 07:01:42 +0000 (09:01 +0200)] 
RELEASE-NOTES: synced

Bumped to 8.4.0, the next presumed version

2 years agotest2600: remove special case handling for USE_ALARM_TIMEOUT
Dan Fandrich [Thu, 14 Sep 2023 06:36:45 +0000 (23:36 -0700)] 
test2600: remove special case handling for USE_ALARM_TIMEOUT

This was originally added to handle platforms that supported only 1
second granularity in connect timeouts, but after some recent changes
the test currently permafails on several Windows platforms.

The need for this special-case was removed in commit 8627416, which
increased the connect timeout in all cases to well above 1 second.

Fixes #11767
Closes #11849

2 years agoSECURITY-PROCESS.md. call it vulnerability disclosure policy
Daniel Stenberg [Thu, 14 Sep 2023 14:41:19 +0000 (16:41 +0200)] 
SECURITY-PROCESS.md. call it vulnerability disclosure policy

SECURITY-PROCESS.md -> VULN-DISCLOSURE-POLICY.md

This a name commonly used for a document like this. This name helps
users find it.

Closes #11852

2 years agoquiche: fix build error with --with-ca-fallback
Junho Choi [Thu, 14 Sep 2023 01:13:11 +0000 (10:13 +0900)] 
quiche: fix build error with --with-ca-fallback

- Fix build error when curl is built with --with-quiche
  and --with-ca-fallback.

- Add --with-ca-fallback to the quiche CI job.

Fixes https://github.com/curl/curl/issues/11850
Closes https://github.com/curl/curl/pull/11847

2 years agoescape: replace Curl_isunreserved with ISUNRESERVED
Jay Satiro [Wed, 13 Sep 2023 18:41:51 +0000 (14:41 -0400)] 
escape: replace Curl_isunreserved with ISUNRESERVED

- Use the ALLCAPS version of the macro so that it is clear a macro is
  being called that evaluates the variable multiple times.

- Also capitalize macro isurlpuntcs => ISURLPUNTCS since it evaluates
  a variable multiple times.

This is a follow-up to 291d225a which changed Curl_isunreserved into an
alias macro for ISUNRESERVED. The problem is the former is not easily
identified as a macro by the caller, which could lead to a bug.

For example, ISUNRESERVED(*foo++) is easily identifiable as wrong but
Curl_isunreserved(*foo++) is not even though they both are the same.

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

2 years agotests: increase the default server logs lock timeout
Dan Fandrich [Wed, 13 Sep 2023 07:07:25 +0000 (00:07 -0700)] 
tests: increase the default server logs lock timeout

This timeout is used to wait for the server to finish writing its logs
before checking them against the expected values. An overloaded machine
could take more than the two seconds previously allocated, so increase
the timeout to 5 seconds.

Ref: #11328
Closes #11834

2 years agotests: increase TEST_HANG_TIMEOUT in two tests
Dan Fandrich [Wed, 13 Sep 2023 06:30:56 +0000 (23:30 -0700)] 
tests: increase TEST_HANG_TIMEOUT in two tests

These tests had a 5 second timeout compared to 60 seconds for all other
tests. Make these consistent with the others for more reliability on
heavily-loaded machines.

Ref: #11328

2 years agotest1056: disable on Windows
Dan Fandrich [Tue, 12 Sep 2023 06:47:35 +0000 (23:47 -0700)] 
test1056: disable on Windows

This test relies on the IPv6 scope field being ignored when connecting to
ipv6-localhost (i.e. [::1%259999] is treated as [::1]). Maybe this is a bit
dodgy, but it works on all our test platforms except Windows. This
test was disabled manually on all Windows CI builds already, so instead
add an incompatible feature and precheck so it's skipped on Windows
everywhere automatically.

2 years agotest587: add a slight delay after test
Dan Fandrich [Mon, 11 Sep 2023 23:38:46 +0000 (16:38 -0700)] 
test587: add a slight delay after test

This test is designed to connect to the server, then immediately send a
few bytes and disconnect. In some situations, such as on a loaded
server, this doesn't give the server enough time to write its lock file
before its existence is checked. The test harness then fails to find the
server's input log file (because it hasn't been written yet) and fails
the test. By adding a short delay after the test, the HTTP server has
enough time to write its lock file which gives itself more time to write
its remaining files.

Ref: #11328

2 years agotests: stop overriding the lock timeout
Dan Fandrich [Mon, 11 Sep 2023 23:35:04 +0000 (16:35 -0700)] 
tests: stop overriding the lock timeout

These tests reduce the server lock wait timeout which can increase
flakiness on loaded machines. Since this is merely an optimization,
eliminate them in favour of reliability.

Ref: #11328

2 years agotests: add some --expect100-timeout to reduce timing dependencies
Dan Fandrich [Mon, 11 Sep 2023 22:28:01 +0000 (15:28 -0700)] 
tests: add some --expect100-timeout to reduce timing dependencies

These tests can fail when the test machine is so slow that the test HTTP
server didn't get a chance to complete before the client's one second
100-continue timeout triggered. Increase that 1 second to 999 seconds so
this situation doesn't happen.

Ref: #11328

2 years agotest661: return from test early in case of curl error
Dan Fandrich [Mon, 11 Sep 2023 21:27:52 +0000 (14:27 -0700)] 
test661: return from test early in case of curl error

2 years agotests: add the timing-dependent keyword on several tests
Dan Fandrich [Fri, 8 Sep 2023 06:48:33 +0000 (23:48 -0700)] 
tests: add the timing-dependent keyword on several tests

These are ones likely to fail on heavily-loaded machines that alter the
normal test timing. Most of these tests already had the flaky keyword
since this condition makes them more likely to fail on CI.

2 years agotest1592: greatly increase the maximum test timeout
Dan Fandrich [Fri, 8 Sep 2023 06:46:10 +0000 (23:46 -0700)] 
test1592: greatly increase the maximum test timeout

It was too short to be reliable on heavily loaded CI machines, and
as a fail-safe only, it didn't need to be short.

Ref: #11328

2 years agotest: minor test cleanups
Dan Fandrich [Fri, 8 Sep 2023 06:32:41 +0000 (23:32 -0700)] 
test: minor test cleanups

Remove an obsolete block of code in tests 2032 & 576.
Add a comment in test 1474.

2 years agotests: quadruple the %FTPTIME2 and %FTPTIME3 timeouts
Dan Fandrich [Wed, 6 Sep 2023 20:38:53 +0000 (13:38 -0700)] 
tests: quadruple the %FTPTIME2 and %FTPTIME3 timeouts

This gives more of a margin for error when running on overloaded CI
servers.

Ref: #11328

2 years agotests: improve SLOWDOWN test reliability by reducing sent data
Dan Fandrich [Wed, 6 Sep 2023 19:00:47 +0000 (12:00 -0700)] 
tests: improve SLOWDOWN test reliability by reducing sent data

These tests are run in SLOWDOWN mode which adds a 10 msec delay after
each character output, which means it takes at least 1.6 seconds (and
320 kernel calls) just to get through the long welcome banner. On an
overloaded system, this can end up taking much more than 1.6 seconds,
and even more than the 7 or 16 second curl timeout that the tests rely
on, causing them to fail. Reducing the size of the welcome banner drops
the total number of characters sent before the transfer starts by more
than half, which reduces the opportunity for test-breaking slowdowns by
the same amount.

Ref: #11328

2 years agotest650: fix an end tag typo
Dan Fandrich [Wed, 6 Sep 2023 18:07:58 +0000 (11:07 -0700)] 
test650: fix an end tag typo

2 years agotool_cb_wrt: fix debug assertion
Jay Satiro [Wed, 13 Sep 2023 17:57:39 +0000 (13:57 -0400)] 
tool_cb_wrt: fix debug assertion

- Fix off-by-one out-of-bounds array index in Windows debug assertion.

Bug: https://github.com/curl/curl/commit/af3f4e41#r127212213
Reported-by: Gisle Vanem
2 years agoctype: add ISUNRESERVED()
Daniel Stenberg [Tue, 12 Sep 2023 13:38:02 +0000 (15:38 +0200)] 
ctype: add ISUNRESERVED()

... and make Curl_isunreserved() use that macro instead of providing a
separate funtion for the purpose.

Closes #11840

2 years agoRELEASE-NOTES: syn ced curl-8_3_0
Daniel Stenberg [Wed, 13 Sep 2023 06:19:24 +0000 (08:19 +0200)] 
RELEASE-NOTES: syn ced

curl 8.3.0 release

2 years agoTHANKS: contributors from 8.3.0
Daniel Stenberg [Wed, 13 Sep 2023 06:19:24 +0000 (08:19 +0200)] 
THANKS: contributors from 8.3.0

2 years agocmake: set SIZEOF_LONG_LONG in curl_config.h
Thorsten Klein [Tue, 12 Sep 2023 10:37:08 +0000 (12:37 +0200)] 
cmake: set SIZEOF_LONG_LONG in curl_config.h

in order to support 32bit builds regarding wolfssl CTC_SETTINGS

Closes #11839

2 years agocurl_ngtcp2: fix error message
Jay Satiro [Tue, 12 Sep 2023 07:14:16 +0000 (03:14 -0400)] 
curl_ngtcp2: fix error message

2 years agohttp_aws_sigv4: handle no-value user header entries
Jay Satiro [Sat, 12 Aug 2023 19:06:08 +0000 (15:06 -0400)] 
http_aws_sigv4: handle no-value user header entries

- Handle user headers in format 'name:' and 'name;' with no value.

The former is used when the user wants to remove an internal libcurl
header and the latter is used when the user actually wants to send a
no-value header in the format 'name:' (note the semi-colon is converted
by libcurl to a colon).

Prior to this change the AWS header import code did not special case
either of those and the generated AWS SignedHeaders would be incorrect.

Reported-by: apparentorder@users.noreply.github.com
Ref: https://curl.se/docs/manpage.html#-H

Fixes https://github.com/curl/curl/issues/11664
Closes https://github.com/curl/curl/pull/11668

2 years agoCI: run pytest with the -v option
Dan Fandrich [Sat, 9 Sep 2023 20:35:58 +0000 (13:35 -0700)] 
CI: run pytest with the -v option

This lists of the test cases being run so it can be tracked over time.

Closes #11824

2 years agoHTTP3: the msquic backend is not functional
Daniel Stenberg [Mon, 11 Sep 2023 07:27:43 +0000 (09:27 +0200)] 
HTTP3: the msquic backend is not functional

I ask that we do not submit bugs for this backend just yet as we know it
does not fully work.

Closes #11831
Closes #11819

2 years agoaws_sigv4: the query canon code miscounted URL encoded input
Daniel Stenberg [Sun, 10 Sep 2023 21:47:38 +0000 (23:47 +0200)] 
aws_sigv4: the query canon code miscounted URL encoded input

Added some extra ampersands to test 439 to verify "blank" query parts

Follow-up to fc76a24c53b08cdf

Closes #11829

2 years agoquic: don't set SNI if hostname is an IP address
vvb2060 [Sun, 10 Sep 2023 19:50:10 +0000 (03:50 +0800)] 
quic: don't set SNI if hostname is an IP address

We already do this for TLS connections.

RFC 6066 says: Literal IPv4 and IPv6 addresses are not permitted in
"HostName".

Ref: https://www.rfc-editor.org/rfc/rfc6066#section-3

Fixes https://github.com/curl/curl/issues/11827
Closes https://github.com/curl/curl/pull/11828

2 years agoRELEASE-NOTES: synced
Daniel Stenberg [Sun, 10 Sep 2023 10:52:55 +0000 (12:52 +0200)] 
RELEASE-NOTES: synced

2 years agoconfigure: fix `HAVE_TIME_T_UNSIGNED` check
Benoit Pierre [Sun, 10 Sep 2023 04:26:14 +0000 (06:26 +0200)] 
configure: fix `HAVE_TIME_T_UNSIGNED` check

The syntax was incorrect (need a proper main body), and the test
condition was wrong (resulting in a signed `time_t` detected as
unsigned).

Closes #11825

2 years agoTHANKS-filter: pszlazak on github
Daniel Stenberg [Sat, 9 Sep 2023 21:48:12 +0000 (23:48 +0200)] 
THANKS-filter: pszlazak on github

2 years agoinclude.d: explain headers not printed with --fail before 7.75.0
pszlazak [Fri, 8 Sep 2023 15:55:11 +0000 (17:55 +0200)] 
include.d: explain headers not printed with --fail before 7.75.0

Prior to 7.75.0 response headers were not printed if -f/--fail was used
and an error was reported by server.  This was fixed in ab525c0
(precedes 7.75.0).

Closes #11822

2 years agohttp_aws_sigv4: skip the op if the query pair is zero bytes
Daniel Stenberg [Fri, 8 Sep 2023 16:13:14 +0000 (18:13 +0200)] 
http_aws_sigv4: skip the op if the query pair is zero bytes

Follow-up to fc76a24c53b08cdf

Spotted by OSS-Fuzz

Bug: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=62175
Closes #11823

2 years agocmdline-docs: use present tense, not future
Daniel Stenberg [Fri, 8 Sep 2023 12:32:29 +0000 (14:32 +0200)] 
cmdline-docs: use present tense, not future

+ some smaller cleanups

Closes #11821

2 years agocmdline-docs: make sure to phrase it as "added in ...."
Daniel Stenberg [Fri, 8 Sep 2023 12:03:59 +0000 (14:03 +0200)] 
cmdline-docs: make sure to phrase it as "added in ...."

References to things that were added or changed in a specific version
should be specified as "(added in [version]) for two reasons:

1 - consistency

2 - to allow gen.pl to strip them out if deemed referring to too old
    versions

Closes #11821