]> git.ipfire.org Git - thirdparty/curl.git/log
thirdparty/curl.git
3 months agolibssh2: allocate libssh2-friendly memory in kbd_callback
Daniel Stenberg [Thu, 16 Apr 2026 08:09:59 +0000 (10:09 +0200)] 
libssh2: allocate libssh2-friendly memory in kbd_callback

The function libssh2_userauth_keyboard_interactive_ex() calls the
callback and is documented to call free() on the memory returned to
libssh2 from the callback. libcurl can therefore not use the regular
curlx_strdup() for this, as that is not compatible in debug builds or
when curl_global_init_mem() is used.

Fixes #21336
Closes #21338

3 months agobuild: fix `-Wformat-signedness` by adjusting printf masks
Viktor Szakats [Thu, 16 Apr 2026 01:16:20 +0000 (03:16 +0200)] 
build: fix `-Wformat-signedness` by adjusting printf masks

- sync printf masks with the passed value.
- fix a couple of casts.

Cherry-picked from #20848

Closes #21335

3 months agoci: update RUSTLS_VERSION 0.15.1 -> 0.15.2
Daniel McCarney [Wed, 15 Apr 2026 13:46:07 +0000 (09:46 -0400)] 
ci: update RUSTLS_VERSION 0.15.1 -> 0.15.2

Closes #21333

3 months agounittests: cleanups
Daniel Stenberg [Wed, 15 Apr 2026 10:11:54 +0000 (12:11 +0200)] 
unittests: cleanups

- make sure all UNITTEST prototypes mark in which unit test they are used,
  with "@unittest" markup

- make sure all UNITTEST functions do not use Curl_ prefix, as that is a
  prefix we use for global private functions and these functions are static
  and therefore not global and the prefix is wrong

- drop UNITTEST for functions not used in unit tests

- make the extract-unit-protos script highlight the above issues if found

- extract-unit-protos now also outputs the unit test number for all the
  generated protos in lib/unitprotos.h to aid readers. It also adds the source
  file and line number where the proto originates from.

- extract-unit-protos now exits with a non-zero value if any of the above
  warnings are triggered

- cf-dns: Curl_cf_dns_result => static cf_dns_result
- hostip: Curl_ipv6works => static ipv6works
- url: remove Curl_setup_conn() - not used anymore
- connect: Curl_timeleft_now_ms => UNITTEST timeleft_now_ms

Closes #21330

3 months agorenovate: use standard bump formula for OpenSSL
Viktor Szakats [Wed, 15 Apr 2026 06:50:00 +0000 (08:50 +0200)] 
renovate: use standard bump formula for OpenSSL

Cherry-picked from #21317

Closes #21323

3 months agopytest: fix dnsd pid filename
Viktor Szakats [Tue, 14 Apr 2026 22:28:03 +0000 (00:28 +0200)] 
pytest: fix dnsd pid filename

Spotted by GitHub Code Quality

Follow-up to a5542c23e7427b8ea8f6183f503f2935d88d5d65 #21289

Closes #21321

3 months agotransfer: clear the old autoreferer
Daniel Stenberg [Wed, 15 Apr 2026 06:11:33 +0000 (08:11 +0200)] 
transfer: clear the old autoreferer

Verify in test 2505

Closes #21322

3 months agourlapi: make parse_file() return zero data on error
Daniel Stenberg [Wed, 15 Apr 2026 07:47:00 +0000 (09:47 +0200)] 
urlapi: make parse_file() return zero data on error

This fixes the torture failures in 1675

Also, make it allocate the scheme *after* the path has been verified, so
that it is avoided in the common error cases.

Fixes #21326
Closes #21324

3 months agoGHA/linux: tidy up and extend address-sanitizer job options
Viktor Szakats [Mon, 2 Mar 2026 00:46:13 +0000 (01:46 +0100)] 
GHA/linux: tidy up and extend address-sanitizer job options

Also tried `integer` which has hits, but too slow to be practical to run on
every commit.

Closes #20785

3 months agoGHA/non-native: bump cross-platform-actions to 1.0.0
Viktor Szakats [Tue, 14 Apr 2026 21:23:11 +0000 (23:23 +0200)] 
GHA/non-native: bump cross-platform-actions to 1.0.0

Closes #21320

3 months agoGHA/linux: rename mbedtls-prev env to align with Renovate
Viktor Szakats [Tue, 14 Apr 2026 15:48:18 +0000 (17:48 +0200)] 
GHA/linux: rename mbedtls-prev env to align with Renovate

- rename version env to stay compatible with Renovate `matchStrings`.
- also switch to manual bumps.
  Bump rule was wrong, and deemed not worthy the complexity to fix.

Closes #21319

3 months agoGHA/http3-linux: bump OpenSSL 4 beta to final
Viktor Szakats [Tue, 14 Apr 2026 15:29:31 +0000 (17:29 +0200)] 
GHA/http3-linux: bump OpenSSL 4 beta to final

Closes #21318

3 months agourldata: move cookiehost to struct SingleRequest
Daniel Stenberg [Tue, 14 Apr 2026 06:51:44 +0000 (08:51 +0200)] 
urldata: move cookiehost to struct SingleRequest

To make it scoped for the single request appropriately.

Reported-by: Muhamad Arga Reksapati
Verify with libtest 2504: a custom Host *disabled* on reused handle

Closes #21312

3 months agotest dnsd: implement delayed responses
Stefan Eissing [Mon, 13 Apr 2026 14:11:37 +0000 (16:11 +0200)] 
test dnsd: implement delayed responses

Add "Delay-A: ms", "Delay-AAAA: ms" and "Delay-HTTPS: ms" to the test
dnsd config and implement delayed response handling.

Add test_21_09 and test_21_10 to check that delayed responses connect
using the undelayed address family.

Closes #21299

3 months agosocks: use dns filter for resolving
Stefan Eissing [Mon, 13 Apr 2026 10:57:11 +0000 (12:57 +0200)] 
socks: use dns filter for resolving

Use a dns connection filter to resolve hostnames where their addresses
are locally resolved and forwarded to the SOCKS proxy.

This makes all improvements, like in #21295 for example, also apply
to socks connections. Curl_resolv() is now only called from a DNS
filter.

(ftp still calls Curl_resolv_blocking() in two places, one of which
 may be replaceable with a DNS filter as well to remove the block, tbd)

Closes #21297

3 months agotests: use %b64[] instead of "raw" base64
Daniel Stenberg [Tue, 14 Apr 2026 07:24:14 +0000 (09:24 +0200)] 
tests: use %b64[] instead of "raw" base64

Closes #21313

3 months agohttp: clear the proxy credentials as well on port or scheme change
Daniel Stenberg [Mon, 13 Apr 2026 15:17:23 +0000 (17:17 +0200)] 
http: clear the proxy credentials as well on port or scheme change

Add tests 2009-2011 to verify switching between proxies with credentials
when the switch is driven by a redirect

Reported-by: Dwij Mehta
Closes #21304

3 months agourlapi: stop extracting hostname from file:// URLs on Windows
Daniel Stenberg [Mon, 13 Apr 2026 12:55:16 +0000 (14:55 +0200)] 
urlapi: stop extracting hostname from file:// URLs on Windows

There is no reason we should treat this part different on Windows. Noe
anything except blank, localhost or 127.0.0.1 cause error there as well.

Also: fix query handling in urlencode_str

Closes #21296

3 months agotest1675: unit tests for URL API helper functions
Daniel Stenberg [Mon, 13 Apr 2026 10:46:45 +0000 (12:46 +0200)] 
test1675: unit tests for URL API helper functions

- ipv4_normalize
- urlencode_str
- ipv6_parse
- parse_file

urlapi: make the string URL encoder normalize to uppercase
percent-encoding

Closes #21296

3 months agolib1560: fix comment typo
Daniel Stenberg [Mon, 13 Apr 2026 20:43:53 +0000 (22:43 +0200)] 
lib1560: fix comment typo

3 months agorequest: cleanup the auth headers on soft rest as well
Daniel Stenberg [Tue, 14 Apr 2026 08:56:39 +0000 (10:56 +0200)] 
request: cleanup the auth headers on soft rest as well

To avoid the risk them lingering around.

Follow-up to 3512b673ddc54074676d

Closes #21311

3 months agoGHA: update dependency google/boringssl to v0.20260413.0
renovate[bot] [Tue, 14 Apr 2026 07:01:38 +0000 (07:01 +0000)] 
GHA: update dependency google/boringssl to v0.20260413.0

Closes #21310

3 months agohttp: use header_has_value() instead of duplicate code
Daniel Stenberg [Mon, 13 Apr 2026 20:30:13 +0000 (22:30 +0200)] 
http: use header_has_value() instead of duplicate code

Closes #21302

3 months agoGHA: bump pytest from 9.0.2 to 9.0.3
dependabot[bot] [Tue, 14 Apr 2026 00:24:46 +0000 (00:24 +0000)] 
GHA: bump pytest from 9.0.2 to 9.0.3

CVE-2025-71176

Closes #21306

3 months agoKNOWN_BUGS: Native CA roots incomplete on Windows with OpenSSL/fork
Viktor Szakats [Mon, 13 Apr 2026 23:37:50 +0000 (01:37 +0200)] 
KNOWN_BUGS: Native CA roots incomplete on Windows with OpenSSL/fork

Reported-by: finkjsc on github
Reported-by: nitrogene on github
Ref: #12303
Closes #20897

Closes #21305

3 months agoclang-tidy: enable more checks, fix fallouts
Viktor Szakats [Tue, 3 Mar 2026 00:58:29 +0000 (01:58 +0100)] 
clang-tidy: enable more checks, fix fallouts

- enable three checks:
  - bugprone-invalid-enum-default-initialization
  - bugprone-sizeof-expression
  - readability-inconsistent-declaration-parameter-name (strict)
- fix remaining discrepancies with arg names in prototypes
  and implementation, in strict mode.
- document reason for some checks tested but not enabled.

Closes #20794

3 months agotidy-up: miscellaneous
Viktor Szakats [Mon, 9 Mar 2026 11:27:12 +0000 (12:27 +0100)] 
tidy-up: miscellaneous

- examples: sync debug output printf masks.
- INSTALL-CMAKE.md: tidy up section for some options.
- curl_sha512_256: delete comment suggesting an optimization.
- vtls/keylog: scope a variable.
- vtls/openssl: make a source code URL a permalink.
- vtls/schannel: drop redundant parentheses.
- test1119.pl: robustify `$1` -> `$s`.
- sync arg names in comments to match the code.
- tidy up and minor fixes to comments.
- fix formatting/indenting/comment/newline/include nits.
- move `UNITTEST` protos next to definitions, sync their argument names.
- make variables static.
- add parentheses to Perl `open()` calls.
- drop unnecessary double quotes in Perl.
- clang-format.

Closes #21000

3 months agolib: move request specific allocations to the request struct
Daniel Stenberg [Mon, 13 Apr 2026 17:38:16 +0000 (19:38 +0200)] 
lib: move request specific allocations to the request struct

To make it clearer that they are ephemeral.

Closes #21301

3 months agosetopt: fix typos in comments
Daniel Stenberg [Mon, 13 Apr 2026 20:41:40 +0000 (22:41 +0200)] 
setopt: fix typos in comments

Closes #21303

3 months agotest1560: add a few more URL API test variations
Daniel Stenberg [Mon, 13 Apr 2026 08:00:44 +0000 (10:00 +0200)] 
test1560: add a few more URL API test variations

Closes #21294

3 months agohostip: resolve user supplied ip addresses
Stefan Eissing [Mon, 13 Apr 2026 08:32:48 +0000 (10:32 +0200)] 
hostip: resolve user supplied ip addresses

When a user supplied an ip address in a URL as hostname, use that even
when address family restrictions like -4 or -6 are set.

Add test_10_15/16 to verify with a local proxy server.

Fixes #21146
Reported-by: Terrance Wong
How:
- cf-dns: on see the hostname is an ip(v6) address, add the respective
  A/AAAA to the dns query bits
- cf-dns/hostip: only hand out addrinfos for a family if that family
  is part of the DNS queries. That prevents for example ipv6 addresses
  to show up from dns cache entries
- change cf-ip-happy to no longer check for "ip_version" and instead
  use all addresses that cf-dns hands out

Closes #21295

3 months agosetopt: move CURLOPT_CURLU
Daniel Stenberg [Mon, 13 Apr 2026 11:46:20 +0000 (13:46 +0200)] 
setopt: move CURLOPT_CURLU

To fix cast from 'char *' to 'CURLU *' (aka 'struct Curl_URL *')
increases required alignment from 1 to 8

Follow-up to 3407bee8c8f145557fc9f8baa

Closes #21298

3 months agoschannel: increase renegotiation timeout to 60 seconds
Jay Satiro [Fri, 10 Apr 2026 18:02:55 +0000 (14:02 -0400)] 
schannel: increase renegotiation timeout to 60 seconds

Prior to this change the timeout was 7 seconds but that is too short for
enhanced-security users that have to fill out an interactive prompt on
Schannel renegotiation (PIN, smart card, etc).

Reported-by: Tim Omta
Fixes https://github.com/curl/curl/issues/21270
Closes https://github.com/curl/curl/pull/21291

3 months agoRELEASE-NOTES: synced
Daniel Stenberg [Mon, 13 Apr 2026 06:08:19 +0000 (08:08 +0200)] 
RELEASE-NOTES: synced

3 months agohttp: fix auth_used and auth_avail
Stefan Eissing [Fri, 10 Apr 2026 08:57:47 +0000 (10:57 +0200)] 
http: fix auth_used and auth_avail

Fix http auth to set the `picked` auth when sending the corresponding
headers. Fix reporting Digest as avail.

Fixes #21274
Reported-by: sergio-nsk on github
Closes #21284

3 months agopytest: test threaded resolver
Stefan Eissing [Fri, 10 Apr 2026 09:43:28 +0000 (11:43 +0200)] 
pytest: test threaded resolver

Add `resolv-threaded` to curlinfo to detect use of the threaded resolver
correctly even with c-ares linked to https-rr.

Run test_21_05 exactly when threaded resolver is built.

Closes #21287

3 months agounit1398: add msnprintf tests with negative precision
Daniel Stenberg [Sat, 11 Apr 2026 09:04:41 +0000 (11:04 +0200)] 
unit1398: add msnprintf tests with negative precision

Closes #21292

3 months agogetinfo: repair CURLINFO_TLS_SESSION
Daniel Stenberg [Fri, 10 Apr 2026 13:50:17 +0000 (15:50 +0200)] 
getinfo: repair CURLINFO_TLS_SESSION

This should return a SSL_CTX pointer but it was accidentally broken.

Verify with test 1587

Follow-up to 2db8ae480fdcae7f005

Spotted by Codex Security

Closes #21290

3 months agoGHA: update dependency ruff to v0.15.10
renovate[bot] [Fri, 10 Apr 2026 02:02:35 +0000 (02:02 +0000)] 
GHA: update dependency ruff to v0.15.10

Closes #21282

3 months agoconfigure: tidy up comments
Viktor Szakats [Thu, 19 Mar 2026 20:10:39 +0000 (21:10 +0100)] 
configure: tidy up comments

- convert `#` comments to `dnl`, except copyright headers, and inline
  comments in `curl-complilers.m4`.
- drop empty comments.
- drop line-ending `dnl` markers. (except `zz40-xc-ovr.m4` where it's
  used to produce a comment in `configure`.)
- replace `dnl` line with C comment in `AC_CHECK_HEADERS()`.

Verified to produce the same `configure` script except empty lines,
`#` comments, and C comments, with autoreconf 2.72.

Cherry-picked from #21000

Closes #21246

3 months agotests/http: add abrupt server close test
Daniel McCarney [Wed, 8 Apr 2026 20:28:06 +0000 (16:28 -0400)] 
tests/http: add abrupt server close test

Test that connecting to a server that immediately closes the connection
produces an error instead of hanging/timing out.

3 months agorustls: handle EOF during initial handshake
kpcyrd [Mon, 6 Apr 2026 16:45:19 +0000 (18:45 +0200)] 
rustls: handle EOF during initial handshake

Closes #21242

3 months agopytest: adding support for dnsd test server
Stefan Eissing [Fri, 10 Apr 2026 11:31:02 +0000 (13:31 +0200)] 
pytest: adding support for dnsd test server

Add tests to test_21 with checks for 'overrride-dns' from curlinfo.

Closes #21289

3 months agopytest: switch off h3 for pytest_07_22
Stefan Eissing [Fri, 10 Apr 2026 09:17:36 +0000 (11:17 +0200)] 
pytest: switch off h3 for pytest_07_22

Run test_07_22 only on http/1.1 and h2. For h3, we get unreliable tests
results in CI due to (probably) nghttpx not always reporting the RESET
from the backend and the test timing out.

Closes #21286

3 months agovquic: fix variable name in fallback code
Viktor Szakats [Thu, 9 Apr 2026 21:56:40 +0000 (23:56 +0200)] 
vquic: fix variable name in fallback code

Could not cause an issue in practice.

Closes #21281

3 months agohttp: on 303, switch to GET
Daniel Stenberg [Thu, 9 Apr 2026 21:43:55 +0000 (23:43 +0200)] 
http: on 303, switch to GET

... unless it is a POST and the user explicitly asked to keep doing
POST.

Add test1983/1984: verify --follow with 303 and PUT + custom GET

Fixes #20715
Reported-by: Dan Arnfield
Closes #21280

3 months agotool: simplify retrycheck()
Daniel Stenberg [Thu, 9 Apr 2026 15:41:27 +0000 (17:41 +0200)] 
tool: simplify retrycheck()

- By making retry_sleep() a separate funtion that determines how long to
  wait until the next retry.

- switch the retry timer to uint32 to make it uniform across platforms

Closes #21279

3 months agoGHA: update awslabs/aws-lc to v1.71.0
renovate[bot] [Fri, 10 Apr 2026 02:02:40 +0000 (02:02 +0000)] 
GHA: update awslabs/aws-lc to v1.71.0

Closes #21283

3 months agoRELEASE-NOTES: fix typos [ci skip]
Viktor Szakats [Thu, 9 Apr 2026 22:10:42 +0000 (00:10 +0200)] 
RELEASE-NOTES: fix typos [ci skip]

3 months agocfilters: CF_TYPE_SETUP connection filter
Stefan Eissing [Wed, 8 Apr 2026 12:37:45 +0000 (14:37 +0200)] 
cfilters: CF_TYPE_SETUP connection filter

Connection filters can now carry the flag CF_TYPE_SETUP, indicating that
they are only needed during connection setup, e.g. connect.

Once the connection is fully established, those filter are removed
again. This frees resources and also makes the filter (call) chains
shorter.

Closes #21269

3 months agoasyn-ares: connect async
Stefan Eissing [Thu, 2 Apr 2026 09:10:33 +0000 (11:10 +0200)] 
asyn-ares: connect async

Make separate queries for A and AAAA records. Hand out A/AAAA/HTTPS
information before all queries are complete.

Closes #21205

3 months agoh3: HTTPS-RR use in HTTP/3
Stefan Eissing [Tue, 7 Apr 2026 11:53:42 +0000 (13:53 +0200)] 
h3: HTTPS-RR use in HTTP/3

When HTTPS-RR is needed for the HTTP/3 handshake, delay the connect
until it arrives. Relevant only for TLS backends that support ECH, for
now.

Closes #21253

3 months agotests/http: bump cryptography from 46.0.6 to 46.0.7
dependabot[bot] [Wed, 8 Apr 2026 23:59:10 +0000 (23:59 +0000)] 
tests/http: bump cryptography from 46.0.6 to 46.0.7

Closes #21273

3 months agoGHA: update dependency wolfSSL/wolfssl to v5.9.1
renovate[bot] [Wed, 8 Apr 2026 21:16:30 +0000 (21:16 +0000)] 
GHA: update dependency wolfSSL/wolfssl to v5.9.1

Closes #21272

3 months agobuild: skip detecting `pipe2()` for Apple targets
Viktor Szakats [Wed, 8 Apr 2026 18:46:06 +0000 (20:46 +0200)] 
build: skip detecting `pipe2()` for Apple targets

To avoid (mis-)detecting it via the internal Apple library
`/usr/lib/system/libsystem_sim_kernel.dylib` when targeting iPhone
Simulator (seen with iPhoneSimulator26.4.sdk).

Reported-by: Ian Spence
Fixes #21236

Closes #21271

3 months agodns: https-eyeballing async
Stefan Eissing [Wed, 8 Apr 2026 09:45:30 +0000 (11:45 +0200)] 
dns: https-eyeballing async

Make cf-https-connect work async correctly:
- only start first baller when at least one A/AAAA address
  is available
- select first connect attempt after that with HTTPS-RR info
  there or not.
- select second connect attempt only when HTTPS-RR is resolved
  (may have resolved to "not known") and select possible ALPN
  from things known by then. May not select any second attempt
  when first already covers everything.

This means when the HTTPS-RR is known at/before the first address
is resolved, everything behaves as before. When the HTTPS-RR is
late, a first connection attempt will have been started. Any
ALPN preference from the HTTPS-RR that is not already ongoing will
then start the second attempt.

For HTTPS-RRs that recommend 2 or more ALPNs, the first will always
be attempted: either it is already ongong or it will be the ALPN
for the second attempt. The 2nd ALPN recommendation from HTTPS-RR
*may* be honored or not, depending on what is already selected.

The difference in behaviour between early/late HTTPS-RR resolve
cannot be helped - unless we do not perform any attempts before
it arrives. Trade offs.

Closes #21267

3 months agotests: make whitespace between functions and classes consistent
Dan Fandrich [Sun, 5 Apr 2026 16:00:55 +0000 (09:00 -0700)] 
tests: make whitespace between functions and classes consistent

Mostly, this means two blank lines between classes and functions and one
line between methods. Since these checks are currently in preview, they
are done in a separate ruff invocation to avoid turning ALL the preview
checks on at the same time.

3 months agotests: alphabetize and group Python imports & add check
Dan Fandrich [Fri, 3 Apr 2026 18:52:44 +0000 (11:52 -0700)] 
tests: alphabetize and group Python imports & add check

- De-duplicates, groups, and sorts imports based on the provided `isort` settings.

3 months agotests: enable more ruff checks
Dan Fandrich [Fri, 3 Apr 2026 00:49:37 +0000 (17:49 -0700)] 
tests: enable more ruff checks

- Checks for missing explicit `return` statements at the end of functions
that can return non-`None` values.
- Checks for classes that inherit from `object`.
- Checks for useless expressions.
- Within an `except*` clause, raise exceptions with `raise ... from err`
or `raise ... from None` to distinguish them from errors in exception
handling
- Checks for variable assignments that immediately precede a `return` of the
assigned variable.
- Checks for `else` statements with a `return` statement in the preceding
`if` block.
- Checks for unnecessary parentheses on raised exceptions.

Closes: #21258
3 months agovtls_scache: include cert_blob independently of verifypeer
Daniel Stenberg [Sat, 4 Apr 2026 16:20:41 +0000 (18:20 +0200)] 
vtls_scache: include cert_blob independently of verifypeer

The making of the TLS session cache key should use the cert blob
independently of verifypeer on/off.

Follow-up to fa0ccd9f1fbbbd77bf50b2

Spotted by Codex Security

Closes #21222

3 months agoparsedate: bsearch the time zones
Daniel Stenberg [Wed, 8 Apr 2026 08:30:36 +0000 (10:30 +0200)] 
parsedate: bsearch the time zones

There are 69 entries, bsearch is faster than linear search for random
access.

This now also makes the matching case sensitive (zone names always in
uppercase). No docs said otherwise and all tests assumed uppercase.

Extended test 517

Closes #21266

3 months agoRELEASE-NOTES: update the entry for `mk-ca-bundle.pl` [ci skip]
Viktor Szakats [Wed, 8 Apr 2026 09:40:15 +0000 (11:40 +0200)] 
RELEASE-NOTES: update the entry for `mk-ca-bundle.pl` [ci skip]

To dsecribe the feature remaiming after follow-up commits.

Follow-up to 351e4f956a11bdf419c14f1f69758a15e77e7fea #21116

3 months agoRELEASE-NOTES: synced
Daniel Stenberg [Wed, 8 Apr 2026 09:33:11 +0000 (11:33 +0200)] 
RELEASE-NOTES: synced

3 months agombedtls: fix ECJPAKE matching
Daniel Stenberg [Wed, 8 Apr 2026 07:20:11 +0000 (09:20 +0200)] 
mbedtls: fix ECJPAKE matching

It did not require a full-length match, so empty or prefix tokens map to
ECJPAKE would silently add that cipher to the configured list.

Follow-up to fba9afebba22d577f122239b18

Reported by Codex Security

Closes #21264

3 months agodocs: use the correct CURLOPT_WRITEFUNCTION signature
Ted Lyngmo [Wed, 8 Apr 2026 07:15:03 +0000 (09:15 +0200)] 
docs: use the correct CURLOPT_WRITEFUNCTION signature

In order to not encourage users to use incompatible function pointers,
change the callback function definitions to use `char *` instead of
`void *` for the first argument.

Triggered by https://stackoverflow.com/questions/79921871/curl-c-c-library-based-application-produces-erronious-response-for-http-post-r#comment141032037_79921871 :

"The code was mostly modified from
 [this example code](https://curl.se/libcurl/c/postinmemory.html),
 honestly I never knew this is wrong. Thanks for pointing it out."

Signed-off-by: Ted Lyngmo <ted@lyncon.se>
Closes #21265

3 months agotool_getparam: reduce opt_string complexity
Daniel Stenberg [Tue, 7 Apr 2026 22:36:36 +0000 (00:36 +0200)] 
tool_getparam: reduce opt_string complexity

- move arguments taking unsigned numbers into opt_num

- move arugments taking seconds into opt_secs

Closes #21261

3 months agoconfigure: silence useless clang warnings in C89 builds
Viktor Szakats [Wed, 8 Apr 2026 01:18:11 +0000 (03:18 +0200)] 
configure: silence useless clang warnings in C89 builds

Syncing with CMake.

Follow-up to 43397b0283d4cdb10797e7ead6eacbe09f8a3e77 #21015
Follow-up to 09c9afdd711d0b2ee9f524a235803e755e1074b7 #20363

Closes #21263

3 months agoGHA/linux: bump mbedTLS 3 to 3.6.5 (from 3.6.4), also verify hash
Viktor Szakats [Tue, 7 Apr 2026 23:35:37 +0000 (01:35 +0200)] 
GHA/linux: bump mbedTLS 3 to 3.6.5 (from 3.6.4), also verify hash

Also:
- fix incorrect version in cache id.
  Follow-up to 3a305831d1a9d10b2bfd4fa3939ed41275fee7f7 #19077
- latest version 3.6.6 fails pytests. Seems similar to the v4.1.0
  regression.
  https://github.com/curl/curl/pull/21178
  https://github.com/Mbed-TLS/mbedtls/issues/10668

Closes #21262

3 months agogtls: fail for large files in `load_file()`
Viktor Szakats [Tue, 7 Apr 2026 15:01:29 +0000 (17:01 +0200)] 
gtls: fail for large files in `load_file()`

Used for issuer certs. Limit the size at `CURL_MAX_INPUT_LENGTH`, 8MB.

Bug: https://github.com/curl/curl/pull/21256#discussion_r3045854654

Closes #21257

3 months agoclang-tidy: avoid assigments in `if` expressions
Viktor Szakats [Tue, 7 Apr 2026 13:40:18 +0000 (15:40 +0200)] 
clang-tidy: avoid assigments in `if` expressions

Also enable check in clang-tidy.

Cherry-picked from #20794

Closes #21256

3 months agoparsedate: clarify time2epoch and add more variations to test 517
Daniel Stenberg [Tue, 7 Apr 2026 09:11:38 +0000 (11:11 +0200)] 
parsedate: clarify time2epoch and add more variations to test 517

Polish the time2epoch function to become a little more readable.

Corrected the military time zones: they were going in the wrong
direction.

Add more curl_getdate() input varations to test 517

Closes #21251

3 months agoclang-tidy: drop readability-math-missing-parentheses
Daniel Stenberg [Tue, 7 Apr 2026 09:19:30 +0000 (11:19 +0200)] 
clang-tidy: drop readability-math-missing-parentheses

It's mostly annoying and not helpful

3 months agocf-ip-happy: limit concurrent attempts
Stefan Eissing [Tue, 7 Apr 2026 09:57:37 +0000 (11:57 +0200)] 
cf-ip-happy: limit concurrent attempts

Introduce a limit on the concurrent connect attempts of 6:

- document this in CURLOPT_HAPPY_EYEBALLS_TIMEOUT_MS
- close the oldest attempt before opening a new one that would
  exceed the limit
- closing failed attempts early to avoid sockets use beyong their
  usefulness
- add tests for limits in unit2600

These changes are externally visible as file descriptors will be
reassigned where we previously kept the old one around and started a
new socket, allocating always a new descriptor.

Closes #21252

3 months agoGHA: update openssl/openssl to v3.6.2
renovate[bot] [Tue, 7 Apr 2026 12:52:03 +0000 (12:52 +0000)] 
GHA: update openssl/openssl to v3.6.2

Closes #21254

3 months agolibssh: split myssh_statemach_act into sub functions and rename
Daniel Stenberg [Tue, 7 Apr 2026 07:54:56 +0000 (09:54 +0200)] 
libssh: split myssh_statemach_act into sub functions and rename

Follow-up to bd3b2a626a33434a1e9e83a

- rename it to myssh_statemachine

- remove the use of ternary operators in the switch

- fix the error handling for if 'sshp' actually ever is NULL

Closes #21250

3 months agolibssh2: split ssh_statemachine into more sub functions
Daniel Stenberg [Tue, 7 Apr 2026 07:02:01 +0000 (09:02 +0200)] 
libssh2: split ssh_statemachine into more sub functions

The pieces of the state machine that were not separate functions before, now
are.

Also removed the use of ternary operators in the function calls.

Follow-up to f0bf43e20936cf4aa2665

Closes #21249

3 months agoprotocol: disable connection reuse for SMB(S)
Daniel Stenberg [Sun, 5 Apr 2026 16:23:35 +0000 (18:23 +0200)] 
protocol: disable connection reuse for SMB(S)

Connections should only be reused when using the same "share" (and
perhaps some additional conditions), but instead of fixing this flaw,
this change completely disables connection reuse for SMB. This protocol
is about to get dropped soon anyway.

Reported-by: Osama Hamad
Closes #21238

3 months agocurl_ntlm_core: use wolfCrypt DES API with wolfSSL
Viktor Szakats [Mon, 6 Apr 2026 23:49:12 +0000 (01:49 +0200)] 
curl_ntlm_core: use wolfCrypt DES API with wolfSSL

Replacing the last uses of the OpenSSL compatibility API, and dropping
the redefinition of external symbols.

Closes #21247

3 months agolib: replace `PRI*32` printf masks with C89 ones
Viktor Szakats [Sun, 5 Apr 2026 16:08:32 +0000 (18:08 +0200)] 
lib: replace `PRI*32` printf masks with C89 ones

Also: fix indent.

Follow-up to 13c1a934144e98d06214a043ff4538791c7d9583 #20215

Closes #21234

3 months agoDockerfile: update debian:bookworm-slim Docker digest to 4724b8c
renovate[bot] [Tue, 7 Apr 2026 04:32:28 +0000 (04:32 +0000)] 
Dockerfile: update debian:bookworm-slim Docker digest to 4724b8c

Closes #21248

3 months agolib: reserve 'result' for CURLcode, even more
Daniel Stenberg [Mon, 6 Apr 2026 21:27:36 +0000 (23:27 +0200)] 
lib: reserve 'result' for CURLcode, even more

Closes #21245

3 months agocmake: pre-fill `HAVE_PIPE2` for two more platforms
Viktor Szakats [Mon, 6 Apr 2026 19:52:20 +0000 (21:52 +0200)] 
cmake: pre-fill `HAVE_PIPE2` for two more platforms

For DragonFlyBSD and SunOS.

Also opt-in `BSD`, which is covering those listed explicitly, when using
CMake 3.25+.

Follow-up to 131a2fd5aaa1a809211695d2ef8151ffadbebc0c #16987

Closes #21243

3 months agolib: reserve 'result' for CURLcode
Daniel Stenberg [Mon, 6 Apr 2026 20:21:12 +0000 (22:21 +0200)] 
lib: reserve 'result' for CURLcode

For consistency, whereever we use a local variable named 'result' that
is a CURLcode type. Make other types use other names.

Closes #21244

3 months agocfilters: fix Curl_pollset_poll() return code mixup
Daniel Stenberg [Sun, 5 Apr 2026 15:44:01 +0000 (17:44 +0200)] 
cfilters: fix Curl_pollset_poll() return code mixup

Curl_conn_cf_poll did not map adjust_pollset failures to poll-style
errors properly, so error codes were treated as ready events.

Found by Codex Security

Closes #21231

3 months agoGHA/curl-for-win: drop certdata dependency and `GITHUB_TOKEN` with it
Viktor Szakats [Mon, 6 Apr 2026 15:09:10 +0000 (17:09 +0200)] 
GHA/curl-for-win: drop certdata dependency and `GITHUB_TOKEN` with it

`certdata` dependency requires accessing api.github.com for
a reproducible timestamp, which in turn requires a GitHub token to avoid
errors due to rate limiting. Avoid all this by omitting this dependency,
which isn't necessary for these build tests anyway.

The `zero` job already did not use `certdata`, but disable explicitly
anyway just in case.

Reported-by: James Fuller
Follow-up to https://github.com/curl/curl-for-win/commit/9514184977347dbfcd7a4f48daeda7bdb8222458
Follow-up to 128c252975423856d1403c42267a8a1f1b97433f #21105

Closes #21241

3 months agoGHA: autoreconf downloaded tarballs where missing
Viktor Szakats [Mon, 6 Apr 2026 13:54:43 +0000 (15:54 +0200)] 
GHA: autoreconf downloaded tarballs where missing

To avoid using pre-built `./configure` scripts.

Also: drop unrecognized nettle `./configure` option.

Closes #21240

3 months agospacecheck.pl: fix to check 3+ newlines in all files
Viktor Szakats [Mon, 6 Apr 2026 01:32:30 +0000 (03:32 +0200)] 
spacecheck.pl: fix to check 3+ newlines in all files

Follow-up to e52e6dac8e83dd06306e3e9eca32a39575e8fec6 #20269

Closes #21237

3 months agocmake: drop redundant condition
Viktor Szakats [Fri, 20 Mar 2026 21:13:59 +0000 (22:13 +0100)] 
cmake: drop redundant condition

Follow-up to 43397b0283d4cdb10797e7ead6eacbe09f8a3e77 #21015
Cherry-picked from #21000

3 months agoMakefile.am: replace stray `:=` with `=` [ci skip]
Viktor Szakats [Thu, 12 Mar 2026 00:34:01 +0000 (01:34 +0100)] 
Makefile.am: replace stray `:=` with `=` [ci skip]

`=` is used everywhere else in `Makefile.am` files.

Cherry-picked from #21000

3 months agocurl_setup.h: drop stray/unused `USE_OPENSSL_QUIC` guard
Viktor Szakats [Sun, 5 Apr 2026 19:14:45 +0000 (21:14 +0200)] 
curl_setup.h: drop stray/unused `USE_OPENSSL_QUIC` guard

Follow-up to 6aaac9dd388a64d0f511544496608693e1105d13 #20226

Closes #21235

3 months agoman: fix argument type for `CURLSHOPT_[UN]SHARE` options
Viktor Szakats [Sun, 5 Apr 2026 15:45:04 +0000 (17:45 +0200)] 
man: fix argument type for `CURLSHOPT_[UN]SHARE` options

Closes #21232

3 months agoCURLOPT_SOCKS5_AUTH.md: an access property
Daniel Stenberg [Sun, 5 Apr 2026 15:01:06 +0000 (17:01 +0200)] 
CURLOPT_SOCKS5_AUTH.md: an access property

Reported-by: Cutiapreta on hackerone
Closes #21230

3 months agoGHA/windows: enable more options in 32-bit jobs
Viktor Szakats [Sun, 5 Apr 2026 12:55:30 +0000 (14:55 +0200)] 
GHA/windows: enable more options in 32-bit jobs

c-ares, gnutls, libssh, openssl.

Closes #21227

3 months agodocs: noproxy wants the punycoded hostname version
Daniel Stenberg [Sun, 5 Apr 2026 14:24:37 +0000 (16:24 +0200)] 
docs: noproxy wants the punycoded hostname version

Reported-by: Mehtab Zafar
Closes #21228

3 months agolibssh: fix 64-bit printf mask for mingw-w64 <=6.0.0
Viktor Szakats [Sun, 5 Apr 2026 13:31:35 +0000 (15:31 +0200)] 
libssh: fix 64-bit printf mask for mingw-w64 <=6.0.0

Fixing (dl-mingw, CM 6.4.0-i686 (mingw-w64 5.0.0) schannel !unity):
```
lib/vssh/libssh.c: In function 'myssh_in_SFTP_QUOTE_STATVFS':
lib/vssh/libssh.c:573:31: error: ISO C does not support the 'I' printf flag [-Werror=format=]
     char *tmp = curl_maprintf("statvfs:\n"
                               ^~~~~~~~~~~~
lib/vssh/libssh.c:573:31: error: format '%u' expects argument of type 'unsigned int', but argument 2 has type 'uint64_t {aka long long unsigned int}' [-Werror=format=]
lib/vssh/libssh.c:573:31: error: ISO C does not support the 'I' printf flag [-Werror=format=]
[...]
```
Ref: https://github.com/curl/curl/actions/runs/24002480364/job/70000685821

mingw-w64 <=6.0.0 define `PRIu64` like this:
```
./inttypes.h:#define PRIu64 "I64u"
```

Follow-up to 413a0fedd02c8c6df1d294534b8c6e306fcca7a2 #12346
Cherry-picked from #21227

Closes #21229

3 months agoshare: do bitshifts after the type is checked to be valid
Daniel Stenberg [Sun, 5 Apr 2026 12:46:40 +0000 (14:46 +0200)] 
share: do bitshifts after the type is checked to be valid

Fixes #21224
Reported-by: bird on github
Closes #21226

3 months agolibssh: fix `-Wsign-compare` in 32-bit builds by dropping a redundant check
Viktor Szakats [Sun, 5 Apr 2026 09:32:48 +0000 (11:32 +0200)] 
libssh: fix `-Wsign-compare` in 32-bit builds by dropping a redundant check

Follow-up to 8c8eeba5225599a1f5750ece1d15751a8bfce0bb #21214 (wrong silencing)
Follow-up to c049c37acd074a61bbd07eebe25fdf32af575a2a #18989 (add redundant check)
Follow-up to c988ec9f41060144e175b519f9017c569ac8d3db #9328 (make check fail)
Follow-up to 44a02d2532c4e6dabb8f2a074d52d5e99ff533be #9324 (add original check)

Closes #21225

3 months agoruntests: allow configuring SSH host/client key algorithm
Viktor Szakats [Wed, 1 Apr 2026 23:05:54 +0000 (01:05 +0200)] 
runtests: allow configuring SSH host/client key algorithm

via env `CURL_TEST_SSH_KEYALGO`, `rsa` (default), `ecdsa`, `ed25519`.

To ease debugging and testing and to make these code paths more
universal.

Closes #21223

3 months agosendf: fix CR detection if no LF is in the chunk
Daniel Stenberg [Sat, 4 Apr 2026 16:10:31 +0000 (18:10 +0200)] 
sendf: fix CR detection if no LF is in the chunk

When doing line ending conversions, and a chunk contains no '\n', the
function returned early without updating prev_cr to reflect the last
byte. It could then lead to CRLFs sequences not get converted when
occuring right on the boundary border.

Found by Codex Security

Closes #21221

3 months agoGHA/windows: restore libssh, fix to pass tests with 0.12.0
Viktor Szakats [Thu, 2 Apr 2026 15:03:16 +0000 (17:03 +0200)] 
GHA/windows: restore libssh, fix to pass tests with 0.12.0

libssh 0.12.0 on Windows 64-bit Intel fails to connect to sshd (with SSH
state 30) when using the mlkem768x25519-sha256 KEX. (32-bit Intel, ARM64
and tested non-Windows platforms work fine.) Fix by disabling this KEX
for the libssh job.

I do not recommend libssh on Windows due to bugs an insecure behavior.

Also:
- fix libssh TFLAGS condition for mingw-w64.

Follow-up to e127f8ce843e1c070c0ca2074c10dcc01081a395 #21204
Follow-up to fcf946e8461b68840e4afb39711a52c9bf622a10 #21195

Closes #21199