]> git.ipfire.org Git - thirdparty/curl.git/log
thirdparty/curl.git
13 hours agombedtls: enforce verifyhost when verifypeer is disabled master
Alhuda Khan [Mon, 3 Aug 2026 15:21:52 +0000 (20:51 +0530)] 
mbedtls: enforce verifyhost when verifypeer is disabled

Verify in test 2118

Closes #22475

13 hours agoCI: filter all .[ch] files before doing typo checks
Daniel Stenberg [Thu, 6 Aug 2026 20:52:45 +0000 (22:52 +0200)] 
CI: filter all .[ch] files before doing typo checks

The filter only leaves comments and strings in all files using .c or .h
extensions.

It is important that the filter runs after all the other checks are done
on these files as this process destroys the files.

Fixes #22508
Closes #22509

24 hours agolibcurl.pc: add the Link.ABI and Source tags
Dan Fandrich [Sat, 8 Aug 2026 04:16:52 +0000 (21:16 -0700)] 
libcurl.pc: add the Link.ABI and Source tags

Link.ABI is a feature of pkgconf 3.0 and indicates the ABI against which
a consumer must link the package. For libcurl, this is hard-coded as C.
Source is a URL from which to download the package tarball.

Closes #22519

32 hours agoRELEASE-NOTES: synced rc-8_22_0-1
Daniel Stenberg [Sat, 8 Aug 2026 21:05:31 +0000 (23:05 +0200)] 
RELEASE-NOTES: synced

37 hours agoapi: fix printf format specifier
Jay Satiro [Fri, 7 Aug 2026 02:00:42 +0000 (22:00 -0400)] 
api: fix printf format specifier

- Use %hu for unsigned short instead of %u.

Prior to this change some compilers could warn of an argument type
mismatch. C argument promotion rules promote the unsigned short argument
to an int, which does not match %u (unsigned int) but does match %hu
(unsigned short).

Assisted-by: Viktor Szakats
Closes https://github.com/curl/curl/pull/22511

47 hours agotests: fix typo in assert message in http test
Dan Fandrich [Sat, 8 Aug 2026 05:32:02 +0000 (22:32 -0700)] 
tests: fix typo in assert message in http test

Found by pyrefly.

2 days agotests/server/tftpd: replace duplicate code with `open_udp_sock()` call
Viktor Szakats [Fri, 7 Aug 2026 15:22:46 +0000 (17:22 +0200)] 
tests/server/tftpd: replace duplicate code with `open_udp_sock()` call

Follow-up to 7f6a75664f9fb45390193e492ee3361fb795d098 #22506

Closes #22517

2 days agoconfigure: clarify --enable-debug option
Jay Satiro [Fri, 7 Aug 2026 03:30:50 +0000 (23:30 -0400)] 
configure: clarify --enable-debug option

- Change --enable-debug help text to say it is for developing curl.

- Warn when --enable-debug is used.

This change copies the help text and warning from cmake ENABLE_DEBUG.
Also, it shortens the "for debugging curl itself" to just say "for
debugging curl".

Now it looks like this:

  --enable-debug          Enable curl debug features (for developing
                          curl)
  --disable-debug         Disable curl debug features

Ref: https://github.com/curl/curl/issues/22481#issuecomment-5207220359

Reported-by: Viktor Szakats
Closes https://github.com/curl/curl/pull/22512

2 days agocurl_url_set.md: expand the CURLU_NO_AUTHORITY description
Daniel Stenberg [Fri, 7 Aug 2026 09:41:16 +0000 (11:41 +0200)] 
curl_url_set.md: expand the CURLU_NO_AUTHORITY description

Closes #22515

2 days agoldap_do: refactor error handling and simplify show_vals function
Daniel Stenberg [Thu, 6 Aug 2026 21:14:25 +0000 (23:14 +0200)] 
ldap_do: refactor error handling and simplify show_vals function

- (much) less code repetition

- simplifies ldap_do somewhat

Closes #22510

2 days agodnsd: add support for DoH
Stefan Eissing [Thu, 6 Aug 2026 11:46:41 +0000 (13:46 +0200)] 
dnsd: add support for DoH

dnsd now opens UDP+TCP sockets and accepts http: DoH requests to obtain
the same, configured answers (records, delays, error codes) as over UDP.

DoH: use `async->queries_ongoing` like all other resolvers instead of
the internal `pending` counter. Fixes waiting for results.

Tests: in pytest, parameterize dnsd tests to use both DNS and DoH.

Closes #22506

3 days agoCI: fix labeler matches for vdns file move
Dan Fandrich [Thu, 6 Aug 2026 15:24:02 +0000 (08:24 -0700)] 
CI: fix labeler matches for vdns file move

3 days agocookie: refuse to load cookies set against a PSL domain
Daniel Stenberg [Thu, 6 Aug 2026 07:13:30 +0000 (09:13 +0200)] 
cookie: refuse to load cookies set against a PSL domain

Verified by test 409

Reported-by: 1rhino2 on hackerone
Closes #22500

3 days agoservers: drop CRT and curlx calls from `main_window_loop()` (Windows)
Viktor Szakats [Tue, 16 Jun 2026 11:50:51 +0000 (13:50 +0200)] 
servers: drop CRT and curlx calls from `main_window_loop()` (Windows)

To simplify and to avoid the chance of potential interference or
thread-safety issues. If one these 3 Win32 API calls fail, there is
likely a serious problem, out of the code's control. Knowing
`GetLastError()` is unlikely to help.

Refs:
https://learn.microsoft.com/windows/win32/api/winuser/nc-winuser-wndproc
https://learn.microsoft.com/previous-versions/windows/desktop/legacy/ms686736(v=vs.85)
https://learn.microsoft.com/windows/win32/api/winuser/nf-winuser-getmessage
https://learn.microsoft.com/windows/win32/api/winuser/nf-winuser-createwindowexa
https://learn.microsoft.com/windows/win32/api/winuser/nf-winuser-registerclassa

Ref: 9ea48811fed455d4a869eb100b2216f039f8677a #22487
Ref: 1c49f2f26d0f200bb9de61f795f06a1bc56845e9 #18451
Follow-up to ac1e206278b98fbe762f4b554803c64e8b562156

Closes #22045

3 days agoTODO: ECH for QUIC
Daniel Stenberg [Thu, 6 Aug 2026 09:05:01 +0000 (11:05 +0200)] 
TODO: ECH for QUIC

And drop:

- Consider OCSP stapling by default

It is a practice that is going out-of-style, so doing this by default now
seems wrong.

- Provide callback for cert verification

We have lots of options already. Let's not do this.

Closes #22504

3 days agortsp: refactor method handling and improve error checks
Daniel Stenberg [Wed, 5 Aug 2026 21:40:18 +0000 (23:40 +0200)] 
rtsp: refactor method handling and improve error checks

- convert the method switch() to a simple table

- avoid converting the methods from external to internal numbers, they were
  the same anyway so keep the external ones, just use the old defines.

- fix range check. It wrongly used the method numbers as bitmask, which made
  the check not work previously. Also error on OOM.

- Dropped the session-id check. It too wrongly did a bitmask check which was
  wrong and never worked. When fixed, it broke test cases so I dropped the
  entire check.

- split out rtsp_setup_request() from rtsp_do()

- replace the httpversion variable with a define

Closes #22505

3 days agopsl: update a comment to understandable English
Daniel Stenberg [Thu, 6 Aug 2026 08:03:56 +0000 (10:03 +0200)] 
psl: update a comment to understandable English

Closes #22502

3 days agotests: keep test names shorter than 70 columns
Daniel Stenberg [Wed, 5 Aug 2026 12:19:14 +0000 (14:19 +0200)] 
tests: keep test names shorter than 70 columns

- makes test names less complicated

- makes them less likely to wrap lines when using narrow terminals

- runtests now returns error for the test if the name is longer

- replace the "..." with a singe space

Closes #22492

3 days agocf-socket: disable TCP SYN retransmissions for localhost on Windows
Daniel Stenberg [Wed, 5 Aug 2026 12:56:40 +0000 (14:56 +0200)] 
cf-socket: disable TCP SYN retransmissions for localhost on Windows

Suggested-by: Marcel Jamin
URL: https://curl.se/mail/lib-2026-08/0002.html
URL: https://daniel.haxx.se/blog/2024/08/14/slow-tcp-connect-on-windows/

Closes #22494

3 days agoservers: drop duplicate (and interacting) ctrl handlers on Windows, add exit message
Viktor Szakats [Wed, 5 Aug 2026 07:43:57 +0000 (09:43 +0200)] 
servers: drop duplicate (and interacting) ctrl handlers on Windows, add exit message

On Windows, the init code calls `SetConsoleCtrlHandler()`, and before
this patch also set handlers for all Unixy signals. Of these, `SIGBREAK`
(used on Windows-only), `SIGINT`, `SIGABRT` and `SIGTERM` were also
setting up a `SetConsoleCtrlHandler()`, in addition to the call made
directly. (The rest, `SIGHUP`, `SIGPIPE`, `SIGALRM` are either missing
the macros, or ignored by `signal()` on Windows.)

As per WINE sources, `SetConsolCtrlHandler(<h>, TRUE)` calls are
additive, which means the test server set up two console ctrl handlers.

Then the ctrl handler set directly (`ctrl_event_handler()`), was
triggering the other signal handler via `raise()`, for the 'initiate
exit' logic, which in turn triggered exiting a wait within `select_ws()`
and other loops. The Windows window handler also made use of the
`SIGTERM` event to initiate exit via `raise()` and the second signal
handler.

To simplify, de-duplicate the ctrl handlers by dropping `signal()` calls
and keeping the direct Win32 call with `ctrl_event_handler()` doing all
the signal handling on Windows. Break out the 'initiate exit' logic into
a function and call it from both Unix and Windows signal/ctrl/window
handlers. Also drop calling `raise()` on exit, because it's a no-op
without a `signal()` pair.

Also:
- drop logging the actual ctrl type number, replace with just logging
  whether we handled the event, in `ctrl_event_handler()`. To avoid
  using non-signal-safe functions (e.g. `fprintf()`) from the handler.
- also replace `logmsg()` with `WriteFile()` to prevent regressions.
  Ref: #22045
- replace `logmsg()` with `WriteFile()` in `main_window_proc()`.
- fix to forward ctrl handling to the OS in the rare case of failed
  `exit_event` initialization on startup. To swap a possible hang
  (within `WaitForMultipleObjectsEx()`) with an ungraceful shutdown.
- add support for an 'exit message' string, set by signal/ctrl handlers,
  and log it on app exit. To avoid the need to deal with logging within
  the handlers, yet have a static trace message about the event.
  Complementing the already logged signal number.
- drop stderr trace message from `exit_signal_handler()` in favor of an
  exit message. runtests triggers it frequantly, which added much noise
  to stderr. As a bonus, this also allows dropping the compiler warning
  suppression.
Reported-by: Stefan Eissing
  Bug: https://github.com/curl/curl/pull/22487#issuecomment-5204092974
  Follow-up to 3aae64e4fbee7c1fa408c54df18d3f631781c283 #22507

Refs:
https://learn.microsoft.com/windows/console/setconsolectrlhandler
https://learn.microsoft.com/windows/console/registering-a-control-handler-function
https://learn.microsoft.com/cpp/c-runtime-library/reference/raise
https://learn.microsoft.com/cpp/c-runtime-library/reference/signal
https://gitlab.winehq.org/wine/wine/-/blob/wine-11.14/dlls/kernelbase/console.c#L1517-1526
https://github.com/huangqinjin/ucrt/blob/d6e817a4cc90f6f1fe54f8a0aa4af4fff0bb647d/misc/signal.cpp#L286-L348

Follow-up to fe28fcf04cdfe7c6e1ab4499a33f9b8479839f14 7dc8a981fa043b9dbbae3a632229b74dcd868bd7 0e058776c02cf8ddc753a36f9cde98cc87899d51 #5260

Closes #22487

3 days agoservers: drop complex and redundant signal handler output
Viktor Szakats [Thu, 6 Aug 2026 09:54:04 +0000 (11:54 +0200)] 
servers: drop complex and redundant signal handler output

In year 2020 the Unixy signal handler received a `logmsg()` call to log
the signal number, but at the same time it already saved it to a global
variable and logged it on exit, meaning this extra `logmsg()` was
redundant. Because `logmsg()` is not signal-safe, this call was replaced
in 2025 with signal-safe logging, but without the signal number, while
also adding complexity, spent on trying to open the log file and handle
errors. All for nothing, because the signal number was logged all along.

This patch removes all this, and simplifies it to a single, signal-safe
`write()` to STDERR to say that the signal handler triggered. This is
also non-critical, but may help debugging.

Also: point the POSIX documentation to the 2004 revision, which has a
shorter list of safe functions. (was: 2018)

Follow-up to e95f509c66abdd88ae02e3243cdc217f19c4a330 #16852
Follow-up to 9869f6dc5af85caf2e0fd4c56713a7f2049ecfff #5218

Closes #22507

3 days agoservers: de-duplicate shutdown signal/logging code
Viktor Szakats [Thu, 6 Aug 2026 05:45:14 +0000 (07:45 +0200)] 
servers: de-duplicate shutdown signal/logging code

To share more common code between servers, and to log the same set of
information for all of them.

Also:
- move server unix socket to global variable.

Follow-up to d1eca3861c9cf8f3cd03274ce0db3c500bd246ae #22501
Follow-up to 1637bbc9ced4213b902703b9223273ab2dcd2c6e #22498

Closes #22503

3 days agoDEPRECATE.md: HTTP/2 Server Push gets removed in March 2027
Daniel Stenberg [Wed, 5 Aug 2026 11:40:18 +0000 (13:40 +0200)] 
DEPRECATE.md: HTTP/2 Server Push gets removed in March 2027

URL: https://curl.se/mail/lib-2026-08/0003.html
Closes #22490

3 days agoservers: sync server port global variable across servers, make port variables `uint16_t`
Viktor Szakats [Thu, 6 Aug 2026 07:27:41 +0000 (09:27 +0200)] 
servers: sync server port global variable across servers, make port variables `uint16_t`

Follow-up to 1637bbc9ced4213b902703b9223273ab2dcd2c6e #22498

Closes #22501

3 days agotests/server/dnsd: fix to install signal handlers on startup
Viktor Szakats [Thu, 6 Aug 2026 06:58:22 +0000 (08:58 +0200)] 
tests/server/dnsd: fix to install signal handlers on startup

To sync with the rest of code which already handled `got_exit_signal`
and did the restoration on exit. Also syncing with rest of servers.

Also: turn off `keep_sigalrm` to sync with most servers.

Closes #22499

3 days agoservers: sync socket type global variables
Viktor Szakats [Thu, 6 Aug 2026 05:59:29 +0000 (07:59 +0200)] 
servers: sync socket type global variables

Replace `ipv_inuse` and `use_ipv6` with `socket_type` and
`socket_domain` (where missing) to avoid dupliicate globals with
overlapping purposes. The replacement variables also support Unix
sockets.

Also:
- simplify/reduce IPv6 guards.
- socksd: fix to reset `socket_domain` for `--ipv4` option.

Closes #22498

4 days agoservers: drop re-registering the signal handler on modern systems
Viktor Szakats [Wed, 5 Aug 2026 17:10:52 +0000 (19:10 +0200)] 
servers: drop re-registering the signal handler on modern systems

Before this patch modern systems used `sigaction()` and `SA_RESTART` to
install signal handlers, but the signal handler function itself still
made a call to the legacy `signal()` function to re-register itself
before returning.

Re-registering the handler is not necessary with `sigaction()`. It's
also undesired to use the legacy API when the modern one is available.

Fix by guarding off this call in builds that support the modern API.

Follow-up to 3fb6e5a01001b8c7dfdc33a89041178aac381a27 #6529
Follow-up to 18cbb4d7d645016d1a9c0ee772c724d8c41db3bd

Closes #22497

4 days agoGHA/windows: re-enable taskkill in torture jobs
Viktor Szakats [Wed, 5 Aug 2026 13:59:30 +0000 (15:59 +0200)] 
GHA/windows: re-enable taskkill in torture jobs

Torture jobs are arguably the most flaky nowadays. Make a blind try to
see if re-enabling taskkill makes an observable improvement for torture.

Follow-up to 208b87744e8ce326e2569c2efd735da43ce74a0b #21039
Follow-up to f450f3801b6b9dff0ea280f5fb4bf28203f7b313 #19897
Follow-up to 2701ac6a4d16a62130dad05be1c484903b8545c7 #19421

Closes #22495

4 days agoservers: drop redundant guards on Windows
Viktor Szakats [Wed, 5 Aug 2026 12:40:35 +0000 (14:40 +0200)] 
servers: drop redundant guards on Windows

These `SIG*` macro are provided by all supported Windows toolchains.

Cherry-picked from #22487

Closes #22493

4 days agoservers: fix to avoid a non-signal-safe call in signal handler
Viktor Szakats [Wed, 5 Aug 2026 12:06:57 +0000 (14:06 +0200)] 
servers: fix to avoid a non-signal-safe call in signal handler

`strlen()` is only guaranteed to be signal-safe since POSIX.1-2008.

Ref: https://pubs.opengroup.org/onlinepubs/009695399/functions/xsh_chap02_04.html#tag_02_04_03

Reported by Copilot
Bug: https://github.com/curl/curl/pull/22487#pullrequestreview-4863961494
Follow-up to e95f509c66abdd88ae02e3243cdc217f19c4a330 #16852

Closes #22491

4 days agoRELEASE-NOTES: synced
Daniel Stenberg [Wed, 5 Aug 2026 11:19:30 +0000 (13:19 +0200)] 
RELEASE-NOTES: synced

4 days agoservers: fix HANDLE leak in UWP builds
Viktor Szakats [Wed, 5 Aug 2026 10:42:15 +0000 (12:42 +0200)] 
servers: fix HANDLE leak in UWP builds

Also: shorten code.

Reported by Copilot
Bug: https://github.com/curl/curl/pull/22487#pullrequestreview-4863399903

Closes #22489

4 days agohttp2: make server push transfers inherit share from parent
Daniel Stenberg [Wed, 5 Aug 2026 08:02:53 +0000 (10:02 +0200)] 
http2: make server push transfers inherit share from parent

Reported-by: Stephan Zeisberg
Closes #22488

4 days agovdns: directory for all DNS related sources
Stefan Eissing [Tue, 4 Aug 2026 09:52:00 +0000 (11:52 +0200)] 
vdns: directory for all DNS related sources

Move all DNS related source files from lib to lib/vdns. Fix
include paths, no furher changes.

Closes #22482

4 days agoDockerfile: Update debian:bookworm-slim Docker digest to abd67ff
renovate[bot] [Wed, 5 Aug 2026 04:44:44 +0000 (04:44 +0000)] 
Dockerfile: Update debian:bookworm-slim Docker digest to abd67ff

Closes #22486

5 days agoservers: fix to reverse `SA_RESTART` option for `sigaction()` on modern codepath
Viktor Szakats [Tue, 16 Jun 2026 01:07:58 +0000 (03:07 +0200)] 
servers: fix to reverse `SA_RESTART` option for `sigaction()` on modern codepath

Historically servers used the deprecated `siginterrupt()` function to
configure restart behavior on specific signals. It accepts a flag, where
1 means to remove the `SA_RESTART` option, and 0 means to enable it.

In year 2021 3fb6e5a01001b8c7dfdc33a89041178aac381a27 introduced the
modern alternative to the codebase, replacing `siginterrupt()` with
`sigaction()`. After this patch, supporting, modern, systems reacted on
the same flag, but, by accident, set the `SA_RESTART` bit when flag is
1, and did not set it when 0. This reversed the previous behavior, and
the one still used on the `siginterrupt()` legacy codepath.

Fix it by revesring the `SA_RESTART` logic for the `sigaction()`
codepath, syncing it with the pre-existing behavior.

I find it odd this did not cause any perceivable issue for 5 years, even
though it's the active one in most Unix envs.

Spotted by GitHub Code Quality, though suggesting to fix
`siginterrupt()` calls. But looking into the history, those were correct
all along.

Refs:
https://pubs.opengroup.org/onlinepubs/9699919799/functions/siginterrupt.html
https://pubs.opengroup.org/onlinepubs/9699919799/functions/sigaction.html
https://www.man7.org/linux/man-pages/man3/siginterrupt.3.html
https://www.man7.org/linux/man-pages/man2/sigaction.2.html

Follow-up to 3fb6e5a01001b8c7dfdc33a89041178aac381a27 #6529

Closes #22037

5 days agoTODO: do not consider APPDATA for netrc
Daniel Stenberg [Tue, 4 Aug 2026 08:17:03 +0000 (10:17 +0200)] 
TODO: do not consider APPDATA for netrc

See #22462
Closes #22480

5 days agodnscache: use Curl_peer in resolve and dnscache operations
Stefan Eissing [Thu, 30 Jul 2026 11:49:58 +0000 (13:49 +0200)] 
dnscache: use Curl_peer in resolve and dnscache operations

Removes unused/duplicate members in async/ares/doh structs.

Closes #22446

5 days agourl: rename Curl_init_do => Curl_init_transfer
Daniel Stenberg [Mon, 3 Aug 2026 14:49:40 +0000 (16:49 +0200)] 
url: rename Curl_init_do => Curl_init_transfer

And correct some comments

Closes #22474

6 days agocurl_ed25519: add GnuTLS support (via nettle, hogweed)
Viktor Szakats [Fri, 31 Jul 2026 22:45:57 +0000 (00:45 +0200)] 
curl_ed25519: add GnuTLS support (via nettle, hogweed)

The necessary cryptography API is provided by nettle 3.1+, via its
'hogweed' library. The minimum GnuTLS version required by curl is 3.6.5,
which requires nettle 3.4.1+, so the API is always available.

Also:
- autotools: detect and use nettle's hogweed library.
- cmake/FindNettle: add support for the hogweed library.
- GHA/http3-linux: enable in the autotools/cmake GnuTLS jobs.

Ref: https://github.com/gnutls/gnutls/commit/4353ea025ae032887f3e8cf5aadace25662c6b35

Closes #22456

6 days agotest557: test curl_mv*printf() functions
Daniel Stenberg [Mon, 3 Aug 2026 12:38:38 +0000 (14:38 +0200)] 
test557: test curl_mv*printf() functions

These functions were previously untested in the test suite. This is just
a set of basic invokes to make sure they work. The core of these
functions is identical and is tested already.

  - curl_mvfprintf
  - curl_mvprintf
  - curl_mvsnprintf
  - curl_mvsprintf
  - curl_mvaprintf

Closes #22472

6 days agolib1560: add CURLU_NO_GUESS_SCHEME tests 22469/head
Daniel Stenberg [Mon, 3 Aug 2026 10:51:02 +0000 (12:51 +0200)] 
lib1560: add CURLU_NO_GUESS_SCHEME tests

Closes #22469

6 days agotests: convert unit test 1396 and 1398 into libtests
Daniel Stenberg [Mon, 3 Aug 2026 11:31:33 +0000 (13:31 +0200)] 
tests: convert unit test 1396 and 1398 into libtests

They were previously unit tests but used only public library functions.

Closes #22471

6 days agocurl_trc: remove unused expire timers
Stefan Eissing [Mon, 3 Aug 2026 10:14:17 +0000 (12:14 +0200)] 
curl_trc: remove unused expire timers

The expire timers
-  DNS_PER_NAME
-  DNS_PER_NAME2
-  HAPPY_EYEBALLS_DNS

are unused since we changed our happy eyeballing and handling of partial
resolve results.

Closes #22468

6 days agomulti: remove #if 0'ed code that uses old struct
Daniel Stenberg [Mon, 3 Aug 2026 08:37:28 +0000 (10:37 +0200)] 
multi: remove #if 0'ed code that uses old struct

Closes #22467

6 days agoGHA: Update pizlonator/fil-c to v0.682
renovate[bot] [Mon, 3 Aug 2026 04:52:17 +0000 (04:52 +0000)] 
GHA: Update pizlonator/fil-c to v0.682

Closes #22464

6 days agolib: update mentions of the legacy "sessionhandle"
Daniel Stenberg [Sun, 2 Aug 2026 22:53:00 +0000 (00:53 +0200)] 
lib: update mentions of the legacy "sessionhandle"

It is now "Curl_easy"

Follow-up to 434f8d0389 (June 2016)

Closes #22463

7 days agosshserver.pl: bump an sshd config to use its modern name
Viktor Szakats [Sun, 2 Aug 2026 09:09:40 +0000 (11:09 +0200)] 
sshserver.pl: bump an sshd config to use its modern name

Ref: https://github.com/openssh/openssh-portable/commit/ee9c0da8035b3168e8e57c1dedc2d1b0daf00eec

Closes #22460

7 days agoDEPENDENCIES.md: document minimum nettle version: 3.4.1 (2018-12-04)
Viktor Szakats [Sat, 1 Aug 2026 11:08:30 +0000 (13:08 +0200)] 
DEPENDENCIES.md: document minimum nettle version: 3.4.1 (2018-12-04)

It comes as a transitive requirement by the minimum GnuTLS version.
Because libcurl uses nettle directly (in GnuTLS builds), I figure it is
useful to document explicitly.

Refs:
https://github.com/gnutls/gnutls/commit/4353ea025ae032887f3e8cf5aadace25662c6b35
https://github.com/curl/curl/pull/22456#discussion_r3695417678
https://github.com/gnutls/nettle/releases/tag/nettle_3.4.1_release_20181204

Closes #22457

8 days agoGHA: bump GitHub Actions and pips
dependabot[bot] [Sat, 1 Aug 2026 14:56:08 +0000 (14:56 +0000)] 
GHA: bump GitHub Actions and pips

- update `actions/checkout` from 7.0.0 to 7.0.1
- update `actions/labeler` from 6.1.0 to 7.0.0
- update `github/codeql-action/analyze` from 4.36.2 to 4.37.3
- update `github/codeql-action/init` from 4.36.2 to 4.37.3

- update `cryptography` from 48.0.1 to 49.0.0
- update `filelock` from 3.29.0 to 3.32.0
- update `impacket` from 0.13.0 to 0.13.1
- update `pytest` from 9.0.3 to 9.1.1
- update `websockets` from 16.0 to 16.1.1

Closes #22458
Closes #22459

9 days agoGHA/http3-linux: enable HTTPSIG in jobs running tests
Viktor Szakats [Fri, 31 Jul 2026 10:51:25 +0000 (12:51 +0200)] 
GHA/http3-linux: enable HTTPSIG in jobs running tests

To test HTTPSIG with all supported OpenSSL forks.

Follow-up to a55731050e8c3dbea0b96205cf916443118f6acb #22386 #21239

Closes #22453

9 days agocurl_ed25519: drop unused wolfSSL random generator
Viktor Szakats [Thu, 30 Jul 2026 23:35:56 +0000 (01:35 +0200)] 
curl_ed25519: drop unused wolfSSL random generator

Follow-up to a55731050e8c3dbea0b96205cf916443118f6acb #22386 #21239

Closes #22451

9 days agocurl_ed25519: tidy-up backend fallback
Viktor Szakats [Thu, 30 Jul 2026 22:26:37 +0000 (00:26 +0200)] 
curl_ed25519: tidy-up backend fallback

Sync fallback logic with other crypto algos to:

- allow falling back to the next backend candidate when wolfSSL does not
  have ed25519 built in.

- de-duplicate fallback code.

Follow-up to a55731050e8c3dbea0b96205cf916443118f6acb #22386 #21239

Closes #22450

9 days agobuild: assume POSIX `select()` is available
Viktor Szakats [Thu, 30 Jul 2026 12:20:59 +0000 (14:20 +0200)] 
build: assume POSIX `select()` is available

This change effectively replaces an explicit compile-time #error with
a missing prototype error in environments not offering `select()`, and
saves curl-compatible systems from performing an explicit feature check.

Refs:
https://pubs.opengroup.org/onlinepubs/009695399/functions/pselect.html
https://linux.die.net/man/2/select

Closes #22448

9 days agoh3-proxy: fix NULL deref when non-:status header arrives before :status
Ramesh Adhikari [Thu, 30 Jul 2026 16:29:16 +0000 (21:59 +0530)] 
h3-proxy: fix NULL deref when non-:status header arrives before :status

Closes #22449

10 days agoapple-fast-udp: fix sendmsg_x partial results
Stefan Eissing [Wed, 29 Jul 2026 11:11:20 +0000 (13:11 +0200)] 
apple-fast-udp: fix sendmsg_x partial results

When sending with sendmsg_x(), fix handling of last gso chunk being
smaller. Handle partial results correctly. Ignore SOCKEMSGSIZE by
reporting success which drops PMTUD probes into the void.

Closes #22429

10 days agocurl: help category cleanups
Daniel Stenberg [Thu, 30 Jul 2026 11:47:03 +0000 (13:47 +0200)] 
curl: help category cleanups

- add 'mqtt' as a category
- add more protocol categories to several options
- make --data worded better to also cover MQTT

Closes #22447

10 days agogitignore: maintenance updates
Viktor Szakats [Sat, 25 Jul 2026 14:50:51 +0000 (16:50 +0200)] 
gitignore: maintenance updates

- docs/cmdline-opts/.gitignore: also ignore `manpage.tmp.*`.
  Follow-up to a55731050e8c3dbea0b96205cf916443118f6acb #22386 #21239

- ./.gitignore: drop obsolete entries.
  Follow-up to 4f38db1d28a971f938400f558e968fdffb9233a0 #1923

Closes #22445

10 days agotidy-up: minor code fixes and improvements
Viktor Szakats [Fri, 24 Jul 2026 22:11:21 +0000 (00:11 +0200)] 
tidy-up: minor code fixes and improvements

- schannel: drop redundant parentheses.
- os400sys: drop redundant includes.
  Follow-up to ebc5212dacd3db8f5315b5a2d676415848e936d5 #22374
- pytest: replace `()` with `[]` to match rest of tests.
- libtests: constify some local pointers.
- libtests: drop redundant `(long)` casts.
- lib650: use `CURL_CSTRLEN()`.
  Follow-up to 59dc2bbe07c3b5889e0b380e5fa384d338d9d24e #22424

Closes #22444

10 days agotidy-up: comments, messages, formatting
Viktor Szakats [Fri, 24 Jul 2026 00:44:11 +0000 (02:44 +0200)] 
tidy-up: comments, messages, formatting

- 'null-terminate', sync casing.
- add an `#endif` comment.
- avoid a few instances of 'will'.
- configure: 'aws' -> 'aws-sigv4', where missing.
- unfold/fold lines.
- update memzero/strzero comments.
- uppercase 'CRLF'.

Closes #22443

10 days agoGHA: update dependency google/boringssl to v0.20260730.0
renovate[bot] [Thu, 30 Jul 2026 08:37:30 +0000 (08:37 +0000)] 
GHA: update dependency google/boringssl to v0.20260730.0

Closes #22442

10 days agolib5004: fix memleak on OOM, check all slist append results (httpsig)
Viktor Szakats [Wed, 29 Jul 2026 21:30:51 +0000 (23:30 +0200)] 
lib5004: fix memleak on OOM, check all slist append results (httpsig)

Detected by torture tests:
```
test 5004...[HTTP RFC 9421 B.2.6: Ed25519 POST with headers (RFC test vector)]
 105 functions found, but only fail 25 (23.81%)
** MEMORY FAILURE
Leak detected: memory still allocated: 99 bytes
At 6000022c9408, there is 36 bytes.
 allocated by /Users/runner/work/curl/curl/lib/slist.c:87
At 6000039c8e78, there is 31 bytes.
 allocated by /Users/runner/work/curl/curl/lib/slist.c:87
At 6000037dd688, there is 16 bytes.
 allocated by /Users/runner/work/curl/curl/lib/slist.c:62
At 6000037dd628, there is 16 bytes.
 allocated by /Users/runner/work/curl/curl/lib/slist.c:62
LIMIT /Users/runner/work/curl/curl/lib/slist.c:62 malloc reached memlimit
 5004: torture FAILED: function number 10 in test.
```
Ref: https://github.com/curl/curl/actions/runs/30497660391/job/90730128599?pr=22437#step:16:2331

Also:
- enable HTTPSIG in torture tests.
- NULL check all `curl_slist_append()` results.
- apply a NULL check to sibling test 5000 also.

Co-authored-by: Daniel Stenberg
Follow-up to a55731050e8c3dbea0b96205cf916443118f6acb #22386 #21239

Closes #22437

10 days agoGHA: set `HOMEBREW_NO_INSTALL_CLEANUP=1` where brew is used
Viktor Szakats [Wed, 29 Jul 2026 22:52:10 +0000 (00:52 +0200)] 
GHA: set `HOMEBREW_NO_INSTALL_CLEANUP=1` where brew is used

To save work unnecessary in CI context, and to reduce log noise.

Cherry-picked from #22437

Closes #22440

10 days agoRELEASE-NOTES: synced
Daniel Stenberg [Thu, 30 Jul 2026 07:12:28 +0000 (09:12 +0200)] 
RELEASE-NOTES: synced

11 days agobuild: fix HTTPSIG option for unsupported TLS backends
Viktor Szakats [Thu, 30 Jul 2026 00:24:58 +0000 (02:24 +0200)] 
build: fix HTTPSIG option for unsupported TLS backends

Show a warning and force-disable HTTPSIG when the TLS backend is not
OpenSSL or wolfSSL. Before this patch this resulted in a mismatched
feature list in configure and `curl -V`.

Also enable HTTPSIG in more CI jobs to cover unsupported ones, Windows
compilers, clang-tidy, cmake.

Follow-up to a55731050e8c3dbea0b96205cf916443118f6acb #22386 #21239
Cherry-picked from #22437

Closes #22439

11 days agoGHA: work around Homebrew `ca-certificates` install error
Viktor Szakats [Wed, 29 Jul 2026 23:46:15 +0000 (01:46 +0200)] 
GHA: work around Homebrew `ca-certificates` install error

Working around:
```
==> Installing libngtcp2 dependency: ca-certificates
==> Pouring ca-certificates--2026-07-16.all.bottle.1.tar.gz
Warning: The post-install step did not complete successfully
[...]
Error: Process completed with exit code 1.
```

Refs:
https://github.com/Homebrew/homebrew-core/pull/295934
https://github.com/Homebrew/brew/pull/23357

Bug: https://github.com/curl/curl/pull/22437#issuecomment-5124151490

Closes #22438

11 days agosws: log the exact closing reason better, to help debugging tests
Daniel Stenberg [Wed, 29 Jul 2026 14:32:40 +0000 (16:32 +0200)] 
sws: log the exact closing reason better, to help debugging tests

Closes #22431

11 days agotool: remove duplicate setopts
Stefan Eissing [Wed, 29 Jul 2026 15:58:08 +0000 (17:58 +0200)] 
tool: remove duplicate setopts

CURLOPT_RESOLVE and CURLOPT_CONNECT_TO were set twice.
A happy little accident?

Closes #22433

11 days agotests: fix cert comparison with old cryptography
Dan Fandrich [Tue, 28 Jul 2026 23:27:38 +0000 (16:27 -0700)] 
tests: fix cert comparison with old cryptography

The fallback path for cryptography < 42 was broken by commit e13362c2
that caused a comparison between offset-naive and offset-aware
datetimes. Use the positional form of tz in datetime.now() everywhere.

Ref: #22396

Pointed out by Codex Security
Closes #22426

11 days agoldap: support empty username and password
Jay Satiro [Fri, 26 Jun 2026 18:12:43 +0000 (14:12 -0400)] 
ldap: support empty username and password

Prior to this change an empty username or password was passed to the
LDAP bind function as NULL instead of an empty string.

Regression since 8f71d0fd.

Reported-by: Yoshiro Yoneya
Fixes https://github.com/curl/curl/issues/22162
Closes https://github.com/curl/curl/pull/22196

11 days agoGHA: update dependency nghttp2/nghttp2 to v1.70.0
renovate[bot] [Wed, 29 Jul 2026 17:14:11 +0000 (17:14 +0000)] 
GHA: update dependency nghttp2/nghttp2 to v1.70.0

Closes #22434

11 days agourlapi: clear password buffer on error path
Viktor Szakats [Wed, 29 Jul 2026 15:09:06 +0000 (17:09 +0200)] 
urlapi: clear password buffer on error path

Reported by Copilot
Bug: https://github.com/curl/curl/pull/21637#pullrequestreview-4809702512
Follow-up to 112a8b5adf36c17e7816a8db701b3e7a22958e52 #21637
Follow-up to 7c34365ccea19949317878c7fcd5f7376e2e09f1 #21879

Closes #22432

11 days agosrc: safely clear certain buffers
Viktor Szakats [Wed, 13 May 2026 23:36:22 +0000 (01:36 +0200)] 
src: safely clear certain buffers

That may hold credentials or other sensitive data, or where we want to
ensure the zeroing is not optimized out by the compiler.

Credits-to: Daniel Gustafsson
Ref: #13589 (original attempt)
Ref: #21588

Follow-up to #21645
Follow-up to 066478f6346a2d987a9ecc3bd3bf45764d69c1c4 #21598

Closes #21637

11 days agodocs/INTERNALS.md -> docs/DEPENDENCIES.md
Daniel Stenberg [Wed, 29 Jul 2026 11:59:31 +0000 (13:59 +0200)] 
docs/INTERNALS.md -> docs/DEPENDENCIES.md

With some minor cleanups

Closes #22430

11 days agosrc: improve `curlx_memzero()` internal APIs
Viktor Szakats [Sat, 16 May 2026 10:08:00 +0000 (12:08 +0200)] 
src: improve `curlx_memzero()` internal APIs

- delete zero-and-free wrapper macros. (not yet used)
  To keep it simple.
- do NULL-check in `curlx_memzero()`.
  To avoid noise at call sites.
- add `curlx_strzero()` for null-terminated strings, also with
  NULL-check.

Ref: #21637
Follow-upt o 066478f6346a2d987a9ecc3bd3bf45764d69c1c4 #21598

Closes #21645

11 days agoh2: bootstrap max streams from multi handle if in use
CatboxParadox [Tue, 28 Jul 2026 12:12:09 +0000 (14:12 +0200)] 
h2: bootstrap max streams from multi handle if in use

Closes #22418

11 days agoEXPERIMENTAL: cleanups, unify on titles, merge quiche into a single segment
Daniel Stenberg [Wed, 29 Jul 2026 11:21:52 +0000 (13:21 +0200)] 
EXPERIMENTAL: cleanups, unify on titles, merge quiche into a single segment

Closes #22428

11 days agoEXPERIMENTAL: Apple fast UDP
Daniel Stenberg [Wed, 29 Jul 2026 11:12:46 +0000 (13:12 +0200)] 
EXPERIMENTAL: Apple fast UDP

Follow-up to 079a11bcba5858ffab2cf6e810e9d980

Closes #22428

11 days agowebsocket: pause writing and meta data fix
Stefan Eissing [Tue, 28 Jul 2026 12:27:13 +0000 (14:27 +0200)] 
websocket: pause writing and meta data fix

When writing a decoded chunk of websocket data, always flush the writer
chain so that buffered data gets delivered before the ws meta data gets
updated.

Add client writer flags CURL_CW_FLAG_BLOWUP for writer types that may
significantly enlarge write sizes. This flag causes the pause writer to
be added and shrinks the write chunk sizes. We do not want that for
content decoders like WS that do not change the size.

Add test_20_13 to check that large frames are paused/unpaused correctly
with the matching meta data.

Fixes #22413
Reported-by: Hendrik Hübner
Closes #22416

11 days agoconncache: connection healthiness fix
Stefan Eissing [Tue, 28 Jul 2026 08:43:30 +0000 (10:43 +0200)] 
conncache: connection healthiness fix

Update the `lastchecked` timestamp on connection health checks when
successful to prevent repeated recalcs for a second.

Rename `seems_dead` to `seems_healthy` because the world is already
depressing enough.

Consider pending input on connection only unhealthy when the connection
has no transfers and is not multiplexed.

Closes #22412

11 days agovquic: add option to use Apple fast UDP
Viktor Szakats [Tue, 28 Jul 2026 12:22:43 +0000 (14:22 +0200)] 
vquic: add option to use Apple fast UDP

Using Apple's secret `SYS_recvmsg_x` and `SYS_sendmsg_x` syscalls for
receiving/sending batches of UDP packets.

Since it uses undocumented calls, it's experimental and disabled by
default.

To enable:
- autotools: `--enable-apple-fast-udp`
- cmake: `-DCURL_ENABLE_APPLE_FAST_UDP=ON`

Also:
- enable in two H3 CI jobs with both build tools, pytest and clang-tidy.

Refs:
https://max-inden.de/post/fast-udp-io-in-firefox/
https://www.macsyscalls.com/en/syscall/480-recvmsg-x
https://www.macsyscalls.com/en/syscall/481-sendmsg-x

C-code-authored-by: Stefan Eissing
Build-code-authored-by: Viktor Szakats
Closes #22341
Closes #22417

11 days agoGHA/configure-vs-cmake: dump `./configure --help`
Viktor Szakats [Wed, 29 Jul 2026 09:25:07 +0000 (11:25 +0200)] 
GHA/configure-vs-cmake: dump `./configure --help`

For visual review when necessary. For the three major platforms for
symmetry and good measure.

Closes #22427

11 days agoGHA: update dependency google/boringssl to v0.20260728.0
renovate[bot] [Tue, 28 Jul 2026 22:21:01 +0000 (22:21 +0000)] 
GHA: update dependency google/boringssl to v0.20260728.0

Closes #22425

11 days agoHISTORY: add when c-ares support was introduced (2004)
Daniel Stenberg [Wed, 29 Jul 2026 07:04:46 +0000 (09:04 +0200)] 
HISTORY: add when c-ares support was introduced (2004)

12 days agotidy-up: use `CURL_CSTRLEN()` macro on more static strings
Viktor Szakats [Tue, 28 Jul 2026 20:36:11 +0000 (22:36 +0200)] 
tidy-up: use `CURL_CSTRLEN()` macro on more static strings

Follow-up to e1450d8fdaf05f27ec75eb15df303fe931755a59 #22406

Closes #22424

12 days agoscripts/badwords.txt: do not recommend using 'will' in rewrites
Daniel Stenberg [Tue, 28 Jul 2026 20:44:50 +0000 (22:44 +0200)] 
scripts/badwords.txt: do not recommend using 'will' in rewrites

Instead suggest "avoid contraction and rewrite to present tense"

Reported-by: claudex on github
Fixes #22422
Closes #22423

12 days agodocs/INTERNALS.md: move a column one byte
Daniel Stenberg [Tue, 28 Jul 2026 12:47:44 +0000 (14:47 +0200)] 
docs/INTERNALS.md: move a column one byte

To make the minimum gap two spaces, so that we can separate the columns
programmatically

12 days agoscorecard: fix `max_upload` init value in `ul_parallel()`
Viktor Szakats [Wed, 15 Jul 2026 00:18:30 +0000 (02:18 +0200)] 
scorecard: fix `max_upload` init value in `ul_parallel()`

"In `ul_parallel`, `max_parallel` is computed using
`self._download_parallel` instead of `self._upload_parallel`. This
causes the upload parallelism to incorrectly follow the download
parallel setting. It should use `self._upload_parallel` to be consistent
with how `uploads()` computes `max_parallel`."

Reported by GitHub Code Quality

Follow-up to 30ef79ed937ca0fc7592ff73d162398773c6a5aa #17295

Closes #22421

12 days agodnsd: fix bounds check in `read_https_alpn_part()`
Viktor Szakats [Wed, 15 Jul 2026 00:28:09 +0000 (02:28 +0200)] 
dnsd: fix bounds check in `read_https_alpn_part()`

"The check `i > 256` permits `i == 256` to pass through. When `i` is
then cast to `uint8_t` in `blob_add(b, (uint8_t)i)`, the value wraps to
0, silently encoding a zero-length ALPN entry instead of rejecting it.
The condition should be `i > 255` (or equivalently `i >= 256`) to
correctly reject any length that does not fit in a single byte."

Reported by GitHub Code Quality

Follow-up to 86f1e5b3f6c90e453368fdf23c366c1d4a8c953b #21299

Closes #22420

12 days agoCI: improve labeler matches
Dan Fandrich [Tue, 28 Jul 2026 20:19:40 +0000 (13:19 -0700)] 
CI: improve labeler matches

12 days agoschannel: fix error check logic in `get_client_cert()` file reader
Viktor Szakats [Wed, 15 Jul 2026 16:04:59 +0000 (18:04 +0200)] 
schannel: fix error check logic in `get_client_cert()` file reader

Reported by GitHub Code Quality
Follow-up to 0fdf96512613574591f501d63fe49495ba40e1d5 #5193

Closes #22415

12 days agocurl_gssapi: document/update feature availability
Viktor Szakats [Tue, 28 Jul 2026 15:08:02 +0000 (17:08 +0200)] 
curl_gssapi: document/update feature availability

- update `GSS_C_DELEG_POLICY_FLAG` comment to include Apple GSS, add
  date, and amend MIT Kerberos version to 1.7+ (was: 1.8+)
  Ref: https://github.com/krb5/krb5/commit/45875a4d7bbd6bb8a943572d84fef5ca2bb18291
  Ref: https://github.com/apple-oss-distributions/Heimdal/commit/1635de38a813f6e1dd3f8fd270683187ad4f02be

- document `HAVE_GSS_SET_NEG_MECHS`/`gss_set_neg_mechs()`.
  Ref: https://github.com/krb5/krb5/commit/079eed2cf749702f75ddc385cf943fbab931f9d8
  It's also committed to Heimdal, but not present in a release
  as of 7.8.0 (current latest).
  Ref: https://github.com/heimdal/heimdal/commit/735039dbdc3aa58d06afdefd214efe3f5e421244

Follow-up to a8881e5e1d2e22d4b085d45ab6c8ce1df251d602 #21315 #22410
Follow-up to d169ad68faa5ed5ba2375e7502307a6262466d88 #22052

Closes #22419

12 days agotests: bump ruff version to 0.60.0
Dan Fandrich [Sat, 25 Jul 2026 23:41:05 +0000 (16:41 -0700)] 
tests: bump ruff version to 0.60.0

This version enables many more warnings by default.

Closes #22396

12 days agotests: target Python 3.8 as the minimum Python version
Dan Fandrich [Sat, 25 Jul 2026 20:34:38 +0000 (13:34 -0700)] 
tests: target Python 3.8 as the minimum Python version

This version is already two releases out of support, but is "only" 7
years old so is probably still being used in the real world. Document
this version along with some other testing dependencies.  Remove code
support for earlier versions. Disable ruff checks that need a newer
version.

12 days agotests: address mutable class vars and naive datetime in Python code
Dan Fandrich [Sat, 25 Jul 2026 20:23:21 +0000 (13:23 -0700)] 
tests: address mutable class vars and naive datetime in Python code

Mark Python mutable class variables with ClassVar, to denote that the
danger this can cause has been considered.  Since any change made to
these in any object affects all other objects, this can cause locality
errors. However, as used in the test suite, they are are never modified
and so they are annotated as being intended.

Always set a timezone in datetime objects, as mixing naive and
timezone-aware object can cause errors.

These fix ruff rules DTZ005, RUF012.

12 days agotests: use simpler constructions in Python code
Dan Fandrich [Sat, 25 Jul 2026 21:05:01 +0000 (14:05 -0700)] 
tests: use simpler constructions in Python code

* call super() without arguments
* mark an unused variable as such
* simplify by using dict getter for default values
* use writelines() when possible
* use dedent to simplify some text formatting
* avoid items() on dict in a loop when unnecessary
* replace most Python format() calls with f-strings
* use capture_output in subprocess.run

This fixes ruff rules FLY002, FURB122, PERF102, RUF059, SIM401, UP008,
UP022, UP030.

12 days agotests: simplify by removing unneeded Python code
Dan Fandrich [Sat, 25 Jul 2026 20:49:29 +0000 (13:49 -0700)] 
tests: simplify by removing unneeded Python code

* combine separate if statements
* remove an unneeded encode() call
* remove unneeded returns
* simplify code when returning early

This fixes ruff rules SIM102, SIM114, UP012, PLR1711.

12 days agotests: change whitespace and comments in Python test code
Dan Fandrich [Sat, 25 Jul 2026 20:35:51 +0000 (13:35 -0700)] 
tests: change whitespace and comments in Python test code

* remove an unneeded ruff warning disable
* remove coding: utf-8 from Python code; PEP 3120 makes UTF-8 the
  default encoding
* remove unusable shebang lines from Python code
* remove empty print strings
* disable warnings when file objects are stored; these instances can't
  be handled with context managers
* use more consistent whitespace in Python code, fixing flake8 warnings
* set the executable bit on scorecard.py, making it easier to run

These fix ruff rules EXE001, FURB105, UP009, SIM115.

12 days agotests: improve exception handling in Python test code
Dan Fandrich [Sat, 25 Jul 2026 20:06:38 +0000 (13:06 -0700)] 
tests: improve exception handling in Python test code

* Explicitly set "check" in subprocess.run() to raise an exception
  automatically, where it was done manually before
* Use contextlib.suppress to ignore exceptions
* Use custom exceptions for test errors for clarity and flexibility.
* Replace IOError with OSError

This fixes ruff rules BLE001, PLW1510, S110, TRY201, TRY203, TRY002,
UP024.

12 days agotidy-up: use more `static`, `sizeof()`, `char[]`, double-const
Viktor Szakats [Wed, 22 Jul 2026 23:50:06 +0000 (01:50 +0200)] 
tidy-up: use more `static`, `sizeof()`, `char[]`, double-const

- make `const` data `static`, where missing and possible.
- replace `strlen()` on literal or const strings with `sizeof()`.
  While the latter is optimized by popular C compiler, e.g. MSVC only
  does it with `/O2`.
- replace magic numbers with `sizeof()`, where missing.
- introduce `CURL_CSTRLEN()` macro for `sizeof(char[]) - 1`.
- use `CURL_CSTRLEN()` macro.
- move `const` before integer types, where missing.
- replace `char *var` with `var[]`, where missing and possible.
- use double const, where missing.
  `static const char *` -> `static const char * const`.
- lib1514: constify pointers.
- unit3205: drop redundant cast, avoid another one.
- unit1666: map `OID()` macro to identical `STRCONST()`.

Closes #22406