Commit graph

38650 commits

Author SHA1 Message Date
Viktor Szakats
cc5eb4aba9
docs: fix a couple of typos
Spotted by GitHub Code Quality

Closes #21617
2026-05-15 01:37:38 +02:00
Viktor Szakats
5a869edb0f
creds: drop redundant CURL_UNCONST()s
Follow-up to 8f71d0fde5 #21548

Closes #21612
2026-05-15 01:37:38 +02:00
Viktor Szakats
27936d411a
lib: make __STDC_VERSION__ literals L (where missing) 2026-05-14 18:35:49 +02:00
Viktor Szakats
1a69c3a9c0
cmake: unfold a line 2026-05-14 16:33:23 +02:00
Viktor Szakats
db5d888673
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
2026-05-14 14:26:43 +02:00
Daniel Stenberg
81f950dd90
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
2026-05-13 23:47:39 +02:00
0xN3R3K3
db4a6f286b
docs: fix grammar and wording in FAQ
Closes #21593
2026-05-13 23:19:26 +02:00
Viktor Szakats
a36c571984
pythonlint.sh: make it fail on error, fix ruff warnings in pytest
Follow-up to a5542c23e7 #21289
Follow-up to 17e8200733

Closes #21597
2026-05-13 22:59:36 +02:00
Viktor Szakats
e25e497c5e
cmake: merge if blocks (tidy-up)
Closes #21596
2026-05-13 22:47:56 +02:00
Viktor Szakats
616e8ea6d8
cookie: constify struct pointers
Closes #21589
2026-05-13 17:52:49 +02:00
Viktor Szakats
96dbcf6921
llist: constify struct pointers
Closes #21590
2026-05-13 17:40:42 +02:00
Daniel Stenberg
675a9b0189
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
2026-05-13 16:47:05 +02:00
Stefan Eissing
7f7e4e3e68
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 5e99b73cf4

Closes #21591
2026-05-13 16:37:15 +02:00
Daniel Stenberg
b079595f2e
url: keep the question mark for empty queries
Reported-by: Bill Mill
Fixes #21544

Verified by test 1721

Closes #21584
2026-05-13 14:34:54 +02:00
Daniel Stenberg
11df1251e5
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 cc6777d939

Reported by Codex Security
Closes #21583
2026-05-13 14:34:08 +02:00
Stefan Eissing
5e99b73cf4
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
2026-05-13 14:04:17 +02:00
Daniel Stenberg
b2476a0712
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 2238f0921c

Spotted by Codex Security

Closes #21586
2026-05-13 13:12:10 +02:00
Daniel Stenberg
2238f0921c
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
2026-05-13 10:07:50 +02:00
Daniel Stenberg
89f38c168c
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
2026-05-13 09:45:33 +02:00
Viktor Szakats
eca309c2a1
ldap: fix to not leak attribute on OOM (WinLDAP)
Reported-by: Andrew Nesbitt

Closes #21576
2026-05-13 00:43:27 +02:00
Viktor Szakats
54d5de5305
THANKS-filter: update
Source: https://github.com/andrew

Closes #21577
2026-05-13 00:43:27 +02:00
Andrei Rybak
a3618d166d
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
2026-05-12 23:47:29 +02:00
Daniel Stenberg
287b082c63
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
2026-05-12 23:46:04 +02:00
Viktor Szakats
02dca1eb86
src: fix comment typos
Found by GitHub Code Quality

Closes #21570
2026-05-12 17:14:38 +02:00
Viktor Szakats
2538dc04e3
curl_ntlm_core: propagate DES CryptEncrypt() error
Spotted by GitHub Code Quality

Closes #21569
2026-05-12 17:14:38 +02:00
Stefan Eissing
8f71d0fde5
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
2026-05-12 16:05:15 +02:00
Daniel Stenberg
a32a2b0b77
GHA: (re-)enable SMB in a few builds
Closes #21564
2026-05-12 14:53:48 +02:00
Viktor Szakats
82216163b1
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 01f08dc4eb #21557

Closes #21566
2026-05-12 14:21:25 +02:00
Daniel Stenberg
cb4395b403
rtsp: bump buf after rtsp_filter_rtp()
Reported-by: Andrew Nesbit
Closes #21563
2026-05-12 12:39:06 +02:00
Song X. Gao
cc6777d939
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
2026-05-12 10:27:29 +02:00
Daniel Stenberg
2256162fa7
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
2026-05-12 10:26:20 +02:00
Daniel Stenberg
7eb0b30934
tool_urlglob: make globbing error reported for correct position
Reported by Codex Security

Closes #21561
2026-05-12 10:21:45 +02:00
Daniel Stenberg
cb0636980b
tool_urlglob: add named globs
Idea-by: Bastian Jesuiter

Verified by test 2408 - 2411

Closes #21409
2026-05-12 08:33:01 +02:00
Stefan Eissing
2a2104f3cf
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
2026-05-12 08:11:31 +02:00
Viktor Szakats
01f08dc4eb
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 cfadbaa133 #21169

Closes #21557
2026-05-12 05:33:08 +02:00
Viktor Szakats
b582a936dd
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
2026-05-12 04:26:33 +02:00
Xi Ruoyao
cfadbaa133
gnutls: allow building with nettle 4.0
Closes #21169
2026-05-12 03:54:24 +02:00
Tim Martin
185e67e1fa
docs: fix --follow doc typo
Let the singular ~~object~~ subject "option" agree with the verb "set".

Closes #21553
2026-05-12 02:10:27 +02:00
Viktor Szakats
4d82423dd3
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
2026-05-11 22:05:29 +02:00
Kai Pastor
7d546e52b2
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 8fce3e17e6 #20814

Closes #21540
2026-05-11 21:53:39 +02:00
Viktor Szakats
e8ce697973
idn: replace header guards with forward declaration
Follow-up to bc40e09f63 #21472

Closes #21551
2026-05-11 17:01:34 +02:00
amitbidlan
e0e56e9ae4
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
2026-05-11 16:19:34 +02:00
Daniel Stenberg
daf6f541cc
RELEASE-NOTES: synced 2026-05-11 14:51:03 +02:00
Daniel Stenberg
37b2403f48
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
2026-05-11 13:43:47 +02:00
Kai Pastor
10d4b34e5c
cmake: fix zstd CMake config name
They install `zstdConfig.cmake`,
885c79ba4a/build/cmake/CMakeModules/ZstdPackage.cmake (L33-L38).
With the `Config.cmake` pattern, this is a case-sensitive package name,
`zstd`.

Follow-up to 8fce3e17e6 #20814
Closes #21538
2026-05-11 12:08:32 +02:00
Viktor Szakats
4815070794
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
2026-05-11 11:57:25 +02:00
Viktor Szakats
ed3cd8b046
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:
773e092a82/ports/curl/dependencies.patch
70b941a5d2

Downstream-patch-by: Kai Pastor

Closes #21470
2026-05-11 11:57:25 +02:00
Daniel Stenberg
6f1dfab6a2
ftp: avoid accessing EPSV response one byte past the NULL
If the response is just a single "(".

Reported-by: Andrew Nesbit
Closes #21545
2026-05-11 08:07:24 +02:00
renovate[bot]
67ce672842
GHA: update awslabs/aws-lc to v1.73.0
Closes #21542
2026-05-10 23:22:45 +02:00
Daniel Stenberg
ea75ccc53b
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
2026-05-10 23:21:08 +02:00