]> git.ipfire.org Git - thirdparty/curl.git/log
thirdparty/curl.git
11 days agonetrc: scanner refactor
Stefan Eissing [Fri, 15 May 2026 09:45:49 +0000 (11:45 +0200)] 
netrc: scanner refactor

Refactor the netrc scanner. Add test case for checking that the last
matched machine with unmatched login does not return the password as
success (unit1304).

Closes #21624

11 days agocurl_easy_setopt.md: change options when no transfer runs
Daniel Stenberg [Mon, 18 May 2026 12:15:28 +0000 (14:15 +0200)] 
curl_easy_setopt.md: change options when no transfer runs

Underscore this. Changing them mid-transfer may cause problems.

Fixes #21604
Reported-by: Joshua Rogers
Closes #21657

11 days agovtls_scache: include signature_algorithms in the SSL peer cache key
Mark Esler [Sat, 16 May 2026 22:07:15 +0000 (15:07 -0700)] 
vtls_scache: include signature_algorithms in the SSL peer cache key

Curl_ssl_peer_key_make() omitted ssl->signature_algorithms, although
match_ssl_primary_config() compares the field. Two handles differing
only in CURLOPT_SSL_SIGNATURE_ALGORITHMS therefore shared a peer key and
could resume each other's sessions across a shared CURLSH SSL session
cache.

Add :SIGALGS-%s next to the other ssl_primary_config fields.

Closes #21651

11 days agomk-unity.pl: `#include`, and not concatenate input headers
Viktor Szakats [Mon, 18 May 2026 09:50:37 +0000 (11:50 +0200)] 
mk-unity.pl: `#include`, and not concatenate input headers

When using `-D_CURL_TESTS_CONCAT=ON` with CMake, do not concatenate
`first.h` (or any future header) into the output C file, but `#include`
it instead. This is to play nice with compilers and analyzers which may
apply different checker rules on logic found in headers, vs. the input
source file. As seen for example with `-Wunused-macro` enabled in CI.
After this patch concatenated sources behave closer to regular C
sources.

Also:
- first.h: drop some `-Wunused-macro` silencers that became redundant
  with this patch.

Follow-up to 47f411c6d840dcee63a2ac9cbc0bfbea522ac5cd #21554
Follow-up to 39542f09935aba0b7130c20b6aae0be5cd6ff709 #20667

Closes #21656

11 days agoscripts/contri*: fix the Credits-to regex
Daniel Stenberg [Sun, 17 May 2026 21:55:48 +0000 (23:55 +0200)] 
scripts/contri*: fix the Credits-to regex

On my suggestion, the regex turned up wrong when looking for Credits-to
in git logs. This adjustment allows the leading spaces.

Follow-up to 64adc43a6ea07e4d807bbf9b5

Closes #21655

12 days agocmake: fix three issues generating lib options in config files
Viktor Szakats [Sun, 17 May 2026 12:04:49 +0000 (14:04 +0200)] 
cmake: fix three issues generating lib options in config files

- drop duplicate libs lists next to each other in `libcurl.pc`.
  Logic copied from libssh2.
  Fixing (seen in a local build):
  ```diff
  -Libs.private: -lssh2 -lz -lz -lldap -llber -lssl -lcrypto -lcrypto -lz -lbrotlidec -lbrotlicommon -lzstd -lnghttp2 -licucore -liconv -lpsl -lbacktrace
  +Libs.private: -lssh2 -lz -lldap -llber -lssl -lcrypto -lz -lbrotlidec -lbrotlicommon -lzstd -lnghttp2 -licucore -liconv -lpsl -lbacktrace
  ```
  Refs:
  https://github.com/libssh2/libssh2/commit/e1da7b2cb89063fc253bf94570c1ccfb3f1c2e81
  https://github.com/libssh2/libssh2/pull/1621
  https://github.com/libssh2/libssh2/commit/6464301820a9ca4a56c5f02717430bbd4150c7b2
  https://github.com/libssh2/libssh2/pull/1131

- handle `$<LINK_ONLY:NAMESPACE::NAME>` references.
  Fixing (seen in a local build using libssh2 v1.11.2-DEV):
  ```diff
  -Libs.private: -lssh2 -l$<LINK_ONLY:OpenSSL::Crypto> -lz -lldap -llber [...]
  +Libs.private: -lssh2 -lcrypto -lz -lldap -llber [...]
  ```

- fix `-l-pthread` sneaking into `libcurl.pc`.
  Fixing (seen with Android):
  ```diff
  -Libs.private:  -lz -l-pthread
  +Libs.private: -pthread -lz
  ```
  Refs:
  https://github.com/microsoft/vcpkg/blob/2b65c20fc66eda893aa15a15a453c3cf09500b19/ports/curl/dependencies.patch#L631-L634
  https://github.com/microsoft/vcpkg/commit/70b941a5d2443e79eeab62507acb41bd22201277#diff-7f2c3b2f93cd3478671a603cbd5ef818c7c403a11dc25e1d3539e9b03495a5d3
Upstream-patch-by: Kai Pastor
Closes #21654

12 days agoscripts: catch Credits-to contributors
Viktor Szakats [Sun, 17 May 2026 11:33:07 +0000 (13:33 +0200)] 
scripts: catch Credits-to contributors

Also:
- THANKS: add Credits-to attribution missed earlier.

Closes #21653

12 days agoconnect: remove deref of freed pointer in trace call
Daniel Stenberg [Sat, 16 May 2026 21:59:05 +0000 (23:59 +0200)] 
connect: remove deref of freed pointer in trace call

Spotted by CodeSonar

Closes #21649

12 days agourlapi: prevent a terminal `.0x` component to normalize IPv4
Daniel Stenberg [Sat, 16 May 2026 22:27:30 +0000 (00:27 +0200)] 
urlapi: prevent a terminal `.0x` component to normalize IPv4

Extend test 1560 to verify

Follow-up to 831a1514843bfa4d4d006627

Spotted by Codex Security
Closes #21652

12 days agobuild: omit zlib pkg-config reference for Android
Viktor Szakats [Sat, 16 May 2026 21:38:11 +0000 (23:38 +0200)] 
build: omit zlib pkg-config reference for Android

In both autotools and cmake builds, because Android does not offer
a `zlib.pc`.

Also:
- GHA/non-native: dump config files, to verify.

Reported-by: sfan5 on github
Fixes #21647

Closes #21648

12 days agourl: remove superfluous check
Daniel Stenberg [Sat, 16 May 2026 22:02:08 +0000 (00:02 +0200)] 
url: remove superfluous check

This pointer is already verified to be non-NULL some 15 lines above.

Pointed out by CodeSonar
Closes #21650

12 days agocf-h2-prox: fix peer leak
Stefan Eissing [Fri, 15 May 2026 11:37:36 +0000 (13:37 +0200)] 
cf-h2-prox: fix peer leak

The unlinking of the new Curl_peer was happening too later after
the struct had been set to zero. Move the unlink to happen before
that.

Fixes #21602
Reported-by: Joshua Rogers
Closes #21627

13 days agoRELEASE-NOTES: synced
Daniel Stenberg [Sat, 16 May 2026 21:09:52 +0000 (23:09 +0200)] 
RELEASE-NOTES: synced

13 days agounix-sockets: ignore proxy settings
Stefan Eissing [Fri, 15 May 2026 12:11:13 +0000 (14:11 +0200)] 
unix-sockets: ignore proxy settings

Fix a recent regression: when a unix-socket is configured, all proxy
settings must be ignored. The `via_peer` had been checked correctly,
but the connections proxy bits were not cleared.

Add test_11_04 to verify.

Reported-by: Fabian Keil (libcurl mailing list)
Closes #21630

13 days agolib678: fix to not be perma-skipped
Viktor Szakats [Sat, 16 May 2026 01:56:33 +0000 (03:56 +0200)] 
lib678: fix to not be perma-skipped

Prior to this patch the test was always skipped due to failing precheck
with `CURLE_BAD_FUNCTION_ARGUMENT`, because of the zero-length blob
passed to setopt. Fix by passing a non-zero long dummy blob as done in
`mk-lib1521.pl`.

Fixing:
```
test 0678 SKIPPED: CURLOPT_CAINFO_BLOB is not supported
```

Follow-up to 956e1ae84f2fec9f027b4ce80999744326b30992 #20705

Closes #21641

13 days agorunner.pm: set `CURL_TESTNUM` for `precheck` commands
Viktor Szakats [Sat, 16 May 2026 01:38:19 +0000 (03:38 +0200)] 
runner.pm: set `CURL_TESTNUM` for `precheck` commands

Closes #21640

13 days agoSSLCERTS: document 8.19.0 default Native CA builds (Windows)
Viktor Szakats [Fri, 15 May 2026 23:51:17 +0000 (01:51 +0200)] 
SSLCERTS: document 8.19.0 default Native CA builds (Windows)

Ref: https://curl.se/docs/sslcerts.html

Follow-up to 1730407b74f41cfd33f189348be54d0504b7c291 #18279
Reported-by: chrizilla on github
Fixes #21634

Closes #21639

13 days agosetopt: fix to honor `CURLOPT_PROXY_CAINFO_BLOB` over Native CA
Viktor Szakats [Fri, 15 May 2026 12:33:07 +0000 (14:33 +0200)] 
setopt: fix to honor `CURLOPT_PROXY_CAINFO_BLOB` over Native CA

In AppleSecTrust or NativeCA-enabled builds, make sure override it when
setting a custom `CURLOPT_PROXY_CAINFO_BLOB`.

Reported-by: Joshua Rogers (Aisle Research)
Follow-up to 1730407b74f41cfd33f189348be54d0504b7c291 #18279
Follow-up to eefd03c572996e5de4dec4fe295ad6f103e0eefc #18703

Closes #21631

13 days agoschannel: enforce Extended Key Usage for custom CA roots
Viktor Szakats [Fri, 15 May 2026 11:26:05 +0000 (13:26 +0200)] 
schannel: enforce Extended Key Usage for custom CA roots

Reported-by: Joshua Rogers (Aisle Research)
Closes #21629

13 days agodocs: end "...can be used several times..." sentences with period
Tim Martin [Sat, 16 May 2026 09:12:06 +0000 (04:12 -0500)] 
docs: end "...can be used several times..." sentences with period

Closes #21644

13 days agourlapi: handle redirect without set scheme with default-scheme
Daniel Stenberg [Fri, 15 May 2026 12:37:58 +0000 (14:37 +0200)] 
urlapi: handle redirect without set scheme with default-scheme

Verify in test 1921

Reported-by: mulan_dh on hackerone
Closes #21632

13 days agocookie: trim trailing dots when checking PSL
Daniel Stenberg [Fri, 15 May 2026 22:19:09 +0000 (00:19 +0200)] 
cookie: trim trailing dots when checking PSL

Verified with test 1629

Closes #21636

13 days agotidy-up: miscellaneous
Viktor Szakats [Thu, 14 May 2026 18:37:42 +0000 (20:37 +0200)] 
tidy-up: miscellaneous

- avoid "will" in builds scripts, scripts folder, curl_easy_ssls_export.md,
  and few other files.
- badwords: add "initialise", "nul terminated", "thread safety" and
  variations.
- prefer "null-terminat", where missing (two places).
- fix "null-terminat*" missing dash.
- hostip: merge two `#if` blocks.
- tool_doswin: fix comment
  Spotted by GitHub Code Quality
  Follow-up to 9a2663322c330ff11275abafd612e9c99407a94a #17572
- fix stray spaces and newlines.

Closes #21638

13 days agoGHA: enable `-Wunused-macros` in clang-tidy jobs
Viktor Szakats [Tue, 12 May 2026 00:26:05 +0000 (02:26 +0200)] 
GHA: enable `-Wunused-macros` in clang-tidy jobs

Also fix fallouts found.

Windows clang-tidy CI job is a little pickier than I'd prefer due to the
`_CURL_TESTS_CONCAT=ON` option used there, and all macros considered
local, thus checked by the compiler. Upside: it revealed macro usage
dynamics in tests. If too annoying, `first.h` may be opted-out from the
concat logic. Some macros may also be deleted instead of `#if 0`-ing.

Follow-up to e0e56e9ae434552bd6ac5570ed91483188d75788 #21550
Follow-up to 5fa5cb382560316a55f0954f1e8cebdbd6568cfb #20593

Closes #21554

13 days agourl: compare full origin when setting credentials
jeffhuang [Tue, 12 May 2026 16:13:15 +0000 (16:13 +0000)] 
url: compare full origin when setting credentials

Closes #21575

13 days agourl: url_match_destination fix
Stefan Eissing [Tue, 12 May 2026 15:58:03 +0000 (17:58 +0200)] 
url: url_match_destination fix

Match origin/via_peer also for non-SSL schemes.

Closes #21573

13 days agox509asn1: fix DH public key parameter extraction
Sergio Correia [Wed, 13 May 2026 18:44:05 +0000 (19:44 +0100)] 
x509asn1: fix DH public key parameter extraction

The dh(g) parameter was read from param->beg instead of from the
cursor p returned by parsing dh(p). This caused dh(g) to always
report the same value as dh(p) when inspecting DH certificates
via CURLOPT_CERTINFO on non-OpenSSL backends.

The DSA branch correctly advances the cursor; the DH branch lost
this during what appears to be a copy-paste.

Add unit1676 to verify that dh(p) and dh(g) report distinct values
using a hand-crafted minimal DER certificate.

Assisted by: Claude Opus 4.6
Signed-off-by: Sergio Correia <scorreia@redhat.com>
Closes #21595

13 days agosetopt: more careful cleanup of the HSTS cache
Daniel Stenberg [Thu, 14 May 2026 21:23:08 +0000 (23:23 +0200)] 
setopt: more careful cleanup of the HSTS cache

Reported-by: Joshua Rogers
Closes #21615

13 days agoKNOWN_BUGS.md: remove fixed x509asn.1 bug
Emanuel Krollmann [Thu, 14 May 2026 15:27:13 +0000 (17:27 +0200)] 
KNOWN_BUGS.md: remove fixed x509asn.1 bug

KNOWN_BUGS.md contains an entry about a CURLE_OUT_OF_MEMORY
error on a CURLOPT_CERTINFO call when using Schannel.

This bug was fixed by 137a668e8cb42dda1673bf2c79cbb24c8fe0b405.

remove the entry from KNOWN_BUGS.md.

Ref: https://github.com/curl/curl/issues/8741#issuecomment-4445486705

Closes #21611

13 days agocf-h2-proxy: drop interim responses
Stefan Eissing [Fri, 15 May 2026 11:03:02 +0000 (13:03 +0200)] 
cf-h2-proxy: drop interim responses

Any 1xx response before the CONNECT final one can be dropped as no one
uses those in the HTTP/2 proxy filter. This eliminates a potential
memory exhaustion by the famous malicious server on the internet.

Closes #21626

13 days agoCURLOPT_SSH_HOSTKEYFUNCTION.md: for new connections only
Daniel Stenberg [Fri, 15 May 2026 11:54:41 +0000 (13:54 +0200)] 
CURLOPT_SSH_HOSTKEYFUNCTION.md: for new connections only

curl can then reuse the connection for subsequent transfers without
calling this function again.

Fixes #21606
Reported-by: Joshua Rogers
Closes #21628

13 days agosrc: add `curlx_memzero()` to clear buffers securely
Viktor Szakats [Wed, 13 May 2026 16:20:33 +0000 (18:20 +0200)] 
src: add `curlx_memzero()` to clear buffers securely

To safely zero memory, introduce `curlx_memzero()`, and map it to
`memset_s()` (C11) or `memset_explicit()` (C23) if auto-detected, or
`explicit_bzero()` or `explicit_memset()` for platforms opted-in, or
fall back to a local workaround if all unavailable. On Windows, always
use `SecureZeroMemory()`, or `SecureZeroMemory2()` with Visual Studio
and Windows SDK 10.0.26100.0+.

Details above are experimental and may change if they cause issues.

Also add macros/functions that zero memory before freeing a buffer:
- `curlx_safefreezero()`: for buffers with size.
- `curlx_safefreezeroz()`: for null-terminated buffers.
- `curlx_freezero()`: for buffers with size.
- `curlx_freezeroz()`: for null-terminated buffers.

`curlx_memzero()` must not be passed a NULL pointer because in some
implementations it is undefined behavior.

Also:
- curl_sha512_256: Replace hard-wired `explicit_memset()` call with new
  `curlx_memzero()`.

Refs:
https://en.cppreference.com/c/string/byte/memset
https://man7.org/linux/man-pages/man3/explicit_bzero.3.html
https://man.freebsd.org/cgi/man.cgi?query=explicit_bzero
https://man.netbsd.org/NetBSD-7.2/explicit_memset.3
https://learn.microsoft.com/previous-versions/windows/desktop/legacy/aa366877(v=vs.85)
https://learn.microsoft.com/windows/win32/memory/winbase-securezeromemory2
https://learn.microsoft.com/cpp/overview/compiler-versions
https://learn.microsoft.com/windows/apps/windows-sdk/downloads
https://jtsoya539.github.io/windows-sdk-versions/

Credits-to: Daniel Gustafsson
Credits-to: Will Cosgrove and co-authors in libssh2
Ref: #13589 (original attempt)
Ref: #21588

Closes #21598

13 days agourlapi: consume trailing dots after IPv4 numerical addresses
Daniel Stenberg [Fri, 15 May 2026 15:04:26 +0000 (17:04 +0200)] 
urlapi: consume trailing dots after IPv4 numerical addresses

If the hostname is specified as an IPv4 numerical address and it is
followed by a single dot, acccept that as a valid IPv4 and remove the
dot when normalizing.

This prevents otherwise legitimate IPv4 hostnames to have trailing dots.
Seems to match what browsers do.

Extended test 1560 to verify.

Closes #21635

2 weeks agoCURLOPT_SHARE: warn about early remove
Stefan Eissing [Fri, 15 May 2026 12:56:24 +0000 (14:56 +0200)] 
CURLOPT_SHARE: warn about early remove

Add a warning to removing a SHARE from an EASY handle before it is
finished.

Closes #21633

2 weeks agocookie: compare path case sensitively
Daniel Stenberg [Thu, 14 May 2026 21:46:45 +0000 (23:46 +0200)] 
cookie: compare path case sensitively

Verify with test 1645

Reported-by: Joshua Rogers
Closes #21616

2 weeks agostrparse: make curlx_str_until() accept zero for 'max'
Daniel Stenberg [Wed, 13 May 2026 22:06:03 +0000 (00:06 +0200)] 
strparse: make curlx_str_until() accept zero for 'max'

When asked to parse for a string with max zero bytes, it will always
return error and no longer trigger an assert. This saves the caller from
having to check for this condition.

Closes #21600

2 weeks agorustls: drop two wrong leftover casts to `ssize_t`
Viktor Szakats [Fri, 15 May 2026 09:54:14 +0000 (11:54 +0200)] 
rustls: drop two wrong leftover casts to `ssize_t`

While both source and target types are already `size_t`.

Spotted by GitHub Code Quality

Follow-up to b7c676d13f0988bde9bb0e4c3cfc688072cdb2e0 #17593

Closes #21625

2 weeks agotidy-up: prefer "initialize" with a 'z'
Viktor Szakats [Thu, 14 May 2026 22:37:37 +0000 (00:37 +0200)] 
tidy-up: prefer "initialize" with a 'z'

To match the majority of usage in source.

Closes #21618

2 weeks agogsasl: fix potential double free
Viktor Szakats [Thu, 14 May 2026 12:35:21 +0000 (14:35 +0200)] 
gsasl: fix potential double free

Also:
- require libgsasl 1.6.0+ (2010-12-14) for a `gsasl_finish()` that
  handles a NULL argument.
  Ref: https://gitlab.com/gsasl/gsasl/-/commit/b550032df8488a9ceaa3cfd4c634947d8f219717

Reported-by: Joshua Rogers (Aisle Research)
Closes #21609

2 weeks agolibssh: add support for SHA256 host public keys
Viktor Szakats [Thu, 14 May 2026 11:32:46 +0000 (13:32 +0200)] 
libssh: add support for SHA256 host public keys

Reported-by: Joshua Rogers
Fixes #21605

Closes #21607

2 weeks agourlapi: deny hostnames with more than one trailing dot
Daniel Stenberg [Fri, 15 May 2026 08:14:36 +0000 (10:14 +0200)] 
urlapi: deny hostnames with more than one trailing dot

Or consisting of just a single dot.

Such names cannot be resolved with DNS.

While they *can* still be resolved with /etc/hosts or --resolve tricks,
they easily cause internal problems because their trailing dots.

Let's not allow them anymore.

Closes #21622

2 weeks agorustls: error on CURLOPT_CRLFILE with native CA store
Joshua Rogers [Thu, 14 May 2026 21:19:54 +0000 (23:19 +0200)] 
rustls: error on CURLOPT_CRLFILE with native CA store

Closes #21614

2 weeks agowindows: update MS SDK versions in comments
Viktor Szakats [Fri, 15 May 2026 00:10:24 +0000 (02:10 +0200)] 
windows: update MS SDK versions in comments

To make them more accurate.

Also:
- show Visual Studio version, where missing.
- ease the formatting.
- schannel_int.h: clang-tidy fallback code.

Used: `rg -l --sort=path CERT_FIND_HAS_PRIVATE_KEY`

Closes #21621

2 weeks agoGHA: pin containers to hash (where missing)
Viktor Szakats [Thu, 14 May 2026 22:50:18 +0000 (00:50 +0200)] 
GHA: pin containers to hash (where missing)

Fixing this with zizmor v1.25.0:
```
error[unpinned-images]: unpinned image references
  --> .github/workflows/linux-old.yml:59:5
59 |     container: 'debian:stretch'
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^ container image is not pinned to a SHA256 hash
   = help: audit documentation -> https://docs.zizmor.sh/audits/#unpinned-images
[...]
```
Ref: https://github.com/curl/curl/actions/runs/25890035949/job/76090925291?pr=21618

Sadly there is no automatic mechanism to bump them..

Also:
- replace `debian-stretch` with its slim variant.
- bump one of the two Alpine jobs from 3.20 to 3.23.4.

Closes #21619

2 weeks agodocs: fix a couple of typos
Viktor Szakats [Thu, 14 May 2026 22:28:02 +0000 (00:28 +0200)] 
docs: fix a couple of typos

Spotted by GitHub Code Quality

Closes #21617

2 weeks agocreds: drop redundant `CURL_UNCONST()`s
Viktor Szakats [Thu, 14 May 2026 19:57:02 +0000 (21:57 +0200)] 
creds: drop redundant `CURL_UNCONST()`s

Follow-up to 8f71d0fde515aa4c68002477356c35bd79927729 #21548

Closes #21612

2 weeks agolib: make `__STDC_VERSION__` literals `L` (where missing)
Viktor Szakats [Thu, 14 May 2026 08:57:34 +0000 (10:57 +0200)] 
lib: make `__STDC_VERSION__` literals `L` (where missing)

2 weeks agocmake: unfold a line
Viktor Szakats [Thu, 14 May 2026 14:33:23 +0000 (16:33 +0200)] 
cmake: unfold a line

2 weeks agoGHA: explicitly `brew update` before `brew install` with Linuxbrew
Viktor Szakats [Thu, 14 May 2026 12:09:50 +0000 (14:09 +0200)] 
GHA: explicitly `brew update` before `brew install` with Linuxbrew

Fixing:
```
==> Installing openssl@3 dependency: ca-certificates
==> Pouring ca-certificates--2026-05-14.all.bottle.tar.gz
Error: undefined method '[]' for nil
/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/utils/bottles.rb:127:in 'Utils::Bottles.load_tab'
/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/formula_installer.rb:1507:in 'FormulaInstaller#pour'
[...]
/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/brew.rb:114:in '<main>'
You have disabled automatic updates and have not updated today.
Do not report this issue until you've run `brew update` and tried again.
Error: Process completed with exit code 1.
```
Ref: https://github.com/curl/curl/actions/runs/25859030402/job/75984082148?pr=21607

Dropping `HOMEBREW_NO_AUTO_UPDATE=1` was not enough to fix it.

Closes #21608

2 weeks agostrparse: split a multi-line assert into many separate ones
Daniel Stenberg [Wed, 13 May 2026 21:28:43 +0000 (23:28 +0200)] 
strparse: split a multi-line assert into many separate ones

This way we can better tell exactly which condition that triggers. Like
in fuzzer logs.

Closes #21599

2 weeks agodocs: fix grammar and wording in FAQ
0xN3R3K3 [Wed, 13 May 2026 15:34:10 +0000 (18:34 +0300)] 
docs: fix grammar and wording in FAQ

Closes #21593

2 weeks agopythonlint.sh: make it fail on error, fix ruff warnings in pytest
Viktor Szakats [Wed, 13 May 2026 20:50:13 +0000 (22:50 +0200)] 
pythonlint.sh: make it fail on error, fix ruff warnings in pytest

Follow-up to a5542c23e7427b8ea8f6183f503f2935d88d5d65 #21289
Follow-up to 17e8200733a1fd9db148f794d7e1cfb47e491fcd

Closes #21597

2 weeks agocmake: merge `if` blocks (tidy-up)
Viktor Szakats [Wed, 13 May 2026 20:08:03 +0000 (22:08 +0200)] 
cmake: merge `if` blocks (tidy-up)

Closes #21596

2 weeks agocookie: constify struct pointers
Viktor Szakats [Wed, 13 May 2026 12:28:27 +0000 (14:28 +0200)] 
cookie: constify struct pointers

Closes #21589

2 weeks agollist: constify struct pointers
Viktor Szakats [Wed, 13 May 2026 12:42:55 +0000 (14:42 +0200)] 
llist: constify struct pointers

Closes #21590

2 weeks agourlapi: change more lowercase percent-encoded to uppercase
Daniel Stenberg [Wed, 13 May 2026 14:06:00 +0000 (16:06 +0200)] 
urlapi: change more lowercase percent-encoded to uppercase

For consistency with other code, prefer uppercase.

Verified by test 1628
Reported-by: Fabian Keil
URL: https://curl.se/mail/lib-2026-05/0006.html
Closes #21592

2 weeks agocreds: create on service name only
Stefan Eissing [Wed, 13 May 2026 12:45:35 +0000 (14:45 +0200)] 
creds: create on service name only

Fix creation of creds object for transfer when only a sasl service
name is configured by the application.

Follow-up to 5e99b73cf441d9c369768

Closes #21591

2 weeks agourl: keep the question mark for empty queries
Daniel Stenberg [Wed, 13 May 2026 08:35:02 +0000 (10:35 +0200)] 
url: keep the question mark for empty queries

Reported-by: Bill Mill
Fixes #21544

Verified by test 1721

Closes #21584

2 weeks agosnpego_sspi: preserve distinction btw policy-only and uncond delegation
Daniel Stenberg [Wed, 13 May 2026 07:55:36 +0000 (09:55 +0200)] 
snpego_sspi: preserve distinction btw policy-only and uncond delegation

CURLOPT_GSSAPI_DELEGATION exposes distinct modes:
CURLGSSAPI_DELEGATION_POLICY_FLAG is documented as delegating only when
OK-AS-DELEGATE policy permits it, while CURLGSSAPI_DELEGATION_FLAG is
unconditional. The new SSPI implementation checks for either bit and
sets ISC_REQ_DELEGATE, so a caller requesting policy-limited delegation
is put on the same SSPI path as unconditional delegation.

In addition, curl's existing protection that avoids reusing a connection
when the GSS delegation setting differs was guarded only by HAVE_GSSAPI;
SSPI-only builds now have an effective delegation option, but the
connection's delegation setting was neither copied nor compared. This
would cause Windows SSPI Negotiate/Kerberos authentication to delegate
credentials contrary to the caller's selected policy or reuse an
already-delegated authenticated connection for a transfer that requested
no delegation.

Follow-up to cc6777d939976b2f322dcbe5a

Reported by Codex Security
Closes #21583

2 weeks agocreds: add sasl service name
Stefan Eissing [Wed, 13 May 2026 10:02:48 +0000 (12:02 +0200)] 
creds: add sasl service name

The SASL service name, used in authentication, is part of curl's credentials
when authenticating to a server/proxy. Make it part of `struct Curl_creds`.

Change code to use `creds` to obtain a service name. By tying creds used
to the connection, connection reuse is also only allowed when the service
name matches.

Closes #21585

2 weeks agotool_urlglob: check glob use before access
Daniel Stenberg [Wed, 13 May 2026 10:41:51 +0000 (12:41 +0200)] 
tool_urlglob: check glob use before access

As this function can now be invoked with only the second glob "active",
it must avoid accessing the first one if not in use.

Follow-up to 2238f0921cb00b3395847

Spotted by Codex Security

Closes #21586

2 weeks agocurl: named globs in output file name for upload glob references
Daniel Stenberg [Tue, 21 Apr 2026 22:52:16 +0000 (00:52 +0200)] 
curl: named globs in output file name for upload glob references

Use parts of text from the upload filename field when that uses globbing
by giving it a name the same way we do it for URL globs. For example, if
you upload three files to a HTTP URL and want to save the corresponding
responses in separate files:

    curl -T 'file{<num>1,2,3}' https://upload.example/ -o 'response-#<num>'

Verified by test 2014

Closes #21407

2 weeks agoCURLOPT_MAXFILESIZE: clarify this also works for on-going transfers
Daniel Stenberg [Wed, 13 May 2026 06:58:04 +0000 (08:58 +0200)] 
CURLOPT_MAXFILESIZE: clarify this also works for on-going transfers

It was not really clear, but it has worked like this since 8.4.0 which
now is a while.

Closes #21582

2 weeks agoldap: fix to not leak `attribute` on OOM (WinLDAP)
Viktor Szakats [Tue, 12 May 2026 16:19:26 +0000 (18:19 +0200)] 
ldap: fix to not leak `attribute` on OOM (WinLDAP)

Reported-by: Andrew Nesbitt
Closes #21576

2 weeks agoTHANKS-filter: update
Viktor Szakats [Tue, 12 May 2026 16:24:19 +0000 (18:24 +0200)] 
THANKS-filter: update

Source: https://github.com/andrew

Closes #21577

2 weeks agoVULN-DISCLOSURE-POLICY.md: remove mention of bug bounty reward
Andrei Rybak [Tue, 12 May 2026 16:02:21 +0000 (18:02 +0200)] 
VULN-DISCLOSURE-POLICY.md: remove mention of bug bounty reward

As a follow-up to commits ca7ef4b817 ("BUG-BOUNTY.md: we stop the
bug-bounty end of Jan 2026", 2026-01-22) and ed7bf43a08 ("BUG-BOUNTY.md:
minor rephrase to say there is no bug bounty", 2026-03-10), remove a
leftover mention of the reward for vulnerability reports, that no longer
exists, in file `VULN-DISCLOSURE-POLICY.md`.

Fixes #21571
Reported-by: Alan De Smet
Closes #21574

2 weeks agotool_urlglob: better 'Duplicate glob name' position
Daniel Stenberg [Tue, 12 May 2026 14:01:41 +0000 (16:01 +0200)] 
tool_urlglob: better 'Duplicate glob name' position

This now points to where the duplicate name ends, not where it starts.

Also fixes test 2410 to use a fixed hostname so that the error position
remains the same.

Reported-by: Viktor Szakats
Fixes #21567
Closes #21568

2 weeks agosrc: fix comment typos
Viktor Szakats [Tue, 12 May 2026 13:54:06 +0000 (15:54 +0200)] 
src: fix comment typos

Found by GitHub Code Quality

Closes #21570

2 weeks agocurl_ntlm_core: propagate DES `CryptEncrypt()` error
Viktor Szakats [Tue, 12 May 2026 13:56:11 +0000 (15:56 +0200)] 
curl_ntlm_core: propagate DES `CryptEncrypt()` error

Spotted by GitHub Code Quality

Closes #21569

2 weeks agocreds: hold credentials
Stefan Eissing [Mon, 11 May 2026 12:25:52 +0000 (14:25 +0200)] 
creds: hold credentials

Authorizdation credentials are kept in `struct Curl_creds`. This contains:

* `user`: the username, maybe the empty string
* `passwd`: the password, maybe the empty string
* `sasl_authzid`: the SASL authz value, maybe the empty string
* `oauth_bearer`: the OAUTH bearer token, maybe the empty string
* `source`: where the credentials from from
* `refcount`: a reference counter to link/unkink creds

A `creds` with all values empty is equivalent to NULL, e.g. no `creds`
instance. With reference counting, `creds` can be linked/unlinked
in several places.

See docs/internals/CREDENTIALS.md for use.

Closes #21548

2 weeks agoGHA: (re-)enable SMB in a few builds
Daniel Stenberg [Tue, 12 May 2026 10:49:30 +0000 (12:49 +0200)] 
GHA: (re-)enable SMB in a few builds

Closes #21564

2 weeks agocurl_ntlm_core: fix nettle 4+ builds in certain MultiSSL combos
Viktor Szakats [Tue, 12 May 2026 11:42:12 +0000 (13:42 +0200)] 
curl_ntlm_core: fix nettle 4+ builds in certain MultiSSL combos

Also rename macro to resemble other backends.

Reported by Codex Security

Fixes #21562
Follow-up to 01f08dc4eb20a19aa60230653715c8b839619cbb #21557

Closes #21566

2 weeks agortsp: bump buf after rtsp_filter_rtp()
Daniel Stenberg [Tue, 12 May 2026 09:56:16 +0000 (11:56 +0200)] 
rtsp: bump buf after rtsp_filter_rtp()

Reported-by: Andrew Nesbit
Closes #21563

2 weeks agospnego_sspi: honor CURLOPT_GSSAPI_DELEGATION for Windows SSPI
Song X. Gao [Mon, 11 May 2026 16:45:15 +0000 (12:45 -0400)] 
spnego_sspi: honor CURLOPT_GSSAPI_DELEGATION for Windows SSPI

Make CURLOPT_GSSAPI_DELEGATION effective on Windows builds that use SSPI
(instead of a native GSS-API implementation), so Kerberos delegation can
be requested during SPNEGO/Negotiate authentication.

Closes #21528

2 weeks agotftp: stricter option name checks
Daniel Stenberg [Tue, 12 May 2026 07:20:31 +0000 (09:20 +0200)] 
tftp: stricter option name checks

Previously, the use of checkprefix() alone allowed the code to match not
only on "blksize" but also (mistakenly) on "blksizeFOO" etc.

Reported-by: Andrew Nesbit
Closes #21560

2 weeks agotool_urlglob: make globbing error reported for correct position
Daniel Stenberg [Tue, 12 May 2026 08:03:02 +0000 (10:03 +0200)] 
tool_urlglob: make globbing error reported for correct position

Reported by Codex Security

Closes #21561

2 weeks agotool_urlglob: add named globs
Daniel Stenberg [Wed, 22 Apr 2026 09:38:02 +0000 (11:38 +0200)] 
tool_urlglob: add named globs

Idea-by: Bastian Jesuiter
Verified by test 2408 - 2411

Closes #21409

2 weeks agoevent: fix wakeup consumption
Stefan Eissing [Mon, 11 May 2026 12:56:04 +0000 (14:56 +0200)] 
event: fix wakeup consumption

The events on a multi wakeup socketpair were only consumed via
curl_multi_poll()/curl_multi_wait() but not in event based processing on
a curl_multi_socket() call. That led to busy loops as reported in

Fixes #21547
Reported-by: Earnestly on github
Closes #21549

2 weeks agognutls: fix more nettle 4+ compatibility issues
Viktor Szakats [Tue, 12 May 2026 02:50:09 +0000 (04:50 +0200)] 
gnutls: fix more nettle 4+ compatibility issues

- disable DES with nettle 4. It no longer supports it.
  ```
  lib/curl_ntlm_core.c:67:12: fatal error: 'nettle/des.h' file not found
     67 | #  include <nettle/des.h>
        |            ^~~~~~~~~~~~~~
  ```

- fix MD4 support with nettle 4.
  ```
  lib/md4.c:178:36: error: too many arguments to function call, expected 2, have 3
    178 |   md4_digest(ctx, MD4_DIGEST_SIZE, digest);
        |   ~~~~~~~~~~                       ^~~~~~
  ```

- fix unused argument compiler warning:
  ```
  lib/vtls/gtls.c:2267:39: error: unused parameter 'sha256len' [clang-diagnostic-unused-parameter,-warnings-as-errors]
  2267 |                                size_t sha256len)
       |                                       ^
  ```
  Ref: https://github.com/curl/curl/actions/runs/25710321195/job/75488970143?pr=21557

- GHA/macos: stop enabling NTLM in the GnuTLS job.
  It no longer builds due to missing DES support in nettle 4.
  ```
  lib/curl_ntlm_core.c:90:4: error: "cannot compile NTLM support without a crypto library with DES."
     90 | #  error "cannot compile NTLM support without a crypto library with DES."
        |    ^
  ```
  Ref: https://github.com/curl/curl/actions/runs/25710321195/job/75488970170?pr=21557

Follow-up to cfadbaa133504d47ece989486fde944d076e0222 #21169

Closes #21557

2 weeks agoGHA/linux: build local wolfSSL opensslextra with `--enable-ed25519`
Viktor Szakats [Tue, 12 May 2026 02:02:36 +0000 (04:02 +0200)] 
GHA/linux: build local wolfSSL opensslextra with `--enable-ed25519`

For use with RFC 9421 HTTP Message Signatures support.

Ref: https://github.com/curl/curl/pull/21239/files#r3222322908
Ref: #21239

Closes #21555

2 weeks agognutls: allow building with nettle 4.0
Xi Ruoyao [Thu, 30 Apr 2026 14:53:20 +0000 (22:53 +0800)] 
gnutls: allow building with nettle 4.0

Closes #21169

2 weeks agodocs: fix --follow doc typo
Tim Martin [Mon, 11 May 2026 20:06:57 +0000 (15:06 -0500)] 
docs: fix --follow doc typo

Let the singular ~~object~~ subject "option" agree with the verb "set".

Closes #21553

2 weeks agodelta: harden external command invocations
Viktor Szakats [Wed, 18 Mar 2026 12:24:07 +0000 (13:24 +0100)] 
delta: harden external command invocations

By moving operations Perl-native (from shell and external commands), and
passing arguments individually to external commands.

Pointed out by Codex Security

Closes #21104

2 weeks agocmake: export/forward `NGTCP2_CRYPTO_BACKEND`
Kai Pastor [Sat, 9 May 2026 05:23:37 +0000 (07:23 +0200)] 
cmake: export/forward `NGTCP2_CRYPTO_BACKEND`

Exporting the component name as passed in is somewhat boring. OTOH it is
convenient for reuse.

- FindNGTCP2: export crypto backend in `NGTCP2_CRYPTO_BACKEND`.
- pass `COMPONENTS` `NGTCP2_CRYPTO_BACKEND` in `curl-config.cmake`.
- FindNGTCP2: fix to skip Config detection when optional `COMPONENTS` is
  not passed.

Co-authored-by: Viktor Szakats
Reported-by: x-xiang on github
Fixes #21523
Follow-up to 8fce3e17e6cb310cd6dbe38ff14869b8fe5827d2 #20814

Closes #21540

2 weeks agoidn: replace header guards with forward declaration
Viktor Szakats [Mon, 11 May 2026 08:50:36 +0000 (10:50 +0200)] 
idn: replace header guards with forward declaration

Follow-up to bc40e09f63889a8bc14fa8f7221921eb5b4a559e #21472

Closes #21551

2 weeks agohostip: remove unused MAX_HOSTCACHE_LEN and MAX_DNS_CACHE_SIZE
amitbidlan [Mon, 11 May 2026 13:39:53 +0000 (22:39 +0900)] 
hostip: remove unused MAX_HOSTCACHE_LEN and MAX_DNS_CACHE_SIZE

These macros are leftovers from when DNS caching was moved out of
hostip.c into its own source file. Both are still defined and used in
lib/dnscache.c; the copies in lib/hostip.c are unreferenced.

Detected with clang -Wunused-macros.

Follow-up to 96d5b5c688
Closes #21550

2 weeks agoRELEASE-NOTES: synced
Daniel Stenberg [Mon, 11 May 2026 12:51:03 +0000 (14:51 +0200)] 
RELEASE-NOTES: synced

2 weeks agolib: drop support for CURLAUTH_DIGEST_IE 21486/head
Daniel Stenberg [Sat, 2 May 2026 20:50:10 +0000 (22:50 +0200)] 
lib: drop support for CURLAUTH_DIGEST_IE

This bit was used to do Digest authentication like Internet Explorer
before version 7 (released on October 18, 2006). Presumably no one uses
this anymore and since it is hard to use and does broken auth, starting
in 8.21.0 this bit does nothing (except setting the actual Digest bit).

Closes #21486

2 weeks agocmake: fix zstd CMake config name
Kai Pastor [Fri, 8 May 2026 15:21:52 +0000 (17:21 +0200)] 
cmake: fix zstd CMake config name

They install `zstdConfig.cmake`,
https://github.com/facebook/zstd/blob/885c79ba4ae8345e006f61bc97b270d4cf7ff076/build/cmake/CMakeModules/ZstdPackage.cmake#L33-L38.
With the `Config.cmake` pattern, this is a case-sensitive package name,
`zstd`.

Follow-up to 8fce3e17e6cb310cd6dbe38ff14869b8fe5827d2 #20814
Closes #21538

2 weeks agotidy-up: sort TLS backends, distros, alphabetically
Viktor Szakats [Fri, 1 May 2026 11:25:49 +0000 (13:25 +0200)] 
tidy-up: sort TLS backends, distros, alphabetically

Also:
- replace stray [Rr]ustls-ffi with Rustls for consistency.
- add AWS-LC to a couple of lists where missing.

Closes #21481

2 weeks agocmake: auto-select static nghttp2/nghttp3/ngtcp2 Config
Viktor Szakats [Wed, 29 Apr 2026 17:09:28 +0000 (19:09 +0200)] 
cmake: auto-select static nghttp2/nghttp3/ngtcp2 Config

When detecting these dependencies via CMake Config and their main
imported target is undefined, automatically assume and use their static
imported target instead.

Adopting from vcpkg downstream, where it's done for nghttp3 and ngtcp2,
but not for nghttp2.

Refs:
https://github.com/microsoft/vcpkg/blob/773e092a82fc3b4c3e73ee7b049a5e119fa45898/ports/curl/dependencies.patch
https://github.com/microsoft/vcpkg/commit/70b941a5d2443e79eeab62507acb41bd22201277

Downstream-patch-by: Kai Pastor
Closes #21470

2 weeks agoftp: avoid accessing EPSV response one byte past the NULL
Daniel Stenberg [Sun, 10 May 2026 22:18:53 +0000 (00:18 +0200)] 
ftp: avoid accessing EPSV response one byte past the NULL

If the response is just a single "(".

Reported-by: Andrew Nesbit
Closes #21545

2 weeks agoGHA: update awslabs/aws-lc to v1.73.0
renovate[bot] [Sun, 10 May 2026 00:33:47 +0000 (00:33 +0000)] 
GHA: update awslabs/aws-lc to v1.73.0

Closes #21542

2 weeks agoschannel_verify: avoid out of blob access
Daniel Stenberg [Sun, 10 May 2026 13:13:59 +0000 (15:13 +0200)] 
schannel_verify: avoid out of blob access

The code would previously read one byte past the provided
CURLOPT_CAINFO_BLOB if the blob ends exactly with -----BEGIN
CERTIFICATE-----

Reported-by: Andrew Nesbit
Closes #21543

2 weeks agocookie: simplify strstore(), remove outdated comment
Daniel Stenberg [Sat, 9 May 2026 13:27:11 +0000 (15:27 +0200)] 
cookie: simplify strstore(), remove outdated comment

Closes #21541

2 weeks agoDockerfile: update debian:bookworm-slim Docker digest to 67b30a6
renovate[bot] [Sat, 9 May 2026 04:45:54 +0000 (04:45 +0000)] 
Dockerfile: update debian:bookworm-slim Docker digest to 67b30a6

Closes #21539

3 weeks agoGHA: update google/boringssl to v0.20260508.0
renovate[bot] [Fri, 8 May 2026 14:24:33 +0000 (14:24 +0000)] 
GHA: update google/boringssl to v0.20260508.0

Closes #21537

3 weeks agoCURLOPT_ECH.md: simplify the description language
Daniel Stenberg [Fri, 8 May 2026 11:13:20 +0000 (13:13 +0200)] 
CURLOPT_ECH.md: simplify the description language

It no longer requires "a special build" of OpenSSL, just OpenSSL 4+.

Emphasize the experimental part a little clearer.

Drop the caveat for wolfSSL from the main description.

Closes #21536

3 weeks agoECH: cleanups
Daniel Stenberg [Thu, 7 May 2026 21:07:54 +0000 (23:07 +0200)] 
ECH: cleanups

- passing an unknown string to CURLOPT_ECH now returns error

  To properly allow applications to spot if they pass in a typo or
  something to libcurl.

- CURLECH_DISABLE is now a plain zero internally, not a dedicated bit which
  simplifies checks for when ECH is enabled

- Dropped the CURLECH_CLA_CFG bit, and just check STRING_ECH_CONFIG

- Turn grease/enable/hard into three different numerical values, no bitmask
  needed

- Convert the struct field 'tls_ech' from an int to a byte.

Closes #21532

3 weeks agox509asn1: fix operator order in do_pubkey
Daniel Stenberg [Thu, 7 May 2026 21:35:40 +0000 (23:35 +0200)] 
x509asn1: fix operator order in do_pubkey

Check the range before reading data, as it would otherwise read one byte
too many.

Reported-by: Andrew Nesbit
Closes #21533