]> git.ipfire.org Git - thirdparty/curl.git/log
thirdparty/curl.git
13 months agovtls/rustls: support strong CSRNG data
Daniel McCarney [Thu, 12 Sep 2024 16:38:51 +0000 (12:38 -0400)] 
vtls/rustls: support strong CSRNG data

Now that the curl rustls vtls backend is using rustls 0.14 we can
address the weak random situation by using
`rustls_default_crypto_provider_random()` to provide a `Curl_ssl`
`random` callback that fills the provided buffer with cryptographically
secure random data.

The mentions in `docs/` about weak RNG when using rustls are removed as
they are no longer applicable.

Closes #14889

13 months agovtls/rustls: simplify ciphersuite skipping
Daniel McCarney [Thu, 12 Sep 2024 16:31:59 +0000 (12:31 -0400)] 
vtls/rustls: simplify ciphersuite skipping

Now that the rustls vtls backend is using rustls 0.14 we can take
advantage of `rustls_supported_ciphersuite_protocol_version()` to skip
TLS 1.3 and TLS 1.2 ciphersuites as required without needing to
interrogate the ciphersuite names as `rustls_str`s.

Closes #14889

13 months agovtls/rustls: rustls-ffi 0.14.0 update
Daniel McCarney [Thu, 12 Sep 2024 16:18:26 +0000 (12:18 -0400)] 
vtls/rustls: rustls-ffi 0.14.0 update

* Documentation is updated to describe new required version, and to link
  to the upstream README about cryptography providers.
* GitHub workflow is updated to fetch 0.14.0.
* Breaking changes in`lib/vtls/rustls.c` are addressed:
  * The `rustls_client_config_builder_build()` function now uses an out
    parameter for the built config instead of returning it directly.
    This allows the building process to fail if the default crypto
    provider state isn't appropriate, or another error condition occurs.
  * Default ciphersuites are collected using renamed functions named to
    make it clear the ciphersuites are associated with the default
    crypto provider.
  * Customization of ciphersuites is now done via
    a `rustls_crypto_provider_builder` used to instantiate a
    `rustls_crypto_provider`. The customized provider can then can be
    used with `rustls_client_config_builder_new_custom` in place of
    providing ciphersuites directly.
  * `rustls_connection_get_negotiated_ciphersuite()` now returns the
    ciphersuite ID directly.

Closes #14889

13 months agovtls/rustls: differentiate error messages
Daniel McCarney [Tue, 6 Aug 2024 17:49:03 +0000 (13:49 -0400)] 
vtls/rustls: differentiate error messages

It's easier to diagnose a problem when there is one place where the
error message can be emitted. For that reason this commit updates two
errors that were shared between other fallible operations to use unique
messages.

Closes #14889

13 months agovtls/rustls: simplify builder cleanup
Daniel McCarney [Fri, 19 Jul 2024 16:23:18 +0000 (12:23 -0400)] 
vtls/rustls: simplify builder cleanup

Don't build `config_builder` just to free the resulting config, free the
builder directly.

When `cr_init_backend` encounters an error condition setting up the
Rustls client configuration it must do something with the
`config_builder` that was constructed earlier to avoid a memory leak.

The previous implementation preferred to use a pattern of building the
builder (thus consuming it) and then freeing the built config (to avoid
a memory leak). However, the purpose/intent is clearer when we just free
the builder directly instead of building it and freeing the result.

Closes #14889

13 months agorequest: correctly reset the eos_sent flag
Stefan Eissing [Fri, 13 Sep 2024 07:58:16 +0000 (09:58 +0200)] 
request: correctly reset the eos_sent flag

Add test cases

Bug: https://marc.info/?l=git&m=172620452502747&w=2
Reported-by: Patrick Steinhardt
Closes #14895

13 months agotests: tweak lock file handling and timers
Stefan Eissing [Mon, 9 Sep 2024 11:52:44 +0000 (13:52 +0200)] 
tests: tweak lock file handling and timers

- when server are killed by a test case, do not wait for the server lock
  file to go away. These tests are mostly about client timeouts and the
  server will hang until killed.
- when killing a server successfully, check for a remaining lock file,
  log its existence and remove it.
- lower the delay timings on SLOWDOWN by half
- add SLOWDOWNDATA server command to only slow down the FTP data bytes,
  not the control ones.
- lower some timeout values

Closes #14835

13 months agoRELEASE-NOTES: synced
Daniel Stenberg [Thu, 12 Sep 2024 18:31:41 +0000 (20:31 +0200)] 
RELEASE-NOTES: synced

13 months agoautotools: fix `--with-ca-embed` build rule
Viktor Szakats [Thu, 12 Sep 2024 13:08:05 +0000 (15:08 +0200)] 
autotools: fix `--with-ca-embed` build rule

Add missing rule dependency on the user-specified CA bundle. This fixes
including it when using the curl distro tarball, and other cases.

Also:
- fix the internal name of the CA bundle to avoid nested quotes.
  It broke broke the rule dependency for the make tool.
- exclude the generated (empty) `tool_ca_embed.c` file from the distro
  tarball.
Patch-by: Daniel Stenberg
Follow-up to 8a3740bc8e558b9a9d4a652b74cf27a0961d7010 #14059
Reported-by: rampageX on github
Fixes #14879
Closes #14882

13 months agosetopt: remove superfluous use of ternary expressions
Gabriel Marin [Thu, 12 Sep 2024 13:44:23 +0000 (16:44 +0300)] 
setopt: remove superfluous use of ternary expressions

Closes #14884

13 months agoCURLMOPT_TIMERFUNCTION.m: emphasize that only a single timer should run
Daniel Stenberg [Thu, 12 Sep 2024 15:35:58 +0000 (17:35 +0200)] 
CURLMOPT_TIMERFUNCTION.m: emphasize that only a single timer should run

Closes #14886

13 months agovtls: fix `Curl_ssl_conn_config_match` doc param
Daniel McCarney [Mon, 9 Sep 2024 18:47:09 +0000 (14:47 -0400)] 
vtls: fix `Curl_ssl_conn_config_match` doc param

The configuration data compared to `candidate` comes from `data`, not
`conn`. This commit fixes the docstring to reflect this.

Closes #14887

13 months agohttp2: when uploading data from stdin, fix eos forwarding
Stefan Eissing [Thu, 12 Sep 2024 08:03:33 +0000 (10:03 +0200)] 
http2: when uploading data from stdin, fix eos forwarding

When uploading data from stdin ('-T -'), and the EOS was only detected
on a 0-length read, the EOS was not forwarded to the filters. This led
HTTP/2 to hang on not forwarding this to the server.

Added test_07_14 to reproduce and verify.

Fixes #14870
Reported-by: nekopsykose on github
Closes #14877

13 months agocmake: ensure `CURL_USE_OPENSSL`/`USE_OPENSSL_QUIC` are set in sync
Viktor Szakats [Wed, 11 Sep 2024 21:42:43 +0000 (23:42 +0200)] 
cmake: ensure `CURL_USE_OPENSSL`/`USE_OPENSSL_QUIC` are set in sync

OpenSSL must be selected (manually or by default) and detected for
`USE_OPENSSL_QUIC=ON` to work. This was documented before this patch,
but with CMake it was possible to use `USE_OPENSSL_QUIC=ON` without
an explicit or default `CURL_USE_OPENSSL=ON`, leading to a confused
internal state.

Fix by checking the QUIC condition early, showing a warning if enabled
without OpenSSL, and ignoring QUIC in such case.

Also: Fix casing of OpenSSL in option description.

Ref: #14866
Closes #14872

13 months agoGHA/macOS: add an -e test
Daniel Stenberg [Thu, 12 Sep 2024 07:19:15 +0000 (09:19 +0200)] 
GHA/macOS: add an -e test

Adds -e to runtests for using the event-based API in the tool.

Closes #14876

13 months agotest537: cap the rlimit max this test runs
Stefan Eissing [Wed, 11 Sep 2024 10:10:10 +0000 (12:10 +0200)] 
test537: cap the rlimit max this test runs

Modern debian reports a soft limit of 134217724 which makes this test
run for minutes to allocate all file descriptors. Impose a cap of 256k,
so we do not run this tests on systems with larger rlimits.

Closes #14857

13 months agoQUIC: on connect, keep on trying on draining server
Stefan Eissing [Wed, 11 Sep 2024 11:53:44 +0000 (13:53 +0200)] 
QUIC: on connect, keep on trying on draining server

Do not give up connect on servers that are in draining state. This might
indicate the QUIC server restarting and the UDP packet routing still
hitting the instance shutting down.

Instead keep on connecting until the overall TIMEOUT fires.

Closes #14863

13 months agorustls: fixed minor logic bug in default cipher selection
Jan Venekamp [Mon, 9 Sep 2024 22:10:37 +0000 (00:10 +0200)] 
rustls: fixed minor logic bug in default cipher selection

Follow-up to 1e03d4b

Closes #14840

13 months agolib: fix AF_INET6 use outside of USE_IPV6
Harry Sintonen [Wed, 11 Sep 2024 10:10:44 +0000 (13:10 +0300)] 
lib: fix AF_INET6 use outside of USE_IPV6

Closes #14858

13 months agomulti: check that the multi handle is valid in curl_multi_assign
Daniel Stenberg [Wed, 11 Sep 2024 12:12:41 +0000 (14:12 +0200)] 
multi: check that the multi handle is valid in curl_multi_assign

By requiring that the multi handle is fine, it can detect bad usage
better and by that avoid crashes. Like in the #14860 case, which is an
application calling curl_multi_assign() with a NULL pointer multi
handle.

Reported-by: Carlo Cabrera
Fixes #14860
Closes #14862

13 months agoRELEASE-NOTES: synced
Daniel Stenberg [Wed, 11 Sep 2024 06:20:09 +0000 (08:20 +0200)] 
RELEASE-NOTES: synced

Bumped to 8.10.1 for now

13 months agoruntests: accecpt 'quictls' as OpenSSL compatible
Daniel Stenberg [Tue, 10 Sep 2024 12:46:40 +0000 (14:46 +0200)] 
runtests: accecpt 'quictls' as OpenSSL compatible

And set the "OpenSSL" feature.

Follow-up to 86d4a4124e275f355320d

Closes #14850

13 months agolibcurl-docs: CURLINFO_LOCAL_* work for QUIC as well as TCP
Daniel Stenberg [Tue, 10 Sep 2024 14:27:53 +0000 (16:27 +0200)] 
libcurl-docs: CURLINFO_LOCAL_* work for QUIC as well as TCP

Also, CURLOPT_TCP_FASTOPEN is for TCP only.

Closes #14852

13 months agoRELEASE-NOTES: synced curl-8_10_0
Daniel Stenberg [Wed, 11 Sep 2024 05:36:22 +0000 (07:36 +0200)] 
RELEASE-NOTES: synced

13 months agoTHANKS: contributors from 8.10.0
Daniel Stenberg [Wed, 11 Sep 2024 05:36:22 +0000 (07:36 +0200)] 
THANKS: contributors from 8.10.0

13 months agoGHA/windows: raise test run timeouts
Viktor Szakats [Tue, 10 Sep 2024 13:11:40 +0000 (15:11 +0200)] 
GHA/windows: raise test run timeouts

Give more time for recently enabled TLS tests to complete.

Follow-up to bc72a78a11764558639131d51fa8e7c81ee1e113 #14488
Ref: #14849
Closes #14851

13 months agoCURLOPT_COOKIE.md: tiny language edit
Daniel Stenberg [Tue, 10 Sep 2024 12:22:10 +0000 (14:22 +0200)] 
CURLOPT_COOKIE.md: tiny language edit

13 months agoNTLM_WB: delete remains in tests, docs updates
Viktor Szakats [Mon, 9 Sep 2024 09:10:19 +0000 (11:10 +0200)] 
NTLM_WB: delete remains in tests, docs updates

Also update more docs to reflect the removal of NTLM_WB.

Follow-up to 50def7c881ba560ab6e0235990e8f07fa69f4bc8 #13249
Closes #14832

13 months agocd2nroff: only require "added-in" for source "libcurl"
Daniel Stenberg [Tue, 10 Sep 2024 08:21:08 +0000 (10:21 +0200)] 
cd2nroff: only require "added-in" for source "libcurl"

To allow this script to be used by trurl easier.

Closes #14844

13 months agoCURLOPT_*-docs: provide additional details
Daniel Stenberg [Tue, 10 Sep 2024 09:37:27 +0000 (11:37 +0200)] 
CURLOPT_*-docs: provide additional details

Went through CURLOPTTYPE_STRINGPOINT and CURLOPTTYPE_SLISTPOINT options
and clarified:

- what happens when setting the option *again*

- setting to NULL disables/restores to default

- libcurl does not copy the slist for options using a such

Closes #14846

13 months agotests: ignore the tests/buildinfo.txt file generated
Stefan Eissing [Tue, 10 Sep 2024 11:26:53 +0000 (13:26 +0200)] 
tests: ignore the tests/buildinfo.txt file generated

Closes #14847

13 months agoCURLOPT_COOKIE.md: this cookie gets appended to the others
Daniel Stenberg [Mon, 9 Sep 2024 21:48:19 +0000 (23:48 +0200)] 
CURLOPT_COOKIE.md: this cookie gets appended to the others

... so it adds the risk of making the header too long. Clarify this
better.

Also: remove the PSL mention from here since it is not really relevant
for this option as this option is for specific *outgoing* cookies only.

Reported-by: Hiroki Kurosawa
Closes #14839

13 months agoGHA/linux-old: add an autoconf/automake build
Dan Fandrich [Fri, 6 Sep 2024 17:29:58 +0000 (10:29 -0700)] 
GHA/linux-old: add an autoconf/automake build

This verifies that using older autotools still works. The results of the
autoconf build should end up being identical to the second of the two
cmake builds (the difference in the platform string notwithstanding).

Closes #14816

13 months agoserver/getpart: delete unused code
Viktor Szakats [Sun, 8 Sep 2024 18:28:59 +0000 (20:28 +0200)] 
server/getpart: delete unused code

Follow-up to 2610142139d14265ed9acf9ed83cdf73d6bb4d05 #8378
Closes #14829

13 months agolib: enable strerror and strncpy checksrc warnings in subdirs
Daniel Stenberg [Mon, 9 Sep 2024 11:49:53 +0000 (13:49 +0200)] 
lib: enable strerror and strncpy checksrc warnings in subdirs

Closes #14834

13 months agocontent_encoding: avoid getting all encodings unless necessary
Daniel Stenberg [Mon, 9 Sep 2024 07:15:56 +0000 (09:15 +0200)] 
content_encoding: avoid getting all encodings unless necessary

The error_do_write() function may very well return witout needing the
listing of all encoding types so postpone that call until it is needed.

Closes #14831

13 months agounit1398: test maximum input parameters/output segments
Daniel Stenberg [Mon, 9 Sep 2024 11:16:13 +0000 (13:16 +0200)] 
unit1398: test maximum input parameters/output segments

...for the mprintf() code

Closes #14833

13 months agochecksrc: add STRNCPY as an opt-in rule to detect and error on strncpy
Daniel Stenberg [Mon, 9 Sep 2024 08:15:49 +0000 (10:15 +0200)] 
checksrc: add STRNCPY as an opt-in rule to detect and error on strncpy

make "lib/.checksrc" enable it

Closes #14830

13 months agolib: remove the final strncpy() calls
Daniel Stenberg [Mon, 9 Sep 2024 07:09:46 +0000 (09:09 +0200)] 
lib: remove the final strncpy() calls

wolfssl: use strcpy() as the target buffer is > 40 bytes

gethostname: return failure if the buffer is too small instead

Closes #14830

13 months agoasyn-thread: stop using GetAddrInfoExW on Windows
Jay Satiro [Thu, 5 Sep 2024 06:18:25 +0000 (02:18 -0400)] 
asyn-thread: stop using GetAddrInfoExW on Windows

- For the threaded resolver backend on Windows, revert back to
  exclusively use the threaded resolver with libcurl-owned threading
  instead of GetAddrInfoExW with Windows-owned threading.

Winsock (the Windows sockets library) has a bug where it does not wait
for all of the name resolver threads it is managing to terminate before
returning from WSACleanup. The threads continue to run and may cause a
crash.

This commit is effectively a revert of several commits that encompass
all GetAddrInfoExW code in libcurl. A manual review of merge conflicts
was used to resolve minor changes that had modified the code for
aesthetic or build reasons in other commits.

Prior to this change if libcurl was built with the threaded resolver
backend for Windows, and Windows 8 or later was the operating system at
runtime, and the caller was not impersonating another user, then libcurl
would use GetAddrInfoExW to handle asynchronous name lookups.

GetAddrInfoExW support was added in a6bbc87f, which preceded 8.6.0, and
prior to that the threaded resolver backend used libcurl-owned threading
exclusively on Windows.

Reported-by: Ionuț-Francisc Oancea
Reported-by: Razvan Pricope
Ref: https://developercommunity.visualstudio.com/t/ASAN:-heap-use-after-free-in-NdrFullPoin/10654169

Fixes https://github.com/curl/curl/issues/13509#issuecomment-2225338110
Closes https://github.com/curl/curl/pull/14794

---

Revert "asyn-thread: avoid using GetAddrInfoExW with impersonation"

This reverts commit 0caadc1f24d20514eed2bf6e5ef0adc140f122c3.

Conflicts:
lib/system_win32.c

--

Revert "asyn-thread: fix curl_global_cleanup crash in Windows"

This reverts commit 428579f5d136fd473e97fe089c42ffee55b72a8f.

--

Revert "system_win32: fix a function pointer assignment warning"

This reverts commit 26f002e02ef1142a432c8dc087bd27de71ce38bf.

--

Revert "asyn-thread: use GetAddrInfoExW on >= Windows 8"

This reverts commit a6bbc87f9e9ffb46a1801dfb983e7534825ed56b.

Conflicts:
lib/asyn-thread.c
lib/system_win32.c

--

14 months agodoh: remove redundant checks
Daniel Stenberg [Sat, 7 Sep 2024 14:10:23 +0000 (16:10 +0200)] 
doh: remove redundant checks

Pointed out by CodeSonar

Closes #14823

14 months agomaketgz: fix RELEASE-TOOLS.md for daily tarballs
Dan Fandrich [Sat, 7 Sep 2024 01:17:19 +0000 (18:17 -0700)] 
maketgz: fix RELEASE-TOOLS.md for daily tarballs

The daily snapshots have no associated git tag, so provide a commit hash
instead in these cases. Fix the dpkg detection since the shell would
exit immediately without showing an error message if it weren't found.

Closes #14820

14 months agoMakefile.mk: update to use Markdown sources for manual
Viktor Szakats [Fri, 6 Sep 2024 09:36:46 +0000 (11:36 +0200)] 
Makefile.mk: update to use Markdown sources for manual

Closes #14813

14 months agoautotools: fix MS-DOS builds
Viktor Szakats [Fri, 6 Sep 2024 13:14:26 +0000 (15:14 +0200)] 
autotools: fix MS-DOS builds

- disable threaded resolver by default.
- fix forming WATT path. Requires `WATT_PATH` env.

Closes #14814

14 months agobuild: drop unused `NROFF` reference
Viktor Szakats [Fri, 6 Sep 2024 09:02:22 +0000 (11:02 +0200)] 
build: drop unused `NROFF` reference

Closes #14812

14 months agoMakefile.dist: fix `ca-firefox` target
Viktor Szakats [Fri, 6 Sep 2024 00:10:35 +0000 (02:10 +0200)] 
Makefile.dist: fix `ca-firefox` target

Follow-up to 8e22fc68e7dda43e9f0b6857b1057d0e9131a4b2 #8625

Closes #14804

14 months agocmake: fix to show features/protocols with `CURL_DISABLE_INSTALL=ON`
Viktor Szakats [Thu, 5 Sep 2024 23:42:47 +0000 (01:42 +0200)] 
cmake: fix to show features/protocols with `CURL_DISABLE_INSTALL=ON`

Follow-up to aace27b0965c10394544d1dacc9c2cb2fe0de3d3 #12287

Closes #14803

14 months agobuild: generate `buildinfo.txt` for test logs
Viktor Szakats [Thu, 5 Sep 2024 21:23:47 +0000 (23:23 +0200)] 
build: generate `buildinfo.txt` for test logs

Also:
- read `buildinfo.txt` from `runtests.pl` and dump it to the log.
- cmake: show `CROSS` target flag for cross-builds.
- cmake: add logic to detect arguments passed via the command-line.

It is meant to help filling out missing datapoints in the testclutch
matrix.

Closes #14802

14 months agoCI: update names of jobs that are now building tests [ci skip]
Viktor Szakats [Fri, 6 Sep 2024 15:14:26 +0000 (17:14 +0200)] 
CI: update names of jobs that are now building tests [ci skip]

Follow-up to d620ec67913b2c4be25e7d72f1933f0a8a3e0a2e #14700

14 months ago.dcignore: remove
Daniel Stenberg [Fri, 6 Sep 2024 08:58:47 +0000 (10:58 +0200)] 
.dcignore: remove

This was a config file for deepcode.ai, a static code analyzer that we
have not used for ages.

Closes #14811

14 months agopop3: fix multi-line with LIST arg
Stefan Eissing [Fri, 6 Sep 2024 07:43:38 +0000 (09:43 +0200)] 
pop3: fix multi-line with LIST arg

The POP3 LIST command is not multi-line when having an argument. Fix the
definition to correct the behaviour.

Reported-by: ralfjunker on github
Fixes #14801
Closes #14808

14 months agodoh: cleanups
Stefan Eissing [Wed, 4 Sep 2024 11:36:01 +0000 (13:36 +0200)] 
doh: cleanups

Mostly cleanup on identifiers of DoH code.
Always use 'Curl_doh_cleanup()' for releasing resources.

More concise and telling names (ymmv):

* prefix all static functions with 'doh_' for unity builds
* doh_encode -> doh_req_encode
* doh_decode -> doh_resp_decode
* struct dohdata -> struct doh_probes
* probe's 'serverdoh' -> 'resp_body'
* probe's 'dohbuffer' -> 'req_body'
* probe's 'headers' -> 'req_hds'
* 'dohprobe()' -> doh_run_probe()'
* 'DOH_PROBE_SLOTS' -> 'DOH_SLOT_COUNT'
* 'DOH_PROBE_SLOT_IPADDR_V4' -> 'DOH_SLOT_IPV4'
* 'DOH_PROBE_SLOT_IPADDR_V6' -> 'DOH_SLOT_IPV6'
* 'DOH_PROBE_SLOT_HTTPS' -> 'DOH_SLOT_HTTPS_RR'

Closes #14783

14 months agofirefox-db2pem: mention what "certutil" the script uses
Daniel Stenberg [Fri, 6 Sep 2024 06:28:42 +0000 (08:28 +0200)] 
firefox-db2pem: mention what "certutil" the script uses

... and the Debian package that provides it.

Closes #14806

14 months agoscripts/delta: output bugfixes/day
Daniel Stenberg [Fri, 6 Sep 2024 06:47:06 +0000 (08:47 +0200)] 
scripts/delta: output bugfixes/day

14 months agoRELEASE-NOTES: synced
Daniel Stenberg [Fri, 6 Sep 2024 06:42:32 +0000 (08:42 +0200)] 
RELEASE-NOTES: synced

14 months agoGHA/distcheck: keep upload artifacts for one day only
Daniel Stenberg [Thu, 5 Sep 2024 13:58:45 +0000 (15:58 +0200)] 
GHA/distcheck: keep upload artifacts for one day only

The uploads are only used as a cache mechanism between jobs to save them
from having to re-run maketgz multiple times, so there is no need to
save the artifact longer than this.

Closes #14793

14 months agoCURLMOPT_SOCKETFUNCTION.md: expand on the easy argument
Daniel Stenberg [Thu, 5 Sep 2024 14:17:50 +0000 (16:17 +0200)] 
CURLMOPT_SOCKETFUNCTION.md: expand on the easy argument

Since recent changes makes it more likely to be an internal handle that
shows up and some users have been surprised by this.

Ref: #14792
Closes #14795

14 months agomaketgz: move from / into scripts
Daniel Stenberg [Thu, 5 Sep 2024 14:31:38 +0000 (16:31 +0200)] 
maketgz: move from / into scripts

Closes #14797

14 months agolibcurl.def: move from / into lib
Daniel Stenberg [Thu, 5 Sep 2024 14:24:08 +0000 (16:24 +0200)] 
libcurl.def: move from / into lib

It is meant for the library, it belongs in lib/

Closes #14796

14 months agosystem_win32: fix typo
Jay Satiro [Thu, 5 Sep 2024 06:30:07 +0000 (02:30 -0400)] 
system_win32: fix typo

14 months agoGHA/distcheck:: bump actions/upload-artifact from 4.3.6 to 4.4.0
dependabot[bot] [Mon, 2 Sep 2024 14:08:33 +0000 (14:08 +0000)] 
GHA/distcheck:: bump actions/upload-artifact from 4.3.6 to 4.4.0

Bumps [actions/upload-artifact](https://github.com/actions/upload-artifact) from 4.3.6 to 4.4.0.
- [Release notes](https://github.com/actions/upload-artifact/releases)
- [Commits](https://github.com/actions/upload-artifact/compare/834a144ee995460fba8ed112a2fc961b36a5ec5a...50769540e7f4bd5e21e526ee35c689e35e0d6874)

---
updated-dependencies:
- dependency-name: actions/upload-artifact
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Closes #14759

14 months agoDockerfile: Update debian:bookworm-slim Docker digest to 903d322
renovate[bot] [Wed, 4 Sep 2024 22:57:14 +0000 (22:57 +0000)] 
Dockerfile: Update debian:bookworm-slim Docker digest to 903d322

Closes #14788

14 months agollist: only provide Curl_llist_tail in unit test builds
Daniel Stenberg [Thu, 5 Sep 2024 09:45:21 +0000 (11:45 +0200)] 
llist: only provide Curl_llist_tail in unit test builds

... since it is not used otherwsie. Also fix Curl_node_prev to have the
same status.

Closes #14790

14 months agoGHA/linux-old: split test step into build and run
Viktor Szakats [Thu, 5 Sep 2024 10:05:02 +0000 (12:05 +0200)] 
GHA/linux-old: split test step into build and run

To see how much time each takes.

Closes #14791

14 months agocf-socket: fix listen pollset for FTP active mode
Stefan Eissing [Wed, 4 Sep 2024 14:06:16 +0000 (16:06 +0200)] 
cf-socket: fix listen pollset for FTP active mode

Follow-up to a07ba37b5e88a89bf4bcc6b0c927f7a42d7ea4f2 which did not
solve the issue of corrent polling for FTP active data connections.

Added test cases for active up-/download.

Closes #14786

14 months agosmb: convert superflous assign into assert
Daniel Stenberg [Wed, 4 Sep 2024 12:22:23 +0000 (14:22 +0200)] 
smb: convert superflous assign into assert

Since the value is already supposed to be correct, verify that with and
assert instead of doing an assign that is not needed.

Bonus: remove unnecessary clearing of data

Closes #14784

14 months agoschannel: avoid malloc for CAinfo_blob_digest
Daniel Stenberg [Wed, 4 Sep 2024 08:07:08 +0000 (10:07 +0200)] 
schannel: avoid malloc for CAinfo_blob_digest

...it can just as well be part of the struct always.

Closes #14777

14 months agosrc: namespace symbols clashing with lib
Viktor Szakats [Tue, 3 Sep 2024 19:22:04 +0000 (21:22 +0200)] 
src: namespace symbols clashing with lib

Before this patch `lib/http.h` and `src/tool_sdecls.h` both declared
`HTTPREQ_*` enums.

Rename `src` ones to have distinct names.

They are not included in the same code for now, but this may change when
bundling unit/libtests into single programs.

Closes #14785

14 months agoKNOWN_BUGS: cleanup
Daniel Stenberg [Wed, 4 Sep 2024 07:43:46 +0000 (09:43 +0200)] 
KNOWN_BUGS: cleanup

- Move all Windows unicode issues into the single "bug", as they are all
  at least semi-related

- Removed ancient issues that are not relevant anymore

Closes #14775

14 months agoopenssl: certinfo errors now fail correctly
Daniel Stenberg [Wed, 4 Sep 2024 09:11:06 +0000 (11:11 +0200)] 
openssl: certinfo errors now fail correctly

If there is a (memory) error when creating the certinfo data, the code
would previously continue which could lead to a partial/broken response.
Now, the first error aborts and cleans up the entire thing.

A certinfo "collection" error is however still not considered an error
big enough to stop the handshake.

Bonus 1: made two functions static (and removed the Curl_ prefix) that
were not used outside of openssl.c

Bonus 2: removed the unused function Curl_ossl_set_client_cert

Closes #14780

14 months agolib: make SSPI global symbols use Curl_ prefix
Daniel Stenberg [Wed, 4 Sep 2024 08:24:23 +0000 (10:24 +0200)] 
lib: make SSPI global symbols use Curl_ prefix

Do not pollute the namespace.

Closes #14776

14 months agocmake: restore variable names `CURL_CA_BUNDLE_SET`/`CURL_CA_PATH_SET`
Viktor Szakats [Wed, 4 Sep 2024 08:54:36 +0000 (10:54 +0200)] 
cmake: restore variable names `CURL_CA_BUNDLE_SET`/`CURL_CA_PATH_SET`

They were renamed recently as internal variables, but they are both
cached, so let's keep the original names for consistency and
compatibility.

Partial revert of c2889a7b4180fc963ae30811f59ab547b6eb03cd #14388
Tested via #14778

14 months agodocs: document the (weak) random value situation in rustls builds
Daniel Stenberg [Tue, 3 Sep 2024 14:09:40 +0000 (16:09 +0200)] 
docs: document the (weak) random value situation in rustls builds

Closes #14770

14 months agoRELEASE-NOTES: synced
Daniel Stenberg [Tue, 3 Sep 2024 14:43:30 +0000 (16:43 +0200)] 
RELEASE-NOTES: synced

14 months agocf-socket: fix pollset for listening
Stefan Eissing [Tue, 3 Sep 2024 07:54:59 +0000 (09:54 +0200)] 
cf-socket: fix pollset for listening

When FTP does an active data connection, the socket connection
filter is instantiated with a listening socket. When the filter
adjusts its pollset, it needs to POLLIN, not OUT.

Bug: https://curl.se/mail/lib-2024-08/0023.html
Reported-by: Yoshimasa Ohno
Closes #14766

14 months agoconnect: always prefer ipv6 in IP eyeballing
Stefan Eissing [Tue, 3 Sep 2024 12:30:32 +0000 (14:30 +0200)] 
connect: always prefer ipv6 in IP eyeballing

Always try ipv6 addresses first, ipv4 second after a delay.

If neither ipv4/6 are amongst the supplied addresses, start a happy
eyeballer for the first address family present. This is for AF_UNIX
connects.

Fixes #14761
Reported-by: janedenone on hackerone
Closes #14768

14 months agoKNOWN_BUGS: CURLOPT_CONNECT_TO does not work for HTTPS proxy
Daniel Stenberg [Tue, 3 Sep 2024 12:32:48 +0000 (14:32 +0200)] 
KNOWN_BUGS: CURLOPT_CONNECT_TO does not work for HTTPS proxy

Closes #14481
Closes #14769

14 months agolib: use FMT_ as prefix instead of CURL_FORMAT_ 14764/head
Daniel Stenberg [Mon, 2 Sep 2024 22:04:23 +0000 (00:04 +0200)] 
lib: use FMT_ as prefix instead of CURL_FORMAT_

For printf format defines used internally. Makes the code slighly
easier to read.

Closes #14764

14 months agoopenssl: fix the data race when sharing an SSL session between threads
Aki [Sat, 31 Aug 2024 03:48:18 +0000 (11:48 +0800)] 
openssl: fix the data race when sharing an SSL session between threads

The SSL_Session object is mutated during connection inside openssl,
and it might not be thread-safe. Besides, according to documentation
of openssl:

```
SSL_SESSION objects keep internal link information about the session
cache list, when being inserted into one SSL_CTX object's session
cache. One SSL_SESSION object, regardless of its reference count,
must therefore only be used with one SSL_CTX object (and the SSL
objects created from this SSL_CTX object).
```
If I understand correctly, it is not safe to share it even in a
single thread.

Instead, serialize the SSL_SESSION before adding it to the cache,
and deserialize it after retrieving it from the cache, so that no
concurrent write to the same object is infeasible.

Also
 - add a ci test for thread sanitizer
 - add a test for sharing ssl sessions concurrently
 - avoid redefining memory functions when not building libcurl, but
   including the soruce in libtest
 - increase the concurrent connections limit in sws

Notice that there are fix for a global data race for openssl which
is not yet release. The fix is cherry pick for the ci test with
thread sanitizer.
https://github.com/openssl/openssl/commit/d8def79838cd0d5e7c21d217aa26edb5229f0ab4

Closes #14751

14 months agohaproxy: send though next filter
Stefan Eissing [Mon, 2 Sep 2024 11:29:54 +0000 (13:29 +0200)] 
haproxy: send though next filter

Small but, instead of sending the initial data though the connection
method, send it to the next filter in the chain. While the connection
methods accomodates for such use, by ignoring unconnected filters, it is
better to follow the filter chain explicitly.

Closes #14756

14 months agoprintf: fix mingw-w64 format checks
Viktor Szakats [Thu, 22 Aug 2024 08:54:42 +0000 (10:54 +0200)] 
printf: fix mingw-w64 format checks

Change mingw-w64 printf format checks in public curl headers to use
`__MINGW_PRINTF_FORMAT` instead of `gnu_printf`. This syncs the format
checker with format string macros published via `curl/system.h`. (Also
disable format checks for mingw-w64 older than 3.0.0 (2013-09-20) and
classic-mingw, which do not support this macro.)

This fixes bogus format checker `-Wformat` warnings in 3rd party code
using curl format strings with the curl printf functions, when using
mingw-w64 7.0.0 (2019-11-10) and older (with GCC, MSVCRT).

It also allows to delete two workaounds for this within curl itself:
- setting `-D__USE_MINGW_ANSI_STDIO=1` for mingw-w64 via cmake and
  configure for `docs/examples` and `tests/http/clients`.
  Ref: c730c8549b5b67e7668ca5d2cd82c3cc183e125d #14640

The format check macro is incompatible (depending on mingw-w64 version
and configuration) with the C99 `%z` (`size_t`) format string used
internally by curl.

To work around this problem, override the format check style in curl
public headers to use `gnu_printf`. This is compatible with `%z` in all
mingw-w64 versions and allows keeping the C99 format strings internally.

Also:
- lib/ws.c: add missing space to an error message.
- docs/examples/ftpgetinfo.c: fix to use standard printf.

Ref: #14643 (take 1)
Follow-up to 3829759bd042c03225ae862062560f568ba1a231 #12489

Closes #14703

14 months agocmake: default `CURL_DISABLE_LDAPS` to the value of `CURL_DISABLE_LDAP`
Viktor Szakats [Tue, 27 Aug 2024 16:54:59 +0000 (18:54 +0200)] 
cmake: default `CURL_DISABLE_LDAPS` to the value of `CURL_DISABLE_LDAP`

After this patch LDAPS is disabled by default when LDAP is manually
disabled.

This makes it unnecessary to disable them in sync manually just to avoid
a `CMakeLists.txt` warning.

Syncs behavior with `./configure`.

Closes #14758

14 months agorand: only provide weak random when needed
Daniel Stenberg [Sat, 31 Aug 2024 21:37:00 +0000 (23:37 +0200)] 
rand: only provide weak random when needed

builds without TLS and builds using rustls

Closes #14749

14 months agolib: remove use of RANDOM_FILE
Daniel Stenberg [Sat, 31 Aug 2024 21:07:12 +0000 (23:07 +0200)] 
lib: remove use of RANDOM_FILE

It could previously be set with configure/cmake and used in rare cases
for reading randomness: with ancient mbedTLS or rustls without
arc4random.

We now get randomness in this order:

1. The TLS library's way to provide random
2. On Windows: Curl_win32_random
3. if arc4random exists, use that
4. weak non-crytographically strong pseudo-random

Closes #14749

14 months agourl: fix connection reuse for HTTP/2 upgrades
Stefan Eissing [Fri, 30 Aug 2024 11:25:26 +0000 (13:25 +0200)] 
url: fix connection reuse for HTTP/2 upgrades

Normally, when a connection's filters have all connected, the
multiplex status is determined. However, HTTP/2 Upgrade:
requests will only do this when the first server response
has been received.

The current connection reuse mechanism does not accomodate
that and when the time between connect and response is large
enough, connection reuse may not happen as desired.

See test case 2405 failures, such as in
https://github.com/curl/curl/actions/runs/10629497461/job/29467166451

Add 'conn->bits.asks_multiplex' as indicator that a connection is
still being evaluated for mulitplexing, so that new transfers
may wait on this to be cleared.

Closes #14739

14 months agocurl_easy_handler.md: fix language
наб [Sun, 1 Sep 2024 02:10:02 +0000 (04:10 +0200)] 
curl_easy_handler.md: fix language

Applications need to [...] if it needs -> The application needs to

Closes #14752

14 months agocurl.h: make CURLOPT_WRITEINFO and CURLOPT_CLOSEPOLICY compile
Daniel Stenberg [Sat, 31 Aug 2024 15:24:01 +0000 (17:24 +0200)] 
curl.h: make CURLOPT_WRITEINFO and CURLOPT_CLOSEPOLICY compile

The symbols have not been in use for 17+ years and they did not do
anything for several years before that, but apparently there are still
code using them.

Follow-up to 3b057d4b7a7
Fixes #14747
Reported-by: Kai Pastor
Closes #14748

14 months agobuild: add options to disable SHA-512/256 hash algo
Viktor Szakats [Sun, 1 Sep 2024 14:25:49 +0000 (16:25 +0200)] 
build: add options to disable SHA-512/256 hash algo

Existing C macro lacked build-level counterparts.
Add them in this patch.

- cmake: `-DCURL_DISABLE_SHA512_256=ON`
- autotools: `--disable-sha512-256`

Also drop the checker exception from `test1165.pl`.

Follow-up to cbe41d151d6a100c1f045eaf37ff06b2b2a7b382 #12897
Closes #14753

14 months agotest1165: check if `curl_config.h.cmake` lists all `DISABLED` options
Viktor Szakats [Sun, 1 Sep 2024 14:55:53 +0000 (16:55 +0200)] 
test1165: check if `curl_config.h.cmake` lists all `DISABLED` options

Also fix issues:
- cmake: fix `CURL_DISABLE_HTTP_AUTH` option
- cmake: fix `CURL_DISABLE_SHUFFLE_DNS` option

Fixes:
```
Present in CMakeLists.txt, not propagated via curl_config.h.cmake: CURL_DISABLE_HTTP_AUTH
Present in CMakeLists.txt, not propagated via curl_config.h.cmake: CURL_DISABLE_SHUFFLE_DNS
```
Ref: https://github.com/curl/curl/actions/runs/10655027540/job/29532054141?pr=14754#step:11:2090

Closes #14754

14 months agoautotools: settle with option name: `--enable-windows-unicode`
Viktor Szakats [Sat, 31 Aug 2024 13:06:44 +0000 (15:06 +0200)] 
autotools: settle with option name: `--enable-windows-unicode`

Bring the option name style in sync with cmake and with other configure
options aiming to enable something unrelated to an optional package.

(I initially named this new option `--with-windows-unicode` within this
release cycle.)

Follow-up to 9e4a2187e763dd80a1296b07fd3e073f46c4dc8f #14478

Closes #14746

14 months agoconfigure: break indentation to fix `--help` output
Viktor Szakats [Sat, 31 Aug 2024 13:39:17 +0000 (15:39 +0200)] 
configure: break indentation to fix `--help` output

For recently added/updated options:
windows-unicode, winidn, apple-idn

It looks like the second `AS_HELP_STRING()` must start in the first
column, otherwise its indentation will appear in the `--help` output,
and break unalignment with the rest.

(There must be a better way to tackle this.)

14 months agocmake: sync `CURL_DISABLE_*` behaviour with autotools
Viktor Szakats [Fri, 30 Aug 2024 18:42:54 +0000 (20:42 +0200)] 
cmake: sync `CURL_DISABLE_*` behaviour with autotools

- disable RTSP, ALTSVC, HSTS when HTTP is disabled.
  (`./configure` warning deemed unnecessary and not replicated with
  cmake.)

- disable HSTS when there is no TLS backend.

Tested via #14744
Closes #14745

14 months agocmake: allow disabling `RANDOM_FILE`
Viktor Szakats [Fri, 30 Aug 2024 15:40:33 +0000 (17:40 +0200)] 
cmake: allow disabling `RANDOM_FILE`

`./configure` allows `--random-file=no`. Allow this with CMake too,
using `-DRANDOM_FILE=OFF` (other boolean values work too: no, false, 0,
case insensitive.)

Also disable `RANDOM_FILE` detection for Windows.

Closes #14743

14 months agobuild: add `poll()` detection for cross-builds
Viktor Szakats [Thu, 29 Aug 2024 23:04:18 +0000 (01:04 +0200)] 
build: add `poll()` detection for cross-builds

For cross-builds rely on `_POSIX_C_SOURCE` to decide if `poll()` is
supported, rather than just assuming it isn't.

This may still miss to detect `poll()` support, as seen for example with
Linux MUSL cross-builds.

Also:

- GHA/curl-for-win: enable RISC-V 64 cross-target for Linux MUSL.
  (to test this case with cmake, with a false-negative.)
  The first RISC-V 64 build in curl's CI.

- GHA/curl-for-win: add arm64/intel64 job for Linux glibc.
  (to test this case with cmake, and succeed.)

- cmake: delete unnecessary `#include <sys/time.h>` from non-cross-build
  `poll()` detection snippet.
  Follow-up tp cc8b8137659e1733fdd3810c19ff5ec8db438509 #14718

Fixes #14714
Closes #14734

14 months agoRELEASE-NOTES: synced
Daniel Stenberg [Fri, 30 Aug 2024 14:16:51 +0000 (16:16 +0200)] 
RELEASE-NOTES: synced

14 months agoPOP3: fix multi-line responses
Stefan Eissing [Wed, 28 Aug 2024 09:09:43 +0000 (11:09 +0200)] 
POP3: fix multi-line responses

Some POP3 commands are multi-line, e.g. have responses terminated by a
last line with '.', but some are not. Define the known command
properties and fix response handling.

Add test case for STAT.

Fixes #14677
Reported-by: ralfjunker on github
Closes #14707

14 months agollist: clear the list pointer when a node is removed
Stefan Eissing [Fri, 30 Aug 2024 09:54:14 +0000 (11:54 +0200)] 
llist: clear the list pointer when a node is removed

Closes #14738

14 months agocmdline-opts: language fix for expect100-timeout.md and max-time.md
Daniel Stenberg [Fri, 30 Aug 2024 09:03:38 +0000 (11:03 +0200)] 
cmdline-opts: language fix for expect100-timeout.md and max-time.md

needs to **be** provided

Also a http3.md spellfix

Follow-up from 22a6a0bc6b5ab935

Closes #14737

14 months agohttp3.md: mention how the fallback can be h1 or h2
Daniel Stenberg [Fri, 30 Aug 2024 07:04:15 +0000 (09:04 +0200)] 
http3.md: mention how the fallback can be h1 or h2

Closes #14736

14 months agomailmap: Aki Sakurai
Daniel Stenberg [Fri, 30 Aug 2024 08:28:34 +0000 (10:28 +0200)] 
mailmap: Aki Sakurai