]> git.ipfire.org Git - thirdparty/curl.git/log
thirdparty/curl.git
10 days agocmake: enable pthreads for BoringSSL/AWS-LC
Viktor Szakats [Sat, 28 Mar 2026 22:23:31 +0000 (23:23 +0100)] 
cmake: enable pthreads for BoringSSL/AWS-LC

Depends on 6828df7d2116fe680a0d012b06a4501e26efa99b #21176

Closes #21168

10 days agodocs: SSH host verification is done at connect time
Daniel Stenberg [Tue, 31 Mar 2026 08:42:56 +0000 (10:42 +0200)] 
docs: SSH host verification is done at connect time

Connection reuse is done more "casually" once verified.

Closes #21173

10 days agoINSTALL.md: update Cygwin instructions
John Haugabook [Thu, 19 Mar 2026 04:05:24 +0000 (00:05 -0400)] 
INSTALL.md: update Cygwin instructions

Polish Cygwin section of install, adding suggestions for:

- `cmake`
- `ninja`
- `setup --build-depends`

Closes #20995

10 days agocmake: improve passing build options to `try_compile()`
Viktor Szakats [Tue, 31 Mar 2026 04:18:57 +0000 (06:18 +0200)] 
cmake: improve passing build options to `try_compile()`

Pass build options directly via `COMPILE_DEFINTIONS` and
`LINK_LIBRARIES`, instead of "tunneling" them through `CMAKE_FLAGS`.
The latter method breaks when passing `Threads::Threads` as library via
`CMAKE_REQUIRED_LIBRARIES`, while also being complex and fragile.

Example:
```
-- Performing Test HAVE_FSETXATTR_5
CMake Error at bld/CMakeFiles/CMakeTmp/CMakeLists.txt:27 (target_link_libraries):
  Target "cmTC_3386e" links to:

    Threads::Threads

  but the target was not found.  Possible reasons include:

    * There is a typo in the target name.
    * A find_package call is missing for an IMPORTED target.
    * An ALIAS target is missing.

CMake Error at CMake/Macros.cmake:51 (try_compile):
  Failed to generate test project build system.
Call Stack (most recent call first):
  CMakeLists.txt:1684 (curl_internal_test)
```
Ref: https://github.com/curl/curl/actions/runs/23792043930/job/69329796592?pr=21168#step:38:318

Note: a side-effect is no longer passing C compiler flags (e.g.
`CMAKE_REQUIRED_FLAGS`) to the _linker_. This should not be an issue,
though CMake is passing them during its built-in detections.

Ref: https://cmake.org/cmake/help/v3.18/command/try_compile.html

Closes #21176

10 days agoRELEASE-NOTES: synced
Daniel Stenberg [Tue, 31 Mar 2026 07:02:47 +0000 (09:02 +0200)] 
RELEASE-NOTES: synced

10 days agohttp2: return error on OOM in push headers
Daniel Stenberg [Mon, 30 Mar 2026 06:49:31 +0000 (08:49 +0200)] 
http2: return error on OOM in push headers

Reported-by: M42kL33 on hackerone
Bug: https://hackerone.com/reports/3636044
Closes #21171

10 days agoCURLOPT_SSL_CTX_FUNCTION.md: expand on effects connection reuse
Daniel Stenberg [Mon, 30 Mar 2026 21:11:38 +0000 (23:11 +0200)] 
CURLOPT_SSL_CTX_FUNCTION.md: expand on effects connection reuse

Closes #21164

10 days agotool_operhlp: iterate through all slashes to find name
Daniel Stenberg [Mon, 30 Mar 2026 21:34:14 +0000 (23:34 +0200)] 
tool_operhlp: iterate through all slashes to find name

If there is no trailing file name for -O or --remote-name-all, continue
searching until there is no more to search. A URL ending with multiple
slashes would previously make it do wrong.

Add test 1639 and 1644 to verify.

Follow-up to e26eefd9ce19b1b954a

Reported-by: James Fuller
Closes #21165

10 days agodocs: list more dependencies for running Python HTTP tests
Dan Fandrich [Thu, 26 Mar 2026 22:06:20 +0000 (15:06 -0700)] 
docs: list more dependencies for running Python HTTP tests

Reviewed-by: Daniel Stenberg <daniel@haxx.se>
Reviewed-by: Viktor Szakats <commit@vsz.me>
Closes #21110

10 days agocmake: silence bad library `Threads::Threads` warning
Viktor Szakats [Tue, 31 Mar 2026 02:50:23 +0000 (04:50 +0200)] 
cmake: silence bad library `Threads::Threads` warning

Seen on macOS:
```
CMake Warning at CMakeLists.txt:2158 (message):
  Bad lib in library list: Threads::Threads
```

Follow-up to 2d546d239ecd455b6459e68b85ef8d4b045c0a00 #21163

Closes #21170

10 days agocf-https-connect: silence `-Wimplicit-int-enum-cast` with HTTPS-RR + clang 21 (reapply)
Viktor Szakats [Tue, 31 Mar 2026 01:09:48 +0000 (03:09 +0200)] 
cf-https-connect: silence `-Wimplicit-int-enum-cast` with HTTPS-RR + clang 21 (reapply)

Reapply: e09a7b83d67c56bcb65ef6d0d3c9ba517942fa6d #21057

Also:
- enable HTTPS-RR by default in curl-for-win to test it with clang 21.
  Ref: https://github.com/curl/curl-for-win/commit/dc65c449f313a16279dde7eb243367b77986ddf1

Follow-up to 335dc0e3c59688270140115c9f84ea5c929870d8 #21027

Closes #21167

10 days agoGHA: update dependency google/boringssl to v0.20260327.0
renovate[bot] [Mon, 30 Mar 2026 22:04:47 +0000 (22:04 +0000)] 
GHA: update dependency google/boringssl to v0.20260327.0

Closes #21166

10 days agocmake: use `Threads::Threads` imported target for POSIX Threads
Viktor Szakats [Sat, 28 Mar 2026 22:23:01 +0000 (23:23 +0100)] 
cmake: use `Threads::Threads` imported target for POSIX Threads

- use `Threads::Threads` imported target, replacing
  `CMAKE_THREAD_LIBS_INIT`. To use the modern form and to allow using
  `THREADS_PREFER_PTHREAD_FLAG` option.

- only add Threads library/options if POSIX Threads was detected (not
  any other threading backend FindThreads may detect, e.g. the HP one.)

- curl-config.in.cmake: detect and define `Threads::Threads`.

Refs:
https://cmake.org/cmake/help/v3.18/module/FindThreads.html
https://cmake.org/cmake/help/v4.3/module/FindThreads.html

Closes #21163

10 days agobuild: drop redundant `HAVE_PTHREAD_H` guard
Viktor Szakats [Sat, 28 Mar 2026 22:39:41 +0000 (23:39 +0100)] 
build: drop redundant `HAVE_PTHREAD_H` guard

Prior to this patch code used either `HAVE_PTHREAD_H`, or
`HAVE_THREADS_POSIX`, or both, to decide if POSIX Threads support is
present. In effect requiring both to be defined for a consistent build.

Drop detecting and guarding for `pthread.h`, and assume it present when
`HAVE_THREADS_POSIX` is set.

OS/400 had `HAVE_PTHREAD_H` set, but not `HAVE_THREADS_POSIX`, which
possibly left threading disabled in most sources.

Ref: https://pubs.opengroup.org/onlinepubs/009695399/basedefs/pthread.h.html
Ref: 930f2e822715d4602326d549e5a8085ee8c3ec11 #21144

Closes #21158

10 days agotest445: fix error code, remove SMB use
Daniel Stenberg [Mon, 30 Mar 2026 16:31:35 +0000 (18:31 +0200)] 
test445: fix error code, remove SMB use

The test should now expect error 7. SMB is now opt-in, so not used in as
many builds anymore.

Follow-up to a186ecf4bf0c8ebb3a

Closes #21160

10 days agowolfssl: fix build without TLS 1.3 support
Daniel Stenberg [Mon, 30 Mar 2026 16:36:20 +0000 (18:36 +0200)] 
wolfssl: fix build without TLS 1.3 support

Follow-up to: eac64c187997a3bdbdc27c

Closes #21161

10 days agofopen: for temp files, inherit permissions only for owner
Stefan Eissing [Wed, 25 Mar 2026 09:35:28 +0000 (10:35 +0100)] 
fopen: for temp files, inherit permissions only for owner

When creating a temp file in order to later replace an original, copying
over the existing permissions can not be considered safe when the user
running libcurl is not the owner of the existing file.

Closes #21092

11 days agowolfssl: refactor Curl_wssl_ctx_init into sub functions
Daniel Stenberg [Fri, 27 Mar 2026 16:44:11 +0000 (17:44 +0100)] 
wolfssl: refactor Curl_wssl_ctx_init into sub functions

Reduce complexity. It was at complexity 60, with is the current max
allowed. After this, the worst in wolfssl.c is at 29.

Closes #21128

11 days agotool: fix two more allocator mismatches
MarkLee131 [Sun, 29 Mar 2026 16:59:24 +0000 (00:59 +0800)] 
tool: fix two more allocator mismatches

memory allocated by libcurl (curl_maprintf) must be freed with
curl_free(), and memory allocated by the tool (curlx_strdup via
findfile) must be freed with curlx_free().

- tool_cfgable: ech_config is allocated with curl_maprintf, free it
  with curl_free() instead of tool_safefree()
- config2setopts: known hosts from findfile() is allocated with
  curlx_strdup, free it with curlx_free() instead of curl_free()

Follow-up to b71973c115

Closes #21150

11 days agosocks: add assertion for hostname length in SOCKS5 connect
Kaixuan Li [Mon, 30 Mar 2026 11:12:55 +0000 (19:12 +0800)] 
socks: add assertion for hostname length in SOCKS5 connect

socks5_req0_init() rejects hostnames longer than 255 bytes, but the
later cast to unsigned char in socks5_req1_init() has no local
indication that it is safe. Add a DEBUGASSERT and comment to document
the invariant and guard against future refactoring.

Closes #21157

11 days agosocks: reject zero-length GSSAPI/SSPI tokens from proxy
Greg Kroah-Hartman [Mon, 30 Mar 2026 13:33:54 +0000 (15:33 +0200)] 
socks: reject zero-length GSSAPI/SSPI tokens from proxy

A "broken" SOCKS5 proxy can send an invalid length of the encryption
token, which could cause malloc(0) to be called, which is a "platform
can do what it wants" potential problem.

Resolve this by explicitly checking the length and rejecting the invalid
token before ever attempting to allocate any memory.

Closes #21159

11 days agobuild: drop duplicate `pthread.h` includes
Viktor Szakats [Sat, 28 Mar 2026 22:41:31 +0000 (23:41 +0100)] 
build: drop duplicate `pthread.h` includes

Already included from `curl_setup.h`.

Closes #21144

11 days agobuild: drop redundant `USE_QUICHE` guards
Viktor Szakats [Sat, 28 Mar 2026 01:41:40 +0000 (02:41 +0100)] 
build: drop redundant `USE_QUICHE` guards

When used together with `USE_OPENSSL`. `USE_QUICHE` always implies
`USE_OPENSSL`.

Also: merge two (now identical) `#if` blocks in `openssl.c`.

Closes #21135

11 days agotool_dirhie: stop redefining system symbol `mkdir`
Viktor Szakats [Fri, 27 Mar 2026 23:02:04 +0000 (00:02 +0100)] 
tool_dirhie: stop redefining system symbol `mkdir`

Replace with local macro `toolx_mkdir()`, and map that to
platform-specific implementations as necessary.

Closes #21133

11 days agosrc: drop detecting and redefining system symbol `ftruncate`
Viktor Szakats [Fri, 27 Mar 2026 20:51:43 +0000 (21:51 +0100)] 
src: drop detecting and redefining system symbol `ftruncate`

Introduce `toolx_ftruncate()` macro and map it to existing replacements
for non-mingw-w64 Windows and DJGPP, or to `ftruncate` otherwise.

Follow-up to 6041b9b11b904c64305eb6c3f456b83288c1f323 #21109

Closes #21130

11 days agocf-dns: connection filter for DNS queries
Stefan Eissing [Wed, 25 Mar 2026 14:07:10 +0000 (15:07 +0100)] 
cf-dns: connection filter for DNS queries

New connection filter `cf-dns` that manages DNS queries. If hands
out addresses and HTTPS-RR records to anyone interested. Used by
HTTPS and IP happy eyeballing.

Information may become available *before* the libcurl "dns entry"
is complete, e.g. all queries have been answered. The cf-ip-happy
filter uses this information to start connection attempts as soon
as the first address is available.

The multi MSTATE_RESOLVING was removed. A new connection always
goes to MSTATE_CONNECTING. The connectdata bit `dns_resolved`
indicates when DNS information is complete. This is used for
error reporting and starting the progress meter.

Removed dns entries `data->state.dns[i]`, as the `cf-dns` filter
now keeps the reference now.

Many minor tweaks for making this work and pass address information
around safely.

Closes #21027

11 days agocmake: use `AIX` built-in variable (with CMake 4.0+)
Viktor Szakats [Sun, 30 Nov 2025 16:27:52 +0000 (17:27 +0100)] 
cmake: use `AIX` built-in variable (with CMake 4.0+)

Also keep the old method for compatibility with CMake <4.0.

Ref: https://cmake.org/cmake/help/v4.0/variable/AIX.html

Closes #21134

11 days agoGHA/linux: drop slow server logic for non-Azure source [ci skip]
Viktor Szakats [Mon, 30 Mar 2026 11:01:23 +0000 (13:01 +0200)] 
GHA/linux: drop slow server logic for non-Azure source [ci skip]

Ref: https://github.com/curl/curl/actions/runs/23740539514/job/69156214117
Follow-up to 5172ba5475cffc525c2338dfa63f818e11e80a42 #21107

11 days agoGHA/windows: bump to stunnel 5.77 (from 5.76)
Viktor Szakats [Mon, 30 Mar 2026 01:40:59 +0000 (03:40 +0200)] 
GHA/windows: bump to stunnel 5.77 (from 5.76)

Ref: https://www.stunnel.org/mailman3/hyperkitty/list/stunnel-announce@lists.stunnel.org/thread/BLYG54UILDIADJC2HWVFWQ2MK2YC3HOM/

Closes #21154

11 days agocurl_ngtcp2: extend and update callbacks for 1.22.0+
Viktor Szakats [Mon, 30 Mar 2026 00:42:16 +0000 (02:42 +0200)] 
curl_ngtcp2: extend and update callbacks for 1.22.0+

Fixing:
```
lib/vquic/curl_ngtcp2.c:880:1: error: missing field 'recv_stateless_reset2' initializer [-Wmissing-field-initializers]
  880 | };
      | ^
```

Also:
- GHA/http3-linux: bump to ngtcp2 v1.22.0.

Refs:
https://github.com/ngtcp2/ngtcp2/releases/tag/v1.22.0
https://github.com/ngtcp2/ngtcp2/commit/b7bfe41db898b59bda031f8ca2d41abf51fa3726
https://github.com/ngtcp2/ngtcp2/pull/2035

Closes #21152

11 days agodocs: mention more zip bomb precautions
Daniel Stenberg [Sat, 28 Mar 2026 22:33:29 +0000 (23:33 +0100)] 
docs: mention more zip bomb precautions

Closes #21143

11 days agotool_operate: actually apply the --parallel-max-host limit
Daniel Stenberg [Sun, 29 Mar 2026 13:18:04 +0000 (15:18 +0200)] 
tool_operate: actually apply the --parallel-max-host limit

It was wrongly previously only used in debug code for event based
transfer and not in the "normal" parallel transfer case.

Follow-up to 4654493fedfccbae18bd9c

Closes #21147

12 days agotool_cb_rea: make waitfd() return void
Daniel Stenberg [Fri, 27 Mar 2026 16:02:29 +0000 (17:02 +0100)] 
tool_cb_rea: make waitfd() return void

Nothing cared about the return code. Simplified.

Closes #21127

12 days agoconfigure: remove superfluous experimental warning for HTTP/3
Dexter Gerig [Sat, 28 Mar 2026 04:29:23 +0000 (23:29 -0500)] 
configure: remove superfluous experimental warning for HTTP/3

This warning was created at a time when all backends for HTTP/3 were
experimental. Since there are now non-experimental backends this warning
is incorrect in some cases and was already handled by backends that were
added to the experimental list.

Follow-up to 0535f6ec71cf950d7ad412b19ed706fcc7e4a7a9

Closes #21139

13 days agoboringssl: fix more coexist cases with Schannel/WinCrypt
Viktor Szakats [Sat, 28 Mar 2026 01:29:32 +0000 (02:29 +0100)] 
boringssl: fix more coexist cases with Schannel/WinCrypt

By moving the coexist workaround from vtls/openssl.c to vtls/openssl.h.
This way it also applies to vtls.c (and possibly other sources including
`vtls/openssl.h`), which may need it in unity builds before BoringSSL
header `openssl/ssl.h` pulling in the conflicting symbols and causing
conflicts otherwise.

Seen with build config:
```
-DCURL_USE_SCHANNEL=ON -DCURL_USE_OPENSSL=ON
-DCMAKE_UNITY_BUILD=ON -DCMAKE_UNITY_BUILD_BATCH_SIZE=30
```

Fixing:
```
In file included from _cm-win-boringssl/lib/CMakeFiles/libcurl_object.dir/Unity/unity_5_c.c:7:
In file included from lib/vtls/vtls.c:54:
In file included from lib/vtls/openssl.h:33:
In file included from /path/to/boringssl/_x64-win-ucrt/usr/include/openssl/opensslv.h:18:
In file included from /path/to/boringssl/_x64-win-ucrt/usr/include/openssl/crypto.h:18:
/path/to/boringssl/_x64-win-ucrt/usr/include/openssl/base.h:293:29: error: expected ')'
  293 | typedef struct X509_name_st X509_NAME;
      |                             ^
/path/to/llvm-mingw/x86_64-w64-mingw32/include/wincrypt.h:1515:29: note: expanded from macro 'X509_NAME'
 1515 | #define X509_NAME ((LPCSTR) 7)
      |                             ^
[...]
```

Ref: 2a92c39a218713635768364f801fa13831a019e0 #20567

Closes #21136

13 days agokeylog.h: replace literal number with macro in declaration
Viktor Szakats [Sat, 28 Mar 2026 11:17:06 +0000 (12:17 +0100)] 
keylog.h: replace literal number with macro in declaration

Also syncing with the defintion.

Closes #21141

13 days agokeylog: drop unused/redundant includes and guards
Viktor Szakats [Sat, 28 Mar 2026 02:21:27 +0000 (03:21 +0100)] 
keylog: drop unused/redundant includes and guards

Closes #21137

13 days agoGHA: bump pip-dependencies
dependabot[bot] [Sat, 28 Mar 2026 02:30:01 +0000 (02:30 +0000)] 
GHA: bump pip-dependencies

- update `filelock` from 3.24.3 to 3.25.2
- update `ruff` from 0.15.2 to 0.15.7
- update `cryptography` from 46.0.5 to 46.0.6 (CVE-2026-34073)

Closes #21138

13 days agomk-ca-bundle.pl: tidy up more leftovers
Viktor Szakats [Fri, 27 Mar 2026 21:39:15 +0000 (22:39 +0100)] 
mk-ca-bundle.pl: tidy up more leftovers

Follow-up to 351e4f956a11bdf419c14f1f69758a15e77e7fea #21116
Follow-up to ca92e20123928e4788d27135cdafdd084d3833d4 #20528

Closes #21131

13 days agoGHA/http3-linux: fix openssl4 version in cache keys
Viktor Szakats [Fri, 27 Mar 2026 22:56:06 +0000 (23:56 +0100)] 
GHA/http3-linux: fix openssl4 version in cache keys

Follow-up to 7523de760d7b41045b4c5ab4b8cb2419d037f049 #21118

Closes #21132

2 weeks agotool_util: fix the ftruncate use for DJGPP
Daniel Stenberg [Fri, 27 Mar 2026 15:16:56 +0000 (16:16 +0100)] 
tool_util: fix the ftruncate use for DJGPP

Follow-up to 6041b9b11b904c64305eb6c3f4

Since we define ftruncate as a macro, we can't use the macro within
the function!

Closes #21125

2 weeks agotool_cb_hdr: use the file descriptor instead of calling fileno() again
Daniel Stenberg [Fri, 27 Mar 2026 15:37:15 +0000 (16:37 +0100)] 
tool_cb_hdr: use the file descriptor instead of calling fileno() again

Follow-up to 6041b9b11b904c6430

Closes #21126

2 weeks agolibssh: propagate error back in SFTP function
Daniel Stenberg [Fri, 27 Mar 2026 13:42:25 +0000 (14:42 +0100)] 
libssh: propagate error back in SFTP function

The myssh_in_SFTP_READDIR_BOTTOM() function would not store the error
code correctly thus it could be ignored and missed when an error was
returned at that particular moment.

Follow-up to 3c26e6a896247ccf872d3f1

Found by Codex Security

Closes #21122

2 weeks agotransfer: clear the URL pointer in OOM to avoid UAF
Daniel Stenberg [Fri, 27 Mar 2026 13:49:24 +0000 (14:49 +0100)] 
transfer: clear the URL pointer in OOM to avoid UAF

Since the pointer can be extracted with CURLINFO_EFFECTIVE_URL later it
must not linger pointing to freed memory.

Found by Codex Security

Closes #21123

2 weeks agomulti: fix connection retry for non-http
Daniel Stenberg [Fri, 27 Mar 2026 13:33:33 +0000 (14:33 +0100)] 
multi: fix connection retry for non-http

non-HTTP protocols no longer retry after connection reuse failures
because multi_follow() now requires a handler->follow callback that is
NULL for those protocols. Provide a fallback for plain retries.

Follow-up to 1213c312722f93b7856d2

Spotted by Codex Security

Closes #21121

2 weeks agohttp2: prevent secure schemes pushed over insecure connections
Stefan Eissing [Fri, 27 Mar 2026 08:19:34 +0000 (09:19 +0100)] 
http2: prevent secure schemes pushed over insecure connections

When assembling the URL of a pushed resource over a not-secured
connection, require the scheme to be known and not secure.

Reported-by: xkilua on hackerone
Closes #21113

2 weeks agomk-ca-bundle.pl: drop reproducible timestamp feature
Viktor Szakats [Fri, 27 Mar 2026 08:26:15 +0000 (09:26 +0100)] 
mk-ca-bundle.pl: drop reproducible timestamp feature

Mozilla may push to its repo much later than the commit date, which can
be a source of confusion when using the reproducible timestamp (which is
determined by the commit date) by default. Example:

https://curl.se/ca/cacert-2026-03-19.pem vs.
https://github.com/mozilla-firefox/firefox/commits/1a84aee6387d2f9c9531c655edeea4a80aa0fcfa/security/nss/lib/ckfw/builtins/certdata.txt

This feature had no actual user (or a planned one) from within curl at
the moment, and not requested by curl users. curl-for-win does this on
its own, which is the more practical way there since everything (not
just the CA bundle) needs to be reproducible anyway. I surmise this may
be true for most if not all reproducible use-cases.

Another limitation was that it could bump into GitHub's rate limiting,
needing further updates.

Also: code had some unintented leftovers.

Reported-by: Daniel Stenberg
Bug: https://github.com/curl/curl/pull/20528#issuecomment-4140610008
Follow-up to ca92e20123928e4788d27135cdafdd084d3833d4 #20528

Closes #21116

2 weeks agoGHA/http3-linux: add OpenSSL 4 beta jobs, with ECH
Viktor Szakats [Fri, 27 Mar 2026 10:03:27 +0000 (11:03 +0100)] 
GHA/http3-linux: add OpenSSL 4 beta jobs, with ECH

Closes #21118

2 weeks agoopenssl: fix build with 4.0.0-beta1 no-deprecated
Viktor Szakats [Fri, 27 Mar 2026 10:29:30 +0000 (11:29 +0100)] 
openssl: fix build with 4.0.0-beta1 no-deprecated

```
lib/vtls/openssl.c:4238:22: error: â€˜SSL_R_SSLV3_ALERT_CERTIFICATE_EXPIRED’ undeclared (first use in this function); did you mean â€˜SSL_R_TLS_ALERT_CERTIFICATE_EXPIRED’?
 4238 |           (reason == SSL_R_SSLV3_ALERT_CERTIFICATE_EXPIRED))) {
      |                      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      |                      SSL_R_TLS_ALERT_CERTIFICATE_EXPIRED
lib/vtls/openssl.c:4238:22: note: each undeclared identifier is reported only once for each function it appears in
```
Ref: https://github.com/curl/curl/actions/runs/23641366299/job/68863072427#step:24:189

Cherry-picked from #21118

Closes #21119

2 weeks agoGHA/http3-linux: add missing step conditions
Viktor Szakats [Fri, 27 Mar 2026 10:39:24 +0000 (11:39 +0100)] 
GHA/http3-linux: add missing step conditions

To omit unused cache restores. Saving ~7 seconds in jobs not using them.

Closes #21120

2 weeks agorequest: reset resp_trailer in new requests
Daniel Stenberg [Fri, 27 Mar 2026 08:11:43 +0000 (09:11 +0100)] 
request: reset resp_trailer in new requests

Otherwise the trailer state lingers on into subsequent requests.

Follow-up to 29610e5f3d0c9f2643e09

Spotted by Codex Security

Closes #21112

2 weeks agoRELEASE-NOTES: synced
Daniel Stenberg [Fri, 27 Mar 2026 08:38:59 +0000 (09:38 +0100)] 
RELEASE-NOTES: synced

2 weeks agocf-socket: avoid low risk integer overflow on ancient Solaris
Daniel Stenberg [Fri, 27 Mar 2026 08:09:27 +0000 (09:09 +0100)] 
cf-socket: avoid low risk integer overflow on ancient Solaris

Spotted by Codex Security

Closes #21111

2 weeks agotest1619: download into %LOGDIR
Daniel Stenberg [Fri, 27 Mar 2026 08:21:24 +0000 (09:21 +0100)] 
test1619: download into %LOGDIR

Otherwise it will end up in tests/ which is not wanted.

Follow-up to d63432d1f8e759f4c6

Reported-by: Stefan Eissing
Closes #21114

2 weeks agoruntests: check for Debug case sensitively
Daniel Stenberg [Thu, 26 Mar 2026 08:19:08 +0000 (09:19 +0100)] 
runtests: check for Debug case sensitively

For both TrackMemory and Debug

Closes #21099

2 weeks agotool: fix memory mixups
Daniel Stenberg [Tue, 24 Mar 2026 15:44:48 +0000 (16:44 +0100)] 
tool: fix memory mixups

memory allocated by libcurl must be freed with curl_free() and vice versa,
memory allocated by the tool itself must be freed with curlx_free().

- dynbuf: free libcurl data with curl_free()
- tool_operate: make sure we get URL using the right memory
- tool_operhlp: free libcurl memory with curl_free()
- tool_operate: free curl_maprintf() pointer with curl_free
- var: data from curlx_base64_decode needs curlx_free
- tool_operate: fix memory juggling in etag handling
- tool_cb_hdr: fix memory area mixups
- tool_operate: another mixup in etag management
- tool_cb_hdr: more memory mixup fixes
- tool_cfgable.c: document some details
- tool_help: show global-mem-debug in -V output

Closes #21099

2 weeks agoGHA: add a 'curl_global_init_mem debug' job
Daniel Stenberg [Thu, 26 Mar 2026 07:14:40 +0000 (08:14 +0100)] 
GHA: add a 'curl_global_init_mem debug' job

Closes #21099

2 weeks agosrc: add curl_global_init_mem testing
Daniel Stenberg [Tue, 24 Mar 2026 15:25:03 +0000 (16:25 +0100)] 
src: add curl_global_init_mem testing

Build with "configure --enable-init-mem-debug" to make the tool use
curl_global_init_mem() and a set of private memory funtion callbacks for
libcurl's memory management.

Using this setup, memory mixups in tool code is more likely to cause
crashes and thus get discovered while running tests.

This curl_global_init_mem debug mode can only be done when building
libcurl shared (not static) and without debugging enabled - since it
needs to use the custom memory funtion callbacks.

Closes #21099

2 weeks agosrc: use ftruncate() unconditionally
Daniel Stenberg [Thu, 26 Mar 2026 22:03:53 +0000 (23:03 +0100)] 
src: use ftruncate() unconditionally

Systems without it need to provide a custom alternative just like we
have have for Windows. This adds an MSDOS version that fails if trying
to truncate a too large file.

Closes #21109

2 weeks agotool_cb_hdr: only truncate etags output when regular file
Daniel Stenberg [Thu, 26 Mar 2026 13:45:37 +0000 (14:45 +0100)] 
tool_cb_hdr: only truncate etags output when regular file

When sending the output to stdout it cannot truncate.

Add test1619 to verify --etag-save to stdout

Spotted by Codex Security

Closes #21103

2 weeks agohsts: when a dupe host adds subdomains, use that
Daniel Stenberg [Thu, 26 Mar 2026 16:28:34 +0000 (17:28 +0100)] 
hsts: when a dupe host adds subdomains, use that

Otherwise a weaker earlier entry is allowed to override a later more
restrictive one.

Add test 1638 to verify.

Closes #21108

2 weeks agoGHA: try workaround for slow Azure Ubuntu distro server
Viktor Szakats [Thu, 26 Mar 2026 14:59:23 +0000 (15:59 +0100)] 
GHA: try workaround for slow Azure Ubuntu distro server

It's been going on for almost a year, chances seem slim to have this
fixed upstream.

The observed issue is that on GitHub-supplied CI runner images,
sometimes, `apt-get install` using the stock distro server
`http://azure.archive.ubuntu.com/ubuntu` sees extreme slowness while
downloading data, then reaching the job timeout and aborting, making CI
red and necessitating a manual restart of the failed job(s).

In majority of cases the install step takes no longer than 8-40 seconds
(download + install), while in the failing case it takes 10-20+ minutes
just to download.

Earlier I slimmed down installs to avoid unnecessary packages, which
mitigated, but did not completely fix the issue.

Example:
https://github.com/curl/curl/actions/runs/23599596928/job/68725576899?pr=21105

Follow-up to 0455d8772a1af20ce63c46c5738582aa9b1b8441 #18509

Closes #21107

2 weeks agoGHA/curl-for-win: pass GH token to the containers
Viktor Szakats [Thu, 26 Mar 2026 14:23:10 +0000 (15:23 +0100)] 
GHA/curl-for-win: pass GH token to the containers

To avoid rate limits when accessing GH APIs during the build.

Aiming to avoid (while trying to retrieve a file timestamp):
```
++ [[ 2026-02-11-1a84aee6387d2f9c9531c655edeea4a80aa0fcfa =~ (.+)-([a-f0-9]{40,}) ]]
++ ver=2026-02-11
++ commit=1a84aee6387d2f9c9531c655edeea4a80aa0fcfa
++ set +x
curl: (22) The requested URL returned error: 403
curl: (22) The requested URL returned error: 403
curl: (22) The requested URL returned error: 403
curl: (22) The requested URL returned error: 403
[...]
```
Ref: https://github.com/curl/curl/actions/runs/23598912140/job/68723120977?pr=21104

Follow-up to:
https://github.com/curl/curl-for-win/commit/a26898fe489e2721b709d1eebc3b5e95c7332417
https://github.com/curl/curl-for-win/commit/17f2fb3ead747d375ea1d6c08e649efd17017c8b
https://github.com/curl/curl-for-win/commit/6dd6e47e9876ffe615544977ff6cfd684e6d421b
https://github.com/curl/curl-for-win/commit/b461404b5a800bcfebe34d524d9c6a32bc08b9a5

Closes #21105

2 weeks agoperl: harden external command invocations
Viktor Szakats [Sun, 22 Mar 2026 01:42:17 +0000 (02:42 +0100)] 
perl: harden external command invocations

In `adddocsref.pl`, `checksrc-all.pl`, `singleuse.pl` and tests 307, 1013,
1022, 1275, 1707, 1708, 1710.

Closes #21097

2 weeks agocmake: add CMake Config-based dependency detection for c-ares, wolfSSL
Viktor Szakats [Wed, 25 Mar 2026 19:05:32 +0000 (20:05 +0100)] 
cmake: add CMake Config-based dependency detection for c-ares, wolfSSL

For wolfSSL it requires v5.2.1+, and with 5.9.0+ it's also supported when
wolfSSL was built with autotools.

Follow-up to 8fce3e17e6cb310cd6dbe38ff14869b8fe5827d2 #20814

Closes #21098

2 weeks agoDEPRECATE.md: fix copy-and-paste mistaken subtitles
Daniel Stenberg [Thu, 26 Mar 2026 09:46:44 +0000 (10:46 +0100)] 
DEPRECATE.md: fix copy-and-paste mistaken subtitles

Closes #21102

2 weeks agodocs/VERIFY.md: verify curl
Daniel Stenberg [Tue, 24 Mar 2026 11:58:21 +0000 (12:58 +0100)] 
docs/VERIFY.md: verify curl

Don't trust, verify!

Closes #21085

2 weeks agocleancmd.pl: remove markdown links before spellcheck
Daniel Stenberg [Tue, 24 Mar 2026 14:51:15 +0000 (15:51 +0100)] 
cleancmd.pl: remove markdown links before spellcheck

Closes #21085

2 weeks agolocation/follow: mention netrc
Daniel Stenberg [Wed, 25 Mar 2026 09:31:11 +0000 (10:31 +0100)] 
location/follow: mention netrc

Closes #21091

2 weeks agomd4, md5: switch to wolfCrypt API in wolfSSL builds
Viktor Szakats [Tue, 24 Mar 2026 23:49:38 +0000 (00:49 +0100)] 
md4, md5: switch to wolfCrypt API in wolfSSL builds

Replacing the OpenSSL-like compatibility interface, and syncing with other
hashes, when building with wolfSSL.

Also: stop stomping on OpenSSL public MD4 symbols. This makes the wolfSSL
coexist workaround unnecessary, while also syncing up with MD5 sources.

After this patch the only remaining reference to wolfSSL's OpenSSL
compatibility layer is in `lib/curl_ntlm_core.c`.

Closes #21093

2 weeks agocurl_ntlm_core: drop redundant PP condition
Viktor Szakats [Wed, 25 Mar 2026 14:46:32 +0000 (15:46 +0100)] 
curl_ntlm_core: drop redundant PP condition

`LIBWOLFSSL_VERSION_HEX` is always present in supported wolfSSL
versions.

Closes #21096

2 weeks agospacecheck: verify filename lengths and characters
Viktor Szakats [Wed, 25 Mar 2026 12:19:09 +0000 (13:19 +0100)] 
spacecheck: verify filename lengths and characters

Maximum filename length 64, of which 48 maximum for the filename part.
Allowed characters: `A-Za-z0-9/._-`.

Also:
- rename a file to pass the check.
- init max constants outside the loop.
- minor fix to an error message.
  Follow-up to 62d77b12fce55d3481bb0b2e70e0f921c8cbfe5e #21087

Closes #21095

2 weeks agomulti: multi_wait fixes after #20832
Stefan Eissing [Mon, 23 Mar 2026 10:05:07 +0000 (11:05 +0100)] 
multi: multi_wait fixes after #20832

The refactoring in #20832 introduced some inconsistencies between
windows and posix handling, pointed out by reviews. Fix them:

- rename `wait_on_nop` back to `extrawait` as it was called before
- use multi_timeout() to shorten the user supplied timeout for
  both windows/posix in the same way
- remove the extra multi_timeout() check in the posix function
- Add the multi's wakeup socket for monitoring only when there
  are other sockets to poll on or when the caller wants the
  extra waiting time.

Closes #21072

2 weeks agoproxy: chunked response, error code
Stefan Eissing [Tue, 24 Mar 2026 09:03:18 +0000 (10:03 +0100)] 
proxy: chunked response, error code

Add test1715 to check proper handling of chunked transfer
encoding in CONNECT responses. Change proxy error code from
56 (RECV_ERROR) for everything to 7 (COULDNT_CONNECT) when
the server response could be read successfully, but establishing
the connection is not possible (http status code wrong).

Adapt several test expectations from 56 to 7.

Closes #21084

2 weeks agoasync-thrdd: use thread queue for resolving
Stefan Eissing [Tue, 24 Mar 2026 11:50:53 +0000 (12:50 +0100)] 
async-thrdd: use thread queue for resolving

Use a thread queue and pool for asnyc threaded DNS resolves.
Add pytest test_21_* for verification.

Add `CURLMOPT_RESOLVE_THREADS_MAX` to allow applications to
resize the thread pool used.

Add `CURLMOPT_QUICK_EXIT` to allow applications to skip thread
joins when cleaning up a multi handle. Multi handles in
`curl_easy_perform()` inherit this from `CURLOPT_QUICK_EXIT`.

Add several debug environment variables for testing.

Closes #20936

2 weeks agourl: do not reuse a non-tls starttls connection if new requires TLS
Daniel Stenberg [Tue, 24 Mar 2026 07:35:08 +0000 (08:35 +0100)] 
url: do not reuse a non-tls starttls connection if new requires TLS

Reported-by: Arkadi Vainbrand
Closes #21082

2 weeks agospacecheck: check long lines and repeat spaces, fix fallouts
Viktor Szakats [Tue, 24 Mar 2026 13:42:39 +0000 (14:42 +0100)] 
spacecheck: check long lines and repeat spaces, fix fallouts

Verify if lines are not longer than 192 characters. Also verify if lines
have less than 79 repeat spaces (and fix one fallout).

To improve readability by avoiding long lines and to prevent adding
overly long lines with text that may go unnoticed in an editor or diff
viewer.

In addition to pre-existing line length limits: 79 for C, 132 for CMake
sources.

Also:
- spacecheck: fix/harden allowlist regexes.
- spacecheck: tidy-up quotes and simplify escaping.
- spacecheck: allow folding strings with repeat spaces.
- GHA: fix a suppressed shellcheck warning.
- GHA/macos: simplify by dropping brew bundle.
- test1119.pl: precompile a regex.
- FAQ.md: delete very long link to a Windows 7/2008 support article
  that's lost it relevance.

Closes #21087

2 weeks agosha256, sha512_256: switch to wolfCrypt API
Viktor Szakats [Tue, 24 Mar 2026 22:00:02 +0000 (23:00 +0100)] 
sha256, sha512_256: switch to wolfCrypt API

Replacing the OpenSSL-like compatibility interface, and syncing with
existing API use within lib/wolfssl.c for SHA-256.

Ref: https://www.wolfssl.com/documentation/manuals/wolfssl/group__SHA.html

Follow-up to 28f0932073bfbcb977e2638e137e2519cb2b14e2 #21077
Follow-up to 988b352f917151452c4f1483214ba7012299b1e2 #21078

Closes #21090

2 weeks agosha256: support delegating to wolfSSL API
Viktor Szakats [Mon, 23 Mar 2026 21:35:24 +0000 (22:35 +0100)] 
sha256: support delegating to wolfSSL API

Offered by wolfSSL v3.11.0+ (2017-05-04).

Closes #21078

2 weeks agocurl_sha512_256: support delegating to wolfSSL API
Viktor Szakats [Mon, 23 Mar 2026 17:23:39 +0000 (18:23 +0100)] 
curl_sha512_256: support delegating to wolfSSL API

Offered by wolfSSL v5.0.0+ (2021-11-01).

Closes #21077

2 weeks agoratelimit: reset on start
Stefan Eissing [Tue, 24 Mar 2026 12:41:51 +0000 (13:41 +0100)] 
ratelimit: reset on start

On any `Curl_rlimit_start()` the rate limit needs to reset its
values before calculating the effective step duration and adjust
the tokens/burst per step.

Add two fields to the struct to remember the original values.

Closes #21086

2 weeks agowolfssl: document v5.0.0 (2021-11-01) as minimum required
Viktor Szakats [Mon, 23 Mar 2026 21:57:40 +0000 (22:57 +0100)] 
wolfssl: document v5.0.0 (2021-11-01) as minimum required

The previously documented version was based on version checks made in
the source. In practice though, curl doesn't build with <5.0.0.

Also:
- bump main internal version check.
- drop superfluous internal version checks.

Closes #21080

2 weeks agotool_setopt: return error on OOM correctly
Daniel Stenberg [Tue, 24 Mar 2026 08:35:39 +0000 (09:35 +0100)] 
tool_setopt: return error on OOM correctly

When generating mime code for the --libcurl option.

Follow-up to acdb48272a53fe97f63e5

Spotted by Codex Security

Closes #21083

2 weeks agoOS400: add new definitions to the ILE/RPG binding.
Patrick Monnerat [Sun, 22 Feb 2026 10:37:16 +0000 (11:37 +0100)] 
OS400: add new definitions to the ILE/RPG binding.

Also update supported protocols list in README.OS400.

Fixes #20672
Closes #21066

2 weeks agoRELEASE-NOTES: synced
Daniel Stenberg [Tue, 24 Mar 2026 08:09:30 +0000 (09:09 +0100)] 
RELEASE-NOTES: synced

2 weeks agoDEPRECATE: remove NTLM, SMB and local crypto implementations
Daniel Stenberg [Mon, 23 Mar 2026 21:34:39 +0000 (22:34 +0100)] 
DEPRECATE: remove NTLM, SMB and local crypto implementations

Closes #21079

2 weeks agotool_getparam: use correct free function for libcurl memory
Daniel Stenberg [Mon, 23 Mar 2026 14:04:21 +0000 (15:04 +0100)] 
tool_getparam: use correct free function for libcurl memory

Memory returned from curl_easy_escape() should be fred with curl_free()
to avoid surprises.

Follow-up to f37840a46e5eddaf109c16fa7

Spotted by Codex Security
Closes #21075

2 weeks agocurl_version_info.md: clarify age details
Daniel Stenberg [Sun, 22 Mar 2026 10:50:33 +0000 (11:50 +0100)] 
curl_version_info.md: clarify age details

The argument is not used.

Fixes #21052
Reported-by: Dan Fandrich
Closes #21059

2 weeks agolib: add thread pool and queue
Stefan Eissing [Fri, 13 Mar 2026 09:22:07 +0000 (10:22 +0100)] 
lib: add thread pool and queue

- new source files for thread pool and queue
- test cases 3217 and 3218 for them
- internal documentation

Closes #20916

2 weeks agotest2405: require wakeup
Daniel Stenberg [Mon, 23 Mar 2026 13:55:03 +0000 (14:55 +0100)] 
test2405: require wakeup

To get the correct file descriptor count

Reported-by: Marcel Raad
Fixes #21069
Closes #21074

2 weeks agolib1560: verify more URLs
Daniel Stenberg [Mon, 23 Mar 2026 12:56:12 +0000 (13:56 +0100)] 
lib1560: verify more URLs

- control codes at various places in URL, even when URL encoding
  is requested

- verify zone id extraction more

Closes #21071

2 weeks agoconfig2setopts: make --capath work in proxy disabled builds
Daniel Stenberg [Sun, 22 Mar 2026 17:17:53 +0000 (18:17 +0100)] 
config2setopts: make --capath work in proxy disabled builds

Follow-up to 95e8515ca0801c2b1aacbdad0

Spotted by Codex Security

Closes #21063

2 weeks agotest1714: verify telnet download with --max-filesize
Daniel Stenberg [Fri, 20 Mar 2026 09:33:12 +0000 (10:33 +0100)] 
test1714: verify telnet download with --max-filesize

(disabled on Windows because of hangs)

Closes #21023

2 weeks agogenserv.pl: make external calls safe
Viktor Szakats [Wed, 18 Mar 2026 00:39:18 +0000 (01:39 +0100)] 
genserv.pl: make external calls safe

By passing command-line as separate arguments instead of using a single
string. This needs skipping the shell, so rework redirections to use
Perl `open3()`.

Also explored to use `-out` to avoid redirections, but it makes the
command-line incompatible with some OpenSSL implementations/versions
(e.g. on default macOS), and would still need a solution for
`2>/dev/null`.

Ref: https://perldoc.perl.org/IPC::Open3

Closes #20971

2 weeks agourldata: make hstslist only present in HSTS builds
Daniel Stenberg [Mon, 23 Mar 2026 07:56:44 +0000 (08:56 +0100)] 
urldata: make hstslist only present in HSTS builds

Closes #21068

2 weeks agonetrc: remove unused parsenetrc() macro for netrc-disabled
Daniel Stenberg [Mon, 23 Mar 2026 07:51:02 +0000 (08:51 +0100)] 
netrc: remove unused parsenetrc() macro for netrc-disabled

When netrc is disabled, this macro is unused (and wrong).

Closes #21067

2 weeks agourlapi: fix handling of "file:///"
Daniel Stenberg [Mon, 23 Mar 2026 08:19:45 +0000 (09:19 +0100)] 
urlapi: fix handling of "file:///"

When the path is exactly one byte, a single slash.

Extended test 1560 to verify.

Found by Codex Security

Closes #21070

2 weeks agourlapi: remove redundant condition in dedotdotify
Daniel Stenberg [Sun, 22 Mar 2026 22:53:35 +0000 (23:53 +0100)] 
urlapi: remove redundant condition in dedotdotify

Bonus: remove two variables, clear up some comments.

Poined out by CodeSonar

Closes #21065

2 weeks agotool_operate: fix memory-leak on failed uploads
Daniel Stenberg [Sun, 22 Mar 2026 12:08:43 +0000 (13:08 +0100)] 
tool_operate: fix memory-leak on failed uploads

Add test case 1673 to do repeated upload failures and verify there is no
leak. This proved a previous leak and now it verifies the fix.

Reported-by: James Fuller
Closes #21062

2 weeks agoasyn-thrdd: fix clang-tidy unused value warning
Viktor Szakats [Sun, 22 Mar 2026 11:55:42 +0000 (12:55 +0100)] 
asyn-thrdd: fix clang-tidy unused value warning

with `-DCURL_DISABLE_SOCKETPAIR=ON`.

```
lib/asyn-thrdd.c:227:5: error: Value stored to 'do_abort' is never read [clang-analyzer-deadcode.DeadStores,-warnings-as-errors]
  227 |     do_abort = addr_ctx->do_abort;
      |     ^          ~~~~~~~~~~~~~~~~~~
```

Closes #21061