]> git.ipfire.org Git - thirdparty/curl.git/log
thirdparty/curl.git
14 months agorustls: add support for setting TLS version and ciphers
Jan Venekamp [Tue, 13 Aug 2024 20:01:07 +0000 (22:01 +0200)] 
rustls: add support for setting TLS version and ciphers

Add support for CURLOPT_SSLVERSION, CURLOPT_TLS13_CIPHERS and
CURLOPT_SSL_CIPHER_LIST.

Closes #14535

14 months agocmake: add wolfSSH support
Viktor Szakats [Thu, 15 Aug 2024 21:38:10 +0000 (23:38 +0200)] 
cmake: add wolfSSH support

Enable with CMake option `-DCURL_USE_WOLFSSH=ON`. Customize with
`-DWOLFSSH_INCLUDE_DIR=<path-to-wolfssh>/include`,
`-DWOLFSSH_LIBRARY=<path-to-wolfssh>/lib/libwolfssh.a`.

It requires the wolfSSL TLS backend.

Closes #14568

14 months agocmake: TLS 1.3 warning only for bearssl and sectranp
Jan Venekamp [Thu, 15 Aug 2024 18:11:35 +0000 (20:11 +0200)] 
cmake: TLS 1.3 warning only for bearssl and sectranp

Closes #14566

14 months agosplay: use access functions, add asserts, use Curl_timediff
Daniel Stenberg [Thu, 15 Aug 2024 14:13:23 +0000 (16:13 +0200)] 
splay: use access functions, add asserts, use Curl_timediff

- add set/get functions for the custom data in a tree node

- use Curl_timediff for time comparisons instead of the custom macro, as they
  do the exact same things.

- add asserts to catch mistakes better

- updated test 1309 accordingly

Closes #14562

14 months agoscorecard: tweak request measurements
Stefan Eissing [Thu, 15 Aug 2024 14:52:40 +0000 (16:52 +0200)] 
scorecard: tweak request measurements

Increase max-parallel up to 300, the curl max

Tweak output to just give the http response code

Closes #14564

14 months agodocs/internals: new subdirectory
Daniel Stenberg [Thu, 15 Aug 2024 12:05:23 +0000 (14:05 +0200)] 
docs/internals: new subdirectory

For libcurl internal APIs and concepts.

Closes #14552

14 months agotest1707: output diff more for debugging differences in CI outputs
Daniel Stenberg [Thu, 15 Aug 2024 22:19:00 +0000 (00:19 +0200)] 
test1707: output diff more for debugging differences in CI outputs

14 months agomanagen: wordwrap long example lines in ASCII output
Daniel Stenberg [Wed, 14 Aug 2024 11:36:20 +0000 (13:36 +0200)] 
managen: wordwrap long example lines in ASCII output

The entire ASCII version of the manpage word wraps at a fixed column,
while example command lines can easily go wider than so.

This change now makes manage work on wrapping long example command lines
to make them look nicer. And also to avoid triggering the build error
caused by too long lines in the output.

Quoted lines cannot be wrapped, so managen now errors out if they are
"too long". With this addition, the 'maxline' script is removed as it is
no longer needed.

Closes #14543

14 months agocmake: fix find rustls
Jan Venekamp [Thu, 15 Aug 2024 18:43:33 +0000 (20:43 +0200)] 
cmake: fix find rustls

Follow-up to 2784801977e81f68c6f87f9509e64f332d74acab #14545
Closes #14567

14 months agomulti: on socket callback error, remove socket hash entry nonetheless
Daniel Stenberg [Thu, 15 Aug 2024 09:06:38 +0000 (11:06 +0200)] 
multi: on socket callback error, remove socket hash entry nonetheless

Previously an error from the callback accidentally made libcurl keep the
hash entry which would lead to the entry remaining and then potentially
getting removed *again* which would lead to internal confusions.

This is an old issue (introduced in 2b3dd01b779e4eff6), caught by the new
asserts from c0233a35da81.

Closes #14557

14 months agolibcurl.pc: add reference to `libgsasl`
Viktor Szakats [Thu, 15 Aug 2024 08:41:02 +0000 (10:41 +0200)] 
libcurl.pc: add reference to `libgsasl`

Closes #14556

14 months agotidy-up: misc spelling (bit, ASCII)
Viktor Szakats [Thu, 15 Aug 2024 09:00:04 +0000 (11:00 +0200)] 
tidy-up: misc spelling (bit, ASCII)

Closes #14559

14 months agotests: move the disabling of 500 for hyper from CI to DISABLED
Daniel Stenberg [Thu, 15 Aug 2024 07:04:28 +0000 (09:04 +0200)] 
tests: move the disabling of 500 for hyper from CI to DISABLED

Follow-up to 136504195ae63

Closes #14551

14 months agocurl: fix the -w urle.* variables
Daniel Stenberg [Thu, 15 Aug 2024 09:43:59 +0000 (11:43 +0200)] 
curl: fix the -w urle.* variables

urle.scheme, urle.user, urle.password and urle.options mistakenly
operated on the original URL instead of the *effective* (last) URL.

Add test 474 to verify.

Reported-by: Gruber Glass
Fixes #14550
Closes #14560

14 months agocmake: show warning if libpsl is not found
Viktor Szakats [Tue, 13 Aug 2024 11:44:27 +0000 (13:44 +0200)] 
cmake: show warning if libpsl is not found

Also:
- explicitly disable libpsl in CI to avoid configure warning, where
  necessary.
- add TODO to make this warning an error (to match autotools.)

Follow-up to 2998874bb61ac6ef3b72d6a61467cd2aaf6e53ea #12661

Closes #14533

14 months agomime: avoid inifite loop in client reader
Stefan Eissing [Tue, 13 Aug 2024 11:34:54 +0000 (13:34 +0200)] 
mime: avoid inifite loop in client reader

Curl_mime_read() may go into an infinite loop when called with buffer
lengths <= 4. Some encoders, like base64, are not prepared for that.

In the client reader for mime data, skip such small reads. The upload
buffers will get flushed eventually and larger reads will happen again.

Improves robustness of test652 which triggered the loop on blocked
sends.

Closes #14532

14 months agocmake: fix and tidy up c-ares builds, enable in more CI jobs
Viktor Szakats [Wed, 14 Aug 2024 09:07:01 +0000 (11:07 +0200)] 
cmake: fix and tidy up c-ares builds, enable in more CI jobs

- set `CARES_NO_DEPRECATED` to avoid c-ares deprecation warnings.
  Like autotools does.

- drop unused c-ares header directory when building libtests and test
  servers.

- disable TrackMemory (aka `CURLDEBUG`) feature for MSVC builds.
  It fails on test 558 and 1330, saying that TrackMemory isn't working.
  Left a FIXME about it.

- GHA/macos: enable c-ares in a cmake job.

- GHA/windows: enable c-ares in MSVC job.
  Fixes #14202

- GHA/windows: add c-ares mingw autotools job with tests.
  (move `--with-windows-unicode` option from 'default' job to
  this one to keep the former "default".)
  Put these tests on ignore for now:
  ```
  FAIL 472: 'aws-sigv4 with query' HTTP, aws-sigv4
  FAIL 1299: 'Send "OPTIONS *" with --request-target' HTTP, --request-target
  FAIL 1613: 'Send "OPTIONS *" with --request-target to a proxy' HTTP, HTTP proxy, --request-target
  ```
  Ref: https://github.com/curl/curl/actions/runs/10388126947/job/28765761441#step:15:5902

  472: fails with mingw despite Unicode enabled.
  1299, 1613: seem like a case of expanding '*' to a filename.

- GHA/windows: enable c-ares in mingw cmake job.

Closes #14541

14 months agoGHA/configure-vs-cmake: add macOS build, fix issues
Viktor Szakats [Wed, 14 Aug 2024 15:30:47 +0000 (17:30 +0200)] 
GHA/configure-vs-cmake: add macOS build, fix issues

- sync cmake macOS `OS` value manually with the autotools one.
- stop exporting/subst-ing `HAVE_OPENSSL_QUIC` from autotools.
  The variable was only used internally.
- exclude a dependency detection symbol.
- allow to run when the workflow itself was updated.
- simplify cmake command.
- fix indentation.

Closes #14546

14 months agocmake: add missing `pkg-config` hints to Find modules
Viktor Szakats [Tue, 13 Aug 2024 09:20:00 +0000 (11:20 +0200)] 
cmake: add missing `pkg-config` hints to Find modules

- brotli, c-ares, libpsl, libssh2, mbedtls, rustls:
  Use `pkg-config` for path hints and version info. Syncing them up with
  the rest of Find modules.

- GHA/macos: force-disable libssh2 with cmake to sync with autotools.
  After this patch, cmake auto-detects libssh2 in this job.

Closes #14545

14 months agoRELEASE-NOTES: synced
Daniel Stenberg [Thu, 15 Aug 2024 07:09:41 +0000 (09:09 +0200)] 
RELEASE-NOTES: synced

14 months agogetinfo: add CURLINFO_POSTTRANSFER_TIME_T
Alex Snast [Mon, 15 Jul 2024 08:52:50 +0000 (11:52 +0300)] 
getinfo: add CURLINFO_POSTTRANSFER_TIME_T

Returns the time, in microseconds, from the start until the last byte is
sent by libcurl (i.e. the request is sent off).

Closes #14189

14 months agohash: provide asserts to verify API use
Daniel Stenberg [Mon, 12 Aug 2024 12:06:12 +0000 (14:06 +0200)] 
hash: provide asserts to verify API use

- converted the Curl_hash_count() macro to a function

- Discourage accessing struct fields directly

- Document the internal API in HASH.md

Closes #14503

14 months agoGHA/windows: enable HTTP/3 in wolfSSL MSVC job
Tal Regev [Sun, 4 Aug 2024 17:45:00 +0000 (20:45 +0300)] 
GHA/windows: enable HTTP/3 in wolfSSL MSVC job

Closes #14383

14 months agoGHA/windows: add GnuTLS to MSVC jobs
Tal Regev [Sat, 10 Aug 2024 08:15:25 +0000 (11:15 +0300)] 
GHA/windows: add GnuTLS to MSVC jobs

- enable GnuTLS in MultiSSL job.

- add new GnuTLS job with HTTP/3 enabled.
  Replacing the `!ssl` job.
  Use `Release` mode to work around a vcpkg package issue, ending up
  depending on both the debug and release versions of the gnutls DLL,
  one of them miss to copy next to the binary.

- cmake: add `pkg-config` detection for GnuTLS.

Co-authored-by: Tal Regev
Fixes #14494
Closes #14495

14 months agocmake: add rustls
Jan Venekamp [Tue, 13 Aug 2024 22:05:44 +0000 (00:05 +0200)] 
cmake: add rustls

Closes #14534

14 months agocmake: sync up result variable names in Find modules
Viktor Szakats [Wed, 14 Aug 2024 01:09:08 +0000 (03:09 +0200)] 
cmake: sync up result variable names in Find modules

- bearssl, c-ares, gss, libpsl, libssh2, mbedtls:
  Before this patch these Find modules returned results via
  `<NAME>_INCLUDE_DIR` and `<NAME>_LIBRARY`.

  This patch makes them return `<NAME>_INCLUDE_DIRS` (note the `S`)
  and `<NAME>_LIBRARIES` like other modules already did.

- bearssl, mbedtls:
  Before this patch these Find modules allowed custom configuration
  via `<NAME>_INCLUDE_DIRS` (note the `S`).

  This patch makes them accept `<NAME>_INCLUDE_DIR`, like the rest of
  the modules did.

  Deprecate the old variables, but keep accepting them for
  compatibility.

- bearssl: add missing `mark_as_advanced()` call.

Closes #14542

14 months agocmake: tidy up Find modules
Viktor Szakats [Tue, 13 Aug 2024 20:31:21 +0000 (22:31 +0200)] 
cmake: tidy up Find modules

Smoothen out minor differences between Find modules.

- brotli, nghttp2: drop redundant `FOUND_VAR` specifiers from
  `find_package_handle_standard_args()` calls.
  This function sets both `<NAME_UPPER>_FOUND` and `<NAME>_FOUND`
  by default.

- brotli: set result vars only when found.

- brotli: add missing `mark_as_advanced()` call.

- brotli: delete custom fail message.

- mbedtls, bearssl: use `REQUIRED_VARS` instead of `DEFAULT_MSG`.

- msh3, quiche: set `<NAME>_VERSION` (via pkg-config).

- wolfssl: also use `PC_WOLFSSL_INCLUDEDIR`, `PC_WOLFSSL_LIBDIR`
  as hints.

- libpsl, libssh2, zstd: clear temporary variables used for version
  detection.

- gss, msh3, nghttp2, nghttp3, ngtcp2, quiche, zstd: fix to apply
  `mark_as_advanced()` to internal variables only.

Closes #14538

14 months agocmake: update list of "advanced" variables
Viktor Szakats [Wed, 14 Aug 2024 08:11:03 +0000 (10:11 +0200)] 
cmake: update list of "advanced" variables

To hide them from the CMake GUI by default.

Closes #14540

14 months agosmtp: add tracing feature
Stefan Eissing [Tue, 13 Aug 2024 11:49:07 +0000 (13:49 +0200)] 
smtp: add tracing feature

Add `smtp` as tracing feature, use CURL_TRC_SMTP() in code to
trace operations.

Closes #14531

14 months agoTODO: mqtt and gopher test fails on network blocks
Stefan Eissing [Tue, 13 Aug 2024 09:09:30 +0000 (11:09 +0200)] 
TODO: mqtt and gopher test fails on network blocks

Add descriptions of the test failures and how to reproduce
them to the TODO for both protocols.

Closes #14528

14 months agotest649: improve robustness
Stefan Eissing [Tue, 13 Aug 2024 08:53:24 +0000 (10:53 +0200)] 
test649: improve robustness

Remove check of upload data before the error is triggered as this
may vary with network conditions.

Closes #14526

14 months agotest587: improve robustness
Stefan Eissing [Tue, 13 Aug 2024 08:39:48 +0000 (10:39 +0200)] 
test587: improve robustness

Remove check of server output as upload may abort before request
could fully be sent, so server output may be completely missing.

Test already used a 1 second delay to mitigate timing. This change
makes timing no longer an issue.

Closes #14525

14 months agotest httpd, tweak cipher list
Stefan Eissing [Mon, 12 Aug 2024 11:53:04 +0000 (13:53 +0200)] 
test httpd, tweak cipher list

Configure the AES 256 instead of the AES 128 cipher in the test httpd to
make scorecard testing between httpd and caddy more comparable.

Adapt test_17 expectations, now that AES 128 can no longer, but 256 can
now be negotiated.

Closes #14502

14 months agognutls/wolfssl: improve error message when certificate fails
Stefan Eissing [Mon, 12 Aug 2024 10:21:38 +0000 (12:21 +0200)] 
gnutls/wolfssl: improve error message when certificate fails

Give more detailed reasons for certificate failures where available in
gnutls and wolfssi to allow user to understand the cause of the failure.

Closes #14501

14 months agohyper: call Curl_req_set_upload_done()
Stefan Eissing [Wed, 14 Aug 2024 08:22:20 +0000 (10:22 +0200)] 
hyper: call Curl_req_set_upload_done()

Hyper implementation was missing the call to Curl_req_set_upload_done()
as it works differently than out normal request upload handling.

Closes #14539

14 months agourldata: introduce `data->mid`, a unique identifier inside a multi
Stefan Eissing [Mon, 12 Aug 2024 09:28:19 +0000 (11:28 +0200)] 
urldata: introduce `data->mid`, a unique identifier inside a multi

`data->id` is unique in *most* situations, but not in all. If a libcurl
application uses more than one connection cache, they will overlap. This
is a rare situations, but libcurl apps do crazy things. However, for
informative things, like tracing, `data->id` is superior, since it
assigns new ids in curl's serial curl_easy_perform() use.

Introduce `data->mid` which is a unique identifer inside one multi
instance, assigned on multi_add_handle() and cleared on
multi_remove_handle().

Use the `mid` in DoH operations and also in h2/h3 stream hashes.

Reported-by: 罗朝辉
Fixes #14414
Closes #14499

14 months agotool_paramhlp: bump maximum post data size in memory to 16GB
Daniel Stenberg [Tue, 13 Aug 2024 07:12:18 +0000 (09:12 +0200)] 
tool_paramhlp: bump maximum post data size in memory to 16GB

- stick to 2GB for 32bit systems.

Reported-by: Tim Yuer
Fixes #14521
Closes #14523

14 months agocmake: sync up formatting in Find modules
Viktor Szakats [Tue, 13 Aug 2024 08:45:37 +0000 (10:45 +0200)] 
cmake: sync up formatting in Find modules

- lowercase internal variable names (FindGSS)
- comments
- whitespace

Closes #14527

14 months agoruntests: log ignored but passed tests
Viktor Szakats [Thu, 8 Aug 2024 12:42:40 +0000 (14:42 +0200)] 
runtests: log ignored but passed tests

List tests explicitly ignored, but passing. It can be useful to catch
ignore rules that are no longer necessary because the tests are not
failing anymore.

To not clutter the default view, hide this information under a GitHub
Actions foldable group.

Closes #14457

14 months agoGHA/macos: disable AppleIDN for autotools in combinations jobs
Viktor Szakats [Tue, 13 Aug 2024 11:28:48 +0000 (13:28 +0200)] 
GHA/macos: disable AppleIDN for autotools in combinations jobs

Without libidn2, AppleIDN gets enabled by default in autotools.

To remain minimal and match cmake.

Follow-up to 8de8fe8c98309c8b6183b22cc2e209ce4648173b #14401

14 months agotests: don't mangle output if hostname or type unknown
Dan Fandrich [Tue, 13 Aug 2024 08:11:33 +0000 (01:11 -0700)] 
tests: don't mangle output if hostname or type unknown

If either of these couldn't be determined, the output would be missing a
newline. Make sure the line ends even in the case of an error.

14 months agocurl_sha512_256: fix symbol collisions with nettle library
Viktor Szakats [Sun, 11 Aug 2024 19:44:19 +0000 (21:44 +0200)] 
curl_sha512_256: fix symbol collisions with nettle library

`SHA512_256_BLOCK_SIZE`, `SHA512_256_DIGEST_SIZE` macros were both
defined within curl and also in the nettle library required by GnuTLS.

Fix it by namespacing the curl macros.

Cherry-picked from #14495
Closes #14514

14 months agolib: prefer `CURL_SHA256_DIGEST_LENGTH` over the unprefixed name
Viktor Szakats [Sun, 11 Aug 2024 22:57:41 +0000 (00:57 +0200)] 
lib: prefer `CURL_SHA256_DIGEST_LENGTH` over the unprefixed name

Already used in `vtls.h`. Prefer this curl-namespaced name over the
unprefixed `SHA256_DIGEST_LENGTH`. The latter is also defined by TLS
backends with a potential to cause issues.

Also stop relying on externel headers setting this constant. It's
already defined in `vtls.h` on curl's behalf, do this also for `lib`.

Cherry-picked from #14495
Closes #14513

14 months agolib: avoid macro collisions between wolfSSL and GnuTLS headers
Viktor Szakats [Sun, 11 Aug 2024 23:02:37 +0000 (01:02 +0200)] 
lib: avoid macro collisions between wolfSSL and GnuTLS headers

Both of these projects define the same `SHA*` macros via headers
included by curl (in MultiSSL builds, possibly only in Unity builds),
causing redefinition compiler warnings.

Fix it by disabling compatibility macros in wolfSSL.

```
Building C object lib/CMakeFiles/libcurl_static.dir/Unity/unity_0_c.c.o
In file included from _bld/lib/CMakeFiles/libcurl_static.dir/Unity/unity_0_c.c:202:
In file included from lib/http_aws_sigv4.c:33:
In file included from lib/curl_sha256.h:40:
In file included from /usr/local/Cellar/wolfssl/5.7.2/include/wolfssl/openssl/sha.h:30:
/usr/local/Cellar/wolfssl/5.7.2/include/wolfssl/wolfcrypt/sha256.h:117:13: warning: 'SHA256_BLOCK_SIZE' macro redefined [-Wmacro-redefined]
    #define SHA256_BLOCK_SIZE  WC_SHA256_BLOCK_SIZE
            ^
/usr/local/Cellar/nettle/3.10/include/nettle/sha2.h:70:9: note: previous definition is here
#define SHA256_BLOCK_SIZE 64
        ^
In file included from _bld/lib/CMakeFiles/libcurl_static.dir/Unity/unity_0_c.c:202:
In file included from lib/http_aws_sigv4.c:33:
In file included from lib/curl_sha256.h:40:
In file included from /usr/local/Cellar/wolfssl/5.7.2/include/wolfssl/openssl/sha.h:30:
[...]
    #define SHA256_DIGEST_SIZE WC_SHA256_DIGEST_SIZE
    #define SHA224_BLOCK_SIZE  WC_SHA224_BLOCK_SIZE
    #define SHA224_DIGEST_SIZE WC_SHA224_DIGEST_SIZE
    #define SHA512_BLOCK_SIZE  WC_SHA512_BLOCK_SIZE
    #define SHA512_DIGEST_SIZE WC_SHA512_DIGEST_SIZE
    #define SHA384_BLOCK_SIZE  WC_SHA384_BLOCK_SIZE
    #define SHA384_DIGEST_SIZE WC_SHA384_DIGEST_SIZE
```

Cherry-picked from #14495
Closes #14511

14 months agocmake: update `curl-config.cmake.in` template var list [ci skip]
Viktor Szakats [Tue, 13 Aug 2024 08:01:41 +0000 (10:01 +0200)] 
cmake: update `curl-config.cmake.in` template var list [ci skip]

Omit those defined by CMake.

Follow-up to a298df7f475f95996dcabc9e5a6ab31225ae6afa #14462

14 months agolib: fix building with wolfSSL without DES support
Viktor Szakats [Sun, 11 Aug 2024 20:26:21 +0000 (22:26 +0200)] 
lib: fix building with wolfSSL without DES support

E.g. with Homebrew wolfssl 5.7.2 on macOS:
```
In file included from _bld/lib/CMakeFiles/libcurl_static.dir/Unity/unity_0_c.c:85:
lib/curl_ntlm_core.c:157:27: error: unknown type name 'DES_key_schedule'
                          DES_key_schedule DESKEYARG(ks))
                          ^
lib/curl_ntlm_core.c:159:3: error: use of undeclared identifier 'DES_cblock'
  DES_cblock key;
  ^
[...]
```

Earlier patch addressing this for OpenSSL:
802d8644500f5b18c895b77a23d85e029766d65e #7808

Cherry-picked from #14495
Closes #14512

14 months agosha256: fix symbol collision between nettle (GnuTLS) and OpenSSL codepath
Viktor Szakats [Sun, 11 Aug 2024 19:43:46 +0000 (21:43 +0200)] 
sha256: fix symbol collision between nettle (GnuTLS) and OpenSSL codepath

Fixes:
```
C:\vcpkg\installed\x64-windows\include\nettle\sha2.h(75,8): error C2011: 'sha256_ctx': 'struct' type redefinition
```
Ref: https://github.com/curl/curl/actions/runs/10341162641/job/28622681573?pr=14484#step:10:30

Cherry-picked from #14495
Closes #14515

14 months agovtls: fix static function name collisions between TLS backends
Viktor Szakats [Sun, 11 Aug 2024 19:23:44 +0000 (21:23 +0200)] 
vtls: fix static function name collisions between TLS backends

When using CMake Unity build.

- use unique name for `set_ssl_version_min_max()`
  Fixes collision between GnuTLS, mbedTLS and SecureTransport.
  ```
  lib\vtls\mbedtls.c(317,1): error C2084: function 'CURLcode set_ssl_version_min_max(Curl_easy *,ssl_peer *,ssl_primary_config *,const char **,const char *)' already has a body
  lib\vtls\mbedtls.c(837,49): warning C4133: 'function': incompatible types - from 'Curl_cfilter *' to 'Curl_easy *'
  lib\vtls\mbedtls.c(837,53): warning C4133: 'function': incompatible types - from 'Curl_easy *' to 'ssl_peer *'
  lib\vtls\mbedtls.c(837,25): error C2198: 'set_ssl_version_min_max': too few arguments for call
  ```

- use unique name for `do_file_type()`
  Fixes collision between GnuTLS, OpenSSL and wolfSSL.
  ```
  lib\vtls\openssl.c(1053,12): error C2084: function 'gnutls_x509_crt_fmt_t do_file_type(const char *)' already has a body
  ```

Ref: https://github.com/curl/curl/actions/runs/10341162641/job/28622681573?pr=14484#step:10:31
Cherry-picked from #14495
Closes #14516

14 months agobuild: silence C4232 MSVC warnings in vcpkg ngtcp2 builds
Viktor Szakats [Mon, 12 Aug 2024 00:43:52 +0000 (02:43 +0200)] 
build: silence C4232 MSVC warnings in vcpkg ngtcp2 builds

Silence bogus MSVC warning C4232. Use the method already used
for similar cases earlier.

Also fixup existing suppressions to use pragma push/pop.

```
lib\vquic\curl_ngtcp2.c(709,40): error C2220: the following warning is treated as an error
lib\vquic\curl_ngtcp2.c(709,40): warning C4232: nonstandard extension used: 'client_initial': address of dllimport 'ngtcp2_crypto_client_initial_cb' is not static, identity not guaranteed
lib\vquic\curl_ngtcp2.c(709,40): warning C4232: nonstandard extension used: 'recv_crypto_data': address of dllimport 'ngtcp2_crypto_recv_crypto_data_cb' is not static, identity not guaran
lib\vquic\curl_ngtcp2.c(709,40): warning C4232: nonstandard extension used: 'encrypt': address of dllimport 'ngtcp2_crypto_encrypt_cb' is not static, identity not guaranteed
lib\vquic\curl_ngtcp2.c(709,40): warning C4232: nonstandard extension used: 'decrypt': address of dllimport 'ngtcp2_crypto_decrypt_cb' is not static, identity not guaranteed
lib\vquic\curl_ngtcp2.c(709,40): warning C4232: nonstandard extension used: 'hp_mask': address of dllimport 'ngtcp2_crypto_hp_mask_cb' is not static, identity not guaranteed
lib\vquic\curl_ngtcp2.c(709,40): warning C4232: nonstandard extension used: 'recv_retry': address of dllimport 'ngtcp2_crypto_recv_retry_cb' is not static, identity not guaranteed
lib\vquic\curl_ngtcp2.c(709,40): warning C4232: nonstandard extension used: 'update_key': address of dllimport 'ngtcp2_crypto_update_key_cb' is not static, identity not guaranteed
lib\vquic\curl_ngtcp2.c(709,40): warning C4232: nonstandard extension used: 'delete_crypto_aead_ctx': address of dllimport 'ngtcp2_crypto_delete_crypto_aead_ctx_cb' is not static, identit
lib\vquic\curl_ngtcp2.c(709,40): warning C4232: nonstandard extension used: 'delete_crypto_cipher_ctx': address of dllimport 'ngtcp2_crypto_delete_crypto_cipher_ctx_cb' is not static, ide
lib\vquic\curl_ngtcp2.c(709,40): warning C4232: nonstandard extension used: 'get_path_challenge_data': address of dllimport 'ngtcp2_crypto_get_path_challenge_data_cb' is not static, ident
```
Ref: https://github.com/curl/curl/actions/runs/10343459009/job/28627621355#step:10:30

Cherry-picked from #14495
Co-authored-by: Tal Regev
Ref: #14383
Closes #14510

14 months agocmake: add `CURL_USE_PKGCONFIG` option
Viktor Szakats [Mon, 12 Aug 2024 13:35:50 +0000 (15:35 +0200)] 
cmake: add `CURL_USE_PKGCONFIG` option

Add option to control whether to use `pkg-config` to detect
dependencies. Curl's CMake uses `pkg-config` by default for all targets
except for MSVC without vcpkg.

With the CMake option `-DCURL_USE_PKGCONFIG=ON` you can override it to
use `pkg-config` always.

If `pkg-config` is causing issues, e.g. in cross-builds or other cases,
`-DCURL_USE_PKGCONFIG=OFF` disables all use of `pkg-config`.

Also add it to `curl-config.cmake`. Not yet used, but will be once curl
starts referencing any curl-specific `Find*` module from this public
script.

Follow-up to 9dfdc6ff42ba045ec48056bb6d2072f2fcac2e9d #14483
Closes #14504

14 months agoIDN: fix/extend/migrate test exclusion rules
Viktor Szakats [Mon, 12 Aug 2024 15:48:59 +0000 (17:48 +0200)] 
IDN: fix/extend/migrate test exclusion rules

- make sure to exclude failing tests when libidn2 is detected by
  default.

- ignore test 1560 results. Seen to fail with libidn2.
  I'm not sure why this test was not executed earlier:
  https://github.com/curl/curl/actions/runs/10354610889/job/28660309355#step:13:3647

- runtests: recognize `libidn2` as a feature.

- move IDN test exclusions from GHA/windows to `tests/data/DISABLED`.

- GHA/windows: drop default `-DUSE_LIBIDN2=ON` cmake config.

Cherry-picked from #14495
Closes #14519

14 months agodocs: update CIPHERS.md
Jan Venekamp [Fri, 9 Aug 2024 12:29:18 +0000 (14:29 +0200)] 
docs: update CIPHERS.md

Give a more consice overview of curl's cipher options and cipher suites.

Removed long lists of ciphers that were directly copied from the SSL
backends' documentation. Instead present the user a more common aproach
acorss the SSL backends, with notes for backends that do not conform
and/or provide alternate means.

Provide a shorter list of cipher suites that is more relevant for modern
usage and should work mostly across all backends, provide a seperate
list with all cipher suites, and provide links to the SSL backends'
documentation for more information.

Also give examples with modern cipher suites.

Add docs/CIPHERS-TLS12.md for TLS 1.2 ciphers.

Closes #14460

14 months agoGHA: bump deps: upload-artifact, codeql and spellcheck
dependabot[bot] [Mon, 12 Aug 2024 14:07:54 +0000 (14:07 +0000)] 
GHA: bump deps: upload-artifact, codeql and spellcheck

- bump actions/upload-artifact from 4.3.5 to 4.3.6

Signed-off-by: dependabot[bot] <support@github.com>
Closes #14506

- bump github/codeql-action from 3.25.15 to 3.26.0

Closes #14507

- bump rojopolis/spellcheck-github-actions digest to a0fba0c

Closes #14518

14 months agohttp2+h3 filters: fix ctx init
Stefan Eissing [Mon, 12 Aug 2024 13:42:41 +0000 (15:42 +0200)] 
http2+h3 filters: fix ctx init

Members of the filter context, like stream hash and buffers, need to be
initialized early and protected by a flag to also avoid double cleanup.

This allow the context to be used safely before a connect() is started
and the other parts of the context are set up.

Closes #14505

14 months agoGHA/macos: drop gcc-11
Viktor Szakats [Mon, 12 Aug 2024 17:28:06 +0000 (19:28 +0200)] 
GHA/macos: drop gcc-11

No longer present in macos-12, macos-13 images:
https://github.com/actions/runner-images/blob/macos-12/20240811.1/images/macos/macos-12-Readme.md
https://github.com/actions/runner-images/blob/macos-13/20240811.1/images/macos/macos-13-Readme.md

Closes #14509

14 months agowolfssl: fix CURLOPT_SSLVERSION
Jan Venekamp [Fri, 9 Aug 2024 21:17:21 +0000 (23:17 +0200)] 
wolfssl: fix CURLOPT_SSLVERSION

Before, setting CURLOPT_SSLVERSION with wolfSSL restricted the the tls
proto to just the specified version. Now it properly supports a range.
So it can set the min and max tls proto (max requires wolfSSL 4.2.0).

Bump the absolute minimum required version of wolfSSL to 3.4.6 (released
2015) because it is needed for the wolfSSL_CTX_SetMinVersion() function.

Closes #14480

14 months agowebsocket: introduce blocking sends
Stefan Eissing [Thu, 8 Aug 2024 14:00:24 +0000 (16:00 +0200)] 
websocket: introduce blocking sends

When using `curl_ws_send()`, perform a blocking send of the data under
the following conditions:

- the websocket is in raw mode and the call is done from within a curl
  callback. A partial write of the data could subsequently mess up the
  ws framing, as a callback has a hard time handling this.

- the websocket is encoding the data itself, has added it to its
  internal sendbuf. A partial flush of the buffer has unclear semantics
  for the caller, as they will have no idea what to send again.

Fixes WebSockets tests with CURL_DBG_SOCK_WBLOCK=90 set.
Closes #14458

14 months agospnego_gssapi: implement TLS channel bindings for openssl
Max Faxälv [Thu, 29 Feb 2024 08:12:59 +0000 (09:12 +0100)] 
spnego_gssapi: implement TLS channel bindings for openssl

Channel Bindings are used to tie the session context to a specific TLS
channel. This is to provide additional proof of valid identity,
mitigating authentication relay attacks.

Major web servers have the ability to require (None/Accept/Require)
GSSAPI channel binding, rendering Curl unable to connect to such
websites unless support for channel bindings is implemented.

IIS calls this feature Extended Protection (EPA), which is used in
Enterprise environments using Kerberos for authentication.

This change require krb5 >= 1.19, otherwise channel bindings won't be
forwarded through SPNEGO.

Co-Authored-By: Steffen Kieß <947515+steffen-kiess@users.noreply.github.com>
Closes #13098

14 months agocmake: allow `pkg-config` in more envs
Viktor Szakats [Sat, 10 Aug 2024 07:33:18 +0000 (09:33 +0200)] 
cmake: allow `pkg-config` in more envs

Before this patch, `pkg-config` was used for `UNIX` builds only (with
a few exceptions like wolfSSL, libssh, gsasl, libuv). This patch extends
`pkg-config` use to all envs except: `MSVC` without vcpkg. Meaning MSVC
with vcpkg will now use it. Also mingw on Windows.

Also apply the new condition to options where `pkg-config` was used
unconditionally (= for all targets). These are:
`-DCURL_USE_WOLFSSL=ON`, `-DCURL_USE_LIBSSH=ON`,
`-DCURL_USE_GSASL=ON` and `-DCURL_USE_LIBUV=ON`

This patch may still cause regressions for cross-builds (e.g. mingw
cross-build from Unix) and potentially other cases. If that happens, we
recommend using some of these methods to explicitly disable `pkg-config`
when using CMake:
- CMake option: `-DPKG_CONFIG_EXECUTABLE=`
  (or `-DPKG_CONFIG_EXECUTABLE=nonexistent` or similar)
  This is similar to the (curl-specific) `PKG_CONFIG` env for autotools.
- export env: `PKG_CONFIG_LIBDIR=`
  (or `PKG_CONFIG_PATH`, `PKG_CONFIG_SYSROOT_DIR`,
  or the CMake-specific `PKG_CONFIG`)

We may improve control over this in a future patch, also allowing opting
in MSVC (without vcpkg).

Ref: #14405
Ref: #14408
Ref: #14140
Closes #14483

14 months agobuild: tidy up internal macro names for `libcurl.pc`
Viktor Szakats [Fri, 9 Aug 2024 15:45:46 +0000 (17:45 +0200)] 
build: tidy up internal macro names for `libcurl.pc`

Rename internal macros to match their `libcurl.pc` metadata counterpart.
Also apply these to the `curl-config.in` template.

- `CPPFLAG_CURL_STATICLIB` -> `LIBCURL_PC_CFLAGS`
- `LIBCURL_LIBS`           -> `LIBCURL_PC_LIBS_PRIVATE`
- `LIBCURL_NO_SHARED`      -> `LIBCURL_PC_LIBS`

Closes #14476

14 months agotidy-up: delete `Makefile.inc` from `EXTRA_DIST`
Viktor Szakats [Mon, 12 Aug 2024 01:26:26 +0000 (03:26 +0200)] 
tidy-up: delete `Makefile.inc` from `EXTRA_DIST`

autotools is adding them automatically. Delete the few ones that were
also added manually.

Closes #14496

14 months agoRELEASE-NOTES: synced
Daniel Stenberg [Mon, 12 Aug 2024 11:48:08 +0000 (13:48 +0200)] 
RELEASE-NOTES: synced

14 months agollist: remove direct struct accesses, use only functions
Daniel Stenberg [Sat, 10 Aug 2024 21:27:25 +0000 (23:27 +0200)] 
llist: remove direct struct accesses, use only functions

- Turned them all into functions to also do asserts etc.

- The llist related structs got all their fields renamed in order to make
  sure no existing code remains using direct access.

- Each list node struct now points back to the list it "lives in", so
  Curl_node_remove() no longer needs the list pointer.

- Rename the node struct and some of the access functions.

- Added lots of ASSERTs to verify API being used correctly

- Fix some cases of API misuse

Add docs/LLIST.md documenting the internal linked list API.

Closes #14485

14 months agolibcurl/docs: expand on redirect following and secrets to other hosts
Daniel Stenberg [Fri, 9 Aug 2024 11:58:19 +0000 (13:58 +0200)] 
libcurl/docs: expand on redirect following and secrets to other hosts

For CURLOPT_FOLLOWLOCATION and CURLOPT_UNRESTRICTED_AUTH

Ref: #14471
Closes #14472

14 months agourldata: remove 'scratch' from the UrlState struct
Daniel Stenberg [Mon, 12 Aug 2024 09:42:48 +0000 (11:42 +0200)] 
urldata: remove 'scratch' from the UrlState struct

It is not used anywhere anymore

Follow-up to e3905de8196d67b89df160

Closes #14500

14 months agodocs/cmdline: refer to --show-headers instead of --include
Daniel Stenberg [Mon, 12 Aug 2024 07:58:34 +0000 (09:58 +0200)] 
docs/cmdline: refer to --show-headers instead of --include

As it is the new version of the option that is easier to understand what
it does by name.

Follow-up to 82c53f821fa3fd40
Closes #14497

14 months agoDEPRECATE.md: remove hyper after February 2025
Daniel Stenberg [Sun, 11 Aug 2024 11:36:11 +0000 (13:36 +0200)] 
DEPRECATE.md: remove hyper after February 2025

Closes #14492

14 months agocookie.md: try to articulate the two different uses this option has
Daniel Stenberg [Sun, 11 Aug 2024 10:56:45 +0000 (12:56 +0200)] 
cookie.md: try to articulate the two different uses this option has

Ref: #14489
Closes #14491

14 months agoTODO: remove 4.2 Alter passive/active on failure and retry
Daniel Stenberg [Sun, 11 Aug 2024 10:11:28 +0000 (12:11 +0200)] 
TODO: remove 4.2 Alter passive/active on failure and retry

and a dead link to curl issue that has been removed

Reported-by: Yedaya Katsman
Fixes #14475
Closes #14490

14 months agomulti: make the "general" list of easy handles a Curl_llist
Daniel Stenberg [Fri, 9 Aug 2024 13:38:03 +0000 (15:38 +0200)] 
multi: make the "general" list of easy handles a Curl_llist

Instead of having an especially "unique" linked list handler for the
main list of easy handles within the multi handle, this now uses a
regular Curl_llist for this as well.

With this change, it is also clearer that every easy handle added to a
multi handle belongs to one and only one out of three different lists:

 process - the general one for normal transfer processing

 pending - queued up waiting to get a connection (MSTATE_PENDING)

 msgsent - transfer completed (MSTATE_MSGSENT)

An easy handle must therefore be removed from the current list before it
gets added to another.

Closes #14474

14 months agoautotools: add `--with-windows-unicode` option
Viktor Szakats [Fri, 9 Aug 2024 18:18:48 +0000 (20:18 +0200)] 
autotools: add `--with-windows-unicode` option

- add `--with-windows-unicode` and `--without-windows-unicode` (default)
  options.

- enable it in a CI job.

Fixes #7229
Closes #14478

14 months agodist: add CI job to detect files missing from distro
Viktor Szakats [Thu, 8 Aug 2024 20:05:16 +0000 (22:05 +0200)] 
dist: add CI job to detect files missing from distro

Also:
- delete previous, cmake-specific solution.
- move a CI script under `.github`.

Follow-up to a118a6ecddb0322a6da07815aabf9e36cd5f44bc #14323
Closes #14463

14 months agocmake: limit libidn2 `pkg-config` detection to `UNIX`
Viktor Szakats [Tue, 6 Aug 2024 00:59:54 +0000 (02:59 +0200)] 
cmake: limit libidn2 `pkg-config` detection to `UNIX`

libidn2 is detected by default, which triggers a `pkg-config` detectio
attempt by default. This in turn may pick up libidn2 inadvertently from
the disk, and append the libidn2 header directory to the include path.
This header directory might contain incompatible system and/or component
headers, causing confusion and failed builds.

Some of these side-effects may be the result of an unknowningly
configured (or misconfigured) `pkg-config`. In another reported case,
it was hit by the `pkg-config` from Strawberry Perl. Until we
investigate the reasons and come up with a technique to avoid these
issues, limit `pkg-config` detection to UNIX platforms, like we already
do in `Find*` modules.

Notice that `-DCURL_USE_LIBSSH=ON`, `-DCURL_USE_GSASL=ON`, and
`-DCURL_USE_LIBUV=ON` options continue to have the above side-effects,
though these options are disabled by default.

Follow-up to f43adc2c4978f7f82a359e89186e58a31d17b0ad #14137
Reported-by: Micah Snyder
Fixes #14405
Closes #14408

14 months agocmake: exclude tests/http/clients builds by default
Viktor Szakats [Fri, 9 Aug 2024 17:40:04 +0000 (19:40 +0200)] 
cmake: exclude tests/http/clients builds by default

To limit building them with the testdeps target, like it's done with
the rest of test programs.

Follow-up to 232302f88a152a1d1722da9f69c383a766528918 #14382
Closes #14477

14 months agoReplace nonportable grep -o with awk
Dan Fandrich [Fri, 9 Aug 2024 00:08:34 +0000 (17:08 -0700)] 
Replace nonportable grep -o with awk

This stops an error shown at the end of configure on systems with POSIX
grep and fixes the warning it's trying to convey.

Closes #14469

14 months agolib: fix AIX build issues
Viktor Szakats [Thu, 8 Aug 2024 20:31:24 +0000 (22:31 +0200)] 
lib: fix AIX build issues

- memdebug: replace keyword `malloc` with `__malloc__` to
  not interfere with envs where `malloc` is redefined. Also apply
  the fix to `alloc_size`.
  Fixes:
  ```
  lib/memdebug.h:107:13: warning: unknown attribute 'vec_malloc' ignored [-Wunknown-attributes]
  CURL_EXTERN ALLOC_FUNC FILE *curl_dbg_fdopen(int filedes, const char *mode,
              ^~~~~~~~~~
  lib/memdebug.h:37:37: note: expanded from macro 'ALLOC_FUNC'
  # define ALLOC_FUNC __attribute__((malloc))
                                     ^~~~~~
  /usr/include/stdlib.h:753:16: note: expanded from macro 'malloc'
  #define malloc vec_malloc
                 ^~~~~~~~~~
  ```

- memdebug: always undef before defining.
  Also do this for the rest of functions redefined in the same block.
  Avoids warning on AIX:
  ```
  lib/memdebug.h:117:9: warning: 'malloc' macro redefined [-Wmacro-redefined]
  #define malloc(size) curl_dbg_malloc(size, __LINE__, __FILE__)
          ^
  /usr/include/stdlib.h:753:9: note: previous definition is here
  #define malloc vec_malloc
          ^
  ```

- easy: fix `-Wformat` warning on AIX by adding a cast.
  ```
  lib/easy.c:608:47: warning: format specifies type 'int' but the argument has type 'long' [-Wformat]
  "%" CURL_FORMAT_SOCKET_T ")", fds[i].fd);
  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~
  ```

- if2ip: silence compiler warning inside AIX system header.

  ```
  /lib/if2ip.c:219:19: warning: signed shift result (0x80000000) sets the sign bit of the shift expression's type ('int') and becomes negative [-Wshift-sign-overflow]
  if(ioctl(dummy, SIOCGIFADDR, &req) < 0) {
                  ^~~~~~~~~~~
  /usr/include/sys/ioctl.h:401:26: note: expanded from macro 'SIOCGIFADDR'
  #define SIOCGIFADDR (int)_IOWR('i',33, struct oifreq) /* get ifnet address */
                           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
  /usr/include/sys/ioctl.h:174:23: note: expanded from macro '_IOWR'
  #define _IOWR(x,y,t) (IOC_INOUT|((sizeof(t)&IOCPARM_MASK)<<16)|(x<<8)|y)
                        ^~~~~~~~~
  /usr/include/sys/ioctl.h:168:20: note: expanded from macro 'IOC_INOUT'
  #define IOC_INOUT (IOC_IN|IOC_OUT)
                     ^~~~~~
  /usr/include/sys/ioctl.h:167:28: note: expanded from macro 'IOC_IN'
  #define IOC_IN (0x40000000<<1) /* copy in parameters */
                  ~~~~~~~~~~^ ~
  ```

Ref: https://curl.se/dev/log.cgi?id=20240808180420-3809007
Assisted-by: Dan Fandrich
Closes #14464

14 months agocmake: more small tidy-ups
Viktor Szakats [Thu, 8 Aug 2024 17:09:56 +0000 (19:09 +0200)] 
cmake: more small tidy-ups

- prefix local variables with underscore and convert to lowercase.
- list variables accepted by `libcurl.pc` and `curl-config` templates.
- quote more string literals.

Follow-up to 919394ee645be8cf92a96ff01140b4daf9cb21a5 #14450
Closes #14462

14 months agotidy-up: delete unused `m4/xc-translit.m4`
Viktor Szakats [Thu, 8 Aug 2024 14:37:44 +0000 (16:37 +0200)] 
tidy-up: delete unused `m4/xc-translit.m4`

Unused since it was added in 49a8fe51420cf68c4e420668eb354f0cce6ee4f0.
Also missing from the source tarball.

Closes #14459

14 months agodist: add missing `lib/optiontable.pl`
Viktor Szakats [Thu, 8 Aug 2024 21:23:22 +0000 (23:23 +0200)] 
dist: add missing `lib/optiontable.pl`

Closes #14467

14 months agoconfigure: fixup copy-paste mistake
Viktor Szakats [Fri, 9 Aug 2024 00:42:55 +0000 (02:42 +0200)] 
configure: fixup copy-paste mistake

Delete duplicate call to `CURL_DARWIN_CFLAGS`.

Follow-up to ada8ebe18c795cc50a1ee3c56af410f7b8094675 #14419
Closes #14468

14 months agoRELEASE-NOTES: synced
Daniel Stenberg [Fri, 9 Aug 2024 07:43:28 +0000 (09:43 +0200)] 
RELEASE-NOTES: synced

14 months agotest677: improve robustness
Stefan Eissing [Thu, 8 Aug 2024 11:29:12 +0000 (13:29 +0200)] 
test677: improve robustness

Do not treat CURLE_AGAIN as error.

Fixes test with CURL_DBG_SOCK_WBLOCK=90 set.

Closes #14455

14 months agotest579: improve robustness
Stefan Eissing [Thu, 8 Aug 2024 11:26:10 +0000 (13:26 +0200)] 
test579: improve robustness

Log progress only at start and end of transfer to give normalized
output when upload data is only partially sent or temporarily blocked.

Fixes test with CURL_DBG_SOCK_WBLOCK=90 set.

Closes #14454

14 months agotest556: improve robustness
Stefan Eissing [Thu, 8 Aug 2024 11:23:32 +0000 (13:23 +0200)] 
test556: improve robustness

Fix handling of partial/blocked sends.

Fixes test with CURL_DBG_SOCK_WBLOCK=90 set.

Closes #14453

14 months agomk-ca-bundle.pl: include a link to the caextract webpage
Daniel Stenberg [Thu, 8 Aug 2024 21:00:47 +0000 (23:00 +0200)] 
mk-ca-bundle.pl: include a link to the caextract webpage

Makes it easier for users who find the file to find its origin.

Fixes https://github.com/curl/curl-www/issues/374

Closes #14465

14 months agoHISTORY: fill in some events from recent years
Daniel Stenberg [Thu, 8 Aug 2024 22:17:42 +0000 (00:17 +0200)] 
HISTORY: fill in some events from recent years

Closes #14466

15 months agoftp: flush pingpong before response
Stefan Eissing [Thu, 8 Aug 2024 11:12:53 +0000 (13:12 +0200)] 
ftp: flush pingpong before response

Fix FTP protocol to flush the pingpong's send buffer before receiving a
response from the server, as it may never come otherwise.

Fixes FTP/FTPS tests with `CURL_DBG_SOCK_WBLOCK=90` set.

Closes #14452

15 months agomanpage: ensure a maximum width for the text version
Daniel Stenberg [Tue, 6 Aug 2024 15:11:20 +0000 (17:11 +0200)] 
manpage: ensure a maximum width for the text version

... using the new script 'maxline' to which we specify the maximum
number of columns we allow any single line to be, or it will cause an
error.

Starting out with a max width at 100 columns.

Bonus: shorten the long line in the --ipfs-gateway section.

Closes #14423

15 months agocmake: more small tidy-ups and fixes
Viktor Szakats [Wed, 7 Aug 2024 22:53:38 +0000 (00:53 +0200)] 
cmake: more small tidy-ups and fixes

- tidy up two `MATCHES` expression by avoiding macros expansion and
  adding quotes. Then convert then to `STREQUAL` to match other places
  in the code doing the same checks.

- fix setting `_ALL_SOURCE` for AIX to match what autotools does.

- delete stray `_ALL_SOURCE` reference from `lib/config_riscos.h`

- simplify/fix two `STREQUAL ""` checks.
  The one in the `openssl_check_symbol_exists()` macro succeeded
  regardless of the value. The other could return TRUE when
  `CMAKE_OSX_SYSROOT` was undefined.

- delete code for CMake versions (<3.7) we no longer support.

- prefer `LIST(APPEND ...)` to extend `CURL_LIBS`.

- use `CURL_LIBS` to add the `network` lib for Haiku.
  Before this patch it was done via raw C flags. I could not test this.

- move `_WIN32_WINNT`-related code next to each other.
  It also moves detection to the top, allowing more code to use
  the result.

- merge two `WIN32` blocks.

- rename internal variables to underscore + lowercase.

- unwrap a line, indent, whitespace.

Closes #14450

15 months agokrb5: add Linux/macOS CI tests, fix cmake GSS detection
Viktor Szakats [Wed, 7 Aug 2024 18:39:34 +0000 (20:39 +0200)] 
krb5: add Linux/macOS CI tests, fix cmake GSS detection

- GHA/macos: enable GSS krb5 in a cmake job.
  Uses CMake-native detection.

- GHA/linux: enable GSS krb5 in autotools job and add a cmake job to
  match.
  CMake uses `pkg-config`-based detection.

- GHA/linux: add step to dump configure logs.

- fix and simplify logic digesting FindGSS output.

- cmake: add `heimdal-gssapi` to `libcurl.pc`.

Closes #14447

15 months agocmake: detect and show VCPKG in platform flags
Viktor Szakats [Thu, 8 Aug 2024 10:18:37 +0000 (12:18 +0200)] 
cmake: detect and show VCPKG in platform flags

Use `VCPKG_TOOLCHAIN` to detect a vcpkg build environment.

Closes #14451

15 months agoGHA/non-native: ignore FTP results in OpenBSD job
Viktor Szakats [Thu, 8 Aug 2024 11:19:54 +0000 (13:19 +0200)] 
GHA/non-native: ignore FTP results in OpenBSD job

They are flaky.

15 months agocmake: tidy up more value comparisons
Viktor Szakats [Wed, 7 Aug 2024 21:40:05 +0000 (23:40 +0200)] 
cmake: tidy up more value comparisons

- unquote numeric value.

- `NOT LESS` -> `GREATER_EQUAL`.

- replace macro with variable name.
  It also avoids this error when the variable is undefined:
  ```
  CMake Error at CMakeLists.txt:1529 (if):
  if given arguments:
    "GREATER" "4"
  Unknown arguments specified
  ```
  https://github.com/curl/curl/actions/runs/10289921657/job/28478722584#step:30:356

Follow-up to 72ae0d86a42fea83612d8baf59cff2f945aca22a #14409
Follow-up to acbc6b703f6b0ee568d053f6f2565fbc107b5fd3 #14197

Closes #14449

15 months agocmake: fix version variable references in FindGSS
Viktor Szakats [Wed, 7 Aug 2024 21:38:15 +0000 (23:38 +0200)] 
cmake: fix version variable references in FindGSS

Assign the value of the variable instead of the name of the variable
when detecting GSS version via `pkg-config` on old (?) CMake.

(On recent CMake, there is an empty value in these variables.)

Closes #14445

15 months agocmake: more syntax tidy-up
Viktor Szakats [Sun, 4 Aug 2024 18:35:13 +0000 (20:35 +0200)] 
cmake: more syntax tidy-up

- quote string literals.
  In the hope it improves syntax-highlighting and readability.

- use lowercase, underscore-prefixed local var names.
  As a hint for scope, to help readability.

- prefer `pkg_search_module` (over `pkg_check_modules`).
  They are the same, but `pkg_search_module` stops searching
  at the first hit.

- more `IN LISTS` in `foreach()`.

- OtherTests.cmake: clear `CMAKE_EXTRA_INCLUDE_FILES` after use.

- add `PROJECT_LABEL` for http/client and unit test targets.

- sync `Find*` module comments and formatting.

- drop a few local variables.

- drop bogus `CARES_LIBRARIES` from comment.

- unquote numeric literal.

Follow-up to acbc6b703f6b0ee568d053f6f2565fbc107b5fd3 #14197
Closes #14388

15 months agowolfssl: avoid taking cached x509 store ref if sslctx already using it
Alex Snast [Wed, 7 Aug 2024 14:22:22 +0000 (17:22 +0300)] 
wolfssl: avoid taking cached x509 store ref if sslctx already using it

Closes #14442

15 months agotracing: allow CURL_DEBUG override
Stefan Eissing [Wed, 7 Aug 2024 10:54:58 +0000 (12:54 +0200)] 
tracing: allow CURL_DEBUG override

On debug builds, allow environment variable CURL_DEBUG to override any
setting done via '-v' or '--no-verbose'.

Closes #14436

15 months agohttp/2: simplify eos/blocked handling
Stefan Eissing [Wed, 7 Aug 2024 10:42:27 +0000 (12:42 +0200)] 
http/2: simplify eos/blocked handling

- rely on the new flush to handle blocked sends. No longer
  do simulated EAGAIN on (partially) blocked sends with their
  need to handle repeats.
- fix some debug handling CURL_SMALLREQSEND env var
- add some assertings in request.c for affirming we do it right
- enhance assertion output in test_16 for easier analysis

Closes #14435

15 months agocurl: fix --proxy-pinnedpubkey
Jan Venekamp [Wed, 7 Aug 2024 12:09:04 +0000 (14:09 +0200)] 
curl: fix --proxy-pinnedpubkey

This option was added in #2268 but never connected in
tool_operate.c.

Closes #14438

15 months agoverbose.md: polish, mostly remove back-ticks
Daniel Stenberg [Wed, 7 Aug 2024 13:44:15 +0000 (15:44 +0200)] 
verbose.md: polish, mostly remove back-ticks

To make the page render nicer as manpage and text-only.

Closes #14441