]> git.ipfire.org Git - thirdparty/curl.git/log
thirdparty/curl.git
2 months agotests: mark ipfs tests to require ipfs bagder/tests-require-ipfs-for-ipfs 16948/head
Daniel Stenberg [Thu, 3 Apr 2025 17:34:33 +0000 (19:34 +0200)] 
tests: mark ipfs tests to require ipfs

Fixes #16947
Reported-by: Daniel Engberg
2 months agoGHA: update cloudflare/quiche to v0.23.5
renovate[bot] [Wed, 2 Apr 2025 02:03:30 +0000 (02:03 +0000)] 
GHA: update cloudflare/quiche to v0.23.5

Closes #16913

2 months agotests/README.md: document --test-duphandle
Daniel Stenberg [Thu, 3 Apr 2025 14:30:42 +0000 (16:30 +0200)] 
tests/README.md: document --test-duphandle

Follow-up to cbafcec50bc99ba0dd0490e6

Closes #16944

2 months agoasyn-thread: fix build without socketpair
Daniel Stenberg [Thu, 3 Apr 2025 14:47:41 +0000 (16:47 +0200)] 
asyn-thread: fix build without socketpair

Follow-up to 9b6148e9d95db54a752b03b571296c40d66e97fe

Closes #16945

2 months agoasync-threaded resolver: use ref counter
Stefan Eissing [Wed, 2 Apr 2025 10:25:21 +0000 (12:25 +0200)] 
async-threaded resolver: use ref counter

Allocate the data shared between a transfer and an aync resolver thread
separately and use a reference counter to determine its release.

Change `Curl_thread_destroy()` to clear the thread handle, so that the
thread is considered "gone" and we do not try to join (and fail to)
afterwards.

Retake of the revert in fb15a986c0d947ae6b9dd6

Closes #16916

2 months agodnscache: slight refactoring
Stefan Eissing [Thu, 3 Apr 2025 11:11:32 +0000 (13:11 +0200)] 
dnscache: slight refactoring

Slight refactoring around dnscache, e.g. hostcache

- eliminate `data->state.hostcache`. Always look up
  relevant dnscache at share/multi.
- unify naming to "dnscache", replacing "hostcache"
- use `struct Curl_dnscache`, even though it just
  contains a `Curl_hash` for now.
- add `Curl_dnscache_destroy()` for cleanup in
  share/multi.

Closes #16941

2 months agotests/README.md: list the openssl tool among the prerequisites
Daniel Stenberg [Thu, 3 Apr 2025 12:28:37 +0000 (14:28 +0200)] 
tests/README.md: list the openssl tool among the prerequisites

Used for test cert generation since 8.13.0

Closes #16942

2 months agoparsedate: provide Curl_wkday also for GnuTLS builds
Daniel Stenberg [Thu, 3 Apr 2025 13:39:44 +0000 (15:39 +0200)] 
parsedate: provide Curl_wkday also for GnuTLS builds

Otherwise --disable-dateparse + --with-gnutls builds might fail.

Found with randdisable

Closes #16943

2 months agogenserv.pl: fail with a message if `openssl` is missing or failing
Viktor Szakats [Wed, 2 Apr 2025 21:40:14 +0000 (23:40 +0200)] 
genserv.pl: fail with a message if `openssl` is missing or failing

Reported-by: Tomas Volf
Fixes #16926
Follow-up to 44341e736a3e2f7a2b25a774be3a9796e81abab9 #16824
Ref: #16928
Co-authored-by: Daniel Stenberg
Closes #16929

2 months agoconncache: make Curl_cpool_init return void
Daniel Stenberg [Thu, 3 Apr 2025 08:48:25 +0000 (10:48 +0200)] 
conncache: make Curl_cpool_init return void

Since it cannot fail, removing the return code simplifies the code paths
calling this function.

Closes #16936

2 months agohttp: fix a build error when all auths are disabled
Daniel Stenberg [Thu, 3 Apr 2025 10:10:45 +0000 (12:10 +0200)] 
http: fix a build error when all auths are disabled

error: â€˜result’ undeclared (first use in this function)

Found with randdisable

Closes #16939

2 months agohostip: fix build without threaded-resolver and without DoH
Daniel Stenberg [Thu, 3 Apr 2025 09:35:06 +0000 (11:35 +0200)] 
hostip: fix build without threaded-resolver and without DoH

Closes #16938

2 months agovtls: fix build with ssl but without http
Stefan Eissing [Thu, 3 Apr 2025 09:09:01 +0000 (11:09 +0200)] 
vtls: fix build with ssl but without http

Fixes #16935
Closes #16937

2 months agoif2ip: build the function also if FTP is present
Daniel Stenberg [Thu, 3 Apr 2025 07:26:01 +0000 (09:26 +0200)] 
if2ip: build the function also if FTP is present

Previously it was not compiled if CURL_DISABLE_BINDLOCAL is set, but the
FTP code is also using this function.

Easily found by using configure --disable-bindlocal without disabling
FTP.

Closes #16933

2 months agoconfigure: fix --disable-rt
Daniel Stenberg [Thu, 3 Apr 2025 08:12:53 +0000 (10:12 +0200)] 
configure: fix --disable-rt

This option now better only prevents the actual -lrt to be used, and
thus has no effect if the system does not need -lt for the monotonic
clock etc.

Fixes #16932
Closes #16934

2 months agocurl_krb5: only use functions if FTP is still enabled
Daniel Stenberg [Thu, 3 Apr 2025 06:49:20 +0000 (08:49 +0200)] 
curl_krb5: only use functions if FTP is still enabled

Reported-by: x1sc0 on github
Fixes #16925
Closes #16931

3 months agoVERSIONS: list all past releases
Daniel Stenberg [Tue, 1 Apr 2025 15:41:08 +0000 (17:41 +0200)] 
VERSIONS: list all past releases

This document now lists all previous releases.

This allows us to verify that documentation refers to actual release
versions.

Test 971 now verifies options-in-versions and all command line options
documentation individually. Fixed a few discrepancies.

Test 1488 verifies libcurl options "Added-in" to exist. Fixed a few
discrepancies there as well.

Closes #16907

3 months agohttp_negotiate: fix non-SSL build with GSSAPI
Andrew [Wed, 2 Apr 2025 12:45:21 +0000 (13:45 +0100)] 
http_negotiate: fix non-SSL build with GSSAPI

Fixes #16919
Closes #16921

3 months agoeventfd: fix feature guards
Viktor Szakats [Tue, 1 Apr 2025 21:32:16 +0000 (23:32 +0200)] 
eventfd: fix feature guards

Enable eventfd code consistently when both `HAVE_EVENTFD` and
`HAVE_SYS_EVENTFD_H` macros are defined.

Before this patch `HAVE_EVENTFD` guarded it alone, though the code
also required the header, which was guarded by `HAVE_SYS_EVENTFD_H`.

These should normally be detected in pairs. When they aren't, omit using
`eventfd()` to avoid calling it without a known matching header.

If this disables valid cases (e.g. some system declares this function
via a different header), feature detection and the code may be extended
for those cases. If these are known to come in pairs, always, another
option is detect them both at build stage, and forward a single macro
to C.

Reported-by: Abhinav Singhal
Bug: https://curl.se/mail/lib-2025-04/0000.html
Closes #16909

3 months agoconfigure: restore link checks
Viktor Szakats [Wed, 2 Apr 2025 10:24:43 +0000 (12:24 +0200)] 
configure: restore link checks

The omitted link checks were not what I though they were. Omitting one
caused a mis-detection on Solaris, where the compile check alone
mis-detects `CloseSocket` as present.

Restore link checks for these functions:
`closesocket`, `ioctlsocket`, `socket`, `freeaddrinfo`, `getaddrinfo`,
`gethostname`, `getpeername`, `getsockname`,
`CloseSocket` (AmigaOS), `IoctlSocket` (AmigaOS).

Also re-sync link check code snippets with the ones in current master.

Partial revert of, regression from bd9f9b085aa242a5e93be0b2da96ce498d7813c4 #16377
Reported-by: Dagobert Michelsen
Bug: https://curl.se/mail/lib-2025-04/0004.html
Fixes #16915
Closes #16917

3 months agoINSTALL-CMAKE.md: fix typo
Jay Satiro [Wed, 2 Apr 2025 21:45:57 +0000 (17:45 -0400)] 
INSTALL-CMAKE.md: fix typo

3 months agoRELEASE-NOTES: synced
Daniel Stenberg [Wed, 2 Apr 2025 20:51:06 +0000 (22:51 +0200)] 
RELEASE-NOTES: synced

and bump to 8.13.1 for now

3 months agotests/serverhelp: remove last remnants of http-pipe server
Yedaya Katsman [Wed, 2 Apr 2025 13:59:42 +0000 (16:59 +0300)] 
tests/serverhelp: remove last remnants of http-pipe server

Followup on https://github.com/curl/curl/pull/5921

Closes #16924

3 months agolib1960: revert the use of libcurl's inet_pton
Daniel Stenberg [Mon, 31 Mar 2025 21:47:23 +0000 (23:47 +0200)] 
lib1960: revert the use of libcurl's inet_pton

Since it now uses hex conversion code from strparse as well.

Closes #16888

3 months agolib: unify conversions to/from hex
Daniel Stenberg [Mon, 31 Mar 2025 21:12:09 +0000 (23:12 +0200)] 
lib: unify conversions to/from hex

Curl_hexbyte - output a byte as a two-digit ASCII hex number

Curl_hexval - convert an ASCII hex digit to its binary value

... instead of duplicating similar code and hexdigit strings in numerous
places.

Closes #16888

3 months agotest: make unittest 1308 into a libtest
Daniel Stenberg [Tue, 1 Apr 2025 07:18:33 +0000 (09:18 +0200)] 
test: make unittest 1308 into a libtest

Test 1308 was wrongly marked a unit test when in reality it is a
libtest.

Closes #16891

3 months agoprocesshelp.pm: avoid potential endless loop, log more (Windows)
Viktor Szakats [Tue, 1 Apr 2025 20:46:19 +0000 (22:46 +0200)] 
processhelp.pm: avoid potential endless loop, log more (Windows)

`pidwait()` is a function to wait for a PID to disappear from the list
of processes. On Windows change this function to:

- reduce the frequency of calling the external command `tasklist` to
  query the list of processes, including Windows-native ones, to 0.2s
  (from 0.01s).

- print a message when the wait exceeds 5 second marks.

- give up after 20 seconds of total wait, and print a message.

Also log `taskkill` commands to stdout instead of the log.

To potentially avoid hangs seen in CI, and make these spots more
transparent through the log.

Ref: #16840
Ref: #14854

Closes #16908

3 months agocontrithanks.sh: drop set -e
Daniel Stenberg [Wed, 2 Apr 2025 07:41:49 +0000 (09:41 +0200)] 
contrithanks.sh: drop set -e

Makes the script work again

Closes #16914

3 months agoRELEASE-NOTES: synced curl-8_13_0
Daniel Stenberg [Wed, 2 Apr 2025 05:46:30 +0000 (07:46 +0200)] 
RELEASE-NOTES: synced

3 months agoTHANKS: new contributors from 8.13.0 release
Daniel Stenberg [Wed, 2 Apr 2025 05:46:30 +0000 (07:46 +0200)] 
THANKS: new contributors from 8.13.0 release

3 months agoGHA/windows: move libssh job from vcpkg to MSYS2
Viktor Szakats [Tue, 1 Apr 2025 22:04:56 +0000 (00:04 +0200)] 
GHA/windows: move libssh job from vcpkg to MSYS2

To avoid upstream issue where libssh no longer builds with vcpkg:
```
error: building libssh:x64-windows failed with: BUILD_FAILED
```
Ref: https://github.com/curl/curl/actions/runs/14206672441/job/39805869213?pr=16909#step:5:64

Bug: https://github.com/curl/curl/pull/16909#issuecomment-2770792320

Closes #16910

3 months agoGHA/windows: make libssh2 install a per job config
Viktor Szakats [Tue, 1 Apr 2025 22:29:56 +0000 (00:29 +0200)] 
GHA/windows: make libssh2 install a per job config

To allow making per-job variations for SSH backends.

Also:
- fix Cygwin builds to not ignore per-job `install:` items.
  It worked by accident before this patch.
  Follow-up to 66313cc036671cd4d3e72db65a79a715c7b8f154 #16629

Closes #16911

3 months agovtls_scache: remove "Unreachable Call"
Daniel Stenberg [Tue, 1 Apr 2025 08:46:07 +0000 (10:46 +0200)] 
vtls_scache: remove "Unreachable Call"

The condition required to reach this call could not happen, because
cf_ssl_scache_get() already checks the same condition and returns NULL
for 'scache' prior to this.

Found by CodeSonar

Closes #16896

3 months agotool_getparam: avoid redundant condition in set_rate
Daniel Stenberg [Tue, 1 Apr 2025 08:25:41 +0000 (10:25 +0200)] 
tool_getparam: avoid redundant condition in set_rate

When the number parsing fails, the pointer is never moved so there's no
point in checking that.

Pointed out by CodeSonar

Closes #16895

3 months agomulti_ev: remove redundant check from mev_get_last_pollset
Daniel Stenberg [Tue, 1 Apr 2025 08:16:04 +0000 (10:16 +0200)] 
multi_ev: remove redundant check from mev_get_last_pollset

Pointed out by CodeSonar

Closes #16894

3 months agohttp2: fix stream assignemnt for pushes
Stefan Eissing [Tue, 1 Apr 2025 11:44:24 +0000 (13:44 +0200)] 
http2: fix stream assignemnt for pushes

When a PUSH_PROMISE was received, the h2_stream object was assigned
to the wrong `newhandle->mid` and was thereafter not found. This led
to internal confusion, because the nghttp2 stream user_data was not
cleared and an invalid easy handle was use for trace messages,
resulting in a crash.

Reported-by: Viktor Szakats
Fixes #16881
Closes #16905

3 months agoGHA/windows: drop GnuTLS-fork from vcpkg MultiSSL job
Viktor Szakats [Tue, 1 Apr 2025 10:36:06 +0000 (12:36 +0200)] 
GHA/windows: drop GnuTLS-fork from vcpkg MultiSSL job

curl now has a working GnuTLS CI job, with tests, with MSYS2.
The MultiSSL build scenario is now tested on macOS.

The vcpkg GnuTLS package seems to have a deep dependency tree with large
packages that need to be rebuilt relatively frequently. Since they can't
fit into to the time limit, these cause CI failures.

To stabilize CI, drop the `shiftmedia-libgnutls` dependency.

Partial revert of e86f99824c4de0024cc90bca53efe205fd1c1dcc #16623
Ref: https://github.com/curl/curl/actions/runs/14192680124/job/39760753274?pr=16902

Closes #16904

3 months agotests/README: document test bundles
Viktor Szakats [Tue, 1 Apr 2025 09:42:25 +0000 (11:42 +0200)] 
tests/README: document test bundles

Closes #16902

3 months agoruntests: fix bundled test invocation with `-g` option
Viktor Szakats [Tue, 1 Apr 2025 09:02:57 +0000 (11:02 +0200)] 
runtests: fix bundled test invocation with `-g` option

Fixes:
```
$ ./runtests.pl -g 1940
./libtest/libtests lib1940: No such file or directory.
Argument list to give program being debugged when it is started is "http://127.0.0.1:44547/1940".
```

Reported-by: Daniel Stenberg
Fixes #16893
Closes #16898

3 months agoGHA: run random curl command lines for N seconds in CI
Daniel Stenberg [Mon, 31 Mar 2025 11:49:18 +0000 (13:49 +0200)] 
GHA: run random curl command lines for N seconds in CI

In the memory and address sanitizer builds.

Verify that nothing unexpected happens.

Starting out with 60 second runs.

The script does not set any seed so it runs with a new random every
time, meaning that if it fails in a single CI run it might not fail in a
subsequent one: but it should still show the full command that failed to
enable us to reproduce it locally. We can work on improving the seed
situation later if this script turns useful.

Closes #16884

3 months agotool_paramhlp: make proto2num skip leading commas better
Daniel Stenberg [Tue, 1 Apr 2025 07:36:47 +0000 (09:36 +0200)] 
tool_paramhlp: make proto2num skip leading commas better

Closes #16892

3 months agotests/certs/Makefile.am: avoid superfluous cert re-generation
Daniel Stenberg [Tue, 1 Apr 2025 09:06:27 +0000 (11:06 +0200)] 
tests/certs/Makefile.am: avoid superfluous cert re-generation

Fixes #16897
Closes #16899

3 months agolibssh2: show crypto backend in the verbose connect log
Viktor Szakats [Fri, 21 Mar 2025 23:47:07 +0000 (00:47 +0100)] 
libssh2: show crypto backend in the verbose connect log

With libssh2 1.11.0 or newer.

Different crypto backends may offer different features, e.g. in the keys
and algos they support.

Examples:
```
*   Trying 127.0.0.1:22...
* Connected to localhost (127.0.0.1) port 22
* libssh2 crypto backend: openssl compatible
[or]
* libssh2 crypto backend: WinCNG
```

Also fix indentation and drop redundant curly braces.

Closes #16790

3 months agoprox/preproxy.md: document argument within <brackets>
Daniel Stenberg [Mon, 31 Mar 2025 11:17:22 +0000 (13:17 +0200)] 
prox/preproxy.md: document argument within <brackets>

... as the argument is mandatory and we use that symbol for all other
options.

Closes #16883

3 months agoRevert "async-threaded resolver: use ref counter"
Daniel Stenberg [Mon, 31 Mar 2025 07:09:53 +0000 (09:09 +0200)] 
Revert "async-threaded resolver: use ref counter"

This reverts commit 19226f9bb106347e21d1dd113f2e2aeff53ca925.

Due to flaky macos CI builds

Fixes #16880
Closes #16882

3 months agourlapi: remove percent encoded dot sequences from the URL path
Daniel Stenberg [Sat, 29 Mar 2025 18:10:40 +0000 (19:10 +0100)] 
urlapi: remove percent encoded dot sequences from the URL path

Treat %2e and %2E to be "dot equivalents" in the function and remove
such sequences as well, according to RFC 3986 section 5.2.4. That is
also what the browsers do.

This DOES NOT consider %2f sequences in the path to be actual slashes,
so there is no removal of dots for those.

This function does not decode nor encode any percent sequences.

Also switched the code to use dynbuf.

Extends test 1395 and 1560 to verify.

Assisted-by: Demi Marie Obenour
Fixes #16869
Closes #16870

3 months agoasyn-thread: repair build with disabled socketpair
Daniel Stenberg [Sun, 30 Mar 2025 21:18:32 +0000 (23:18 +0200)] 
asyn-thread: repair build with disabled socketpair

Reported-by: Abhinav Singhal
Bug: https://curl.se/mail/lib-2025-03/0031.html
Closes #16877

3 months agodocs/cmdline-opts: use imperative form
Daniel Stenberg [Sun, 30 Mar 2025 22:52:07 +0000 (00:52 +0200)] 
docs/cmdline-opts: use imperative form

Use 'set', not 'sets' etc. For consistency.

Closes #16879

3 months agoaws_sigv4: merge repeated headers in canonical request
Austin Moore [Wed, 19 Mar 2025 03:58:56 +0000 (23:58 -0400)] 
aws_sigv4: merge repeated headers in canonical request

When multiple headers share the same name, AWS SigV4 expects them to be
merged into a single header line, with values comma-delimited in the
order they appeared.

Add libtest 1978 to verify.

Closes #16743

3 months agobuild: drop `build-certs` as a test-run dependency
Viktor Szakats [Sun, 30 Mar 2025 20:34:26 +0000 (22:34 +0200)] 
build: drop `build-certs` as a test-run dependency

After adding it as a test executables dependency, it run twice in
MSBuild jobs. Also there is little reason to try building them in both
build and run tests targets.

(The reason MSBuild building it twice, is our use of
`TrackFileAccess=false` to improve build performance.)

https://github.com/curl/curl/actions/runs/14156797251/job/39662914155?pr=16840#step:15:31

Follow-up to 68609f0e334359875a2f62735377174ab6b873dd #16866
Follow-up to 0c1ad21f978c8f5acf3d0c1708d83a93635d9df3 #16845

Closes #16876

3 months agogenserv.pl: detect `openssl` in `PATH`, omit `command -v`
Viktor Szakats [Sat, 29 Mar 2025 13:43:10 +0000 (14:43 +0100)] 
genserv.pl: detect `openssl` in `PATH`, omit `command -v`

Before this patch the script relied on Perl `system()` finding `openssl`
in `PATH`, plus tried to display the full path of `openssl` by using
`command -v` (or `which` on Windows). `command -v` did not work in CI
for unknown reasons. To resolve it, this patch detects `openssl` in
`PATH` manually, displays the detected full path and calls `openssl`
with the detected full path, and stops relying on `system` for this.

It also follows how `sshhelp.pm` is detecting executables. Though this
patch uses Perl `-f` instead of `-e && -d` used there .

Silencing this in CI logs:
```
Can't exec "command": No such file or directory at ../../../tests/certs/genserv.pl line 51.
```
Ref: https://github.com/curl/curl/actions/runs/14145795884/job/39632942668?pr=16865#step:39:108

Closes #16868

3 months agolib1560: test set path containing LR or CR
Daniel Stenberg [Sun, 30 Mar 2025 14:47:42 +0000 (16:47 +0200)] 
lib1560: test set path containing LR or CR

Ref: #16874
Closes #16875

3 months agoeasy: drop `break` after `return`
Viktor Szakats [Sun, 30 Mar 2025 11:27:13 +0000 (13:27 +0200)] 
easy: drop `break` after `return`

Also some whitespace tidy-ups.

Closes #16873

3 months agolibtest/first.c: remove the Test: stderr output for unity builds
Daniel Stenberg [Sun, 30 Mar 2025 10:42:35 +0000 (12:42 +0200)] 
libtest/first.c: remove the Test: stderr output for unity builds

That makes the output differ between builds which breaks libtests doing
stderr comparisons

Closes #16872

3 months agocmake: also build certs when building test executables
Viktor Szakats [Sat, 29 Mar 2025 12:29:26 +0000 (13:29 +0100)] 
cmake: also build certs when building test executables

To support running tests directly via `runtests.pl` after building
the test targets. Also to sync with the same update for autotools.

Follow-up to 0c1ad21f978c8f5acf3d0c1708d83a93635d9df3 #16845
Closes #16866

3 months agotest313: disable via `<features>` for backends without CRL support
Viktor Szakats [Sat, 29 Mar 2025 12:07:57 +0000 (13:07 +0100)] 
test313: disable via `<features>` for backends without CRL support

Instead of via `tests/data/DISABLED` file.

They are all missing CRL feature support, as opposed to being broken.

Follow-up to 8adee8824cba23b7f3738b551a84101009f8a8d1 #16862
Follow-up to 8b1b5cd4d2df3a8c2c0108d1d2b5d519b7ece23e #16660

Closes #16865

3 months agocurl_trc: provide Curl_trc_dns dummy
Daniel Stenberg [Sat, 29 Mar 2025 19:45:38 +0000 (20:45 +0100)] 
curl_trc: provide Curl_trc_dns dummy

Follow-up to 19226f9bb106347e21d1dd

For building without verbose output.

Closes #16871

3 months agocurl/system.h: drop leftover comment about 32 bit curl_off_t
Daniel Stenberg [Sat, 29 Mar 2025 13:13:29 +0000 (14:13 +0100)] 
curl/system.h: drop leftover comment about 32 bit curl_off_t

curl MUST have a 64 bit curl_off_t these days

Closes #16867

3 months agodocs/internals/PORTING.md: new document
Daniel Stenberg [Fri, 28 Mar 2025 14:37:15 +0000 (15:37 +0100)] 
docs/internals/PORTING.md: new document

The basic approach I use when porting libcurl to another OS when the
existing configure or cmake build setups are not suitable.

Closes #16860

3 months agoasync-threaded resolver: use ref counter
Stefan Eissing [Thu, 27 Mar 2025 12:55:49 +0000 (13:55 +0100)] 
async-threaded resolver: use ref counter

Allocate the data shared between a transfer and an aync resolver
thread separately and use a reference counter to determine its
release.

Closes #16847

3 months agoGHA: update awslabs/aws-lc to v1.49.0
renovate[bot] [Sat, 29 Mar 2025 11:37:28 +0000 (11:37 +0000)] 
GHA: update awslabs/aws-lc to v1.49.0

Closes #16864

3 months agoruntests: support running tests under wine or qemu (cont.)
Viktor Szakats [Fri, 28 Mar 2025 21:21:06 +0000 (22:21 +0100)] 
runtests: support running tests under wine or qemu (cont.)

Respect `CURL_TEST_EXE_RUNNER` env in server verifications using
the in-tree curl, in `tests/servers.pm`.

Follow-up to 72b163c30141b3a9afe23cceb1e2a0b2e817de8b #16785
Closes #16863

3 months agotest313: disable CRL test for Schannel due to lack of support and flakiness
Viktor Szakats [Fri, 28 Mar 2025 18:10:28 +0000 (19:10 +0100)] 
test313: disable CRL test for Schannel due to lack of support and flakiness

The source code and documentation says that CRL is not supported by
curl's Schannel TLS backend.

It's also frequently flaky in CI with both MinGW and MSVC jobs, e.g.:
https://github.com/curl/curl/actions/runs/14134841988/job/39603994164 (Schannel)
https://github.com/curl/curl/actions/runs/14134841988/job/39606336445 (Schannel)
https://github.com/curl/curl/actions/runs/13981383629/job/39147183706 (LibreSSL)

```
curl returned 35, when expecting 60
```

This test was passing with Schannel because it misses the `--insecure`
option and thus always returns 60, regardless of passing `--crlfile` or
not:
```
curl: (60) schannel: CertGetCertificateChain trust error CERT_TRUST_REVOCATION_STATUS_UNKNOWN
More details here: https://curl.se/docs/sslcerts.html

curl failed to verify the legitimacy of the server and therefore could not
establish a secure connection to it. To learn more about this situation and
how to fix it, please visit the webpage mentioned above.
```

Closes #16862

3 months agosshserver.pl: use Perl `chmod`
Viktor Szakats [Fri, 28 Mar 2025 14:21:00 +0000 (15:21 +0100)] 
sshserver.pl: use Perl `chmod`

Instead of relying on the external/shell command. For portability.

Follow-up to 213c5aca7bfc74a6ae02b065c5f38a1e9ff54d62 #3899
Closes #16859

3 months agoruntests: rewrite `genserv.sh` in Perl
Viktor Szakats [Fri, 28 Mar 2025 13:33:02 +0000 (14:33 +0100)] 
runtests: rewrite `genserv.sh` in Perl

To remove POSIX shell as an extra dependency for runtests.

Also fix to `chmod 0600` the `.pem` file (was: `.prm`), and apply it
_before_ writing the keys.

Follow-up to 44341e736a3e2f7a2b25a774be3a9796e81abab9 #16824
Closes #16858

3 months agoRELEASE-NOTES: synced
Daniel Stenberg [Sat, 29 Mar 2025 10:27:44 +0000 (11:27 +0100)] 
RELEASE-NOTES: synced

3 months agoc-ares httpsrr: fix ifdef
Stefan Eissing [Fri, 28 Mar 2025 14:42:29 +0000 (15:42 +0100)] 
c-ares httpsrr: fix ifdef

Fix the ifdef const when enabling HTTPSRR with c-ares.

Reported-by: Pavel Kropachev
Ref: #16855
Closes #16861

3 months agocmake: add shell completion support
Viktor Szakats [Wed, 22 Jan 2025 14:13:47 +0000 (15:13 +0100)] 
cmake: add shell completion support

Add the last (*) missing bit for feature parity with autotools.

Also test in CI. Add a new `cmake install` step to GHA/macos.

(*) AFAIK. Let us know if there's something else missing.

Closes #16833

3 months agotests/server: make the signal handler signal-safe
Viktor Szakats [Fri, 28 Mar 2025 00:41:28 +0000 (01:41 +0100)] 
tests/server: make the signal handler signal-safe

Before this patch the signal handler called `logmsg()` which in turn
called `printf()` variants (internal implementations), and `FILE *`
functions, `localtime()`. Some of these called `malloc`/`free`, which
isn't supported in s signal handler. Replace them with `write` calls,
losing some logging functionality.

Also:
- De-dupe and move `STD*_FILENO` macros to `lib/curl_setup.h`. Revert
  the `src` definition to point to `stderr`, instead of `tool_stderr`.
  Follow-up to e5bb88b8f824ed87620bd923552534c83c2a516e #11958

POSIX specs with list of functions allowed in a signal handler:
2004: https://pubs.opengroup.org/onlinepubs/009695399/functions/xsh_chap02_04.html#tag_02_04_03
2017: https://pubs.opengroup.org/onlinepubs/9699919799/functions/V2_chap02.html#tag_15_04_03
2024: https://pubs.opengroup.org/onlinepubs/9799919799/functions/V2_chap02.html#tag_16_04_03

Linux CI run with the thread sanitizer going crazy when
hitting the signal handler in test 1238 and 1242 (TFTP):
```
WARNING: ThreadSanitizer: signal-unsafe call inside of a signal (pid=12582)
    #0 malloc <null> (servers+0x5ed70)
    #1 _IO_file_doallocate <null> (libc.so.6+0x851b4)
    #2 formatf /home/runner/work/curl/curl/bld/tests/server/../../lib/../../lib/mprintf.c:886:9 (servers+0xdff77)
[...]
WARNING: ThreadSanitizer: signal-unsafe call inside of a signal (pid=12582)
    #0 free <null> (servers+0x5f453)
    #1 fclose <null> (libc.so.6+0x8532f)
    #2 logmsg /home/runner/work/curl/curl/bld/tests/server/../../../tests/server/util.c:134:5 (servers+0xe684d)
```
Ref: https://github.com/curl/curl/actions/runs/14118903372/job/39555309490?pr=16851

Closes #16852

3 months agoGHA/linux: move pytests to non-valgrind job variants, drop 2 redundant runs
Viktor Szakats [Thu, 27 Mar 2025 22:44:51 +0000 (23:44 +0100)] 
GHA/linux: move pytests to non-valgrind job variants, drop 2 redundant runs

- move pytest from the valgrind variant of the mbedTLS and Rustls jobs
  to their non-valgrind counterpart (they different in C compiler and
  build tool respectively). To parallelize more and finish the workflow
  faster.

- drop pytest from the valgrind variant of the two identical (other than
  the build tool) 'libressl heimdal' jobs. Saves 1.5 minutes CI time.

- drop pytest from the longest valgrind job to make the workflow finish
  almost 2 minutes faster. `sync-resolver` is its unique build propery.
  It wasn't pytested on Azure.

- explicitly install `libnghttp2-dev` and `libldap-dev` to keep them in
  jobs where pytest deps were installing them implicitly before this
  patch.

Before: https://github.com/curl/curl/actions/runs/14118080563
After: https://github.com/curl/curl/actions/runs/14118903372?pr=16851

Closes #16851

3 months agoGHA/linux: enable ECH in Rustls jobs
Viktor Szakats [Thu, 27 Mar 2025 22:22:41 +0000 (23:22 +0100)] 
GHA/linux: enable ECH in Rustls jobs

Closes #16850

3 months agodocs: add rustls --ca-native & CURLSSLOPT_NATIVE_CA
Daniel McCarney [Thu, 27 Mar 2025 12:58:12 +0000 (08:58 -0400)] 
docs: add rustls --ca-native & CURLSSLOPT_NATIVE_CA

The one important caveat is that presently _only_ the native platform
verifier/CAs are consulted when this option is used w/ rustls.

Closes #16848

3 months agovquic: obey IOV_MAX
Stefan Eissing [Thu, 27 Mar 2025 13:55:41 +0000 (14:55 +0100)] 
vquic: obey IOV_MAX

When using `recvmmsg()`, check `IOV_MAX` for limits to the iovec array
passed.

Reported-by: Teh Kok How
Fixes #16846
Closes #16849

3 months agotests/makefile: add dependency on build-certs
Stefan Eissing [Thu, 27 Mar 2025 10:24:22 +0000 (11:24 +0100)] 
tests/makefile: add dependency on build-certs

Closes #16845

3 months agoruntests: generate certs dynamically, bump to EC-256, tidy up
Viktor Szakats [Mon, 24 Mar 2025 21:13:29 +0000 (22:13 +0100)] 
runtests: generate certs dynamically, bump to EC-256, tidy up

Before this patch the curl repository and source tarball distribution
contained test certificates as binary blobs. Used by runtests.

Drop these certificates in favor of generating them dynamically as
part of the build process. Both via autotools and CMake.

As part of this, improve certificates, the generator script and process,
file layout, and fix any issue to make it work fast and smooth both in
CI and local builds.

Note, cert generator scripts require OpenSSL >=1.0.2
(or LibreSSL >=3.1.0). Generation requires POSIX shell, also with CMake.
Without a POSIX shell tests relying on TLS (and stunnel) will fail.

Details:

- build: generate certs as part of the test run process.
- build, tests: generate certs in the build directory.
- binarycheck: drop concept of known binary files with hashes.
- binarycheck: move binary check logic into spacecheck and drop this
  separate checker tool.
- build: fix to clean all cert files.
- autotools: fix to not run leaf cert generators in parallel. To avoid
  confusion when updating the revocation database and counter.
- scripts: drop `scripts` subdir, merge two scripts into one,
  auto-generate root cert, allow generating multiple leafs at once.
- scripts: switch to EC-256 keys (was: RSA-2048). For key size and perf.
- scripts: drop `-x` echo, text dumps, most other output. To avoid log
  noise and make it quicker in CI.
- scripts: make it non-RSA-specific.
- scripts: delete unused code.
- scripts: use POSIX shell shebang. Some envs don't have bash (Alpine).
- scripts: pass test pseudo-secrets via the command-line. To avoid:
  ```
  + openssl genrsa -out test-ca.key -passout fd:0 2048
  Invalid password argument, starting with "fd:"
  ```
- cmake: fix to launch generator scripts via the detected POSIX shell.
- cmake: fix `build-certs` rule to not depend on `SRPFILES`
  (`srp-verifier-*`).
- cmake: drop `EXCLUDE_FROM_ALL` for the cert subdir. It makes
  the Visual Studio generator miss to create the `clean-certs`,
  `build-certs` targets. No target depend on them, so they don't execute
  implicitly anyway. Fixes:
  ```
  MSBUILD : error MSB1009: Project file does not exist.
  Switch: clean-certs.vcxproj
  ```
- cmake: add `VERBATIM USES_TERMINAL` to `build-certs` target.
- GHA/linux: install openssl on Alpine, for the cert generator scripts.

Follow-up to 556f722fe32e5e9f4e24f0242100c5e9d57c129b #16593
Follow-up to fa461b4eff52b413f88debf543b5350a6cef4724 #14486

Closes #16824

3 months agorustls: support native platform verifier
Daniel McCarney [Mon, 24 Mar 2025 16:43:22 +0000 (12:43 -0400)] 
rustls: support native platform verifier

e.g. `curl --ca-native ...`

3 months agodocs: include rustls-ffi in ECH docs
Daniel McCarney [Mon, 24 Mar 2025 16:32:50 +0000 (12:32 -0400)] 
docs: include rustls-ffi in ECH docs

3 months agorustls: support ECH w/ DoH lookup for config
Daniel McCarney [Mon, 24 Mar 2025 16:26:21 +0000 (12:26 -0400)] 
rustls: support ECH w/ DoH lookup for config

E.g. `curl --tlsv1.3 --doh-url https://one.one.one.one/dns-query --ech true ...`

Closes #16828

3 months agorustls: add ECH support w/ string ECH config
Daniel McCarney [Mon, 24 Mar 2025 16:11:54 +0000 (12:11 -0400)] 
rustls: add ECH support w/ string ECH config

e.g. `curl --tlsv1.3 --ech ecl:<BASE64 encoded ECH config list> ...`

Closes #16828

3 months agorustls: support ECH GREASE
Daniel McCarney [Mon, 24 Mar 2025 16:01:30 +0000 (12:01 -0400)] 
rustls: support ECH GREASE

e.g. `curl --tlsv1.3 --ech grease ...`

3 months agorustls: use client cert and key if available
Yedaya Katsman [Wed, 1 Jan 2025 19:14:49 +0000 (21:14 +0200)] 
rustls: use client cert and key if available

3 months agorustls: Add support for SSLKEYLOGFILE
Yedaya Katsman [Mon, 21 Oct 2024 20:28:28 +0000 (23:28 +0300)] 
rustls: Add support for SSLKEYLOGFILE

With rustls-ffi 0.15+ we can set up a callback for writing TLS secrets
hooked up to call Curl_tls_keylog_write. To make sure the associated
file is cleaned up we update the Curl_ssl struct for the rustls-ffi vtls
backend to have a cleanup callback.

Closes #16828

3 months agokeylog: move some constants to header file
Yedaya Katsman [Mon, 21 Oct 2024 20:26:08 +0000 (23:26 +0300)] 
keylog: move some constants to header file

This allows TLS implementations to use the constants for defining sizes
and verification.

3 months agoci: use rustls-ffi 0.15 deb
Daniel McCarney [Sun, 16 Mar 2025 16:48:54 +0000 (12:48 -0400)] 
ci: use rustls-ffi 0.15 deb

Take the latest rustls-ffi version and install it via the upstream
project's `.deb` for x86_64 linux.

3 months agodocs: rework RUSTLS install instructions
Daniel McCarney [Sun, 16 Mar 2025 16:38:24 +0000 (12:38 -0400)] 
docs: rework RUSTLS install instructions

Describes using a package manager or pre-built binaries and adopts the
0.15 installation from source instructions.

Previously the rustls docs described installing rustls-ffi from source
using the GNU Makefile. The upstream project has switched to using
cargo-c as a cross-platform solution that works well with the rust
toolchain, pkg-config, and Windows and so this needs an update.

Similarly, for folks that want to avoid the extra cargo-c tool
requirement, rustls-ffi provides binary releases for common platforms,
and some Linux distributions/package managers offer pre-built packages.

The install instructions are expanded to cover these options since
they're generally better for end users than building the dep. from
source (no `rustc` required).

3 months agotests: replace remaining non-ASCII bytes with hex markup
Viktor Szakats [Wed, 26 Mar 2025 16:27:42 +0000 (17:27 +0100)] 
tests: replace remaining non-ASCII bytes with hex markup

Also drop from `binarycheck`.

Closes #16837

3 months agoconfigure: tidy up shell completion rules
Viktor Szakats [Wed, 22 Jan 2025 12:26:53 +0000 (13:26 +0100)] 
configure: tidy up shell completion rules

- allow generating completions in cross-builds.
  Follow-up to d055a01ce90510a6f8ff44bb7fceace9b2dbcf97 #16789

- fix warning messages.

- language, quotes, whitespace.

Closes #16836

3 months agocmake: add custom command scripts as dependencies where missing
Viktor Szakats [Wed, 26 Mar 2025 12:22:14 +0000 (13:22 +0100)] 
cmake: add custom command scripts as dependencies where missing

Also some formatting.

Closes #16835

3 months agoRELEASE-NOTES: synced
Daniel Stenberg [Wed, 26 Mar 2025 06:54:09 +0000 (07:54 +0100)] 
RELEASE-NOTES: synced

3 months agoGHA/non-native: revert to bare builds for Android 21
Viktor Szakats [Wed, 26 Mar 2025 01:53:40 +0000 (02:53 +0100)] 
GHA/non-native: revert to bare builds for Android 21

vcpkg requires Android 28 by default after a recent update that's being
deployed onto CI runs (with `libiconv:arm64-android@1.18#1`).

Revert to bare, no-ssl, no-psl configuration for Android 21 jobs to make
them work again.

Bug: https://github.com/curl/curl/pull/16824#issuecomment-2750912507
Ref: https://github.com/microsoft/vcpkg/pull/44424#issuecomment-2753027630

Closes #16832

3 months agocmake: document `SH_EXECUTABLE` option
Viktor Szakats [Tue, 25 Mar 2025 23:39:20 +0000 (00:39 +0100)] 
cmake: document `SH_EXECUTABLE` option

Closes #16830

3 months agotests: remove base64 encoded sections
Daniel Stenberg [Mon, 24 Mar 2025 13:41:41 +0000 (14:41 +0100)] 
tests: remove base64 encoded sections

The base64 sections were added in a time when there was no other way to
do these tests. Now we remove them again to make less "hidden" data in
the test suite.

For several test cases we instead then provide a sequence of binary
octets which is not really better, but I have tried to minimize them.

Closes #16816

3 months agomqtt: cleanups
Daniel Stenberg [Mon, 24 Mar 2025 13:21:32 +0000 (14:21 +0100)] 
mqtt: cleanups

- make a variable const
- use calloc instead of malloc + memset
- fix comment language
- improve error messages

Closes #16826

3 months agomqtt: convert sendleftovers to dynbuf
Daniel Stenberg [Mon, 24 Mar 2025 10:46:34 +0000 (11:46 +0100)] 
mqtt: convert sendleftovers to dynbuf

Avoid frequent strdups/free calls, including the double-free risk.

Reported-by: Ronald Crane
Closes #16823

3 months agoSSLCERTS: list support for SSL_CERT_FILE and SSL_CERT_DIR
Ben Bodenmiller [Tue, 18 Mar 2025 20:31:10 +0000 (13:31 -0700)] 
SSLCERTS: list support for SSL_CERT_FILE and SSL_CERT_DIR

Closes #16762

3 months agoscripts: update completion.pl to parse options from docs
tiymat [Fri, 21 Mar 2025 23:15:57 +0000 (20:45 -0230)] 
scripts: update completion.pl to parse options from docs

Reported-by: kpcyrd on github
Fixes #16072
Closes #16789

3 months agoeasy: add 'populate_fds' func to reduce size of 'wait_or_timeout'
Gabriel Marin [Mon, 24 Mar 2025 16:18:49 +0000 (18:18 +0200)] 
easy: add 'populate_fds' func to reduce size of 'wait_or_timeout'

Closes #16820

3 months agorustls: tidy up
Daniel McCarney [Fri, 21 Mar 2025 18:43:07 +0000 (14:43 -0400)] 
rustls: tidy up

Closes #16796

3 months agoopenssl: fix crash on missing cert password
Jay Satiro [Mon, 24 Mar 2025 06:48:01 +0000 (02:48 -0400)] 
openssl: fix crash on missing cert password

- Return 0 for password length if OpenSSL is expecting a certificate
  password but the user did not provide one.

Prior to this change libcurl would crash if OpenSSL called the certificate
password callback in libcurl but no password was provided (NULL).

Reported-by: Roman Zharkov
Fixes https://github.com/curl/curl/issues/16806
Closes https://github.com/curl/curl/pull/16807

3 months agoasyn-thread: minor cleanups
Daniel Stenberg [Mon, 24 Mar 2025 09:13:44 +0000 (10:13 +0100)] 
asyn-thread: minor cleanups

- Use 'td->' in more places instead of the full thing.

- Remove an assert that is always true since the extra dynamic malloc
  was removed

- Ignore Curl_ares_perform() errors to prioritize the "real" resolver
  info and leave RR as "less important"

Closes #16808