Commit Graph

38330 Commits

Author SHA1 Message Date
Daniel Stenberg
e96cb8b1d8
buildconf: remove
Not used since 85868537d6 (Aug 2020)

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

Closes #21210
2026-04-04 11:35:24 +02:00
Daniel Stenberg
b1784ead8e
RELEASE-NOTES: synced 2026-04-03 22:33:41 +02:00
Daniel Stenberg
1bf663e32f
dnscache: fix locking for negative caching
Reported-by: Izan on hackerone
Closes #21209
2026-04-03 22:27:59 +02:00
Samuel Henrique
f4eddde9dc
test 766: flag as timing-dependent
We have noticed this test as failing when run in parallel in Fedora and
Amazon Linux:
389f140954

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
2026-04-03 17:07:36 +02:00
Stefan Eissing
78e281bf6a
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
2026-04-03 17:06:16 +02:00
Dan Fandrich
c54a3319ad CI: Fix or remove obsolete files in labeler config
Add a few more paths, too.
2026-04-02 10:11:42 -07:00
Daniel Stenberg
e65ba1bd34
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
2026-04-02 18:01:20 +02:00
Viktor Szakats
dc20c91e04
GHA/windows: switch back to the canonical Cygwin mirror
The spare one is at the time of this patch inaccessible.

Follow-up to fb5541c28b #20583

Closes #21207
2026-04-02 17:00:05 +02:00
Viktor Szakats
e127f8ce84
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] 0e4bd38a5b/libssh.sh (L11-L94)

Refs:
https://www.libssh.org/2026/02/10/libssh-0-12-0-and-0-11-4-security-releases/
91382507d5
#21199 (unsuccessful fix attempts)

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

Closes #21204
2026-04-02 16:40:26 +02:00
Stefan Eissing
99d5b90878
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
2026-04-02 13:15:53 +02:00
Stefan Eissing
33e43985b8
url: improve connection reuse on negotiate
Check state of negotiate to allow proper connection reuse.

Closes #21203
2026-04-02 13:14:29 +02:00
Daniel Stenberg
b27e828b93
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
2026-04-02 10:50:23 +02:00
Daniel Stenberg
93e80c75b4
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 03a792b186

Closes #21200
2026-04-02 10:22:35 +02:00
Daniel Stenberg
d888a53e14
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
2026-04-02 09:55:25 +02:00
Dan Fandrich
38b626e790 CI: Improve labeler tag detection
Add entries for relevant new files added in the last two years.
2026-04-01 17:44:04 -07:00
Viktor Szakats
0b06b944fe
spelling: fix typos
Closes #21198
2026-04-01 22:50:12 +02:00
dependabot[bot]
fcf946e846
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
2026-04-01 22:50:11 +02:00
Viktor Szakats
0df6c01db3
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
2026-04-01 19:53:53 +02:00
Stefan Eissing
2b3dfb4ad4
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
2026-04-01 15:36:31 +02:00
Daniel Stenberg
03a792b186
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
2026-04-01 14:38:41 +02:00
Daniel Stenberg
4f3a0ef90d
test1275.pl: ignore indented sections in markdowns
They are special and should not be checked like this.

Closes #21191
2026-04-01 14:36:10 +02:00
Daniel Stenberg
0805ec043e
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
2026-04-01 12:05:47 +02:00
Daniel Stenberg
c1963e2d2c
altsvc: drop the prio field from the struct
The value is not used for anything, no point in keeping it in memory.

Closes #21188
2026-04-01 11:06:43 +02:00
Daniel Stenberg
11609c3d45
alt-svc: skip expired entries read from file
Extend test 1654 to verify

Closes #21187
2026-04-01 10:56:11 +02:00
Daniel Stenberg
4478a10f0d
hsts: skip expired HSTS entries read from file
Extend test 780 to verify

Closes #21186
2026-04-01 10:49:26 +02:00
Daniel Stenberg
8e8bdd3604
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
2026-04-01 10:45:05 +02:00
Alex Hamilton
46d107d0e7
docs/cmdline-opts: tidy up retry-connrefused
Closes #21182
2026-04-01 08:34:56 +02:00
Daniel Stenberg
1ec912d292
http: refactor http_on_response into sub functions
Reduces complexity.

Closes #21172
2026-03-31 23:53:45 +02:00
Viktor Szakats
a5838847c4
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 5172ba5475 #21107

Closes #21181
2026-03-31 23:39:47 +02:00
Daniel Stenberg
6eab0a42e3
md5: fix large size handling
Follow-up to dd7fcd581f

Closes #21180
2026-03-31 17:53:03 +02:00
Daniel Stenberg
dd7fcd581f
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
2026-03-31 17:19:56 +02:00
Viktor Szakats
1570091f10
INSTALL.md: refer to as Cygwin
Replacing `cygwin`.

Closes #21179
2026-03-31 17:17:47 +02:00
Viktor Szakats
f14d9e6efc
cmake: enable pthreads for BoringSSL/AWS-LC
Depends on 6828df7d21 #21176

Closes #21168
2026-03-31 17:17:47 +02:00
Daniel Stenberg
c31fcf2dec
docs: SSH host verification is done at connect time
Connection reuse is done more "casually" once verified.

Closes #21173
2026-03-31 17:15:47 +02:00
John Haugabook
c1f7ffd572
INSTALL.md: update Cygwin instructions
Polish Cygwin section of install, adding suggestions for:

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

Closes #20995
2026-03-31 16:49:57 +02:00
Viktor Szakats
6828df7d21
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
2026-03-31 13:23:46 +02:00
Daniel Stenberg
3e677a9a26
RELEASE-NOTES: synced 2026-03-31 09:02:47 +02:00
Daniel Stenberg
9b36748938
http2: return error on OOM in push headers
Reported-by: M42kL33 on hackerone
Bug: https://hackerone.com/reports/3636044
Closes #21171
2026-03-31 08:59:07 +02:00
Daniel Stenberg
2f93a0e6bb
CURLOPT_SSL_CTX_FUNCTION.md: expand on effects connection reuse
Closes #21164
2026-03-31 07:50:56 +02:00
Daniel Stenberg
8e89646a3d
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 e26eefd9ce

Reported-by: James Fuller

Closes #21165
2026-03-31 07:43:47 +02:00
Dan Fandrich
bae6237c45 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
2026-03-30 21:54:39 -07:00
Viktor Szakats
b9690e9cd1
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 2d546d239e #21163

Closes #21170
2026-03-31 05:33:45 +02:00
Viktor Szakats
e49190f9f3
cf-https-connect: silence -Wimplicit-int-enum-cast with HTTPS-RR + clang 21 (reapply)
Reapply: e09a7b83d6 #21057

Also:
- enable HTTPS-RR by default in curl-for-win to test it with clang 21.
  Ref: dc65c449f3

Follow-up to 335dc0e3c5 #21027

Closes #21167
2026-03-31 03:32:36 +02:00
renovate[bot]
9dc3c06aa7
GHA: update dependency google/boringssl to v0.20260327.0
Closes #21166
2026-03-31 00:51:04 +02:00
Viktor Szakats
2d546d239e
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
2026-03-31 00:51:04 +02:00
Viktor Szakats
ce6c441cf2
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: 930f2e8227 #21144

Closes #21158
2026-03-30 18:57:07 +02:00
Daniel Stenberg
9f7295fb23
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 a186ecf4bf

Closes #21160
2026-03-30 18:50:44 +02:00
Daniel Stenberg
7deed5bb55
wolfssl: fix build without TLS 1.3 support
Follow-up to: eac64c1879

Closes #21161
2026-03-30 18:50:02 +02:00
Stefan Eissing
8deaf04feb
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
2026-03-30 18:39:12 +02:00
Daniel Stenberg
eac64c1879
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
2026-03-30 16:46:53 +02:00