]> git.ipfire.org Git - thirdparty/curl.git/log
thirdparty/curl.git
3 weeks agolibssh: fix 64-bit printf mask for mingw-w64 <=6.0.0
Viktor Szakats [Sun, 5 Apr 2026 13:31:35 +0000 (15:31 +0200)] 
libssh: fix 64-bit printf mask for mingw-w64 <=6.0.0

Fixing (dl-mingw, CM 6.4.0-i686 (mingw-w64 5.0.0) schannel !unity):
```
lib/vssh/libssh.c: In function 'myssh_in_SFTP_QUOTE_STATVFS':
lib/vssh/libssh.c:573:31: error: ISO C does not support the 'I' printf flag [-Werror=format=]
     char *tmp = curl_maprintf("statvfs:\n"
                               ^~~~~~~~~~~~
lib/vssh/libssh.c:573:31: error: format '%u' expects argument of type 'unsigned int', but argument 2 has type 'uint64_t {aka long long unsigned int}' [-Werror=format=]
lib/vssh/libssh.c:573:31: error: ISO C does not support the 'I' printf flag [-Werror=format=]
[...]
```
Ref: https://github.com/curl/curl/actions/runs/24002480364/job/70000685821

mingw-w64 <=6.0.0 define `PRIu64` like this:
```
./inttypes.h:#define PRIu64 "I64u"
```

Follow-up to 413a0fedd02c8c6df1d294534b8c6e306fcca7a2 #12346
Cherry-picked from #21227

Closes #21229

3 weeks agoshare: do bitshifts after the type is checked to be valid
Daniel Stenberg [Sun, 5 Apr 2026 12:46:40 +0000 (14:46 +0200)] 
share: do bitshifts after the type is checked to be valid

Fixes #21224
Reported-by: bird on github
Closes #21226

3 weeks agolibssh: fix `-Wsign-compare` in 32-bit builds by dropping a redundant check
Viktor Szakats [Sun, 5 Apr 2026 09:32:48 +0000 (11:32 +0200)] 
libssh: fix `-Wsign-compare` in 32-bit builds by dropping a redundant check

Follow-up to 8c8eeba5225599a1f5750ece1d15751a8bfce0bb #21214 (wrong silencing)
Follow-up to c049c37acd074a61bbd07eebe25fdf32af575a2a #18989 (add redundant check)
Follow-up to c988ec9f41060144e175b519f9017c569ac8d3db #9328 (make check fail)
Follow-up to 44a02d2532c4e6dabb8f2a074d52d5e99ff533be #9324 (add original check)

Closes #21225

3 weeks agoruntests: allow configuring SSH host/client key algorithm
Viktor Szakats [Wed, 1 Apr 2026 23:05:54 +0000 (01:05 +0200)] 
runtests: allow configuring SSH host/client key algorithm

via env `CURL_TEST_SSH_KEYALGO`, `rsa` (default), `ecdsa`, `ed25519`.

To ease debugging and testing and to make these code paths more
universal.

Closes #21223

3 weeks agosendf: fix CR detection if no LF is in the chunk
Daniel Stenberg [Sat, 4 Apr 2026 16:10:31 +0000 (18:10 +0200)] 
sendf: fix CR detection if no LF is in the chunk

When doing line ending conversions, and a chunk contains no '\n', the
function returned early without updating prev_cr to reflect the last
byte. It could then lead to CRLFs sequences not get converted when
occuring right on the boundary border.

Found by Codex Security

Closes #21221

3 weeks agoGHA/windows: restore libssh, fix to pass tests with 0.12.0
Viktor Szakats [Thu, 2 Apr 2026 15:03:16 +0000 (17:03 +0200)] 
GHA/windows: restore libssh, fix to pass tests with 0.12.0

libssh 0.12.0 on Windows 64-bit Intel fails to connect to sshd (with SSH
state 30) when using the mlkem768x25519-sha256 KEX. (32-bit Intel, ARM64
and tested non-Windows platforms work fine.) Fix by disabling this KEX
for the libssh job.

I do not recommend libssh on Windows due to bugs an insecure behavior.

Also:
- fix libssh TFLAGS condition for mingw-w64.

Follow-up to e127f8ce843e1c070c0ca2074c10dcc01081a395 #21204
Follow-up to fcf946e8461b68840e4afb39711a52c9bf622a10 #21195

Closes #21199

3 weeks agosshserver.pl: add option to disable KEX algorithms in sshd
Viktor Szakats [Thu, 2 Apr 2026 15:03:16 +0000 (17:03 +0200)] 
sshserver.pl: add option to disable KEX algorithms in sshd

Cherry-picked from #21199

Closes #21220

3 weeks agodoh: remove superfluous doh_req check
Daniel Stenberg [Sat, 4 Apr 2026 10:57:49 +0000 (12:57 +0200)] 
doh: remove superfluous doh_req check

It has already been checked previously in the function.

Spotted by CodeSonar

Closes #21216

3 weeks agoCURLOPT_UPLOAD_FLAGS.md: expand
Daniel Stenberg [Sat, 4 Apr 2026 11:28:21 +0000 (13:28 +0200)] 
CURLOPT_UPLOAD_FLAGS.md: expand

And list each supported flag in a nicer way

Closes #21218

3 weeks agourl: set default upload flags to CURLULFLAG_SEEN
Daniel Stenberg [Sat, 4 Apr 2026 11:11:20 +0000 (13:11 +0200)] 
url: set default upload flags to CURLULFLAG_SEEN

As documented. Not doing this was a regression.

Follow-up to 6758aa722ddf5a6db819b753d96

Reported by Codex Security

Closes #21217

3 weeks agoGHA/windows: bump OpenSSH-Windows to v10, other improvements
Viktor Szakats [Sat, 4 Apr 2026 12:57:16 +0000 (14:57 +0200)] 
GHA/windows: bump OpenSSH-Windows to v10, other improvements

- use it in a mingw-w64 job.
- add support for native ARM64 binaries.
- add ability to use built-in OpenSSH server in mingw-w64 jobs.

Cherry-picked from #21199

Closes #21219

3 weeks agoGHA/windows: switch 3 mingw-w64 jobs to ucrt64
Viktor Szakats [Sat, 4 Apr 2026 00:27:55 +0000 (02:27 +0200)] 
GHA/windows: switch 3 mingw-w64 jobs to ucrt64

mingw-w64 (using msvcrt) is in legacy status.

Ref: https://www.msys2.org/docs/environments/

Closes #21213

3 weeks agolibssh: fix `-Wsign-compare` in 32-bit builds
Viktor Szakats [Sat, 4 Apr 2026 00:14:30 +0000 (02:14 +0200)] 
libssh: fix `-Wsign-compare` in 32-bit builds

Seen with mingw-w64 i686 gcc 15.2.0 (mingw32):
```
D:/a/curl/curl/lib/vssh/libssh.c: In function 'myssh_in_SFTP_QUOTE_STAT':
D:/a/curl/curl/lib/vssh/libssh.c:1664:13: error: comparison of integer expressions
  of different signedness: 'time_t' {aka 'long int'} and 'unsigned int' [-Werror=sign-compare]
 1664 |     if(date > UINT_MAX)
      |             ^
cc1.exe: all warnings being treated as errors
```
Ref: https://github.com/curl/curl/actions/runs/23966805891/job/69908216152

Cherry-picked from #21199

Closes #21214

3 weeks agodocs: CURLOPT_LOGIN_OPTIONS is a login property
Daniel Stenberg [Sat, 4 Apr 2026 09:21:37 +0000 (11:21 +0200)] 
docs: CURLOPT_LOGIN_OPTIONS is a login property

Test case 1982 verifies this

Closes #21215

3 weeks agobuildconf: remove rc-8_20_0-1
Daniel Stenberg [Fri, 3 Apr 2026 21:04:01 +0000 (23:04 +0200)] 
buildconf: remove

Not used since 85868537d6d5b (Aug 2020)

Removed from the release tarballs since 91fcbc5d1a489c (Aug 2024)

Closes #21210

3 weeks agoRELEASE-NOTES: synced
Daniel Stenberg [Fri, 3 Apr 2026 20:33:41 +0000 (22:33 +0200)] 
RELEASE-NOTES: synced

3 weeks agodnscache: fix locking for negative caching
Daniel Stenberg [Thu, 2 Apr 2026 20:10:33 +0000 (22:10 +0200)] 
dnscache: fix locking for negative caching

Reported-by: Izan on hackerone
Closes #21209

3 weeks agotest 766: flag as timing-dependent
Samuel Henrique [Mon, 30 Mar 2026 05:18:52 +0000 (22:18 -0700)] 
test 766: flag as timing-dependent

We have noticed this test as failing when run in parallel in Fedora and
Amazon Linux:
https://src.fedoraproject.org/rpms/curl/c/389f1409549178f639afa49f478c544fdaa87be2?branch=rawhide

Debian did not have issues but given there are other FTP tests flagged
as timing-dependent, it makes sense to flag this one too if we notice
failures in other OSes.

Closes #21155

3 weeks agotool: fix retries in parallel mode
Stefan Eissing [Wed, 1 Apr 2026 12:35:18 +0000 (14:35 +0200)] 
tool: fix retries in parallel mode

Verify that curl's --retry behaviour works

- test 502 in serial, works
- test 502 in parallel, hangs forver, test skipped by default
- test 401, no retries done

Fixes #20669
Reported-by: BlackFuffey on github
Closes #21206

3 weeks agoCI: Fix or remove obsolete files in labeler config
Dan Fandrich [Thu, 2 Apr 2026 16:57:37 +0000 (09:57 -0700)] 
CI: Fix or remove obsolete files in labeler config

Add a few more paths, too.

3 weeks agohsts: make the HSTS read callback handle name dupes
Daniel Stenberg [Thu, 2 Apr 2026 07:16:17 +0000 (09:16 +0200)] 
hsts: make the HSTS read callback handle name dupes

Now the logic for handling name duplicates and picking the longest
expiry and strictest subdomain is the same for the callback as for when
reading from file.

Also strip trailing dots from the hostname added by the callback.

A minor side-effect is that the hostname provided by the callback can
now enable subdomains by starting the name with a dot, but we discourage
using such hostnames in documentation.

Amended test 1915 to verify.

Closes #21201

3 weeks agoGHA/windows: switch back to the canonical Cygwin mirror
Viktor Szakats [Thu, 2 Apr 2026 14:49:23 +0000 (16:49 +0200)] 
GHA/windows: switch back to the canonical Cygwin mirror

The spare one is at the time of this patch inaccessible.

Follow-up to fb5541c28bdc7761c50423335f44b698d36caef1 #20583

Closes #21207

3 weeks agoGHA/windows: drop building with libssh
Viktor Szakats [Thu, 2 Apr 2026 09:46:22 +0000 (11:46 +0200)] 
GHA/windows: drop building with libssh

Bumping `msys2/setup-msys2` from 2.30.0 to 2.31.0 also brought libssh
0.12.0 (after 0.11.3). libssh has been long known for loading OpenSSH
configuration from disk insecurely on Windows. 0.12.0 brings some fixes
to this (CVE-2025-14821), which in turn may be changing its behavior on
the default GH Windows runner to fail all curl SCP/SFTP tests.

Detecting what is the exact root cause, then defining exact runtime
conditions for it is difficult and fragile. Same for changing these
libssh defaults (if at all possible.)

But, since configuration loading remains insecure and broken on Windows
even after the mitigations made by 0.12.0 [0], this patch removes libssh
from the Windows CI job using it previously.

If someone figures out how to run in CI, it can be readded, though in
general, using libssh on Windows seems to be less than ideal.

[0] https://github.com/curl/curl-for-win/blob/0e4bd38a5b90f6431b4c145ed094940b4d6b6c0d/libssh.sh#L11-L94

Refs:
https://www.libssh.org/2026/02/10/libssh-0-12-0-and-0-11-4-security-releases/
https://github.com/msys2/MINGW-packages/commit/91382507d5df17d89c074a1469bf3725a9602ff5
#21199 (unsuccessful fix attempts)

Bug: https://github.com/curl/curl/pull/21195#issuecomment-4173085194
Follow-up to fcf946e8461b68840e4afb39711a52c9bf622a10 #21195

Closes #21204

3 weeks agoasyn-thrdd: item cleanup using resolv_id
Stefan Eissing [Thu, 2 Apr 2026 07:44:39 +0000 (09:44 +0200)] 
asyn-thrdd: item cleanup using resolv_id

Now that we support multiple async operations at the same transfer,
fix the thread queue cleanup to match not only the mid but also the
resolv_id.

Found by Codex Security

Closes #21202

3 weeks agourl: improve connection reuse on negotiate
Stefan Eissing [Thu, 2 Apr 2026 09:33:39 +0000 (11:33 +0200)] 
url: improve connection reuse on negotiate

Check state of negotiate to allow proper connection reuse.

Closes #21203

3 weeks agourl: init req.no_body in DO so that it works for h2 push
Daniel Stenberg [Wed, 1 Apr 2026 13:44:02 +0000 (15:44 +0200)] 
url: init req.no_body in DO so that it works for h2 push

req.no_body was only initialized in Curl_connect, while HTTP/2 server
push adds a duplicated handle via Curl_multi_add_perform and calls
Curl_init_do with conn==NULL, never invoking Curl_connect.

Verify it by amending test 1620

Found by Codex Security

Closes #21194

3 weeks agohsts: accept 10K entries in the list
Daniel Stenberg [Thu, 2 Apr 2026 06:05:40 +0000 (08:05 +0200)] 
hsts: accept 10K entries in the list

Up from 1K.

Reduces the risk that someone could flush the list by tricking a user to
do many transfers to new hostnames.

Document the limit.

Follow-up to 03a792b186da7fdfbe4b85b022d7

Closes #21200

3 weeks agolibssh: path length precaution
Daniel Stenberg [Wed, 1 Apr 2026 13:31:48 +0000 (15:31 +0200)] 
libssh: path length precaution

Make sure the string is non-zero before indexing it -1. Right now, the
path is always non-zero length so this is more for (future) safety
reasons.

Closes #21193

3 weeks agoCI: Improve labeler tag detection
Dan Fandrich [Thu, 2 Apr 2026 00:44:04 +0000 (17:44 -0700)] 
CI: Improve labeler tag detection

Add entries for relevant new files added in the last two years.

3 weeks agospelling: fix typos
Viktor Szakats [Wed, 1 Apr 2026 20:41:42 +0000 (22:41 +0200)] 
spelling: fix typos

Closes #21198

3 weeks agoGHA: bump actions and pips
dependabot[bot] [Wed, 1 Apr 2026 18:58:46 +0000 (18:58 +0000)] 
GHA: bump actions and pips

- update `actions/cache` from 5.0.3 to 5.0.4
- update `actions/download-artifact` from 7.0.0 to 8.0.1
- update `actions/upload-artifact` from 6.0.0 to 7.0.0
- update `msys2/setup-msys2` from 2.30.0 to 2.31.0
- update pip `ruff` from 0.15.7 to 0.15.8

Closes #21195
Closes #21197

3 weeks agotidy-up: rename `Curl_safefree()`/`tool_safefree()` to `curlx_safefree()`
Viktor Szakats [Sun, 29 Mar 2026 23:54:10 +0000 (01:54 +0200)] 
tidy-up: rename `Curl_safefree()`/`tool_safefree()` to `curlx_safefree()`

To sync names for the same macro logic between lib and src, and to move
it to the curlx namespace, to match `curlx_free()` that it's calling.

Closes #21151

3 weeks agolib: make resolving HTTPS DNS records reliable:
Stefan Eissing [Tue, 31 Mar 2026 09:45:21 +0000 (11:45 +0200)] 
lib: make resolving HTTPS DNS records reliable:

- allow to specify when they are wanted on starting a resolve
- match dns cache entries accordingly. An entry which never
  tried to get HTTPS-RRs is no answer for a resolve that wants
  it.
- fix late arrivals of resolve answers to match the "async"
  records that started them - if it still exists.
- provide for multiple "async" resolves in a transfer at the
  same time. We may need to resolve an IP interface while the
  main connection resolve has not finished yet.
- allow lookup of HTTPS-RR information as soon as it is
  available, even if A/AAAA queries are still ongoing.

For this, the "async" infrastructure is changed:

- Defined bits for DNS queries `CURL_DNSQ_A`, `CURL_DNSQ_AAAA`
  and `CURL_DNSQ_HTTPS`. These replace `ip_version` which says
  nothing about HTTPS.
  Use them in dns cache entries for matching.
- enhance the `async->id` to be a unique `uint32_t` for
  resolves inside one multi. This is weak, as the id may
  wrap around. However it is combined with the `mid` of
  the easy handle, making collisions highly unlikely.
  `data->state.async` is only accessed in few places where
  the mid/async-id match is performed.
- vtls: for ECH supporting TLS backends (openssl, rustls, wolfssl),
  retrieve the HTTPS-RR information from the dns connection filter.
  Delay the connect if the HTTPS-RR is needed, but has not
  been resolved yet.

The implementation of all this is complete for the threaded
resolver. c-ares resolver and DoH do not take advantage of
all new async features yet. To be done in separate PRs.

Details:

c-ares: cleanup settings and initialisation. Any ares channel
is only being created on starting a resolve and propagating
operations in setopt.c to the channel are not helpful.

Changed threaded+ares pollset handling so that they do not
overwrite each others `ASYNC_NAME` timeouts.

Add trace name 'threads' for tracing thread queue and
pool used by threaded resolver.

Closes #21175

3 weeks agoHSTS: cap the list at 1,000 entries
Daniel Stenberg [Wed, 1 Apr 2026 08:24:06 +0000 (10:24 +0200)] 
HSTS: cap the list at 1,000 entries

Avoid never-ending growth.

When adding more entries, it now deletes the first entry in the list,
which is the oldest added entry still held in memory. I decided to avoid
a Least Recently Used concept as I suspect with a list with this many
entries most entries have not been used, and we don't save the timestamp
of recent use anyway.

The net effect might (no matter what) be that the removed entry might
feel a bit "random" in the eyes of the user.

Verify with test 1674

Ref #21183
Closes #21190

3 weeks agotest1275.pl: ignore indented sections in markdowns
Daniel Stenberg [Wed, 1 Apr 2026 09:59:44 +0000 (11:59 +0200)] 
test1275.pl: ignore indented sections in markdowns

They are special and should not be checked like this.

Closes #21191

3 weeks agoaltsvc: cap the list at 5,000 entries
Daniel Stenberg [Wed, 1 Apr 2026 07:53:42 +0000 (09:53 +0200)] 
altsvc: cap the list at 5,000 entries

Avoid never-ending growth.

When adding more entries, it now deletes the first entry in the list,
which is the oldest added entry still held in memory. I decided to avoid
a Least Recently Used concept as I suspect with a list with this many
entries most entries have not been used, and we don't save the timestamp
of recent use anyway.

The net effect might (no matter what) be that the removed entry might
feel a bit "random" in the eyes of the user.

Verify with test 1669.

Reported-by: Geeknik Labs
Fixes #21183
Closes #21189

3 weeks agoaltsvc: drop the prio field from the struct 21188/head
Daniel Stenberg [Wed, 1 Apr 2026 07:23:44 +0000 (09:23 +0200)] 
altsvc: drop the prio field from the struct

The value is not used for anything, no point in keeping it in memory.

Closes #21188

3 weeks agoalt-svc: skip expired entries read from file
Daniel Stenberg [Wed, 1 Apr 2026 07:16:31 +0000 (09:16 +0200)] 
alt-svc: skip expired entries read from file

Extend test 1654 to verify

Closes #21187

3 weeks agohsts: skip expired HSTS entries read from file
Daniel Stenberg [Wed, 1 Apr 2026 06:51:25 +0000 (08:51 +0200)] 
hsts: skip expired HSTS entries read from file

Extend test 780 to verify

Closes #21186

3 weeks agocookie: fix rejection when tabs in value
Daniel Stenberg [Wed, 1 Apr 2026 06:09:47 +0000 (08:09 +0200)] 
cookie: fix rejection when tabs in value

A previous refactor changed the TAB check so that the octet could be
accepted in the 'path', which would cause an invalid line in the saved
cookie file so not possible to read the cookie back. Not terrible
because the path cannot contain a raw tab anyway so it would never match
anyway.

Add test 1685 to verify

Reported-by: Izan on hackerone
Closes #21185

3 weeks agodocs/cmdline-opts: tidy up retry-connrefused
Alex Hamilton [Tue, 31 Mar 2026 19:27:07 +0000 (14:27 -0500)] 
docs/cmdline-opts: tidy up retry-connrefused

Closes #21182

3 weeks agohttp: refactor http_on_response into sub functions
Daniel Stenberg [Tue, 31 Mar 2026 05:56:45 +0000 (07:56 +0200)] 
http: refactor http_on_response into sub functions

Reduces complexity.

Closes #21172

3 weeks agoGHA: try workaround for slow Azure Ubuntu distro server (cont.)
Viktor Szakats [Tue, 31 Mar 2026 19:01:57 +0000 (21:01 +0200)] 
GHA: try workaround for slow Azure Ubuntu distro server (cont.)

- fail if all retries failed.
- run `dpkg --configure -a` after an aborted slow attempt.

```
Selecting previously unselected package libsys-hostname-long-perl.
Error: slow server, retry
E: dpkg was interrupted, you must manually run 'sudo dpkg --configure -a' to correct the problem.
[...]
```

Bug: https://github.com/curl/curl/pull/21107#issuecomment-4163506100
Follow-up to 5172ba5475cffc525c2338dfa63f818e11e80a42 #21107

Closes #21181

4 weeks agomd5: fix large size handling
Daniel Stenberg [Tue, 31 Mar 2026 15:36:11 +0000 (17:36 +0200)] 
md5: fix large size handling

Follow-up to dd7fcd581f68fb76198497d

Closes #21180

4 weeks agolib: accept larger input to md5/hmac/sha256/sha512 functions
Daniel Stenberg [Tue, 31 Mar 2026 09:22:34 +0000 (11:22 +0200)] 
lib: accept larger input to md5/hmac/sha256/sha512 functions

Avoid unchecked data conversions from size_t to unsigned int.

Reported-by: James Fuller
Closes #21174

4 weeks agoINSTALL.md: refer to as Cygwin
Viktor Szakats [Tue, 31 Mar 2026 14:52:50 +0000 (16:52 +0200)] 
INSTALL.md: refer to as Cygwin

Replacing `cygwin`.

Closes #21179

4 weeks 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

4 weeks 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

4 weeks 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

4 weeks 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

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

4 weeks 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

4 weeks 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

4 weeks 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

4 weeks 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

4 weeks 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

4 weeks 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

4 weeks 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

4 weeks 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

4 weeks 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

4 weeks 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

4 weeks 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

4 weeks 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

4 weeks 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

4 weeks 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

4 weeks 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

4 weeks 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

4 weeks 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

4 weeks 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

4 weeks 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

4 weeks 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

4 weeks 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

4 weeks 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

4 weeks 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

4 weeks 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

4 weeks 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

4 weeks 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

4 weeks 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

4 weeks 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

4 weeks 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

4 weeks 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

4 weeks 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

4 weeks 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

4 weeks 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

4 weeks 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

4 weeks 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

4 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

4 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

4 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

4 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

4 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

4 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

4 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

4 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

4 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

4 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

4 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

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

4 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

4 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