Commit graph

1453 commits

Author SHA1 Message Date
Viktor Szakats
8a8ff47b63
tidy-up: C and CI
- drop redundant casts for `CURL_UNCONST()` pointers (Windows).
- GHA/linux: delete redundant/dupe `-g` C flag in memory sanitizer job.
  Spotted-by: Daniel Stenberg
- examples/http2-upload: drop local macro.
- examples/http2-upload: drop leading underscore from union name.
- examples/http2-upload: drop interim macro.
- tests/server/util: reapply patch lost in a rebase.
- sync `main()` declarations across the codebase.

Closes #22559
2026-08-12 15:42:54 +02:00
Viktor Szakats
da04aa96ab
tidy-up: comments and formatting
Closes #22558
2026-08-12 13:32:22 +02:00
Viktor Szakats
943ac04fc4
CI: dump libcurl.pc (and curl-config) to log, verify .pc with pccritic tool
`pccritic` is available on the latest macOS runner revision (not every
job runs get it yet), Cygwin, MSYS2/mingw-w64 (one job, others will
follow on the next msys2/setup-msys2 Action bump). It will be
automatically used on BSDs, once they start offering it. Missing from
Linux jobs.

Also:
- GHA/windows: convert `libcurl.pc` to Unix newlines to bump score
  96 to 100 in mingw-w64 jobs.
  CMake-specific fix pending in: #22556
- GHA: verify with minimum `pccritic` score 94 to 100 (depending on CI
  job).
- build: fill `Maintainer:` `libcurl.pc` property when run curl CI.

Issues remaining:

macOS:
```
[info    ] Cflags adds an include path already on the default search path (pkgconf strips it): -I/usr/local/include (cflags/PC031)
[info    ] Libs adds a library path already on the default search path (pkgconf strips it): -L/usr/local/lib (libs/PC040)
[minor   ] Libs.private contains an unexpected flag: /Applications/Xcode_26.6.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX26.5.sdk/System/Library/Frameworks/GSS.framework (libs/PC041)
```

Windows:
```
[minor   ] file uses CRLF line endings (style/PC061)
```

Ref: #22556
Follow-up to b9254da617 #22548
Follow-up to 852f5d34da #22553
Follow-up to 4d9ba9fef4 #22545
Follow-up to 6c7993d4d9 #22536
Follow-up to 3f1c033afe #22519

Closes #22543
2026-08-12 12:53:06 +02:00
Viktor Szakats
852f5d34da
build: strip empty properties from libcurl.pc
To keep it tidy and to support properties in the template that only
appear in the generated `libcurl.pc` when filled.

E.g. `Required.private` may remain empty after #22548.

Also:
- GHA/windows: dump `libcurl.pc` to log in every job
- tidy up a pre-existing regex in the updated command.
  2c22d3069a #22544

Ref: b9254da617 #22548
Cherry-picked from #22543

Closes #22553
2026-08-12 11:24:51 +02:00
Viktor Szakats
3b0cb22eb6
servers: add option to build without window handler (Windows)
curl already built like this in UWP mode; add a macro to allow building
regular Win32 targets too, meaning without the hidden GUI window, window
handler, and thus without support for shutting down `servers.exe`
gracefully. To test the server in CI as a plain console app and remove
one component/variable from the system, in an effort chasing flaky runs.

The graceful option was used by `taskkill` (without `-f`) in runtests,
and it has been disabled (in favor of always `-f` (forced) kill), in an
attempt to avoid taskkill hanging. Those resolved, but general CI
flakiness remained. We see `taskkill` invoked seldom per job, and in
most of these cases it doesn't find the PID requested. It means the
graceful option is not actually used since 2025-04, and rather rarely
before that. Also just today, the callback and main loop received a few
updates to avoid potentially unsafe calls and interaction with the ctrl
handler.

Not expecting anything breakthrough here. Also graceful shutdown
is a useful feature to cleanup properly and to be in sync with other
platforms.

Also: GHA/windows: enable in Windows CI jobs.

Ref: https://learn.microsoft.com/windows/console/registering-a-control-handler-function#listen-with-hidden-window-example

Follow-up to 7db9947fcf #22045
Follow-up to 9ea48811fe #22487
Follow-up to b11e0026f7 #22495
Follow-up to 208b87744e #21039
Follow-up to f450f3801b #19897
Follow-up to 2701ac6a4d #19421
Follow-up to 4e203f65a1 #17054

Closes #22496
2026-08-11 11:15:04 +02:00
Viktor Szakats
1cf6be5a0b
GHA/linux: replace raw C option with CMAKE_BUILD_TYPE=Debug in tsan job
Ref: #22533
Follow-up to 2a46df31fd #18274

Closes #22534
2026-08-10 19:42:22 +02:00
Viktor Szakats
5050196dcc
build: require !NDEBUG for debug-enabled (aka development) builds
To prevent creating a curl-development (aka debug-enabled, aka
`-DENABLE_DEBUG=ON`, `--enable-debug` or `DEBUGBUILD`) build without
`assert()`s. Since it may break expectations by missing to catch error
cases. Also to make it less likely to build an inherently insecure
development build by accident.

- in CMake, for non-Multi-Config builds, show this error unless Debug
  configuration is set at configure-time:
  ```
  CMake Error at CMakeLists.txt:263 (message):
    Debug-enabled (aka development mode) curl requires the Debug configuration
  ```
  Ref: https://github.com/curl/curl/actions/runs/31159065911/job/92805128331?pr=22513#step:6:56
  The other 3 predefined configs (`Release`, `RelWithDebInfo`,
  `MinSizeRel`) set `NDEBUG` automatically.

- or this message in other cases, e.g. when using CMake Multi-Config
  with non-Debug, e.g. `--config Release`, or passed `NDEBUG` manually
  with either build tools:
  ```
  curl_setup.h(1062): fatal error C1189: #error:
    "Debug-enabled builds cannot be combined with NDEBUG"
  ```
  Ref: https://github.com/curl/curl/actions/runs/31159628749/job/92807878479#step:9:28

Also:
- INSTALL-CMAKE.md: document.
- GHA/windows: adjust CI jobs to meet the above requirement, where
  missing.

Reported-by Stefan Eissing
Bug: https://github.com/curl/curl/pull/22484#discussion_r3730045572
Ref: ea98445680 #13592
Fixes #22481
Fixes #22484

Closes #22513
2026-08-10 18:14:09 +02:00
renovate[bot]
8c525c081d
GHA: update dependency pizlonator/fil-c to v0.683
Closes #22523
2026-08-10 08:55:08 +02:00
renovate[bot]
b5ab518ea5
GHA: Update awslabs/aws-lc to v5.5.0
Closes #22526
2026-08-10 08:29:48 +02:00
Daniel Stenberg
1ea07d6e0a
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
2026-08-09 17:36:49 +02:00
Viktor Szakats
b11e0026f7
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 208b87744e #21039
Follow-up to f450f3801b #19897
Follow-up to 2701ac6a4d #19421

Closes #22495
2026-08-05 18:29:59 +02:00
Viktor Szakats
a368fbe968
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: 4353ea025a

Closes #22456
2026-08-03 16:48:08 +02:00
renovate[bot]
a946d40822
GHA: Update pizlonator/fil-c to v0.682
Closes #22464
2026-08-03 09:38:18 +02:00
dependabot[bot]
d2ea63b17c
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
2026-08-02 00:02:10 +02:00
Viktor Szakats
527573490e
GHA/http3-linux: enable HTTPSIG in jobs running tests
To test HTTPSIG with all supported OpenSSL forks.

Follow-up to a55731050e #22386 #21239

Closes #22453
2026-07-31 13:02:10 +02:00
renovate[bot]
83216878e4
GHA: update dependency google/boringssl to v0.20260730.0
Closes #22442
2026-07-30 11:26:22 +02:00
Viktor Szakats
ddb22d12c2
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 a55731050e #22386 #21239

Closes #22437
2026-07-30 10:39:01 +02:00
Viktor Szakats
d3e74f1278
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
2026-07-30 10:36:51 +02:00
Viktor Szakats
7d5398f764
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 a55731050e #22386 #21239
Cherry-picked from #22437

Closes #22439
2026-07-30 02:59:30 +02:00
Viktor Szakats
c155cbc638
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
2026-07-30 02:21:09 +02:00
renovate[bot]
a7f82509e4
GHA: update dependency nghttp2/nghttp2 to v1.70.0
Closes #22434
2026-07-29 19:26:19 +02:00
Daniel Stenberg
172c16b58c
docs/INTERNALS.md -> docs/DEPENDENCIES.md
With some minor cleanups

Closes #22430
2026-07-29 14:20:36 +02:00
Viktor Szakats
079a11bcba
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
2026-07-29 11:53:19 +02:00
Viktor Szakats
c7fb986b72
GHA/configure-vs-cmake: dump ./configure --help
For visual review when necessary. For the three major platforms for
symmetry and good measure.

Closes #22427
2026-07-29 11:43:05 +02:00
renovate[bot]
c7245578c3
GHA: update dependency google/boringssl to v0.20260728.0
Closes #22425
2026-07-29 11:19:28 +02:00
renovate[bot]
ed3508b1ee
GHA: update dependency ngtcp2/ngtcp2 to v1.25.0
Closes #22398
2026-07-27 10:26:59 +02:00
Viktor Szakats
7484874fdf
cmake: verify if options are listed in INSTALL-CMAKE.md
Also:
- add one debug option to pass the test.

Ref: https://github.com/curl/curl/discussions/14885#discussioncomment-10632311

Closes #22404
2026-07-27 10:16:43 +02:00
Viktor Szakats
16d49ac659
GHA/windows: bump stunnel to 5.79
Closes #22403
2026-07-27 01:49:40 +02:00
renovate[bot]
6b1ff5407e
GHA/http3-linux: update dependency ngtcp2/nghttp3 to v1.18.0
Closes #22397
2026-07-26 16:43:35 +02:00
Sameeh Jubran
a55731050e
httpsig: add RFC 9421 HTTP Message Signatures support
Add support for signing outgoing HTTP requests per RFC 9421 using
Ed25519 or HMAC-SHA256 algorithms.

New libcurl options:
 - CURLOPT_HTTPSIG: signing algorithm ("ed25519" or "hmac-sha256")
 - CURLOPT_HTTPSIG_KEY: path to hex-encoded key file
 - CURLOPT_HTTPSIG_KEYID: key identifier for Signature-Input
 - CURLOPT_HTTPSIG_HEADERS: space-separated components to sign

New CLI flags: --httpsig, --httpsig-key, --httpsig-keyid,
--httpsig-headers

The crypto layer follows the sha256.c multi-backend pattern with
implementations for OpenSSL (EVP_DigestSign) and wolfSSL
(wc_ed25519_sign_msg). HMAC-SHA256 uses the existing Curl_hmacit()
infrastructure which works on all backends.

Verified by test 5000 to 5021

Assisted-by: Daniel Stenberg
Signed-off-by: Sameeh Jubran <sameeh@wolfssl.com>
Closes #22386
Closes #21239
2026-07-25 16:25:37 +02:00
renovate[bot]
8b5f1809bd
GHA: update dependency cloudflare/quiche to v0.29.3
Follow-up to f369c7ba43 #22331
Follow-up to 899e2edec9 #22333

Closes #22325
2026-07-15 22:00:26 +02:00
renovate[bot]
87704c45e8
GHA: update dependency google/boringssl to v0.20260713.0
Closes #22311
2026-07-14 03:07:21 +02:00
renovate[bot]
5c5334f831
GHA: update dependency awslabs/aws-lc to v5.1.0
Closes #22288
2026-07-10 12:14:20 +02:00
Viktor Szakats
d054f386dd
GHA/windows: enable wolfSSL in two MSYS2 mingw-w64 jobs
Number of tests went to 1919 (from 1912). Runs 30s faster.

Thanks-to: Christoph Reiter
Ref: 5c995ac098
Ref: #22252

Closes #22259
2026-07-09 21:28:04 +02:00
Viktor Szakats
50c244c74d
tests: skip test 311 for wolfSSL 5.9.2
To fix this for everyone running curl tests.

Also: drop workarounds for CI.

Refs:
https://github.com/wolfSSL/wolfssl/pull/10793
7dd269fc52

Ref: https://github.com/curl/curl/pull/22269#issuecomment-4892203666
Follow-up to 7183bec8fe #22269
Follow-up to 03f9751585 #22204

Closes #22286
2026-07-09 21:09:34 +02:00
Viktor Szakats
06a42cd8bb
GHA/linux: bump 3.x mbedTLS to 3.6.7
Follow-up to 6e5f94cd5d #22271

Closes #22285
2026-07-09 18:21:51 +02:00
Stefan Eissing
7183bec8fe
GHA/macos: ignore test 311 results for Homebrew wolfSSL
Homebrew is distributing v5.9.2 at the time of this commit, which
contains known regression failing to parse the server certificate.
The fix has been merged upstream. Till it makes it into a release
and Homebrew, ignore test results for 311.

Refs:
https://github.com/wolfSSL/wolfssl/pull/10793
7dd269fc52

Follow-up to 03f9751585 #22204 #22175 #22160
Closes #22269
2026-07-09 18:21:51 +02:00
renovate[bot]
6e5f94cd5d
GHA: update dependency Mbed-TLS/mbedtls to v4.2.0
Ref: #21178
Closes #22271
2026-07-09 14:01:15 +02:00
renovate[bot]
6841d59af6
GHA: update dependency pizlonator/fil-c to v0.681
Note: Renovate strips pre-existing quotes from the YAML version value.
This breaks the bump next time its version is ending with zero(s).
Ref: 78267398e5 #22143 #22142

Closes #22267
2026-07-06 13:29:49 +02:00
Viktor Szakats
d169ad68fa
gssapi: add support for Apple GSS Framework
Add support for the native GSS Framework on Apple targets, which is
Apple's fork of Heimdal. This option allows to drop Apple's deprecated
MIT Kerberos compatibility shim "mit-krb5/1.7-prerelease".

Source code uses different headers, other than that no source changes
are necessary.

You can enable by configuring with:
autotools: `--enable-gssapi-apple`
CMake: `-DCURL_USE_GSSAPI=ON -DCURL_GSS_FLAVOR=Apple`

These options are experimental, and may receive breaking updates till
the GSS backend selection logic settles, for Apple and also for the GNU
and MIT implementation.

Version string:
```
curl 8.21.0-DEV (aarch64-apple-darwin25.4.0) libcurl/8.21.0-DEV
  OpenSSL/3.6.2 zlib/1.2.12 AppleIDN AppleGSS OpenLDAP/2.4.28/Apple
```

Also:
- drop in-source deprecation warning suppressions when using AppleGSS.
- GHA/macos: enable Apple GSS in CI jobs.

Supported by:
iOS 5.0+, iPadOS 5.0+, Mac Catalyst 13.0+, macOS 10.14+, visionOS 1.0+

Ref: https://developer.apple.com/documentation/gss
Ref: #19109

Closes #22052
2026-07-04 01:21:57 +02:00
Viktor Szakats
2e2c45831c
GHA/windows: fix MSYS2 UWP job name
Also:
- whitespace tidy-up.
- tried building with MSYS2 wolfSSL, but still not compatible with curl.
  Ref: https://packages.msys2.org/base/mingw-w64-wolfssl
  Ref: #22251

Follow-up to 923db3515d #18116

Closes #22252
2026-07-03 01:35:34 +02:00
Jay Satiro
0a7ec0ea4d ci: retain curl-for-win artifacts for a longer time
- Retain for 5 days because 3 days seems too short.

Follow-up to adf843fb.

Closes https://github.com/curl/curl/pull/22238
2026-07-02 11:03:11 -04:00
Viktor Szakats
03f9751585
GHA: update dependency wolfSSL/wolfssl to v5.9.2, apply upstream patch
Apply upstream patch to fix a regression in 5.9.2.

Refs:
https://github.com/wolfSSL/wolfssl/issues/10790
https://github.com/wolfSSL/wolfssl/pull/10793
7dd269fc52

Ref: #22175 (local mitigation attempt)
Fixes #22160

Closes #22204
2026-07-02 03:20:22 +02:00
dependabot[bot]
0e7030f0e1
GHA: bump GitHub Actions
- updates `actions/cache` from 5.0.5 to 6.1.0
- updates `actions/checkout` from 6.0.2 to 7.0.0
- updates `github/codeql-action/analyze` from 4.36.0 to 4.36.2
- updates `github/codeql-action/init` from 4.36.0 to 4.36.2
- updates `msys2/setup-msys2` from 2.31.1 to 2.32.0

Closes #22239
2026-07-01 17:19:14 +02:00
Viktor Szakats
a55dfa5e35
GHA/windows: exclude diffutils for 32-bit builds
It's not longer offered by MSYS2.

Bug: https://github.com/curl/curl/pull/22239#issuecomment-4856772868
Ref: b13c6d3af1
Ref: c4e776cafa #17103

Closes #22242
2026-07-01 17:18:36 +02:00
Viktor Szakats
adf843fbbd
GHA/curl-for-win: upload snapshot Windows curl tool binary
These are generated for every PR and master pushes. Retain for 3 days.
Size is 1.8MB zipped per artifact. (Takes 1 second extra job time.)

Ref: #22162
Ref: 1b0e3569b3

Closes #22234
2026-07-01 12:12:37 +02:00
Viktor Szakats
99859ecca8
cf-ngtcp2-cmn: initialize new callback ptr for ngtcp2 1.24.0+, bump in CI
Fixes #22205

Closes #22207
2026-06-28 13:57:31 +02:00
renovate[bot]
c253a96296
GHA: update dependency ngtcp2/nghttp3 to v1.17.0
Closes #22202
2026-06-28 13:57:08 +02:00
Viktor Szakats
9f9d2d10d9
lib1587: fix gcc -Wconversion with LibreSSL on Windows, test in CI
By exposing and reusing existing custom type via `vtls/openss.h`.

Also:
- GHA/curl-for-win: test in CI by enabling building tests.
  Cost is 45s per job, so limit it to the gcc job.

Seen with Windows x64 gcc (not tested in CI prior to this patch):
```
tests/libtest/lib1587.c:50:7: error: conversion from 'opt1587' {aka 'long long unsigned int'} to 'long int' may change value [-Werror=conversion]
   50 |       SSL_CTX_set_options(info->internals, opts);
      |       ^~~~~~~~~~~~~~~~~~~
tests/libtest/lib1587.c:59:7: error: conversion from 'opt1587' {aka 'long long unsigned int'} to 'long int' may change value [-Werror=conversion]
   59 |       SSL_set_options(info->internals, opts);
      |       ^~~~~~~~~~~~~~~
```
Ref: https://github.com/curl/curl/actions/runs/28258372229/job/83727170184?pr=22195#step:3:4884

Ref: da2f05e6f6 #22198
Ref: 6163566461 #22197
Follow-up to 3e40ccb875 #21290
Follow-up to 2db8ae480f #17809 #17801

Closes #22195
2026-06-26 22:44:53 +02:00
Viktor Szakats
6d008352c6
cmake: replace deprecated remove command with rm and pass arg safely
All curl-supported CMake versions support the modern method, along with
the `--` marker.

Also:
- make sure to pass `-f` to not fail if the file is missing, as before
  this patch.
- drop now redundant `OUTPUT_QUIET`, `ERROR_QUIET` and error handling
  in `cmake_uninstall`.
- move filename to end of the error message for readability.
- GHA/linux: test these two 'clean' targets in the aws-lc job.

Refs:
https://cmake.org/cmake/help/v4.4/manual/cmake.1.html#cmdoption-cmake-E-arg-remove
https://cmake.org/cmake/help/v3.18/manual/cmake.1.html#run-a-command-line-tool

Closes #22193
2026-06-26 19:01:30 +02:00