Commit graph

39040 commits

Author SHA1 Message Date
Viktor Szakats
5a2af800de
GHA/linux: bump analyzer job to gcc-16, and ubuntu-26.04
To fix false positive gcc analyzer warning
`-Wanalyzer-deref-before-check`, seen with gcc-15 and lower.

Also bump its pair job.

Tests with #22082 applied:
gcc-13: https://github.com/curl/curl/actions/runs/27761999978/job/82138558662 (warning)
gcc-15: https://github.com/curl/curl/actions/runs/27767571050/job/82158465527 (warning)
gcc-16: https://github.com/curl/curl/actions/runs/27767332723/job/82157636394 (OK)

Ref: #22082
Fixes #22083

Closes #22084
2026-06-18 17:01:02 +02:00
alhudz
2f8fb98c5f
pingpong: reject nul byte in server response line
Add test 2108 covering the rejection over FTP. Drop the now-vestigial
nul bytes from test 1282; they exercised the removed Kerberos FTP
security buffer check and now trip this rejection before the 633
login-denied path is reached.

Closes #21996
2026-06-18 14:17:27 +02:00
Daniel Stenberg
a7e35c9194
docs/VERIFY: expand with more things we do
Closes #22080
2026-06-18 12:55:22 +02:00
Viktor Szakats
2d70c815e4
GHA/linux: use default GCC compiler, drop CC/CXX envs
At the time of the original commit, the runner was ubuntu-22.04 with
a default GCC 11. It made sense to bump to 12 manually. Since 2025,
the default is ubuntu-24.04 with GCC 13, when this became a downgrade.

Drop manual envs and bump to GCC 13 with it. Other options available are
14, 15 and 16.

Refs:
https://packages.ubuntu.com/jammy/gcc (ubuntu-22.04)
https://packages.ubuntu.com/noble/gcc (ubuntu-24.04)

Follow-up to 6079ff314b #22075
Follow-up to a8174176b5 #13841

Closes #22077
2026-06-18 10:56:12 +02:00
Viktor Szakats
6079ff314b
GHA/http3-linux: simplify setting CC/CXX envs
Replace `GITHUB_ENV` method by defining these envs at workflow-level.

Follow-up to a8174176b5 #13841

Closes #22075
2026-06-18 10:42:17 +02:00
Viktor Szakats
af94731a43
GHA/linux: drop arm runner home attribute workaround (fixed upstream)
Issue had been fixed in the ubuntu-24.04-arm runner image upstream.

now:
```
$ ls -l /home  # on arm
drwxr-x---  11 runner runner 4096 Jun 18 08:19 runner

$ ls -l /home  # on intel
drwxr-x---  11 runner runner 4096 Jun 18 08:19 runner
```

Follow-up to 2b0d8dcc16 #20231

Closes #22076
2026-06-18 10:42:17 +02:00
Stefan Eissing
f0be417635
multi: xfers_really_alive
Yes, we were counting the "live" transfers before, but were they
*really* alive?

When determining to add the wakeup socket to fdset/waitfds etc, we
should only do that when the multi handle is actually processing
transfers. Other wise, the application could wait on the wakeup socket
forever.

For this, we counted `multi->xfers_alive` (e.g. the "running" number
returned by `curl_multi_perform()`). This was almost correct.

The problem is that added easy handles are counted as "alive" right away
on the addition. But the processing has not started yet. They did not
trigger any DNS resolves or opened any sockets yet.

Add two fields in multi and easy handle:

* `multi->xfers_really_alive`: counts the "alive" transfers that have
  passed `MSTATE_INIT` (at least once)
* `data->state.really_alive`: to track if the transfer has been counted

Add test 2412 to check that adding transfers without perform will not
trigger the wakeup socket to be added.

Fixes #22050
Reported-by: Bryan Henderson
Closes #22066
2026-06-18 10:31:40 +02:00
Daniel Stenberg
abad1c9e48
RELEASE-PROCEDURE.md: update coming relese dates
Adjusted for the summer of bliss 2026
2026-06-18 08:31:39 +02:00
alhudz
4a86af9940
cookie: reject control octets in file-loaded cookies
Verified by test 2311

Closes #22070
2026-06-18 08:04:24 +02:00
Yedaya Katsman
9ccc80b192
url: don't log bits.close state
This doesn't seem useful to users, and there doesn't seem to be a
scenario where bits.close is set to 1 during this logging anyway.

Closes #22073
2026-06-18 08:03:43 +02:00
Viktor Szakats
e136694525
cmake/FindGSS: drop CMake <3.16 compatibility logic
Redundant since bumping minimum to 3.18.

Follow-up to 89043ba906 #20407
Follow-up to 1f11224232 #18950

Closes #22072
2026-06-17 18:38:46 +02:00
Viktor Szakats
6db0ba2a38
cmake/FindGSS: drop "MIT Unknown" version value, related tidy ups
After this patch the `GSS_VERSION` value is left empty in all cases when
there is known version number (potentially on Windows).

Also:
- sync `GSS_FOUND` comment with other Find modules.
- sync `GSS_VERSION` comment with other Find modules, drop the promise
  of returning "unknown", which was not true and also not done by other
  Find modules.
- tidy up Windows-registry-based MIT `GSS_VERSION` detection, by
  guarding the whole block for `WIN32`.
- drop fallback version value `MIT Unknown` used for MIT.
- fix vertical alignment in comment block.

Changing CMake log output like so (in affected config):
```
-- Found GSS: MIT (found version "MIT Unknown")
```
->
```
-- Found GSS: MIT
```

Spotted by Copilot
Bug: https://github.com/curl/curl/pull/22052#discussion_r3429273238
Follow-up to 558814e16d

Closes #22071
2026-06-17 18:04:44 +02:00
Viktor Szakats
a36e979284
GHA/macos: enable krb5 in an autotools job
Cherry-picked from #22052

Closes #22069
2026-06-17 16:29:15 +02:00
Viktor Szakats
174cafb3e6
cmake: simplify LINK_ONLY imported target extraction
Suggested-by: Kai Pastor
Ref: https://github.com/curl/curl/pull/21654#discussion_r3425296606
Follow-up to 3c597ced16 #21654

Closes #22063
2026-06-17 15:16:19 +02:00
Viktor Szakats
e8b76773af
GHA/linux: give more time for apt-get install
3 minutes (was: 2).

IIn the hope it fixes timeouts, assuming the Ubuntu mirrors are only
somewhat slower sometimes (and not completely stalled).

Closes #22068
2026-06-17 15:16:19 +02:00
Viktor Szakats
766969be39
GHA: sync apt-get code between workflows/jobs
- delete 3rd-party apt sources, where missing.
- do `apt-get update`, where missing.

Closes #22067
2026-06-17 15:16:19 +02:00
Viktor Szakats
4e07b374dd
GHA/linux: allow more time for apt.repos.intel.com install
Whether the install is extreme slow and will fail anyway, or only slower
sometimes, and this fixes, we will see.

Example:
```
Need to get 1159 MB of archives.
After this operation, 4463 MB of additional disk space will be used.
Get:1 https://apt.repos.intel.com/oneapi all/main all intel-oneapi-common-licensing-2023.2.0 all 2023.2.0-49462 [30.4 kB]
Get:2 https://apt.repos.intel.com/oneapi all/main all intel-oneapi-common-licensing-2026.0 all 2026.0.0-235 [30.7 kB]
[...]
Get:21 https://apt.repos.intel.com/oneapi all/main amd64 intel-oneapi-dpcpp-debugger-2023.2.0 amd64 2023.2.0-49330 [201 MB]
Error: The action 'install Intel compilers' has timed out after 2 minutes.
```
Ref: https://github.com/curl/curl/actions/runs/27683923870/job/81877924590

Follow-up to 50ff4f2927 #21414

Closes #22065
2026-06-17 14:37:54 +02:00
Viktor Szakats
0ffd2e7fde
GHA/windows: do apt-get update in clang-tidy cross-build job again
Syncing with most similar uses in other workflows.

Fixing, e.g.:
```
E: Failed to fetch http://azure.archive.ubuntu.com/ubuntu/pool/universe/l/
  llvm-toolchain-20/llvm-20-linker-tools_20.1.2-0ubuntu1%7e24.04.2_amd64.deb
  404  Not Found [IP: 172.66.152.176 443]
```
Ref: https://github.com/curl/curl/actions/runs/27682974841/job/81877061033?pr=22061

Follow-up to 1b8449674a #14992

Closes #22064
2026-06-17 14:37:54 +02:00
Viktor Szakats
bdb1773536
INTERNALS.md: document minimum nghttp3 and ngtcp2 versions
Follow-up to 5eefdd71a3 #17027
Follow-up to 915f3981c9 #16320

Closes #22062
2026-06-17 14:37:54 +02:00
Viktor Szakats
4abe47e1f5
src: sync nghttp2 versions checks with current requirements
Also:
- drop a redundant check.
- make the in-source error informative.

Follow-up to 2900c29218 #11473

Closes #22061
2026-06-17 14:37:54 +02:00
Viktor Szakats
60381b2046
first.h reflow 2026-06-17 14:37:14 +02:00
Stefan Eissing
d2886c5ac4
http: for basic+digest auth, do not engage on empty user+passwd
Since we have the quirky of empty credentials (the empty string for
username and password) for Negotiate reactivated, we need to check for
this when considering Basic and Digest auth.

Verify a redirect to blank user+password in test 2208

Closes #22060
2026-06-17 14:05:03 +02:00
Stefan Eissing
8c3ef95adf
dns-httpsrr-lookup: use origin, not peer
Origin is the correct peer for lookup of HTTPS-RR records.

Closes #22059
2026-06-17 12:04:49 +02:00
Daniel Stenberg
39caaff7b3
libtest: unify on easy_setopt macro
- drop the old test_setopt() which did the same thing
- remove #if 0'ed macros from first.h

These macros now store results in 'result' more aggressively, but I
believe that is generally favorable.

Closes #22057
2026-06-17 12:03:41 +02:00
Stefan Eissing
74ac8e74ec
creds: create with empty user+pass
Allow creation of a `Curl_creds` instance with empty username and
password (not NULL username/password). There are authentication
schemes like <insert greek mythology'> that do not use the actual
values of username/password but trigger on the mere existance.

We have no test cases for this, so this is a shot in the dark
here.

Fixes #21943
Reported-by: Dan Fandrich
Closes #22044
2026-06-17 07:54:11 +02:00
Daniel Stenberg
7806fb36c5
RELEASE-NOTES: synced 2026-06-16 23:22:58 +02:00
Stefan Eissing
92db819714
cf-dns: pass peer for result lookups
The DNS filter knows the peer it resolves and the code parts that want
the results know the peer as well. Pass it to lookup methods to make
sure results match.

Background: when tunneling, the resolved peer is not always the one that
other filters are looking for. Especially when HTTPS-RR results are
accessed in TLS filters, those will differ.

This prevents a HTTPS-RR for a proxy to be used for the origin when ECH
is activated. To make ECH work through a tunnel, we need to start an
additional resolve. Something to be fixed after 8.21.

Closes #22042
2026-06-16 23:15:43 +02:00
dependabot[bot]
73d060950e
GHA: bump pip cryptography from 46.0.7 to 48.0.1
Closes #22055
2026-06-16 22:18:43 +02:00
Viktor Szakats
528c05a987
configure: tidy up OPT_APPLE_SECTRUST initialization
The OS detection variable is not initialized at the time of assigning
its value to `OPT_APPLE_SECTRUST`. Replace the current empty value with
`no`. This keeps existing, desired, behavior.

Closes #22054
2026-06-16 22:18:43 +02:00
Dan Fandrich
6125d5d6c5 CI: improve labeler tag detection 2026-06-16 10:53:17 -07:00
Viktor Szakats
aacb90bee9
cmake/FindGSS: prioritize MIT over GNU in pkg-config detection
To match the non-pkg-config path, and also suspected user expectation.

This comes with a small incompatibility in return for more consistency.

Bug: https://github.com/curl/curl/pull/22052#discussion_r3422424979
Follow-up to 9e19a577eb #15176

Closes #22053
2026-06-16 19:11:15 +02:00
Viktor Szakats
be8f24323e
perl: open... || -> open... or (cont.)
Also: unfold a few lines, fix a space, add a missing parentheses.

Follow-up to 678e63934c #22036

Closes #22047
2026-06-16 19:11:15 +02:00
renovate[bot]
1bb75af8e9
GHA: update google/boringssl to v0.20260616.0
Closes #22046
2026-06-16 16:28:02 +02:00
Daniel Stenberg
b56cb3b71e
_URL.md: remove the zone-id mention
While correct, it felt random and misplaced there.

Closes #22048
2026-06-16 16:21:22 +02:00
Stefan Eissing
bd10924b47
url: connection credentials origin
When tying credentials to a connection (NTLM, Negotiate) also link the
origin the credentials are for. This prevents a connection reuse with
the same credentials, but intended for another origin.

The mis-reuse could happen for a forwarding proxy and NTLM (although, in
the mind of the person writing this, it is an insane setup).

Closes #22040
2026-06-16 15:57:10 +02:00
Viktor Szakats
c2b050e4e4
servers: deduplicate storerequest() across two servers
Closes #22041
2026-06-16 12:42:59 +02:00
Daniel Stenberg
e0c6f4d4d6
tool_writeout: fix %time{} output for %s
Now testing both %s and %% in test 1981

Reported-by: wulin-nudt on github
Fixes #22038
Closes #22039
2026-06-16 10:17:43 +02:00
Viktor Szakats
678e63934c
perl: || die -> or die
Usage was fifty-fifty between these syntaxes before this patch.

Closes #22036
2026-06-16 00:41:29 +02:00
Daniel Stenberg
5d1ac48088
setopt: mark function argument as unused *properly*
Closes #22035
2026-06-15 23:08:59 +02:00
Daniel Stenberg
7f57aeec40
verify-release: don't unpack in git repo
- Clarify that the tarball to verify should be put in the same dir you
  run the script.

- Verify that the curl version number in the file name matches the
  version number within the tarball. To reduce risk for mistakes.

- When verifying using git, do not unpack the tarball. It avoids the
  security risk with malicious tarball contents playing tricks on git.

- Only unpack the tarball for git-less verfication.

- Move the source tarball into _tarballs/ instead of overwriting it,
  which can be useful in case the verification fails

Closes #22032
2026-06-15 22:35:33 +02:00
Stefan Eissing
bb72413b03
cf-https-connect: do not engage on proxy origin
When talking to a forwarding proxy, do not start HTTPS Eyeballing.
We might support this in the future, but for now, the --httpx.x
arguments to do not apply to such a setup.

Add a test case for forward proxying without use of ALPN.

Closes #22033
2026-06-15 22:32:15 +02:00
Dave Walker
b9702f8c48
cookie: use origin scheme for secure context check
`Curl_secure_context()` checked `conn->scheme` to determine if Secure
cookies may be sent. Since 73daec6, `conn->scheme` is set to the proxy's
scheme when using an HTTPS forwarding proxy, causing the function to
return TRUE for HTTP origins. This leaked Secure cookies over the
plaintext connection between proxy and origin.

Use `data->state.origin->scheme` instead, which always reflects the
origin's scheme regardless of proxy configuration.

Not an approved vulnerability because the regression was introduced
after the last release and is not present in any released version.

Verified by test 3401

Follow-up to 73daec6620
Reported-by: daviey on hackerone
URL: https://hackerone.com/reports/3803415
Closes #22024
2026-06-15 22:30:14 +02:00
Tobias Frauenschläger
50ffc359e9
tls: wolfssl: fixes for PQC key shares
This PR makes the wolfssl TLS backend work properly for PQC key
exchanges. The following issues are fixed:
* WOLFSSL_HAVE_KYBER is not present anymore in upstream wolfssl (for a
  long time actually), so it has no use and the ML-KEM functionality was
  never turned on properly.
* Key share group selection (via --curves) is now handled via the
  generic wolfSSL_CTX_set1_groups_list() method instead of the prior
  wolfSSL_CTX_set1_curves_list() and the additonal PQC handling. This
  removes a lot of PQC related special handling and the behavior now
  matches the OpenSSL backend.
* The default QUIC group setting has been removed. For QUIC, the key
  share as well as the list in the supported_groups extension is now
  handled all within wolfssl. This also supports --curves properly now.

Closes #22030
2026-06-15 22:18:29 +02:00
Viktor Szakats
526d3b8a53
servers: silence -Wunused-result with pragma
In some configurations the `write()` functions gets the
`warn_unused_result` attribute, that makes casting to `(void)`
ineffective to silence this warning. Seen with glibc, in 5 CI jobs.
The warning option appeared in GCC 4.5 and comes enabled by default.

```
tests/server/util.c:329:5: error: ignoring return value of ‘write’ declared with attribute ‘warn_unused_result’ [-Werror=unused-result]
  329 |     write(STDERR_FILENO, msg, sizeof(msg) - 1);
      |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
```
Ref: https://github.com/curl/curl/actions/runs/27548333990/job/81427544632

Refs:
https://github.com/curl/curl/pull/22023#issuecomment-4708455631
https://gcc.gnu.org/onlinedocs/gcc-16.1.0/gcc/Warning-Options.html#index-Wunused-result
https://gcc.gnu.org/onlinedocs/gcc-16.1.0/gcc/Common-Attributes.html#index-warn_005funused_005fresult
https://stackoverflow.com/questions/40576003/ignoring-warning-wunused-result

Follow-up to c8d8f081fd #22023
Follow-up to e95f509c66 #16852

Closes #22034
2026-06-15 22:04:39 +02:00
Viktor Szakats
5687d211c4
servers: fix off-by-3 OOB write for large loghex() inputs
Spotted by GitHub Code Quality

Closes #22031
2026-06-15 18:38:29 +02:00
Viktor Szakats
46ba384b1b
winldap: avoid NULL pointer deref on ldap_get_dn() fail
In non-Unicode builds.

Assisted-by: Jay Satiro

Closes #22000
2026-06-15 18:38:29 +02:00
Viktor Szakats
adb606eae7
curl_formdata: fix to pass long where missing, document CURLFORM_NAMELENGTH
- lib650: pass `long` to `CURLFORM_NAMELENGTH` in test.
  Spotted by Copilot.
  https://github.com/curl/curl/pull/22011#discussion_r3412407235
  Follow-up to 3620e569b3

- lib650: drop an interim variable, and interim casts.
  Follow-up to 60776a0515 #2747

- curl_formdata.md: document `CURLFORM_NAMELENGTH` on man page.

- curl_formdata.md: pass `long` to `CURLFORM_BUFFERLENGTH` on man page.

- formdata: pass `long` to `CURLFORM_CONTENTSLENGTH` in comment.

Closes #22017
2026-06-15 16:57:21 +02:00
Viktor Szakats
0dae3b2690
servers: accept lstat() failing due to the file missing
In `bind_unix_socket()`, before retrying `bind()`.

Before this patch the code wanted to check if the to-be-deleted unix
socket path was indeed a socket, before deleting it and retrying to
bind. If `lstat()` failed for any reason, it skipped retry. Fix to retry
if `lstat()` failed because of the file missing.

Ref: https://pubs.opengroup.org/onlinepubs/9799919799/functions/lstat.html

Follow-up to 0882e3951d #22026
Follow-up to 03bc93bd32 #22021
Follow-up to e70f8ebd34 #22020
Follow-up to 30e491e5c9 #7034
Follow-up to 99fb36797a

Closes #22010
2026-06-15 16:43:21 +02:00
Stefan Eissing
eb6d1e098e
ratelimits: use minimal burst rate
Some protocols (and servers) prefer to batch IO and will not send data
unless the window is of sufficient size. Set the burst rate for our
rate limits to a minimum of 32KB to prevent stalling.

Reported-by: Tatsuhiro Tsujikawa

Closes #22016
2026-06-15 15:59:10 +02:00
Stefan Eissing
f497b25672
cf-setup: own source file
Move the setup filter into its own source file.

Move the main connect driving function, `Curl_conn_connect()`,
from cfilters.c to connect.c.

Closes #22022
2026-06-15 15:55:58 +02:00