]> git.ipfire.org Git - thirdparty/curl.git/log
thirdparty/curl.git
9 days agoGHA: update gnutls/gnutls to 3.8.11 from 3.8.10
renovate[bot] [Thu, 20 Nov 2025 05:59:59 +0000 (05:59 +0000)] 
GHA: update gnutls/gnutls to 3.8.11 from 3.8.10

Closes #19613

9 days agomulti: make max_total_* members size_t
Stefan Eissing [Thu, 20 Nov 2025 09:58:54 +0000 (10:58 +0100)] 
multi: make max_total_* members size_t

Check size_t conversion on setting these members via CURLMIPT_*. Use
members without casting.

Closes #19618

9 days agosmb: fix a size check to be overflow safe
Daniel Stenberg [Fri, 21 Nov 2025 13:34:31 +0000 (14:34 +0100)] 
smb: fix a size check to be overflow safe

In smb_send_message, although it could never actually overflow it might
as well be done correctly. Also do the check earlier.

Closes #19640

9 days agoapple-sectrust: always ask when `native_ca_store` is in use
Stefan Eissing [Fri, 21 Nov 2025 12:06:00 +0000 (13:06 +0100)] 
apple-sectrust: always ask when `native_ca_store` is in use

When OpenSSL fails to verify the peer certificate, we checked for
one specific reason code and did not ask Apple SecTrust for any
other failure.

Always ask Apple SecTrust after OpenSSL fails when the `native_ca_store`
is enabled. If the user configures a CAfile or CApath, the native store
is disabled, so this does not affect use cases where users asks curl
to use a specific set of trust anchors.

Do the same for GnuTLS

Fixes #19636
Reported-by: ffath-vo on github
Closes #19638

9 days agobuild: add build-level `CURL_DISABLE_TYPECHECK` options
Viktor Szakats [Fri, 21 Nov 2025 11:43:54 +0000 (12:43 +0100)] 
build: add build-level `CURL_DISABLE_TYPECHECK` options

Usage:
- autotools: `--disable-typecheck` (or `--enable-typecheck` (default))
- cmake: `-DCURL_DISABLE_TYPECHECK=ON`.

To disable `curl_easy_setopt()`/`curl_easy_getinfo()` type checking with
supported (new) gcc and clang compilers. It is useful to improve build
performance for the `tests/libtest` target. In particular the CodeQL
analyzer may take above an hour to compile with type checking enabled,
and disabling it brings it down to seconds. On local machines it may
also cut build times in half when build testdeps, depending on platform
and compiler.

Other than these cases, we recommend leaving type checking enabled.

Ref: fdacf34aaeac79ad14fa48dcafae24a6de68823d #19632

Also:
- GHA/codeql: use it.
- test1165: check in `include/curl`.
- lib1912: delete stray todo comment.
- spelling and comment nits.

Closes #19637

9 days agolib: replace `_tcsncpy`/`wcsncpy`/`wcscpy` with `_s` counterparts (Windows)
Viktor Szakats [Mon, 17 Nov 2025 22:49:15 +0000 (23:49 +0100)] 
lib: replace `_tcsncpy`/`wcsncpy`/`wcscpy` with `_s` counterparts (Windows)

Replace:
- curl_sspi: macro `_tcsncpy()` with `_tcsncpy_s()`.
- curlx/fopen: `wcsncpy()` with `wcsncpy_s()`.
- curlx/fopen: `wcscpy()` with `wcscpy_s()`.

Use of the pre-existing functions were safe. This patch aims to use the
recommended Windows CRT functions. Handle errors returned by them. Also
to avoid the compiler warnings silenced via `_CRT_SECURE_NO_WARNINGS`:

```
lib/curl_sspi.c(152): warning C4996: 'wcsncpy': This function or variable may be unsafe. Consider using wcsncpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS.
lib/curlx/fopen.c(161): warning C4996: 'wcsncpy': This function or variable may be unsafe. Consider using wcsncpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS.
lib/curlx/fopen.c(162): warning C4996: 'wcscpy': This function or variable may be unsafe. Consider using wcscpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS.
lib/curlx/fopen.c(174): warning C4996: 'wcsncpy': This function or variable may be unsafe. Consider using wcsncpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS.
lib/curlx/fopen.c(175): warning C4996: 'wcscpy': This function or variable may be unsafe. Consider using wcscpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS.
```

Refs:
https://learn.microsoft.com/cpp/c-runtime-library/reference/strncpy-strncpy-l-wcsncpy-wcsncpy-l-mbsncpy-mbsncpy-l
https://learn.microsoft.com/cpp/c-runtime-library/reference/strncpy-s-strncpy-s-l-wcsncpy-s-wcsncpy-s-l-mbsncpy-s-mbsncpy-s-l
https://learn.microsoft.com/cpp/c-runtime-library/security-features-in-the-crt

Cherry-picked from #19581 (in part)
Closes #19589

9 days agolib: cleanup some whitespace nits
x2018 [Wed, 19 Nov 2025 15:25:57 +0000 (23:25 +0800)] 
lib: cleanup some whitespace nits

Closes #19588

9 days agoopenssl: no verify failf message unless strict
Stefan Eissing [Thu, 20 Nov 2025 12:17:03 +0000 (13:17 +0100)] 
openssl: no verify failf message unless strict

If verifypeer and verifyhost are disabled, to not generate
a failf() message for failed verifications.

Fixes #19615
Reported-by: ncaklovic on github
Closes #19625

9 days agoGHA: disable TLS in the linux-old build
Daniel Stenberg [Fri, 21 Nov 2025 08:19:21 +0000 (09:19 +0100)] 
GHA: disable TLS in the linux-old build

There are no supported TLS libraries left in "stretch".

9 days agogtls: drop support for GnuTLS < 3.6.5
Daniel Stenberg [Wed, 19 Nov 2025 14:05:17 +0000 (15:05 +0100)] 
gtls: drop support for GnuTLS < 3.6.5

Release date 2018-12-01. Has TLS 1.3 support.

Closes #19609

9 days agognutls: implement CURLOPT_CAINFO_BLOB
Marc Aldorasi [Wed, 19 Nov 2025 16:12:31 +0000 (11:12 -0500)] 
gnutls: implement CURLOPT_CAINFO_BLOB

This adds support for in-memory CA certs using CURLOPT_CAINFO_BLOB to
the GnuTLS backend.

Closes #19612

9 days agosrc: move `memdebug.h` to be the last include
Viktor Szakats [Thu, 20 Nov 2025 16:39:53 +0000 (17:39 +0100)] 
src: move `memdebug.h` to be the last include

`memdebug.h` must be included last within each source. This breaks when
including it in a header, which ends up being included in the middle of
other headers, and `memdebug.h` also ending up in the middle of
includes.

Follow-up to c255d2fdcbf27b4bfd668ae3784bb657449d6889 #19602

Closes #19629

9 days agoGHA/checksrc: switch xmllint job to Linux (from macOS)
Viktor Szakats [Fri, 21 Nov 2025 02:52:04 +0000 (03:52 +0100)] 
GHA/checksrc: switch xmllint job to Linux (from macOS)

macOS was chosen because xmllint comes preinstalled, saving the prereq
install step. But, macOS's xmllint jobs sometimes doesn't finish in 1m
(instead of under 1 second) and gets cancelled, causing flaky failures.
Go with Linux and an install phase (of 15s) instead.

Examples:
https://github.com/curl/curl/actions/runs/19558021722/job/56004334495

Closes #19634

9 days agoGHA/codeql: add tweak to successfully build libtests for CodeQL
Viktor Szakats [Fri, 21 Nov 2025 01:44:08 +0000 (02:44 +0100)] 
GHA/codeql: add tweak to successfully build libtests for CodeQL

Turns out the cause of CodeQL hangs (or probably just extreme long
compile) is the header `curl/typecheck-gcc.h`. By accident I noticed
that the preprocessed output of libtests.c is 75 MB (megabytes). This
is much higher than the amounf of source code hinted, also compared to
e.g. units.c or other build targets. The reason for the extreme size
is each easy option call pulling in the large checker logic defined
in this header.

By compiling with `-DCURL_DISABLE_TYPECHECK`, preprocessed output drops
to 2.2 MB (34x), and the libtests target builds without issues.

Also build all tests and examples with the Linux HTTP/3 config, covering
3 more files.

With these, CodeQL C coverage is 893 out of 930 (96%) (was: 645 69%)

Follow-up to 71fc11e6bbf530b90bf6e93a02cb32bdaecc933b #18695
Follow-up to a333fd4411b95fc0c3061b2d675de9287b6123e0 #18557
Follow-up to b4922b1295333dc6679eb1d588ddc2fb6b7fd5b7 #18564

Closes https://github.com/vszakats/curl/pull/11
Closes #19632

9 days agoGHA: update dependency wolfSSL/wolfssl to v5.8.4
renovate[bot] [Fri, 21 Nov 2025 02:14:59 +0000 (02:14 +0000)] 
GHA: update dependency wolfSSL/wolfssl to v5.8.4

Closes #19633

9 days agoRELEASE-NOTES: spellfix
Daniel Stenberg [Thu, 20 Nov 2025 22:59:10 +0000 (23:59 +0100)] 
RELEASE-NOTES: spellfix

10 days agoRELEASE-NOTES: synced
Daniel Stenberg [Thu, 20 Nov 2025 21:42:32 +0000 (22:42 +0100)] 
RELEASE-NOTES: synced

10 days agoquiche: eliminate size_t casts
Stefan Eissing [Thu, 20 Nov 2025 11:12:52 +0000 (12:12 +0100)] 
quiche: eliminate size_t casts

Use new curlx_sotouz_fits() instead.

Remove an unnecessary cast in osslq code while we are here.

Closes #19623

10 days agofile: eliminate size_t cast
Stefan Eissing [Thu, 20 Nov 2025 10:12:53 +0000 (11:12 +0100)] 
file: eliminate size_t cast

Use curlx_sztouz() instead.

Closes #19620

10 days agotool_urlglob: clean up used memory on errors better
Daniel Stenberg [Thu, 20 Nov 2025 08:58:14 +0000 (09:58 +0100)] 
tool_urlglob: clean up used memory on errors better

Previously it had to realloc the pattern array to store the last entry
even when that last entry triggered an error and could be only half
filled in.

Also cleaned up for readability and better reallocs for sets.

Reported-by: letshack9707 on hackerone
Closes #19614

10 days agoGHA: update actions/checkout action to v6 from v5
renovate[bot] [Thu, 20 Nov 2025 16:40:52 +0000 (16:40 +0000)] 
GHA: update actions/checkout action to v6 from v5

Closes #19628

10 days agoINTERNALS: add release dates to the oldest supported dependencies
Daniel Stenberg [Wed, 19 Nov 2025 15:35:25 +0000 (16:35 +0100)] 
INTERNALS: add release dates to the oldest supported dependencies

Closes #19611

10 days agohttp: error on OOM when creating range header
Daniel Stenberg [Thu, 20 Nov 2025 17:06:37 +0000 (18:06 +0100)] 
http: error on OOM when creating range header

Closes #19630

10 days agohttpsrr/altsvc: eliminate size_t casts
Stefan Eissing [Thu, 20 Nov 2025 10:28:41 +0000 (11:28 +0100)] 
httpsrr/altsvc: eliminate size_t casts

Treat alpn raw data as unsigned chars, avoids size_t and char* casts.
Add method to convert a struct Curl_str to an alpnid.

Closes #19621

10 days agovquic: eliminate size_t casts
Stefan Eissing [Thu, 20 Nov 2025 11:28:01 +0000 (12:28 +0100)] 
vquic: eliminate size_t casts

Use new curlx_sotouz_fits() instead.

Closes #19624

10 days agocf-socket: elminiate size_t casts
Stefan Eissing [Thu, 20 Nov 2025 09:46:35 +0000 (10:46 +0100)] 
cf-socket: elminiate size_t casts

Use curlx_sztouz() instead.

Closes #19617

10 days agortmp: eliminate size_t casts
Stefan Eissing [Thu, 20 Nov 2025 10:06:14 +0000 (11:06 +0100)] 
rtmp: eliminate size_t casts

Use curlx_sztouz() instead.

Closes #19619

10 days agomqtt: eliminate size_t cast
Stefan Eissing [Thu, 20 Nov 2025 10:40:23 +0000 (11:40 +0100)] 
mqtt: eliminate size_t cast

Use new curlx_sotouz_fits() instead.

Closes #19622

10 days agoh2-proxy: eliminate size_t cast
Stefan Eissing [Thu, 20 Nov 2025 09:37:46 +0000 (10:37 +0100)] 
h2-proxy: eliminate size_t cast

Use curlx_sztouz() instead.

Closes #19616

10 days agocmake: honor `CURL_DISABLE_INSTALL` and `CURL_ENABLE_EXPORT_TARGET` in lib and src
Viktor Szakats [Wed, 19 Nov 2025 22:33:52 +0000 (23:33 +0100)] 
cmake: honor `CURL_DISABLE_INSTALL` and `CURL_ENABLE_EXPORT_TARGET` in lib and src

Based on existing code and commit history it appears
`CURL_DISABLE_INSTALL` means to prevent calling `install()`;
`CURL_ENABLE_EXPORT_TARGET` means to prevent calling `export()` and
`install()`s with `EXPORT` in them.

Fix them to also apply to the lib and src directories in that vain:
- lib: honor `CURL_DISABLE_INSTALL`
- src: honor `CURL_DISABLE_INSTALL`
- src: honor `CURL_ENABLE_EXPORT_TARGET`

https://cmake.org/cmake/help/v4.2/command/install.html
https://cmake.org/cmake/help/v4.2/command/export.html

- `CURL_DISABLE_INSTALL` follow-up to:
  aace27b0965c10394544d1dacc9c2cb2fe0de3d3 #12287
- `CURL_ENABLE_EXPORT_TARGET` follow-up to:
  8698825106f7a9987ab3924128eee885278f66bb #9638
  643ec296456ba98c536857fce3ecfd021d44d913 #7060

Closes #19144

11 days agocurlx: add and use `curlx_freopen()`
Viktor Szakats [Wed, 19 Nov 2025 00:10:48 +0000 (01:10 +0100)] 
curlx: add and use `curlx_freopen()`

To complement the existing `curlx_fopen()` internal API.
It's used by the curl's `--stderr` option.

`curlx_freopen()` adds two features to the bare `freopen()`:
- tracing for debug-enabled builds.
- Unicode and long-filename support for Windows builds.

In effect this adds long-filename and enables Unicode support for
the `--stderr <filename>` curl command-line option on Windows.

Also add to checksrc.

Follow-up to 2f17a9b654121dd1ecf4fc043c6d08a9da3522db #10673

Closes #19598

11 days agoruntests: add `-m=seconds` to override test curl command timeout
Viktor Szakats [Sat, 1 Nov 2025 02:07:36 +0000 (03:07 +0100)] 
runtests: add `-m=seconds` to override test curl command timeout

To override the curl default of 5 minutes (300000 ms).

Sometimes a simple test data change can result in a stuck test, this
option makes it exit with an error early. Possible future use in CI
or fast machines to prevent a single test taking 5 minutes and failing
the whole job.

Example hangers:

tests/data/test65:
```diff
-<data1000 crlf="yes">
+<data1000 crlf="headers">
```

tests/data/tests993:
```diff
-%repeat[1000 x 95 328485%0d%0a]%</data>
+%repeat[1000 x 95 328485%0d%0a]%
+</data>
```

Closes #19319

11 days agolibssh2: add paths to error messages for quote commands
Christian Schmitz [Wed, 19 Nov 2025 12:15:37 +0000 (13:15 +0100)] 
libssh2: add paths to error messages for quote commands

We really like to know what path curl parsed from our input.

Closes #19605

11 days agohttp: eliminate ssize_t
Stefan Eissing [Wed, 19 Nov 2025 14:09:57 +0000 (15:09 +0100)] 
http: eliminate ssize_t

Use size_t to avoid conversions.

Closes #19610

11 days agogopher: convert ssize_t to size_t
Stefan Eissing [Wed, 19 Nov 2025 13:20:49 +0000 (14:20 +0100)] 
gopher: convert ssize_t to size_t

Make type conversions unnecessary.

Closes #19608

11 days agoftp: use size_t instead of ssize_t
Stefan Eissing [Wed, 19 Nov 2025 13:07:03 +0000 (14:07 +0100)] 
ftp: use size_t instead of ssize_t

Make type conversions unnecessary.

Closes #19607

11 days agotidy-up: move `CURL_UNCONST()` out from macro `curl_unicodefree()`
Viktor Szakats [Wed, 19 Nov 2025 12:30:25 +0000 (13:30 +0100)] 
tidy-up: move `CURL_UNCONST()` out from macro `curl_unicodefree()`

To stop applying it where not needed (most uses) and make it visible
where it's actually used (5 uses).

Follow-up to f4e23950c7b1c389cf0dde8b91353d85b8361b64 #16142

Closes #19606

11 days agoGHA: set `--buildinfo` for `test-torture` jobs
Viktor Szakats [Wed, 19 Nov 2025 03:53:55 +0000 (04:53 +0100)] 
GHA: set `--buildinfo` for `test-torture` jobs

Only the `test-ci` build target sets `--buildinfo` automatically,
since 985f39c0ce78b546e832c250588c14023123edfb. It needs to be set
manually for other targets used in CI, such as `test-torture`,
to enable the `buildinfo.txt` dump in the runtests step.

For Test Clutch. In an attempt to re-sync `targetarch` with the rest of
macOS jobs on the feature matrix page:
https://testclutch.curl.se/static/reports/feature-matrix.html
Before this patch and possibly since the breaking update It's `aarch64e`
for torture jobs and `aarch64` for the rest

(stricly speaking `aarch64e` is the correct value for all macOS jobs, but
autotools and cmake report arm64/aarch64 without the `e`.)

Regression from 985f39c0ce78b546e832c250588c14023123edfb #18147

Closes #19601

11 days agotest777: simple ---ssl-sessions test with wrong sessions
Daniel Stenberg [Wed, 19 Nov 2025 07:32:13 +0000 (08:32 +0100)] 
test777: simple ---ssl-sessions test with wrong sessions

11 days agocurlinfo: add "ssl-sessions" as a feature to show
Daniel Stenberg [Wed, 19 Nov 2025 07:30:49 +0000 (08:30 +0100)] 
curlinfo: add "ssl-sessions" as a feature to show

To allow tests depend on it

11 days agotool_cfgable: free ssl-sessions at exit
Daniel Stenberg [Wed, 19 Nov 2025 07:32:41 +0000 (08:32 +0100)] 
tool_cfgable: free ssl-sessions at exit

Also free the memory correctly in tool_ssls_load

Closes #19602

11 days agocurl_setup.h: document more funcs flagged by `_CRT_SECURE_NO_WARNINGS`
Viktor Szakats [Wed, 19 Nov 2025 00:36:28 +0000 (01:36 +0100)] 
curl_setup.h: document more funcs flagged by `_CRT_SECURE_NO_WARNINGS`

Based on these logs (non-Unicode, Unicode Schannel):
https://github.com/curl/curl/actions/runs/19446115443/job/55640968722?pr=19175
https://github.com/curl/curl/actions/runs/19446115443/job/55640968764?pr=19175

Follow-up to 5fa2d8320c4196435c1d554b06dfdcca73824dec #19175

Closes #19597

11 days agotests/data: mark non-XML-compliant files as such, xmllint the rest in CI
Viktor Szakats [Tue, 18 Nov 2025 18:10:53 +0000 (19:10 +0100)] 
tests/data: mark non-XML-compliant files as such, xmllint the rest in CI

There are 58 non-compliant files. Mark them with the `notxml` keyword.
Also include the compliant ones in the GHA/checksrc xmllint CI job.

Also:
- delete XML prolog from the 3 test data files that had them.
- FILEFORMAT.md: document the `notxml` keyword.
- FILEFORMAT.md: fix a typo.

Follow-up to de49cc89abc917cb4f273ebea8c6fb584d097de2 #19470
Follow-up to f3095f0dbd7e842d4a72c0300ba4817a755c74f5 #19528
Follow-up to 87ba80a6df1dfd7ceaaa52352c9f23afff0ed513

Closes #19595

11 days agoDISTROS.md: add OpenBSD
Viktor Szakats [Tue, 18 Nov 2025 20:41:42 +0000 (21:41 +0100)] 
DISTROS.md: add OpenBSD

Closes #19596

11 days agolib: error for OOM when extracting URL query
Daniel Stenberg [Tue, 18 Nov 2025 16:01:30 +0000 (17:01 +0100)] 
lib: error for OOM when extracting URL query

Closes #19594

12 days agotest2405, 2407: mark tests based on lib2405 flaky
Viktor Szakats [Tue, 18 Nov 2025 11:02:36 +0000 (12:02 +0100)] 
test2405, 2407: mark tests based on lib2405 flaky

Flaky in macOS CI jobs.

2405:
https://github.com/curl/curl/actions/runs/19448567968/job/55648448197 CM gcc-13 aws-lc
https://github.com/curl/curl/actions/runs/19432797208/job/55595742192 AM clang !ssl
https://github.com/curl/curl/actions/runs/19431697816/job/55591941993 AM clang !ssl !debug brotli zstd
https://github.com/curl/curl/actions/runs/19421214342/job/55558775785 CM llvm@18 GnuTLS !ldap krb5 +examples
https://github.com/curl/curl/actions/runs/19413038235/job/55537174590 CM llvm@18 mbedTLS !ldap brotli zstd MultiSSL AppleIDN

2407:
https://github.com/curl/curl/actions/runs/19462732039/job/55691022408 AM clang !ssl
https://github.com/curl/curl/actions/runs/19440283144/job/55621665647 CM gcc-13 OpenSSL gsasl rtmp AppleIDN SecTrust +examples
https://github.com/curl/curl/actions/runs/19440283144/job/55621665682 AM gcc-13 !ssl !debug
https://github.com/curl/curl/actions/runs/19436530386/job/55608724437 CM gcc-13 aws-lc
https://github.com/curl/curl/actions/runs/19436530386/job/55608724641 CM llvm@18 GnuTLS !ldap krb5 +examples
https://github.com/curl/curl/actions/runs/19435651588/job/55605648449 CM llvm@18 OpenSSL gsasl rtmp AppleIDN SecTrust +examples

Ref: https://testclutch.curl.se/static/reports/results-count.html

Bug: https://github.com/curl/curl/pull/19487#issuecomment-3546858203
Bug: https://github.com/curl/curl/pull/19487#issuecomment-3546921877

Follow-up to 2c7e1792a06b81b2bf41c9d348d374a83621340b #19487
Follow-up to 96a5ce5a82eb0f08650649ffafb7bb4e51fc4444 #19481
Follow-up to c78044c07e97cb720049579f4fe3cab33a7ea8d3 #15146 #15155

Closes #19587

12 days agotests/data: more XML-compliance via `%LT` and `%GT` macros in email addresses
Viktor Szakats [Tue, 11 Nov 2025 19:21:44 +0000 (20:21 +0100)] 
tests/data: more XML-compliance via `%LT` and `%GT` macros in email addresses

Reduce number of files failing `xmllint --format` from 133 to 57 (-76)
(3% of 1894), by replacing `<` and `>` with new macro `%LT` and `%GT`,
in most places, which is in email addresses (192 lines).

Follow-up to a9ec2a676c4257cf522a4349fb24fa547ed48aad #19491

Closes #19470

12 days agohsts: propagate and error out correctly on OOM
Daniel Stenberg [Tue, 18 Nov 2025 15:13:28 +0000 (16:13 +0100)] 
hsts: propagate and error out correctly on OOM

Closes #19593

12 days agocookie: return error on OOM
Daniel Stenberg [Tue, 18 Nov 2025 14:00:50 +0000 (15:00 +0100)] 
cookie: return error on OOM

Follow-up to 3f0629ca443825916cbc0795bcd5f241fbf710
Closes #19591

12 days agourl: if OOM in parse_proxy() return error
Daniel Stenberg [Tue, 18 Nov 2025 13:29:36 +0000 (14:29 +0100)] 
url: if OOM in parse_proxy() return error

Closes #19590

12 days agoopenssl: exit properly on OOM when getting certchain
Daniel Stenberg [Tue, 11 Nov 2025 21:40:31 +0000 (22:40 +0100)] 
openssl: exit properly on OOM when getting certchain

Previously, a momentary OOM error in the middle could produce a broken
result instead of correctly returning error.

Closes #19471

12 days agotool_getparam: verify that a file exists for some options
Daniel Stenberg [Tue, 18 Nov 2025 08:04:42 +0000 (09:04 +0100)] 
tool_getparam: verify that a file exists for some options

Passing the option as-is to libcurl is fine, but checking that the file
exists allows the tool to better provide a helpful message.

This now done for the following options:

  --cacert, --crlfile, --knownhosts, --netrc-file, --proxy-cacert amd
  --proxy-crlfile

Bonus: bail out properly on OOM errors in the --cert parser.

Reported-by: Wesley Moore
Fixes #19583
Closes #19585

12 days agoGHA: reduce timeouts for Linux and macOS jobs
Viktor Szakats [Tue, 18 Nov 2025 01:45:17 +0000 (02:45 +0100)] 
GHA: reduce timeouts for Linux and macOS jobs

Also syncing the run tests timeout in GHA/linux with GHA/maos.

Closes #19582

12 days agoTEST-SUITE.md: correct the man page's path
Daniel Stenberg [Tue, 18 Nov 2025 08:22:24 +0000 (09:22 +0100)] 
TEST-SUITE.md: correct the man page's path

Closes #19586

12 days agoAmigaOS: increase minimum stack size for tool_main
boingball [Mon, 17 Nov 2025 22:49:27 +0000 (22:49 +0000)] 
AmigaOS: increase minimum stack size for tool_main

In testing, the older stack size of 16384 was causing curl to crash on
heavy TLS loads

Closes #19578

12 days agoexamples: tidy-up headers and includes
Viktor Szakats [Mon, 17 Nov 2025 22:48:39 +0000 (23:48 +0100)] 
examples: tidy-up headers and includes

To have a more similar layout across examples.

Closes #19580

12 days agoexamples: make functions/data static where missing
Viktor Szakats [Mon, 17 Nov 2025 21:19:54 +0000 (22:19 +0100)] 
examples: make functions/data static where missing

Also to avoid compiler warnings on missing declarations.
Missed by CI for these "complicated" examples.

Closes #19579

12 days agobuild: tidy-up MSVC CRT warning suppression macros
Viktor Szakats [Tue, 21 Oct 2025 09:51:02 +0000 (11:51 +0200)] 
build: tidy-up MSVC CRT warning suppression macros

- curl_setup.h: replace `_CRT_SECURE_NO_DEPRECATE` with
  `_CRT_SECURE_NO_WARNINGS`, which seems to be the preferred,
  more recent macro for this. Also syncing with libssh2.
  They are equivalent for curl sources with the supported compilers.
- cmake: stop setting `_CRT_SECURE_NO_DEPRECATE` globally for examples.
- examples: suppress CRT deprecation warnings on a per-file basis.
  To make it work when compiling examples out of curl's build systems.
  Use `_CRT_SECURE_NO_WARNINGS`.
- examples: document the functions requiring `_CRT_SECURE_NO_WARNINGS`.
- examples/block_ip: delete superfluous `_CRT_SECURE_NO_WARNINGS`.
- examples/block_ip: limit `_CRT_NONSTDC_NO_DEPRECATE` to MSVC.
- examples/log_failed_transfers: fix to set `_CRT_SECURE_NO_WARNINGS`
  before headers and limit to MSVC.
- curl_setup.h: document which SDKs support `_CRT_NONSTDC_NO_DEPRECATE`.

Closes #19175

13 days agobadwords: add more contractions, fix fallouts
Viktor Szakats [Mon, 17 Nov 2025 17:03:22 +0000 (18:03 +0100)] 
badwords: add more contractions, fix fallouts

Also fix hits in autotools scripts (not to enforce).

Closes #19576

13 days agobadwords: fix issues found in scripts and other files
Viktor Szakats [Mon, 17 Nov 2025 15:06:00 +0000 (16:06 +0100)] 
badwords: fix issues found in scripts and other files

Single pass, not enforced.

Also:
- pyspelling.words: drop `web page`

Closes #19572

13 days agorenovate.json: replace `CI:` prefix with `GHA:`
Viktor Szakats [Mon, 17 Nov 2025 15:49:49 +0000 (16:49 +0100)] 
renovate.json: replace `CI:` prefix with `GHA:`

All bumped dependencies are in GHA.

Follow-up to 6225d7ba2f7dcad322776fc1cadae63e530de705 #19547

13 days agoGHA: update dependencies
renovate[bot] [Fri, 14 Nov 2025 00:47:55 +0000 (00:47 +0000)] 
GHA: update dependencies

- github/codeql-action to 4.31.3
- google/boringssl to v0.20251110.0
- ruff to 0.14.5

Closes #19442
Closes #19455

13 days agohttp: avoid two strdup()s and do minor simplifications
Daniel Stenberg [Mon, 17 Nov 2025 12:54:24 +0000 (13:54 +0100)] 
http: avoid two strdup()s and do minor simplifications

Closes #19571

13 days agoappveyor: add VS2010 x86 Release VS project job and switch VS2013 to x64
Viktor Szakats [Mon, 17 Nov 2025 13:55:14 +0000 (14:55 +0100)] 
appveyor: add VS2010 x86 Release VS project job and switch VS2013 to x64

To have a test case for VS2010 after bumping to minimum Vista.

Ref: #18009
Closes #19570

13 days agoh2/h3: handle methods with spaces
Stefan Eissing [Mon, 17 Nov 2025 08:56:48 +0000 (09:56 +0100)] 
h2/h3: handle methods with spaces

The parsing of the HTTP/1.1 formatted request into the h2/h3 header
structures should detect CURLOPT_CUSTOMREQUEST methods and forward them
correctly.

Add test_01_20 to verify

Fixes #19543
Reported-by: Omdahake on github
Closes #19563

13 days agohttp: the :authority header should never contain user+password
Daniel Stenberg [Mon, 17 Nov 2025 12:28:48 +0000 (13:28 +0100)] 
http: the :authority header should never contain user+password

Pointed-out-by: Stanislav Fort
Closes #19568

13 days agoprojects/README.md: Markdown fixes
Viktor Szakats [Mon, 17 Nov 2025 13:53:33 +0000 (14:53 +0100)] 
projects/README.md: Markdown fixes

Closes #19569

13 days agodigest_sspi: fix a memory leak on error path
x2018 [Mon, 17 Nov 2025 11:37:35 +0000 (19:37 +0800)] 
digest_sspi: fix a memory leak on error path

Closes #19567

13 days agoopenssl: fix a potential memory leak of bio_out
x2018 [Mon, 17 Nov 2025 06:26:24 +0000 (14:26 +0800)] 
openssl: fix a potential memory leak of bio_out

Closes #19561

13 days agoopenssl: fix a potential memory leak of params.cert
x2018 [Mon, 17 Nov 2025 06:12:14 +0000 (14:12 +0800)] 
openssl: fix a potential memory leak of params.cert

Closes #19560

13 days agoschannel_verify: fix a memory leak of cert_context
x2018 [Sun, 16 Nov 2025 18:25:57 +0000 (02:25 +0800)] 
schannel_verify: fix a memory leak of cert_context

Closes #19556

13 days agolibssh: properly free sftp_attributes
x2018 [Mon, 17 Nov 2025 10:36:42 +0000 (18:36 +0800)] 
libssh: properly free sftp_attributes

Closes #19564

13 days agobuild: exclude clang prereleases from compiler warning options
Marcel Raad [Mon, 17 Nov 2025 08:25:22 +0000 (09:25 +0100)] 
build: exclude clang prereleases from compiler warning options

Starting with clang 18, stable clang releases start with minor version 1.
Exclude pre-releases with minor version 0 from the compiler warning
options for that major version.

This fixes the build with Android NDK r29, which uses a prerelease
version of clang 21 that doesn't know the new options yet.

Closes #19566

13 days agotidy-up: miscellaneous
Viktor Szakats [Sat, 25 Oct 2025 21:32:14 +0000 (23:32 +0200)] 
tidy-up: miscellaneous

- schannel: delete superfluous parenthesis.
- tftp: delete stray space from log output.
- ws: update guard comment.
- docs/examples: constify variables.
- runtests/servers: enclose unknown parameter between quotes.
- scripts/perlcheck.sh: drop redundant grep `-E` option.
- THANKS: move names from comments to THANKS.
- sync `--depth` option style across scripts.
- sync git repo URL ending between some scripts.
- BINDINGS.md: drop protocol from archive.org URL path.
- whitespace, indent, unfold lines.

Closes #19565

13 days agobadwords: fix issues found in tests
Viktor Szakats [Fri, 14 Nov 2025 23:27:38 +0000 (00:27 +0100)] 
badwords: fix issues found in tests

There remain some false positives, hits in test data, and `dir` use,
around 100 issues in total.

There is no plan to enforce badwords on tests.

Also:
- badwords.txt: let a few `manpage[s]` occurrences through
  (in Perl code).

Closes #19541

13 days agocf-socket: limit use of `TCP_KEEP*` to Windows 10.0.16299+ at runtime
Viktor Szakats [Mon, 17 Nov 2025 00:16:07 +0000 (01:16 +0100)] 
cf-socket: limit use of `TCP_KEEP*` to Windows 10.0.16299+ at runtime

Before this patch `TCP_KEEP*` socket options were unconditionally used
if the build-time SDK supported them. This caused curl logging errors
(or trace messages since #19527) on Windows versions missing support
for them. After this patch, use them only when the runtime environment
supports it and fall back to the alternate method (`SIO_KEEPALIVE_VALS`)
dynamically.

Also:
- log a trace message when using the Win10 method.
- document which SDK versions offer `TCP_KEEP*` macros.

Ref: https://learn.microsoft.com/windows/win32/winsock/ipproto-tcp-socket-options
Ref: https://learn.microsoft.com/windows/win32/winsock/sio-keepalive-vals

Reported-by: Aleksandr Sergeev
Fixes #19520
Follow-up to dc34498d18d3303d67364423b4aa0daab4afb3ba #19527
Closes #19559

13 days agoRELEASE-NOTES: update upcoming removals
Viktor Szakats [Sun, 16 Nov 2025 22:54:54 +0000 (23:54 +0100)] 
RELEASE-NOTES: update upcoming removals

Also add a missed commit (noticed by accident)

Closes #19558

13 days agopytest fixes and improvements
Stefan Eissing [Sat, 15 Nov 2025 11:45:54 +0000 (12:45 +0100)] 
pytest fixes and improvements

- fix test_17_20 flakiness: the test case did not have `nghttpx` in
  its parameters, causing it to no check if a reload was necessary.
  When that test ran behind one that gave nghttpx another certificate,
  eg. in parallel mode, it used the wrong pinned pubkey.
- Have `env` provide lists of HTTP protocol versions available for
  testing. Replace parameterized tests on a fixed protocol list with
  the dynamic one from env. This makes checks for protocol availability
  in the test function bodies superfluous.

refs #19489
Closes #19540

13 days agocurl_sasl: make Curl_sasl_decode_mech compare case insenstively
Daniel Stenberg [Fri, 14 Nov 2025 22:00:05 +0000 (23:00 +0100)] 
curl_sasl: make Curl_sasl_decode_mech compare case insenstively

The provided mechanisms should be compared case insenstively.

Found by ZeroPath

Closes #19535

13 days agoRELEASE-NOTES: synced
Daniel Stenberg [Sun, 16 Nov 2025 22:38:48 +0000 (23:38 +0100)] 
RELEASE-NOTES: synced

13 days agowolfssl: fix a potential memory leak of session
x2018 [Sun, 16 Nov 2025 17:52:02 +0000 (01:52 +0800)] 
wolfssl: fix a potential memory leak of session

Closes #19555

13 days agoruntests: detect bad libssh differently for test 1459 (fixing CircleCI libssh job)
Viktor Szakats [Sun, 16 Nov 2025 18:56:39 +0000 (19:56 +0100)] 
runtests: detect bad libssh differently for test 1459 (fixing CircleCI libssh job)

test 1459 "SFTP with corrupted known_hosts" was seen failing in the past.
To fix it, the test was automatically disabled when detecting libssh
0.9.3 or older, as in the curl CircleCI job, running on Ubuntu 20.04.
This work for a long time, until bumping the CircleCI runner to Ubuntu
22.04 (to have OpenSSL 3), where the test was running again, and failing
with the isssue seen in the past.

- Test skipped with Ubuntu 20.04 (libssh 0.9.3):
  https://app.circleci.com/pipelines/github/curl/curl/16445/workflows/7f198763-e0b0-4037-9245-4c4b40ab8726/jobs/155164
- Failure seen with Ubuntu 22.04 (libssh 0.9.6):
  https://app.circleci.com/pipelines/github/curl/curl/16452/workflows/b817a808-0fd4-40b0-8eb0-d064926efe12/jobs/155206?invite=true#step-107-211709_45
- Failure seen with Ubuntu 24.04 (libssh 0.10.6):
  https://app.circleci.com/pipelines/github/curl/curl/16455/workflows/86c631f1-3c5f-4438-b398-3df2bdab5d20/jobs/155218

Turns out the issue issue isn't libssh 0.9.3 itself, but
a CircleCI-specific default configuration in `/etc/ssh/ssh_config`:
```
# BEGIN ANSIBLE MANAGED BLOCK
Host *
StrictHostKeyChecking no     <------ this particular line
HashKnownHosts no
SendEnv LANG LC_*
# END ANSIBLE MANAGED BLOCK
```

libssh will consult configuration files on hard-coded default system
locations and alter its behavior based on settings found in them.

This libssh behavior is present in all supported versions:
https://gitlab.com/libssh/libssh-mirror/-/commit/5a2abd34ce9ad97c69906c5fb7b07e26e96fceaa
https://gitlab.com/libssh/libssh-mirror/-/tags/libssh-0.9.0

It means the existing disable logic based on libssh version worked by
coincidence, and what needs to be checked is these configurations
to decide if it's safe to run the test. Another, simpler option is
to also accept the result code 67, though in that case the test
wouldn't actually test what we want, but would pass anyway.

With the old `oldlibssh` workaround deleted, and the problematic setting
manually overridden (`StrictHostKeyChecking yes`):
- CircleCI Ubuntu 20.04 passes with 1459 enabled:
  https://app.circleci.com/pipelines/github/curl/curl/16483/workflows/87a9f389-76a2-4a32-acde-c0b411a4c842/jobs/155302
- CircleCI Ubuntu 22.04 does too:
  https://app.circleci.com/pipelines/github/curl/curl/16483/workflows/87a9f389-76a2-4a32-acde-c0b411a4c842/jobs/155303

To fix, replace the `runtests` `oldlibssh` detection logic to parse
libssh config files (instead of checking for libssh version) and disable
test 1459 based on that. Notice the detection is making a light attempt
to parse these files, and does not implement most config file features
(such as includes, quoted values and `=` operator.)

The new runtests workaround tests OK with the:
- default CircleCI configuration, disabling 1459 automatically.
- a sudoless configuration fix, with 1459 run successfully.
  Also keep setting this option in CircleCI jobs.
- a sudo configuration fix, with 1459 run successfully.
Ref: https://app.circleci.com/pipelines/github/curl/curl/16492/workflows/56f39335-97ba-412c-9a9b-3d662694375a

GHA jobs are not affected and they work fine, with 1459 running successfully
before and after this patch.

It's possible the libssh API offers ways to control config file use
and/or set the strict host checking option programatically. Maybe
to enable in debug mode (albeit CircleCI job are not debug-enabled),
or offer an option for them. It may be something for a future patch.

Follow-up to 23540923e1b09ce00dc08bab3bb3a2c0e62ba4e7 #8622
Follow-up to 4b01a57c95fd4c041dfa4a41834c761658ea89ee #8548
Follow-up to bdc664a64002a7df66f34159454844e6b6f5515f #8490
Follow-up to 7c140f6b2d90975629ba81a23acbef4363a3e6fe #8444

Ref: 6d9c5c91b9fd5f3a2733363d1ded8f70b6c24e5d #19549

Closes #19557

2 weeks agoGHA/codeql: limit cron job to the origin repository
Viktor Szakats [Sun, 16 Nov 2025 12:14:04 +0000 (13:14 +0100)] 
GHA/codeql: limit cron job to the origin repository

To avoid running it in every fork, every week.

Closes #19552

2 weeks agoCI: avoid restart prompt on libssh-dev install in CircleCI
Viktor Szakats [Sun, 16 Nov 2025 00:06:24 +0000 (01:06 +0100)] 
CI: avoid restart prompt on libssh-dev install in CircleCI

By setting `DEBIAN_FRONTEND=noninteractive`.

Also:
- add `curl -V` step to CircleCI jobs.
- drop duplicate `libpsl` from `apt install`.
- replace sudo pip with venv, fixing a warning and syncing with GHA.
- Note that test 1459 was disabled on Ubuntu 20.04 due to past issues.
  When running on newer CircleCI Ubuntu runners (22.04 or 24.04), the
  test is not disabled, and also fails with the issue seen in the past.
  I've identified the root cause and will fix it in a separate PR.

Ref: https://circleci.com/developer/images?imageType=machine
Ref: https://discuss.circleci.com/t/ubuntu-20-04-22-04-24-04-q3-current-release/51856/7
Ref: https://app.circleci.com/pipelines/github/curl/curl/16450/workflows/af1f2a99-6452-4cc3-96c1-18a217ebabfc/jobs/155194

Follow-up to 8ba10a790a39dd48536c38e1d4569ab9fac537a1 #19546

Closes #19549

2 weeks agorustls: minor adjustment of sizeof()
Daniel Stenberg [Sat, 15 Nov 2025 22:56:31 +0000 (23:56 +0100)] 
rustls: minor adjustment of sizeof()

The mistake is harmless because it is still a size of a pointer, but
this is the correct pointer.

Acked-by: Daniel McCarney
Reported-by: pelioro on hackerone
Bug: https://hackerone.com/reports/3427460
Closes #19545

2 weeks agoGHA/linux: add missing condition for nghttp2-filc cache step
Viktor Szakats [Sat, 15 Nov 2025 23:42:14 +0000 (00:42 +0100)] 
GHA/linux: add missing condition for nghttp2-filc cache step

Follow-up to 67ef4a34f2e11aa45f0965909d0dd542643deede #19457

Closes #19548

2 weeks agoruntests: drop Python 2 support remains
Viktor Szakats [Sat, 1 Nov 2025 01:20:32 +0000 (02:20 +0100)] 
runtests: drop Python 2 support remains

Used in the test SMB and telnet servers.

Closes #19544

2 weeks agoCI: drop no longer used `install-wolfssl` step in Circle CI
Viktor Szakats [Sat, 15 Nov 2025 23:22:59 +0000 (00:22 +0100)] 
CI: drop no longer used `install-wolfssl` step in Circle CI

Follow-up to b011e3fcfb06d6c0278595ee2ee297036fbe9793 #18700

Closes #19547

2 weeks agoCI: bump Circle CI jobs to Ubuntu 22.04 runners for OpenSSL 3
Viktor Szakats [Sat, 15 Nov 2025 23:18:31 +0000 (00:18 +0100)] 
CI: bump Circle CI jobs to Ubuntu 22.04 runners for OpenSSL 3

Ref: https://packages.ubuntu.com/jammy/libssl-dev

Follow-up to 69c89bf3d3137fcbb2b8bc57233182adcf1e2817 #18330

Closes #19546

2 weeks agoDEPRECATE.md: move OpenSSL to past removals (fixup)
Viktor Szakats [Sat, 15 Nov 2025 21:32:56 +0000 (22:32 +0100)] 
DEPRECATE.md: move OpenSSL to past removals (fixup)

Follow-up to bb213bd76915368ac49c5db9da9d6462c6b8e6cf #19542

2 weeks agoDEPRECATE.md: move OpenSSL to past removals
Viktor Szakats [Sat, 15 Nov 2025 18:33:37 +0000 (19:33 +0100)] 
DEPRECATE.md: move OpenSSL to past removals

Follow-up to 69c89bf3d3137fcbb2b8bc57233182adcf1e2817 #18330

Closes #19542

2 weeks agoopenssl: bump minimum OpenSSL version to 3.0.0
Viktor Szakats [Tue, 26 Aug 2025 22:54:22 +0000 (00:54 +0200)] 
openssl: bump minimum OpenSSL version to 3.0.0

It also means that all supported OpenSSL versions and forks support
TLSv1.3 after this patch.

It reduces `openssl.c` size by more than 10%, or 400 LOC.

Ref: #18822
Closes #18330

2 weeks agobuild: drop support for VS2008 (Windows)
Viktor Szakats [Sun, 13 Jul 2025 10:57:26 +0000 (12:57 +0200)] 
build: drop support for VS2008 (Windows)

Require Visual Studio 2010 or newer.

Ref: https://github.com/curl/curl/discussions/15972

Follow-up to dc28bb86c1e466c667ce220fd2e51355cd8bae8d #17798
Follow-up to 63e513b106113db0b1b68bab347b80cb4cef4e65 #17380

Closes #17931

2 weeks agobuild: drop Windows CE / CeGCC support
Viktor Szakats [Mon, 14 Jul 2025 22:36:08 +0000 (00:36 +0200)] 
build: drop Windows CE / CeGCC support

Windows CE support was limited to successful builds with ming32ce
(a toolchain that hasn't seen an update since 2009, using an ancient gcc
version and "old mingw"-style SDK headers, that curl deprecated earlier).
Builds with MSVC were broken for a long time. mingw32ce builds were never
actually tested and runtime and unlikely to work due to missing stubs.
Windows CE toolchains also miss to comply with C89. Paired with lack of
demand and support for the platform, curl deprecated it earlier.

This patch removes support from the codebase to ease maintaining Windows
codepaths.

Follow-up to f98c0ba834d4b4da480373b732a86976f9064ccd #17924
Follow-up to 8491e6574cde770b227ca0e1cd66548291f49661 #17379
Follow-up to 2a292c39846107228201674d686be5b3ed96674d #15975

Closes #17927

2 weeks agobadwords: check indented lines in source code, fix fallouts
Viktor Szakats [Fri, 14 Nov 2025 16:55:33 +0000 (17:55 +0100)] 
badwords: check indented lines in source code, fix fallouts

- badwords.pl: add `-a` option to check all lines in source code files.
  Before this patch indented lines were skipped (to avoid Markdown code
  fences.)
- GHA/checksrc: use `-a` when verifying the source code.
- GHA/checksrc: disable `So` and `But` rules for source code.
- GHA/checksrc: add docs/examples to the verified sources.
- badwords.txt: delete 4 duplicates.
- badwords.txt: group and sort contractions.
- badwords.txt: allow ` url = `, `DIR`, `<file name`.

Closes #19536

2 weeks agomk-ca-bundle.pl: default to SHA256 fingerprints with `-t` option
Viktor Szakats [Tue, 4 Nov 2025 11:55:25 +0000 (12:55 +0100)] 
mk-ca-bundle.pl: default to SHA256 fingerprints with `-t` option

Replacing previous default: MD5.

You can use the existing `-s` option to override the default.

Also bump version to 1.30.

Closes #19359

2 weeks agobadwords.pl: fix variable in printf mask
Viktor Szakats [Fri, 14 Nov 2025 16:57:03 +0000 (17:57 +0100)] 
badwords.pl: fix variable in printf mask

Causing warnings if a matched line has mask patterns.

Closes #19534

2 weeks agodocs: fix checksrc warning, fix checkdocs CI filter
Viktor Szakats [Fri, 14 Nov 2025 16:09:50 +0000 (17:09 +0100)] 
docs: fix checksrc warning, fix checkdocs CI filter

Also:
- GHA/checkdocs: fix CI filters to catch it early.
  Follow-up to 28dd14aafe2692a3e7dceb40340554c03c127cf1 #15797

Closes #19533

2 weeks agobadwords: fix two exceptions and drop them
Viktor Szakats [Fri, 14 Nov 2025 15:58:05 +0000 (16:58 +0100)] 
badwords: fix two exceptions and drop them

Also:
- extend `dir` rule to exclude C assignments.

Closes #19532

2 weeks agoGHA/checksrc: check XML files for errors
Viktor Szakats [Fri, 14 Nov 2025 14:39:40 +0000 (15:39 +0100)] 
GHA/checksrc: check XML files for errors

Closes #19528