Commit graph

39030 commits

Author SHA1 Message Date
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
Viktor Szakats
8932063828
lib668: do not assume null-terminator in test input data
For correctness. Did not cause an issue, because the null-terminator is
present.

Also:
- change a size type to avoid casts.
- reuse input length value.

Spotted by GitHub Code Quality

Follow-up to 1e4cb333ef #4826

Closes #22027
2026-06-15 15:55:29 +02:00
Viktor Szakats
7d09426187
servers: accept unlink() failing due to the file missing
In `bind_unix_socket()`, before retrying `bind()`.

This patch uses `ENOENT`. This was last time in source between
d25b050379 (2018) and
dffd996e3b (2023), and also earlier. Also
defined by supported Windows envs. Seems safe to use.

Reported-by CodeQL
Follow-up to 99fb36797a
Cherry-picked from #22010

Closes #22028
2026-06-15 15:52:28 +02:00
Daniel Stenberg
6ce740403e
verify-release: verify more thoroughly with git
If the script is invoked in a git repository it verifies the tarball
better.

Closes #22018
2026-06-15 15:44:08 +02:00
Stefan Eissing
7333f6674c
cf-capsule: complete filter
Make the capsule filter complete, implement:

- pollset handling
- flush handling and querying
- shutdown handling
- replace allocated send buffer with a bufq

Closes #22019
2026-06-15 15:42:22 +02:00
Daniel Stenberg
c8d8f081fd
src/test: avoid (void)! constructs
The reason to use them seems to be that just (void) before a function
call is not enough to silence compiler warnings when return codes are
ignored and -Werror=unused-result is used.

While (void)! apparently works to silence those warnings, it is just too
weird and surprising to readers to use.

It is rather a reason to reconsider the usefulness of the warning.

Closes #22023
2026-06-15 14:43:09 +02:00
Daniel Stenberg
9f25dcea55
checksrc: detect and warn for (void)!
It's plain weird. Don't do it.

Closes #22023
2026-06-15 14:42:52 +02:00
Daniel Stenberg
b0d733e143
VULN-DISCLOSURE-POLICY: non-released code
Closes #22025
2026-06-15 14:32:35 +02:00
Viktor Szakats
0882e3951d
servers: mask to S_IFMT in unix socket path attribute check
Instead of `S_IFSOCK` before this patch. For correctness; it is probably
not an issue in most environments.

Spotted by Copilot
Bug: https://github.com/curl/curl/pull/22021#discussion_r3413049506
Follow-up to 99fb36797a

Closes #22026
2026-06-15 14:27:07 +02:00
Stefan Eissing
8cc3fed7df
transfer: adapt Curl_xfer_is_secure()
Now that `conn->origin` can be the proxy, we need to change how
Curl_xfer_is_secure() and some other places work.

Pointed out by Codex Security

Closes #22015
2026-06-15 13:41:26 +02:00
Viktor Szakats
03bc93bd32
servers: drop unix socket path attribute check on Windows
On Windows there is no `lstat()`, which was later substituted with
normal `stat()`, but on Windows `S_IFSOCK` is never defined, which meant
the output of stat was not actually used, reducing this to checking for
the presence of the file, and bailing out without retry if missing.

Follow-up to 30e491e5c9 #7034
Follow-up to 99fb36797a

Cherry-picked from #22010

Closes #22021
2026-06-15 13:36:46 +02:00