]> git.ipfire.org Git - thirdparty/curl.git/log
thirdparty/curl.git
6 weeks agotidy-up: miscellaneous
Viktor Szakats [Fri, 13 Feb 2026 00:47:10 +0000 (01:47 +0100)] 
tidy-up: miscellaneous

- vms/curlmsg_vms.h: delete unused/commented code.
- vtls/schannel_verify: sort includes.
- typecheck-gcc.h: fix indent and alignment.
- lib/config-win32.h: drop idle `#undef`.
- spacecheck: check for stray empty lines before after curly braces.
- make literals more readable: 1048576 -> 1024 * 1024
- scope variables.
- use ISO date in a comment.
- drop redundant parentheses.
- drop empty comments.
- unfold lines.
- duplicate/stray spaces in comments.
- fix indent, whitespace, minor typos.

Closes #20690

6 weeks agoclang-tidy: enable `bugprone-signed-char-misuse`, fix fallouts
Viktor Szakats [Wed, 18 Feb 2026 16:39:23 +0000 (17:39 +0100)] 
clang-tidy: enable `bugprone-signed-char-misuse`, fix fallouts

Examples:
```
lib/vtls/openssl.c:2585:18: warning: 'signed char' to 'int' conversion; consider casting to 'unsigned char' first. [bugprone-signed-char-misuse]
 2585 |       msg_type = *(const char *)buf;
lib/vtls/openssl.c:2593:18: warning: 'signed char' to 'int' conversion; consider casting to 'unsigned char' first. [bugprone-signed-char-misuse]
 2593 |       msg_type = *(const char *)buf;
tests/server/mqttd.c:514:10: warning: comparison between 'signed char' and 'unsigned char' [bugprone-signed-char-misuse]
  514 |       if(passwd_flag == (char)(conn_flags & passwd_flag)) {
tests/server/tftpd.c:362:13: warning: 'signed char' to 'int' conversion; consider casting to 'unsigned char' first. [bugprone-signed-char-misuse]
  362 |         c = test->rptr[0];
tests/server/tftpd.c:454:9: warning: 'signed char' to 'int' conversion; consider casting to 'unsigned char' first. [bugprone-signed-char-misuse]
  454 |     c = *p++;                     /* pick up a character */
src/tool_urlglob.c:272:46: warning: 'signed char' to 'int' conversion; consider casting to 'unsigned char' first. [bugprone-signed-char-misuse]
  272 |     pat->c.ascii.letter = pat->c.ascii.min = min_c;
src/tool_urlglob.c:273:24: warning: 'signed char' to 'int' conversion; consider casting to 'unsigned char' first. [bugprone-signed-char-misuse]
  273 |     pat->c.ascii.max = max_c;
tests/libtest/cli_h2_pausing.c:164:23: warning: suspicious usage of 'sizeof()' on an expression of pointer type [bugprone-sizeof-expression]
  164 |   memset(&resolve, 0, sizeof(resolve));
tests/libtest/cli_upload_pausing.c:158:23: warning: suspicious usage of 'sizeof()' on an expression of pointer type [bugprone-sizeof-expression]
  158 |   memset(&resolve, 0, sizeof(resolve));
tests/libtest/first.c:86:15: warning: 'signed char' to 'int' conversion; consider casting to 'unsigned char' first. [bugprone-signed-char-misuse]
   86 |     coptopt = arg[optpos];
```

Also:
- tests/server/mqttd: drop a redundant and a wrongly signed cast.

Ref: https://clang.llvm.org/extra/clang-tidy/checks/bugprone/signed-char-misuse.html

Closes #20654

6 weeks agoRELEASE-NOTES: synced
Daniel Stenberg [Wed, 25 Feb 2026 13:13:54 +0000 (14:13 +0100)] 
RELEASE-NOTES: synced

6 weeks agobuild: map Apple clang 26.4+ to llvm/clang 21.1
Viktor Szakats [Wed, 25 Feb 2026 01:10:29 +0000 (02:10 +0100)] 
build: map Apple clang 26.4+ to llvm/clang 21.1

Ref: https://en.wikipedia.org/wiki/Xcode#Xcode_26.0_(since_version_number_change)_2

Closes #20717

6 weeks agobuild: enable `-Wjump-misses-init` for clang 21+
Viktor Szakats [Wed, 25 Feb 2026 01:08:09 +0000 (02:08 +0100)] 
build: enable `-Wjump-misses-init` for clang 21+

Refs:
https://github.com/llvm/llvm-project/commit/543f112e148a81de290d099f10784dc3ff698aa4
https://github.com/llvm/llvm-project/commit/43c05d97389d479f78ca18b5d7957f51cb4022fd

Follow-up to db4d617c1cfbe74e010183a3595642434f55ea00 #16252

Closes #20716

6 weeks agodocs: add reproducible example for generating man page
Hamza Bensliman [Tue, 24 Feb 2026 07:09:07 +0000 (07:09 +0000)] 
docs: add reproducible example for generating man page

Fixes #20699
Reported-by: sammydono on github
Closes #20703

6 weeks agobuild: fix building rare combinations
Viktor Szakats [Tue, 24 Feb 2026 12:42:13 +0000 (13:42 +0100)] 
build: fix building rare combinations

- http/2 + !headers
- gnutls + !verbose
- ssls-export + !verbose

Closes #20712

6 weeks agotidy-up: macro parentheses
Viktor Szakats [Sun, 15 Feb 2026 19:34:09 +0000 (20:34 +0100)] 
tidy-up: macro parentheses

Add missing and drop redundant parentheses.

Also: fix whitespace.

Ref: #20690

Closes #20710

6 weeks agomanagen: silence Perl warnings
Viktor Szakats [Tue, 24 Feb 2026 11:07:45 +0000 (12:07 +0100)] 
managen: silence Perl warnings

Closes #20707

6 weeks agoDEPRECATE.md: TLS SRP support gets removed in August 2026
Daniel Stenberg [Mon, 23 Feb 2026 22:55:59 +0000 (23:55 +0100)] 
DEPRECATE.md: TLS SRP support gets removed in August 2026

Closes #20697

6 weeks agoconfig-riscos.h: drop all undefs
Daniel Stenberg [Tue, 24 Feb 2026 13:59:01 +0000 (14:59 +0100)] 
config-riscos.h: drop all undefs

They are superfluous

Closes #20711

6 weeks agotop-complexity: lower the max allowed complexity to 60
Daniel Stenberg [Tue, 24 Feb 2026 10:21:20 +0000 (11:21 +0100)] 
top-complexity: lower the max allowed complexity to 60

Closes #20706

6 weeks agoopenssl: fix potential NULL dereference when loading certs (Windows)
Viktor Szakats [Thu, 19 Feb 2026 17:10:58 +0000 (18:10 +0100)] 
openssl: fix potential NULL dereference when loading certs (Windows)

This could happen if the first cert to be loaded missed EKU (Enhanced
Key Usage) data, when using native CA on Windows.

Fix by skipping certs without Enhanced Key Usage data.

Detected by clang-tidy:
```
lib/vtls/openssl.c:2922:15: warning: Access to field 'cUsageIdentifier'
 results in a dereference of a null pointer (loaded from variable
 'enhkey_usage') [clang-analyzer-core.NullDereference]
 2922 |           if(!enhkey_usage->cUsageIdentifier) {
      |               ^
```

Refs:
https://learn.microsoft.com/windows/win32/secgloss/e-gly
https://learn.microsoft.com/windows/win32/api/wincrypt/nf-wincrypt-certgetenhancedkeyusage
https://gitlab.winehq.org/wine/wine/-/blob/wine-11.2/dlls/crypt32/cert.c?ref_type=tags#L3061-3164

Assisted-by: Stefan Eissing
Closes #20634

6 weeks agombedtls: split mbed_connect_step1 into sub functions
Daniel Stenberg [Mon, 23 Feb 2026 13:45:44 +0000 (14:45 +0100)] 
mbedtls: split mbed_connect_step1 into sub functions

Increase readability. Reduce complexity.

Closes #20689

6 weeks agosetopt: refuse blobs with zero length
Daniel Stenberg [Tue, 24 Feb 2026 10:01:35 +0000 (11:01 +0100)] 
setopt: refuse blobs with zero length

A blob must have a length or it will not be accepted. By enforcing the
check here, TLS backend code can rely on the fact that the length is
always non-zero from this point.

Reported-by: aisle-research-bot
URL: https://github.com/curl/curl/pull/20689#pullrequestreview-3846390367
Closes #20705

6 weeks agodocs: use dot instead of comma at end of sentences
Diogo Correia [Tue, 24 Feb 2026 00:58:35 +0000 (01:58 +0100)] 
docs: use dot instead of comma at end of sentences

Some sentences incorrectly ended with a command instead of a dot.

Closes #20700

6 weeks agoINSTALL-CMAKE.md: document the `curl` build target
Viktor Szakats [Mon, 23 Feb 2026 19:23:58 +0000 (20:23 +0100)] 
INSTALL-CMAKE.md: document the `curl` build target

Can be useful to together with `testdeps` to build all binaries.

Closes #20694

6 weeks agospacecheck: double spaces in folded strings, fix fallouts
Viktor Szakats [Mon, 23 Feb 2026 21:12:03 +0000 (22:12 +0100)] 
spacecheck: double spaces in folded strings, fix fallouts

Closes #20695

6 weeks agoclang-tidy: enable `readability-math-missing-parentheses`, adjust code
Viktor Szakats [Sun, 22 Feb 2026 23:59:57 +0000 (00:59 +0100)] 
clang-tidy: enable `readability-math-missing-parentheses`, adjust code

No functional changes.

Also:
- md4, md5: drop redundant parentheses from macro values.

Closes #20691

6 weeks agoftp: split ftp_state_use_port into sub functions
Daniel Stenberg [Sun, 22 Feb 2026 15:55:55 +0000 (16:55 +0100)] 
ftp: split ftp_state_use_port into sub functions

For readability and reduced complexity.

Fixed a bug when FTPPORT specifies an IPv6-address only, without brackets.

Closes #20685

6 weeks agoclang-tidy: add arg names to prototypes where missing (cont.)
Viktor Szakats [Mon, 23 Feb 2026 14:52:39 +0000 (15:52 +0100)] 
clang-tidy: add arg names to prototypes where missing (cont.)

Detected by `readability-named-parameter` with `HeaderFilterRegex: '.*'`,
or `CURL_CLANG_TIDYFLAGS='--header-filter=.*'`. Seen on Windows.

Follow-up to e8415ad3c7ab69a7056daa4b39e7a0044c43f5ba #20657
Follow-up to c878160e9c1f7366e64299aa02540d5495c3df9c #20624

Closes #20693

6 weeks agosetopt: make setopt_copypostfields a separate function
Daniel Stenberg [Mon, 23 Feb 2026 12:47:18 +0000 (13:47 +0100)] 
setopt: make setopt_copypostfields a separate function

Closes #20688

6 weeks agolib: use lib source directory as base include path
Viktor Szakats [Wed, 18 Feb 2026 23:44:43 +0000 (00:44 +0100)] 
lib: use lib source directory as base include path

Backtrack on previous change that aimed to solve the wrong `share.h`
being included. It turns out it did not fix this issue. At the same time
it introduced relative header filenames and the need to include the same
headers differently depending on the source files' location, reducing
readability and editability.

Replace this method by re-adding curl's lib source directory to the
header path and addressing headers by the their full, relative name to
that base directory. Aligning with this method already used in src and
tests.

With these advantages:
- makes includes easier to read, recognize, grep, sort, write, and copy
  between sources,
- syncs the way these headers are included across curl components,
- avoids the ambiguity between system `schannel.h`, `rustls.h` vs.
  local headers using the same names in `lib/vtls`,
- silences clang-tidy `readability-duplicate-include` checker, which
  detects the above issue,
  Ref: https://clang.llvm.org/extra/clang-tidy/checks/readability/duplicate-include.html
- possibly silences TIOBE coding standard warnings:
  `6.10.2.a: Don't use relative paths in #include statements.`
- long shot: it works well with concatenated test sources, for
  clang-tidy-friendly custom unity builds. Ref: #20667

Slight downside: it's not enforced.

If there happens to be a collision between a local `lib/*.h` header and
a system one, the solution is to rename (possibly with its `.c`
counterpart) into the `curl_` namespace. This is also the method used by
curl in the past.

Also:
- curlx/inet_pton: reduce scope of an include.
- toolx/tool_time: apply this to an include, and update VS project
  files accordingly. Also dropping unnecessary lib/curlx header path.
- clang-tidy: enable `readability-duplicate-include`.

Follow-up to 3887069c661b40e76b053a4867eb565d4761ab3e #19676
Follow-up to 625f2c1644da58b9617479775badea21f125ce6d #16991 #16949

Closes #20623

6 weeks agocmake: add C++ integration test
Viktor Szakats [Mon, 23 Feb 2026 12:32:52 +0000 (13:32 +0100)] 
cmake: add C++ integration test

Also:
- include code to verify a C++-specific public header regression
  reported in 8.19.0-rc2.
- curl/curl.h: mention C++ global namespace in comment.
- GHA/dist: add CI job for C++. Runtime: 15 seconds.

Follow-up to ee9b000438bd6e4cecc8a933804397a55ad0f7b8 #20686
Ref: #20682

Closes #20687

6 weeks agocurl/curl.h: revert to recursive macros to keep supporting C++ use-case
Viktor Szakats [Mon, 23 Feb 2026 11:00:18 +0000 (12:00 +0100)] 
curl/curl.h: revert to recursive macros to keep supporting C++ use-case

To avoid breaking 3rd-party code reusing these symbols as C++ methods,
e.g. in CMake sources:
```
cmake/src/v4.0.0-b30653ae0c.clean/Source/cmCurl.cxx:119:24: error: expected unqualified-id
  119 |     ::CURLcode res = ::curl_easy_setopt(curl, CURLOPT_CAINFO, cafile.c_str());
      |                        ^
```

Also expand comment to highlight the case.

Reported-by: Kai Pastor
Bug: https://github.com/curl/curl/commit/daa6b27b4d998d62c8198b4fe167199cc7bf0064#r177869049
Reported-by: Marcel Raad
Bug: https://curl.se/mail/lib-2026-02/0020.html
Fixes #20682
Follow-up to daa6b27b4d998d62c8198b4fe167199cc7bf0064 #20597

Closes #20686

6 weeks agocmake: always build curlu and curltool test libs in unity mode
Viktor Szakats [Sun, 22 Feb 2026 18:23:41 +0000 (19:23 +0100)] 
cmake: always build curlu and curltool test libs in unity mode

To speed up building/running tests by default (e.g. via `testdeps` or
`tests` targets.)

It reduces build commands to 21 (from 239) for a test build.

In CI, it affects build test step times as below:
- GHA/linux: aws-lc
  12s https://github.com/curl/curl/actions/runs/22279958343/job/64448913413 ->
  6s https://github.com/curl/curl/actions/runs/22282767915/job/64455970302
- GHA/linux: Fil-C
  39s https://github.com/curl/curl/actions/runs/22279958343/job/64448913430 ->
  37s https://github.com/curl/curl/actions/runs/22282767915/job/64455970352
- GHA/non-native: FreeBSD Intel
  22s https://github.com/curl/curl/actions/runs/22279958335/job/64448913514 ->
  15s https://github.com/curl/curl/actions/runs/22282767899/job/64455969960
- GHA/windows: dl-mingw 6.4.0
  23s https://github.com/curl/curl/actions/runs/22279958334/job/64448917225 ->
  9s https://github.com/curl/curl/actions/runs/22282767922/job/64455975006

Follow-up to fff9905bcf7c8c1da1668213d79473865461048f #20670

Closes #20677

6 weeks agoopenssl: fix compiler warning with OpenSSL master
Daniel Stenberg [Mon, 23 Feb 2026 08:11:18 +0000 (09:11 +0100)] 
openssl: fix compiler warning with OpenSSL master

vtls/openssl.c:469:15: error: assignment discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers]

X509_get_X509_PUBKEY() now returns a const pointer - but only on OpenSSL
3, we must keep the non-const version for all forks.

Closes #20681

6 weeks agoclang-tidy: add arg names to prototypes where missing
Viktor Szakats [Fri, 20 Feb 2026 23:01:22 +0000 (00:01 +0100)] 
clang-tidy: add arg names to prototypes where missing

Detected by `readability-named-parameter` with `HeaderFilterRegex: '.*'`,
or `CURL_CLANG_TIDYFLAGS='--header-filter=.*'`.

Follow-up to c878160e9c1f7366e64299aa02540d5495c3df9c #20624

Closes #20657

6 weeks agoURL-SYNTAX.md: fix port number mistakes for IMAP and LDAP
Daniel Stenberg [Sun, 22 Feb 2026 22:53:35 +0000 (23:53 +0100)] 
URL-SYNTAX.md: fix port number mistakes for IMAP and LDAP

Reported-by: Augment code
URL: https://github.com/curl/curl/pull/20673#pullrequestreview-3838139961
Closes #20679

6 weeks agotests/server: silence clang-tidy warning
Viktor Szakats [Sun, 22 Feb 2026 01:18:49 +0000 (02:18 +0100)] 
tests/server: silence clang-tidy warning

It looks like a case that can never happen in practice.

Seen on mingw-w64 with experimental concatenated (vs. #included) test
sources:
```
tests/server/util.c:662:16: error: Null pointer passed as 1st
 argument to string length function [clang-analyzer-unix.cstring.NullArg]
  662 |   size_t len = strlen(unix_socket);
      |                ^
```
Ref: https://github.com/curl/curl/actions/runs/22267482855/job/64416261156#step:10:273

Closes #20668

6 weeks agoGHA/non-native: enable FreeBSD on arm again
Viktor Szakats [Sun, 22 Feb 2026 19:27:14 +0000 (20:27 +0100)] 
GHA/non-native: enable FreeBSD on arm again

Upstream package install is working again.

Follow-up to 41a6eeadf6de719caf414c3520e912db989a6d43 #20267

Closes #20678

6 weeks agocmake: force-disable unity for clang-tidied build targets only
Viktor Szakats [Sun, 22 Feb 2026 10:41:49 +0000 (11:41 +0100)] 
cmake: force-disable unity for clang-tidied build targets only

Instead of globally disabling unity for all targets when clang-tidy is
enabled.

After this patch `CMAKE_UNITY_BUILD=ON` is honored for:
- static libcurl when building both static and shared separately.
- libcurlu and libcurltool internal libraries when building the test
  target.

While keeping unity disabled for the libcurl build pass running
clang-tidy, and the curl tool, also running clang-tidy.

To make clang-tidy-enabled builds finish faster when unity mode is
enabled, yet performs the same clang-tidy checks as before this patch.

Effect on:
- GHA/macos: core build: same, buils tests 5-12 seconds faster,
  with steps going down from 259 to 25.

  52s: https://github.com/curl/curl/actions/runs/22279958340/job/64448913325 ->
  47s: https://github.com/curl/curl/actions/runs/22279873606/job/64448710743

- GHA/windows (not enabled): it'd save about 1 minute, bringing total
  time barely below 10m, still one of the slowest jobs overall.
  (#20667 is trying a way for 4x speed-up (with a drawback)).

  5m21s: https://github.com/curl/curl/actions/runs/22222907068/job/64284556852 ->
  4m26s: https://github.com/curl/curl/actions/runs/22281033369/job/64451601548

Closes #20670

6 weeks agoconfig2setopts: split into smaller functions
Daniel Stenberg [Sun, 22 Feb 2026 14:17:18 +0000 (15:17 +0100)] 
config2setopts: split into smaller functions

Reduces complexity from 63 to 45

Closes #20676

6 weeks agosocks_sspi: split Curl_SOCKS5_gssapi_negotiate into sub functions
Daniel Stenberg [Sun, 22 Feb 2026 11:45:39 +0000 (12:45 +0100)] 
socks_sspi: split Curl_SOCKS5_gssapi_negotiate into sub functions

Create and use socks5_sspi_setup(), socks5_sspi_loop() and
socks5_sspi_encryption(). Reduces complexity.

Closes #20581

6 weeks agocmake: limit clang-tidy to the shared libcurl if static is also built
Viktor Szakats [Sun, 22 Feb 2026 13:13:21 +0000 (14:13 +0100)] 
cmake: limit clang-tidy to the shared libcurl if static is also built

On platforms that require building static and shared libcurl separately,
after this change clang-tidy is only run on one of them, to reduce build
time by avoiding the double-work. From a clang-tidy standpoint, static
and shared libs are identical.

Except `dllmain.c` on Windows, which is only present in shared. To keep
running it through clang-tidy, prefer the shared library for clang-tidy.

Closes #20675

6 weeks agotool: improve config error messaging
Daniel Stenberg [Sat, 21 Feb 2026 22:16:39 +0000 (23:16 +0100)] 
tool: improve config error messaging

- make sure that errors for specific options in config files identify
  the file, line number and shows the error about the correct option

- improve some error message wording

- add warning for leading single quote of arguments in config files
  (verified in test 1712)

- adjust test error outputs accordingly

test1712 introduces mode=warn

Use the mode="warn" attribute if the output curl warning output, as it
then makes the check without newlines and the prefix to better handle
that the lines may wrap at different points depending on the lengths of
the lines and terminal width.

Fixes #20598
Closes #20666

6 weeks agocmake: omit `curl.rc` from curltool lib
Viktor Szakats [Sun, 22 Feb 2026 10:20:30 +0000 (11:20 +0100)] 
cmake: omit `curl.rc` from curltool lib

It's unnecessary for static libs, and saves one build step when building
tests on Windows.

Closes #20671

6 weeks agoclang-tidy: add missing parentheses to debug macro arguments
Viktor Szakats [Sun, 22 Feb 2026 12:10:32 +0000 (13:10 +0100)] 
clang-tidy: add missing parentheses to debug macro arguments

Follow-up to 139307865a32a1a229e7517946e979e19e2f42c0 #20647

Closes #20674

6 weeks agobuild: adjust minimum version for some clang picky warnings
Viktor Szakats [Sat, 21 Feb 2026 22:48:18 +0000 (23:48 +0100)] 
build: adjust minimum version for some clang picky warnings

Enable 3 warnings earlier with autotools, update comments for the rest.

Ref: https://godbolt.org/

Closes #20665

6 weeks agoclang-tidy: check `bugprone-macro-parentheses`, fix fallouts
Viktor Szakats [Fri, 20 Feb 2026 13:20:53 +0000 (14:20 +0100)] 
clang-tidy: check `bugprone-macro-parentheses`, fix fallouts

Also:
- lib/parsedate: avoid relying on side-effect of missing parentheses.
- lib/http: drop redundant parentheses.
- fix cases in headers missed by clang-tidy.

Ref: https://clang.llvm.org/extra/clang-tidy/checks/bugprone/macro-parentheses.html

Closes #20647

6 weeks agosilent.md: also mention it shuts off warning messages
Daniel Stenberg [Sat, 21 Feb 2026 22:34:05 +0000 (23:34 +0100)] 
silent.md: also mention it shuts off warning messages

Closes #20664

6 weeks agourl: fix copy and paste url_match_auth_nego mistake
Daniel Stenberg [Sat, 21 Feb 2026 17:11:41 +0000 (18:11 +0100)] 
url: fix copy and paste url_match_auth_nego mistake

Follow-up to 34fa034
Reported-by: dahmono on github
Closes #20662

6 weeks agoinet_pton: scope an include
Viktor Szakats [Thu, 19 Feb 2026 00:00:20 +0000 (01:00 +0100)] 
inet_pton: scope an include

Closes #20661

6 weeks agoopenssl: fix potential OOB read in debug/verbose logging
Viktor Szakats [Fri, 20 Feb 2026 20:41:40 +0000 (21:41 +0100)] 
openssl: fix potential OOB read in debug/verbose logging

Reported-by: aisle-research-bot
Bug: https://github.com/curl/curl/pull/20654#discussion_r2834860711

Closes #20656

6 weeks agoclang-tidy: drop some redundant conditions reported by `misc-redundant-expression`
Viktor Szakats [Wed, 18 Feb 2026 14:14:06 +0000 (15:14 +0100)] 
clang-tidy: drop some redundant conditions reported by `misc-redundant-expression`

Not enforced due to false positives, and because in cases a redundant
expression (e.g. encapsulated in a macro) may be preferred.

Ref: https://clang.llvm.org/extra/clang-tidy/checks/misc/redundant-expression.html

Closes #20644

6 weeks agoeasy: reset pausing when resetting request
Stefan Eissing [Fri, 20 Feb 2026 12:09:04 +0000 (13:09 +0100)] 
easy: reset pausing when resetting request

When the easy handle's request is reset, this needs to also reset
any pausing/ratelimit state.

Reported-by: Natris on github
Fixes #20641
Closes #20643

6 weeks agorequest.h: rename parameter 'buf' to 'req' in Curl_req_send
Christian Schmitz [Sat, 21 Feb 2026 11:57:35 +0000 (12:57 +0100)] 
request.h: rename parameter 'buf' to 'req' in Curl_req_send

Someone renamed the parameter, so we need to rename the documentation.

Closes #20660

6 weeks agoclang-tidy: link to main documentation page [ci skip]
Viktor Szakats [Fri, 20 Feb 2026 23:08:59 +0000 (00:08 +0100)] 
clang-tidy: link to main documentation page [ci skip]

6 weeks agoRELEASE-NOTES: synced
Daniel Stenberg [Fri, 20 Feb 2026 22:06:43 +0000 (23:06 +0100)] 
RELEASE-NOTES: synced

7 weeks agounit1654: fix clang-tidy `bugprone-redundant-branch-condition`
Viktor Szakats [Wed, 18 Feb 2026 16:43:14 +0000 (17:43 +0100)] 
unit1654: fix clang-tidy `bugprone-redundant-branch-condition`

```
tests/unit/unit1654.c:41:5: warning: redundant condition 'result' [bugprone-redundant-branch-condition]
   41 |     fail_if(result, "Curl_altsvc_load");
      |     ^
tests/libtest/unitcheck.h:29:5: note: expanded from macro 'fail_if'
   29 |     if(expr) {                                                         \
      |     ^
```

Ref: https://clang.llvm.org/extra/clang-tidy/checks/bugprone/redundant-branch-condition.html

Closes #20648

7 weeks agoclang-tidy: check `misc-header-include-cycle`, fix in internal headers
Viktor Szakats [Wed, 18 Feb 2026 14:14:06 +0000 (15:14 +0100)] 
clang-tidy: check `misc-header-include-cycle`, fix in internal headers

Also opt-out `curl/curl.h` because it includes `curl/mprintf.h`, which
in turn includes `curl/curl.h` for `CURL_EXTERN`. Not changeable in
public headers to remain compatible. (Somehow only triggered for
examples.)

Ref: https://clang.llvm.org/extra/clang-tidy/checks/misc/header-include-cycle.html

Closes #20645

7 weeks agolibtests: drop two redundant `memset()`s
Viktor Szakats [Wed, 18 Feb 2026 16:46:36 +0000 (17:46 +0100)] 
libtests: drop two redundant `memset()`s

Reported by clang-tidy `bugprone-sizeof-expression`.

Silencing:
```
tests/libtest/cli_h2_pausing.c:164:23: warning: suspicious usage of 'sizeof()' on an expression of pointer type [bugprone-sizeof-expression]
  164 |   memset(&resolve, 0, sizeof(resolve));
      |                       ^
tests/libtest/cli_upload_pausing.c:158:23: warning: suspicious usage of 'sizeof()' on an expression of pointer type [bugprone-sizeof-expression]
  158 |   memset(&resolve, 0, sizeof(resolve));
      |                       ^
```

Ref: https://clang.llvm.org/extra/clang-tidy/checks/bugprone/sizeof-expression.html

Closes #20649

7 weeks agotests: avoid assignment in `if` conditions in `first.h`
Viktor Szakats [Wed, 18 Feb 2026 16:00:26 +0000 (17:00 +0100)] 
tests: avoid assignment in `if` conditions in `first.h`

Found by clang-tidy `bugprone-assignment-in-if-condition`.

Ref: https://clang.llvm.org/extra/clang-tidy/checks/bugprone/assignment-in-if-condition.html

Closes #20646

7 weeks agobuild: disable typecheck via the command-line instead of `curl_config.h`
Viktor Szakats [Fri, 20 Feb 2026 14:03:17 +0000 (15:03 +0100)] 
build: disable typecheck via the command-line instead of `curl_config.h`

To make it apply to examples. This in turn makes analyzers run quicker
and with fewer false positives.

It's a special disable option, having its effect via `curl/curl.h`.

Bug: https://github.com/curl/curl/pull/20649#issuecomment-3934885021
Follow-up to 9e6f1c5efb7a70e1f33e467a738f3e3f652f3174 #19637

Closes #20650

7 weeks agocmake: include `curl/curl.h` as system header in integration tests
Viktor Szakats [Fri, 20 Feb 2026 15:18:49 +0000 (16:18 +0100)] 
cmake: include `curl/curl.h` as system header in integration tests

Follow-up to fb70812437ad28b74dbdc1031e46c1d86bc9db3c #16126

Closes #20651

7 weeks agomemdebug: include `backtrace.h` as system header
Viktor Szakats [Fri, 20 Feb 2026 11:44:19 +0000 (12:44 +0100)] 
memdebug: include `backtrace.h` as system header

Closes #20642

7 weeks agodocs: clarify --ipv4 and --ipv6
Daniel Lublin [Fri, 13 Feb 2026 08:40:12 +0000 (09:40 +0100)] 
docs: clarify --ipv4 and --ipv6

Try to make the wording more clear. It is the addresses in the resolver
result that are affected, not anything regarding *how* resolving is
done.

Closes #20585

7 weeks agodocs: reword explanation of --variable option
Anna Liberty [Thu, 19 Feb 2026 20:23:04 +0000 (12:23 -0800)] 
docs: reword explanation of --variable option

Simplify the language expaining the --variable option, reducing
repetition. Also fix some minor grammar issues and makes language for
examples more consistent.

Closes #20636

7 weeks agotests/server/sockfilt: check for NULL `tv` to silence clang-tidy
Viktor Szakats [Thu, 19 Feb 2026 17:34:35 +0000 (18:34 +0100)] 
tests/server/sockfilt: check for NULL `tv` to silence clang-tidy

A NULL dereference cannot happen with existing use of this code.

linux-mingw, CM clang-tidy:
```
/home/runner/work/curl/curl/tests/server/sockfilt.c:720:24: error: Access
 to field 'tv_sec' results in a dereference of a null pointer (loaded from
 variable 'tv') [clang-analyzer-core.NullDereference,-warnings-as-errors]
  720 |             tv->tv_sec = 0;
      |             ~~         ^
```
Ref: https://github.com/curl/curl/actions/runs/22191200093/job/64179197235?pr=20631#step:10:283

Cherry-picked from #20631

Closes #20639

7 weeks agoclang-tidy: work around clang-tidy <=20 false positive (Windows)
Viktor Szakats [Thu, 19 Feb 2026 23:43:57 +0000 (00:43 +0100)] 
clang-tidy: work around clang-tidy <=20 false positive (Windows)

clang-tidy <= v20 (as seen between 18.1.3 and 20.1.2) report
`readability-uppercase-literal-suffix` originating from mingw-w64 system
header `_mingw_mac.h` via `define __MSABI_LONG(x) x ## l`

Triggered by `SOCKENOMEM` (e.g. in tests/server/sockfilt.c):
```
warning: integer literal has suffix 'l', which is not uppercase [readability-uppercase-literal-suffix]
```

Work around by replacing Windows macro `WSA_NOT_ENOUGH_MEMORY`
with its literal value.

Bug: https://github.com/curl/curl/pull/20631#issuecomment-3930619868
Follow-up to c07c3cac746bb899e8014200aad02e5f4bb507de #20629
Cherry-picked from #20631

Closes #20638

7 weeks agoINSTALL-CMAKE.md: document more settings requiring absolute paths
Viktor Szakats [Thu, 19 Feb 2026 23:23:25 +0000 (00:23 +0100)] 
INSTALL-CMAKE.md: document more settings requiring absolute paths

Cherry-picked from #20631

Closes #20637

7 weeks agocmake: improve clang-tidy invocation for tests in cross-builds
Viktor Szakats [Thu, 19 Feb 2026 15:43:08 +0000 (16:43 +0100)] 
cmake: improve clang-tidy invocation for tests in cross-builds

By passing to clang-tidy the C compiler with `--target` and sysroot
options, if any.

Fixing (GHA/windows, linux-mingw, CM clang-tidy):
```
lib/curl_setup.h:841:10: error: 'io.h' file not found [clang-diagnostic-error]
  841 | #include <io.h>
      |          ^~~~~~
Found compiler error(s).
FAILED: [code=1] tests/server/CMakeFiles/servers-clang-tidy bld/tests/server/CMakeFiles/servers-clang-tidy
cd tests/server && /usr/bin/clang-tidy --config-file=.clang-tidy.yml
--warnings-as-errors=* --checks=-clang-diagnostic-unused-function first.c getpart.c util.c dnsd.c [...]
-- <-D-options> <-I-options> <cflags>
```

For reference, this is CMake's built-in clang-tidy invocation:
```
/usr/local/bin/cmake -E __run_co_compile --tidy="/usr/bin/clang-tidy;--config-file=.clang-tidy.yml;
--warnings-as-errors=*;--extra-arg-before=--driver-mode=gcc" --source=lib/curl_fopen.c
-- /usr/bin/clang --target=x86_64-w64-mingw32 <-D-options> <-I-options> <cflags>
```

Also:
- bump cmakelint `--max-statements`. Needs 59 after this patch.
- use undocumented CMake variables:
  - `CMAKE_C_COMPILE_OPTIONS_TARGET` for `--target=`
  - `CMAKE_C_COMPILE_OPTIONS_SYSROOT` for `--sysroot=`

Cherry-picked from #20631

Closes #20640

7 weeks agocmake: sync clang-tidy arg order in tests with C compiler
Viktor Szakats [Thu, 19 Feb 2026 17:19:49 +0000 (18:19 +0100)] 
cmake: sync clang-tidy arg order in tests with C compiler

Pass macro definitions first. For uniformity, no functional difference.

To match:
```
CMAKE_C_COMPILE_OBJECT = '<CMAKE_C_COMPILER> <DEFINES> <INCLUDES> <FLAGS> [...]'
```

Closes #20635

7 weeks agoclang-tidy: sort list [ci skip]
Viktor Szakats [Thu, 19 Feb 2026 15:33:52 +0000 (16:33 +0100)] 
clang-tidy: sort list [ci skip]

Follow-up to b7ecd14725fdfe63bf84f63829dd63fb2e8cba3f #20632

7 weeks agoclang-tidy: replace comma-separated string with list in config
Viktor Szakats [Thu, 19 Feb 2026 14:47:00 +0000 (15:47 +0100)] 
clang-tidy: replace comma-separated string with list in config

Bump required clang-tidy version to v17.0.0 for this.

Ref: https://releases.llvm.org/17.0.1/tools/clang/tools/extra/docs/clang-tidy/index.html
Follow-up to 4497dbd9ac4a31b0056a9179d500676ebe091de5 #20605

Closes #20632

7 weeks agoclang-tidy: drop redundant casts
Viktor Szakats [Wed, 18 Feb 2026 13:55:58 +0000 (14:55 +0100)] 
clang-tidy: drop redundant casts

Found via `readability-redundant-casting`. Prone to false positives, not
enabled.

Ref: https://clang.llvm.org/extra/clang-tidy/checks/readability/redundant-casting.html

Closes #20630

7 weeks agoclang-tidy: enable and fix `readability-uppercase-literal-suffix`
Viktor Szakats [Wed, 18 Feb 2026 12:58:36 +0000 (13:58 +0100)] 
clang-tidy: enable and fix `readability-uppercase-literal-suffix`

Ref: https://clang.llvm.org/extra/clang-tidy/checks/readability/uppercase-literal-suffix.html

Closes #20629

7 weeks agoclang-tidy: check `readability-redundant-preprocessor`, fix fallouts
Viktor Szakats [Wed, 18 Feb 2026 13:27:20 +0000 (14:27 +0100)] 
clang-tidy: check `readability-redundant-preprocessor`, fix fallouts

Also:
- cipher_suite: merge `USE_MBEDTLS` `#if` blocks.

Ref: https://clang.llvm.org/extra/clang-tidy/checks/readability/redundant-preprocessor.html

Closes #20628

7 weeks agoclang-tidy: check `readability-redundant-control-flow`
Viktor Szakats [Wed, 18 Feb 2026 13:37:33 +0000 (14:37 +0100)] 
clang-tidy: check `readability-redundant-control-flow`

Also fix fallouts.

Ref: https://clang.llvm.org/extra/clang-tidy/checks/readability/redundant-control-flow.html

Closes #20625

7 weeks agoclang-tidy: sync argument names in prototype and definition
Viktor Szakats [Tue, 17 Feb 2026 23:55:27 +0000 (00:55 +0100)] 
clang-tidy: sync argument names in prototype and definition

Discovered with clang-tidy checker
`readability-inconsistent-declaration-parameter-name`.

Also:
- do not enforce the above because of inconsistencies still present
  between public API prototypes and definitions. (Also betwen man page
  protos, and man page examples, and other parts of the code, e.g.
  `easy` vs `curl` vs `d` vs `handle`) Perhaps subject for a future
  effort:
  https://github.com/curl/curl/actions/runs/22166472728/job/64094691653
- enable and fix `readability-named-parameter` where missing.

Refs:
https://clang.llvm.org/extra/clang-tidy/checks/readability/inconsistent-declaration-parameter-name.html
https://clang.llvm.org/extra/clang-tidy/checks/readability/named-parameter.html

Closes #20624

7 weeks agortspd: fix to check `realloc()` result
Viktor Szakats [Wed, 18 Feb 2026 18:04:12 +0000 (19:04 +0100)] 
rtspd: fix to check `realloc()` result

Also enable `bugprone-suspicious-realloc-usage` clang-tidy option
to verify.

Fixing:
```
tests/server/rtspd.c:328:37: error: 'req->rtp_buffer' may be set to null if 'realloc' fails,
 which may result in a leak of the original buffer
 [bugprone-suspicious-realloc-usage,-warnings-as-errors]
  328 |                   req->rtp_buffer = realloc(req->rtp_buffer,
      |                   ~~~~~~~~~~~~~~~   ^       ~~~~~~~~~~~~~~~
```

Ref: https://clang.llvm.org/extra/clang-tidy/checks/bugprone/suspicious-realloc-usage.html

Closes #20621

7 weeks agocmake/FindMbedTLS: add workaround for missing static MSVC `mbedcrypto.lib` 4.0.0
Viktor Szakats [Wed, 18 Feb 2026 12:21:19 +0000 (13:21 +0100)] 
cmake/FindMbedTLS: add workaround for missing static MSVC `mbedcrypto.lib` 4.0.0

Seen with mbedTLS 4.0.0. mbedTLS 4.0.0 renamed `mbedcrypto` lib to
`tfpsacrypto`, while also keeping a copy under the old name to aid
transition. However, this compatibility logic is broken for MSVC static
builds, and the old name missing.

Work around by looking for the new name in the raw detection codepath.

Note that using `pkg-config`-based detection also works as a workaround.

Reported-by: tawmoto on github
Fixes #20616
Ref: https://github.com/Mbed-TLS/mbedtls/blob/v4.0.0/library/CMakeLists.txt#L275-L282
Ref: https://github.com/Mbed-TLS/mbedtls/issues/10605

Closes #20617

7 weeks agoclang-tidy: fixes and improvements
Viktor Szakats [Sun, 15 Feb 2026 22:58:39 +0000 (23:58 +0100)] 
clang-tidy: fixes and improvements

Fix bigger and smaller kinks in how clang-tidy is configured and used.
Sync behavior more between autotools and cmake, lib/src and tests. Bump
clang-tidy minimum version and prepare logic to allow using clang-tidy
to a fuller extent.

- move clang-tidy settings from builds to a new `.clang-tidy.yml`.
  To make it easy to see and edit checks at one place. Also to allow
  using the `--checks=` option internally to silence tests-specific
  checks. (clang-tidy does not support multiple `--check=` options via
  the command-line.)
  Use explicit `--config-file=` option to point to the configuration.
- .clang-tidy.yml: link to documentation.
- suppress `clang-diagnostic-nullability-extension` due to a false
  positive in libtests with `CURL_WERROR=ON` and `PICKY_COMPILER=OFF`.
- .clang-tidy.yml: enable `portability-*`, `misc-const-correctness`.
- drop `--quiet` clang-tidy option by default to make its working a bit
  more transparent. The extra output is minimial.
- consistently use double-dashes in clang-tidy command-line options.
  Supported by clang-tidy 9.0.0+ (2019-09-19). Before this patch single
  and double were used arbitrarily.
- src/tool_parsecfg: silence false positive `clang-analyzer-unix.Stream`.
  Seen with clang 18 + clang-tidy 19 and 20 (only with autotools.)
- INTERNALS: require clang-tidy 14.0.0+. For the `--config-file` option.
- INTERNALS: recommend clang-tidy 19.1.0+, to avoid bogus
  `clang-analyzer-valist.Uninitialized` warnings. (bug details below)

autotools:

- allow configuring the clang-tidy tool via `CLANG_TIDY` env.
  Also to use in GHA to point to a suffixed clang-tody tool.
- fix to pass CFLAGS to lib, src sources.
  (keep omitting them when using a non-clang compiler.)
- fix to pass `--warnings-as-errors=*` in quotes to avoid globbing.

cmake:

- fix to not pass an empty `-I` to clang-tidy.
- fix to pass CFLAGS (picky warnings) to clang-tidy for test sources.
  (keep omitting them when using a non-clang compiler.)
- fix to disable `clang-diagnostic-unused-function` for test sources.
  (tests have static entry points, which trigger this check when
  checking them as individidual sources.)
- fix forwarding `CURL_CLANG_TIDYFLAGS` to clang-tidy.
- force disable picky warnings when running clang-tidy with a non-clang
  compiler. To not pass these flags when checking lib and src.

CI:

- GHA/linux: avoid clang-tidy bug by upgrading to v19, and drop the
  workaround.
- GHA/linux: switch to clang from gcc in the clang-tidy job. Using gcc
  doesn't allow passing CFLAGS to clang-tidy, making it less effective.
  (My guess this was one factor contributing to this job often missing
  to find certain issues compared to GHA/macos.)

I recomment using clang-tidy with a clang compiler, preferably the same
version or one that's compatible. Other cases are best effort, and may
fail if a C flag is passed to clang-tidy that it does not understand.
Picky warnings are mostly omitted when using a non-clang compiler,
reducing its usefulness.

Details and reproducer for the v18 (and earlier) clang-tidy bug,
previously affecting the GHA/linux job:

clang-tidy <=18 emits false warnings way when passing multiple C sources
at once (as done with autotools):

```sh
cat > src1.c <<EOF
#include <string.h>
static void dummy(void *p) { memcmp(p, p, 0); }
EOF

cat > src2.c <<EOF
#include <stdarg.h>
void vafunc(int option, ...)
{
  va_list param;
  va_start(param, option);
  if(option)
    (void)va_arg(param, int);
  va_end(param);
}
EOF

/opt/homebrew/opt/llvm@18/bin/clang-tidy --checks=clang-analyzer-valist.Uninitialized src1.c src2.c

# src2.c:7:11: warning: va_arg() is called on an uninitialized va_list [clang-analyzer-valist.Uninitialized]
```

Follow-up to e86542038dda88dadf8959584e803895f979310c #17047

Closes #20605

7 weeks agobuild: fix `-Wunused-macros` warnings, and related tidy-ups
Viktor Szakats [Fri, 13 Feb 2026 16:05:36 +0000 (17:05 +0100)] 
build: fix `-Wunused-macros` warnings, and related tidy-ups

- fix internal macro `AN_APPLE_OS` reused between sources without
  resetting it. It may potentially have left the system sha256
  function unused.
- fix to define `WOLFSSL_OPTIONS_IGNORE_SYS` so that it always applies
  to wolfSSL headers, also during feature detection.
- md4, md5, sha256: simplify fallback logic.
- delete 20+ unused macros.
- scope or move macros to avoid `-Wunused-macros` warnings.
- examples: delete unused code.

The warning detects macros defined but not used within the same C
source. It does not warn for macros defined in headers. It also works
with unity builds, but to a lesser extent.

Closes #20593

7 weeks agocurl_ntlm_core: merge two `#if` blocks
Viktor Szakats [Wed, 18 Feb 2026 20:47:31 +0000 (21:47 +0100)] 
curl_ntlm_core: merge two `#if` blocks

Cherry-picked from #20593

Closes #20620

7 weeks agoopenssl: disable local keylog feature if built-in upstream
Viktor Szakats [Tue, 17 Feb 2026 14:04:00 +0000 (15:04 +0100)] 
openssl: disable local keylog feature if built-in upstream

Reported-by: Paul Howarth
Fixes #20611

Closes #20614

7 weeks agoeasy: reset errorbuf on eyeballing success
Stefan Eissing [Tue, 17 Feb 2026 08:50:25 +0000 (09:50 +0100)] 
easy: reset errorbuf on eyeballing success

Any failf() that fill the errorbuf need to be forgotten once happy
eyeballing finds a succssful winner. Because the errorbuf, once set, is
not overwritten with future error information.

Adds test_05_05 to verify.

Reported-by: Tim Friedrich Brüggemann
Fixes #20608

Closes #20613

7 weeks agolibcurl-security.md: Fix typos and add a point about URLs
Dan Fandrich [Tue, 17 Feb 2026 20:38:26 +0000 (12:38 -0800)] 
libcurl-security.md: Fix typos and add a point about URLs

7 weeks agoGHA/windows: mark 3023/3024 flaky
Viktor Szakats [Mon, 16 Feb 2026 19:25:19 +0000 (20:25 +0100)] 
GHA/windows: mark 3023/3024 flaky

Same as the other two tests, but for Schannel.

Follow-up to dead29362a9e8f1dc7e5c59f9ff358337ff0e121 #20602
Follow-up to 3ae234b2a3aca14908c292ac09755f6c08daac1a #20462

Closes #20609

7 weeks agolib: delete unused local includes
Viktor Szakats [Mon, 16 Feb 2026 15:50:52 +0000 (16:50 +0100)] 
lib: delete unused local includes

Filtered from `clang-tidy` `misc-include-cleaner` hits.

Also:
- pingping: scope includes.
- doh: say the reason for an include.

Closes #20607

7 weeks agoinclude: avoid recursive macros
Viktor Szakats [Sat, 14 Feb 2026 13:50:51 +0000 (14:50 +0100)] 
include: avoid recursive macros

To fix potential `-Wdisabled-macro-expansion` warnings when using these
macros within other macros. Fixing for example:
```
lib/doh.c:328:3: error: disabled expansion of recursive macro [clang-diagnostic-disabled-macro-expansion,-warnings-as-errors]
  328 |   ERROR_CHECK_SETOPT(CURLOPT_URL, url);
      |   ^
lib/doh.c:271:14: note: expanded from macro 'ERROR_CHECK_SETOPT'
  271 |     result = curl_easy_setopt((CURL *)doh, x, y);       \
      |              ^
include/curl/curl.h:3332:44: note: expanded from macro 'curl_easy_setopt'
 3332 | #define curl_easy_setopt(handle,opt,param) curl_easy_setopt(handle,opt,param)
      |                                            ^
[...]
```

Also update comments on why curl continues to disable
`-Wdisabled-macro-expansion` and `-Wused-but-marked-unused` warnings.

Follow-up to 92f215fea1aa8bd5b1709d38f42aab77ab3fc662 #18477

Closes #20597

7 weeks agomprintf: rename internal enum to avoid collision with AmigaOS symbol
Viktor Szakats [Fri, 13 Feb 2026 00:36:05 +0000 (01:36 +0100)] 
mprintf: rename internal enum to avoid collision with AmigaOS symbol

Also:
- drop AmigaOS workaround.

Closes #20584

7 weeks agoGHA/windows: mark test 3000 flaky too
Viktor Szakats [Sun, 15 Feb 2026 12:53:42 +0000 (13:53 +0100)] 
GHA/windows: mark test 3000 flaky too

Similar to test 3001 marked flaky earlier.

Example:
https://github.com/curl/curl/actions/runs/22035738719/job/63668228484?pr=20597#step:14:4099

Follow-up to 3ae234b2a3aca14908c292ac09755f6c08daac1a #20462

Closes #20602

7 weeks agosrc: simplify declaring `curl_ca_embed`
Viktor Szakats [Sat, 14 Feb 2026 14:25:38 +0000 (15:25 +0100)] 
src: simplify declaring `curl_ca_embed`

Also to avoid `-Wunused-macros` warnings.

Follow-up to 8a3740bc8e558b9a9d4a652b74cf27a0961d7010 #14059
Cherry-picked from #20593

Closes #20601

7 weeks agocmake: enable binutils ld workaround for all toolchains at build-time (revert)
Viktor Szakats [Sat, 14 Feb 2026 11:03:16 +0000 (12:03 +0100)] 
cmake: enable binutils ld workaround for all toolchains at build-time (revert)

The change was valid, but caused an annoying warning with perfectly
working non-binutils ld linkers:
```
ld: warning: ignoring duplicate libraries: 'my/path/usr/local/lib/libcrypto.a'
```
(seen with Apple clang, when using static `libcrypto.a`)

It means that for the binutil ld hack to work at consumption-time, curl
must be built with the same picky binutils (gcc) toolchain.

Reverts 795433b923fc7953ae0a20b44249055fe334ae33 #20434

Closes #20594

7 weeks agocurl_setup.h: update/expand `OPENSSL_SUPPRESS_DEPRECATED` comment
Viktor Szakats [Sat, 14 Feb 2026 16:07:00 +0000 (17:07 +0100)] 
curl_setup.h: update/expand `OPENSSL_SUPPRESS_DEPRECATED` comment

Document functions/features requiring it.

Follow-up to cab040248d3fba3600825d77d56383019066b447 #10543
Cherry-picked from #20593

Closes #20600

7 weeks agoexamples/usercertinmem: use modern OpenSSL API, drop mentions of RSA
Viktor Szakats [Sat, 14 Feb 2026 12:30:33 +0000 (13:30 +0100)] 
examples/usercertinmem: use modern OpenSSL API, drop mentions of RSA

Replacing API calls deprecated by OpenSSL 3, and also missing
from OpenSSL 3 no-deprecated builds, fixing builds with the latter:
`PEM_read_bio_RSAPrivateKey()`, `RSA_free()`,
`SSL_CTX_use_RSAPrivateKey()`

Also: rename callback to match its `cacertinmem.c` sibling.

Fixes #20595
Closes #20596

8 weeks agolib: skip compiling code with features disabled
Viktor Szakats [Fri, 13 Feb 2026 09:32:28 +0000 (10:32 +0100)] 
lib: skip compiling code with features disabled

In non-SSL, non-SSH, non-H3, non-AppleSecTrust builds.

Also:
- drop unused internal macro `SSL_SYSTEM_VERIFIER`.

Closes #20587

8 weeks agoGHA/windows: bump cygwin/cygwin-install-action to v6.1
Viktor Szakats [Fri, 13 Feb 2026 14:35:22 +0000 (15:35 +0100)] 
GHA/windows: bump cygwin/cygwin-install-action to v6.1

Previous tag v6 changed upstream and points to a different commit. This
made zizmor unhappy. Previous commit is now tagged v6.0 in case we need
it.

Closes #20591

8 weeks agocmake: normalize uppercase hex winver (for display)
Viktor Szakats [Fri, 13 Feb 2026 09:39:28 +0000 (10:39 +0100)] 
cmake: normalize uppercase hex winver (for display)

For display and consistency with other regexp. It did not cause harm.

Follow-up to 2100d9fde267eea68f8097ff0a8ba7b3c9742c7f #12044

Closes #20586

8 weeks agocmake: warn for invalid `CURL_TARGET_WINDOWS_VERSION` values
Viktor Szakats [Thu, 12 Feb 2026 21:25:52 +0000 (22:25 +0100)] 
cmake: warn for invalid `CURL_TARGET_WINDOWS_VERSION` values

Also:
- INSTALL-CMAKE.md: add an example for `CURL_TARGET_WINDOWS_VERSION`.

Reported-by: nono303 on github
Ref: #20575
Closes #20582

8 weeks agoGHA/windows: replace Cygwin distro server
Viktor Szakats [Thu, 12 Feb 2026 22:17:53 +0000 (23:17 +0100)] 
GHA/windows: replace Cygwin distro server

`mirrors.kernel.org` is down.

Also:
- link to `mirrors.kernel.org` status page.
- link to list of mirrors.

Ref: https://archlinux.org/mirrors/kernel.org/

Closes #20583

8 weeks agows/tftp: include header file even when protocol disabled
Daniel Stenberg [Thu, 12 Feb 2026 09:38:26 +0000 (10:38 +0100)] 
ws/tftp: include header file even when protocol disabled

As the scheme details are still needed. clang 21 warned for this in HTTP-only
builds.

Reported-by: Marcel Raad
URL: https://curl.se/mail/lib-2026-02/0008.html
Closes #20568

8 weeks agosmb: include arpa/inet.h for NonStop
Daniel Stenberg [Thu, 12 Feb 2026 18:43:43 +0000 (19:43 +0100)] 
smb: include arpa/inet.h for NonStop

Reported-by: Randall S. Becker
URL: https://curl.se/mail/lib-2026-02/0010.html
Closes #20579

8 weeks agoschannel: refactor: reduce variable scopes, fix comment, fix indent
Daniel Stenberg [Wed, 11 Feb 2026 22:43:45 +0000 (23:43 +0100)] 
schannel: refactor: reduce variable scopes, fix comment, fix indent

Refactor and simplify the Schannel code, primarily by reducing
duplicated buffer-management and credential-setup logic.

- split client certificate selection into get_client_cert() and SSPI
  credential acquisition into acquire_sspi_handle()
- introduce a struct sbuffer for encrypted/decrypted buffering
- Add ensure_encoding_size() and ensure_decoding_size() helpers to
  centralize buffer growth/realloc decisions
- Tighten variable scopes and tidy indentation/logging in the handshake
  and receive/decrypt loops.
- Update comments and adjusts some receive error-condition handling to
  better preserve buffered-data behavior.

Closes #20569

8 weeks agomulti: split multi_runsingle into sub functions
Daniel Stenberg [Thu, 12 Feb 2026 15:12:06 +0000 (16:12 +0100)] 
multi: split multi_runsingle into sub functions

To reduce complexity.

- is_finished() checks if the individual transfer is done

- handle_completed() is the logic that runs for a completed
  transfer

Closes #20573

8 weeks agomsvc: VS2026: unlock picky warning in cmake, test in CI
Viktor Szakats [Thu, 12 Feb 2026 16:59:18 +0000 (17:59 +0100)] 
msvc: VS2026: unlock picky warning in cmake, test in CI

Upgrade a GHA/windows job to VS2026 (from VS2022), using a runner image
released a week ago. It also comes with the same Windows SDK as VS2022:
v10.0.26100.0.

The runner image uses Windows 2025 unfortunately, which makes the job
run significantly slower than before this patch:
- configure: 49s -> 1m10s
- build: 3s -> 5s
- install test prereqs: 23s -> 27s
- run tests: 3m18s -> 4m11s
- build examples: 15s -> 25s

It's a shame.

Also:
- cmake: enable picky warnings for VS2026 internal version 19.50.
  Build is clean with existing options.
- GHA/windows: make the built-in OpenSSH intall path recognize
  the windows-2025-vs2026 image as windows-2025.
- windows-2025-vs2026 is able to load the cached stunnel made on
  the windows-2022 runner.
- disk use of the build is almost identical to VS2022.

Before: https://github.com/curl/curl/actions/runs/21955482367/job/63418133880
After: https://github.com/curl/curl/actions/runs/21957589847/job/63426546943

Ref: https://github.com/actions/runner-images/blob/71f0157880be328a2b0a4dc81cda61735ba6c45d/images/windows/Windows2025-VS2026-Readme.md
Ref: #20575

Closes #20577

8 weeks agoGHA: update google/boringssl to v0.20260211.0
renovate[bot] [Thu, 12 Feb 2026 11:39:21 +0000 (11:39 +0000)] 
GHA: update google/boringssl to v0.20260211.0

Closes #20566

8 weeks agocmake: add `CURL_PATCHSTAMP` configuration variable, test in CI
Viktor Szakats [Thu, 12 Feb 2026 15:55:53 +0000 (16:55 +0100)] 
cmake: add `CURL_PATCHSTAMP` configuration variable, test in CI

Also:
- INSTALL-CMAKE.md: alpha sort.

Closes #20576

8 weeks agocmake: add `BORINGSSL_VERSION` configuration variable, test in CI
Viktor Szakats [Thu, 12 Feb 2026 14:21:12 +0000 (15:21 +0100)] 
cmake: add `BORINGSSL_VERSION` configuration variable, test in CI

To simplify setting BoringSSL version, using:
`-DBORINGSSL_VERSION=0.20260211.0`
or
`-DBORINGSSL_VERSION=${boringssl_version}`

Previously it could be set via C flags, using complicated shell quotes:
`-DCMAKE_C_FLAGS="-DCURL_BORINGSSL_VERSION=\\\"${boringssl_version}\\\""`
(the C flags method remains, also for autotools)

It'd be nice if BoringSSL published its version not just via
`MODULE.bazel` in its source tree, but from its public headers, to make
these workarounds unnecessary.

Also:
- GHA/http3-linux: test both options.

Closes #20571