]> git.ipfire.org Git - thirdparty/curl.git/log
thirdparty/curl.git
11 months agopop3: add null pointer check
Daniel Stenberg [Tue, 6 May 2025 09:05:30 +0000 (11:05 +0200)] 
pop3: add null pointer check

Pointed out by Coverity. A precaution to catch internal errors.

Follow-up to 76d13c721bcd992e3e19f52

Closes #17255

11 months agoftp: fix bug in failed init
Stefan Eissing [Tue, 6 May 2025 10:59:28 +0000 (12:59 +0200)] 
ftp: fix bug in failed init

torture tests revealed that memory was not released correctly when FTP's
connection setup failed an allocation.

Follow-up from a2d90d4ba5076643b5af9978c4

Closes #17258

11 months agosmb: use easy handle/connection meta hash to keep structs
Stefan Eissing [Wed, 30 Apr 2025 12:00:35 +0000 (14:00 +0200)] 
smb: use easy handle/connection meta hash to keep structs

Keep easy/connection related protoocl structs in the meta hash instead
of the unions at request and connectdata.

Closes #17238

11 months agortmp: use connection meta for RTMP* instance
Stefan Eissing [Wed, 30 Apr 2025 10:59:01 +0000 (12:59 +0200)] 
rtmp: use connection meta for RTMP* instance

Keep RTMP* instance at connection meta hash.

Closes #17237

11 months agopop3: use meta hashes at easy handle and connection
Stefan Eissing [Wed, 30 Apr 2025 10:06:53 +0000 (12:06 +0200)] 
pop3: use meta hashes at easy handle and connection

Keep the pop3 related protocol information in the meta hashes at easy
handle and connection.

Move the struct definitions inside pop3.c

Closes #17236

11 months agoftp: use easy handle and connectin meta data for protocol structs
Stefan Eissing [Mon, 5 May 2025 11:31:14 +0000 (13:31 +0200)] 
ftp: use easy handle and connectin meta data for protocol structs

- remove data->req.p.ftp and store `struct FTP` as easy meta data
- place `struct ftp_conn` instance in connection meta data

Closes #17249

11 months agotftp: use connections meta hash
Stefan Eissing [Wed, 30 Apr 2025 09:08:02 +0000 (11:08 +0200)] 
tftp: use connections meta hash

Use connection meta hash for state struct instead of union pointer at
connectdata.

Closes #17235

11 months agoopenldap: use connection meta for context struct
Stefan Eissing [Tue, 29 Apr 2025 11:09:00 +0000 (13:09 +0200)] 
openldap: use connection meta for context struct

Remove member of conn->proto union.

Closes #17224

11 months agoECH: reference the OpenSSL ECH feature branch
sftcd [Mon, 5 May 2025 21:37:49 +0000 (22:37 +0100)] 
ECH: reference the OpenSSL ECH feature branch

rather than the defo-project fork.

Closes #17251

11 months agospacecheck.pl: check for non-ASCII chars, fix fallouts
Viktor Szakats [Sat, 3 May 2025 16:11:29 +0000 (18:11 +0200)] 
spacecheck.pl: check for non-ASCII chars, fix fallouts

Reported-by: James Fuller
Assisted-by: Dan Fandrich
Closes #17247

11 months agoRELEASE-NOTES: synced
Daniel Stenberg [Thu, 1 May 2025 20:27:18 +0000 (22:27 +0200)] 
RELEASE-NOTES: synced

11 months agoGHA: Update libressl-portable/portable to v4.1.0
renovate[bot] [Wed, 30 Apr 2025 19:42:34 +0000 (19:42 +0000)] 
GHA: Update libressl-portable/portable to v4.1.0

Closes #17234

11 months agomkhelp: fix to not generate a line-ending space in some cases
Viktor Szakats [Wed, 30 Apr 2025 16:32:02 +0000 (18:32 +0200)] 
mkhelp: fix to not generate a line-ending space in some cases

Fixing gcc-15:
```
bld/src/tool_hugehelp.c:11739:1: error: trailing whitespace [-Werror=trailing-whitespace=]
```
Ref: https://github.com/curl/curl/actions/runs/14758743743/job/41433794102?pr=17239#step:10:32

Closes #17240

11 months agoTLS: add CURLOPT_SSL_SIGNATURE_ALGORITHMS and --sigalgs
Andrei Florea [Wed, 2 Apr 2025 07:41:54 +0000 (09:41 +0200)] 
TLS: add CURLOPT_SSL_SIGNATURE_ALGORITHMS and --sigalgs

Fixes #12982
Closes #16964

11 months agoTODO: remove "nicer lacking perl message"
NeimadTL [Tue, 29 Apr 2025 22:32:23 +0000 (18:32 -0400)] 
TODO: remove "nicer lacking perl message"

The document has been updated by removing point 20.2 as it was done
some time ago.

Closes #17233

11 months agodocs/libcurl: fix type and prototype problems in examples
Daniel Stenberg [Tue, 29 Apr 2025 20:27:52 +0000 (22:27 +0200)] 
docs/libcurl: fix type and prototype problems in examples

Found by enabling the typechecks when compiling them with
verify-examples.pl

Closes #17231

11 months agoCURLOPT_XFERINFOFUNCTION.md: fix the callback return type in example
Daniel Stenberg [Tue, 29 Apr 2025 15:47:50 +0000 (17:47 +0200)] 
CURLOPT_XFERINFOFUNCTION.md: fix the callback return type in example

Fixes #17228
Reported-by: gkarracer on github
Closes #17229

11 months agoscripts: fix perl indentation, whitespace, semicolons
Viktor Szakats [Mon, 28 Apr 2025 12:57:16 +0000 (14:57 +0200)] 
scripts: fix perl indentation, whitespace, semicolons

Ref: #17116

Closes #17209

11 months agoGHA: drop vcpkg cache and most vcpkg logic with it
Viktor Szakats [Sat, 26 Apr 2025 16:37:39 +0000 (18:37 +0200)] 
GHA: drop vcpkg cache and most vcpkg logic with it

The unplanned dropping of the granular vcpkg binary cache indeed fell
into the cracks between Microsoft's various departments. The old method
is now official dropped, without replacement either on the vcpkg side or
the GitHub cache provider side.

Without a granular cache, vcpkg is impractical for builds larger than
a small dependency tree in CI, for performance reasons.

A granular cache is critical for CI use. Building dependencies is not
a goal of this CI, so a more desirable option would be pre-built binary
downloads. This would also allow keeping job timeouts low, which is
important for quick iteration in GHA when a flaky job requiring a manual
retry needs all other jobs to finish first. (GHA often disregards
step timeouts, which is another contributing factor here.)

Windows remains tested extensively with MSYS2, curl-for-win, and via
AppVeyor CI with MSVC + OpenSSL, and also in GHA via scaled back vcpkg
jobs that perform well without caching. What's lost is the recently
added Android OpenSSL build tests.

We may consider building/cachine important dependencies manually as in
GHA/linux-http3, and/or try integrating MSVC jobs with MSYS2 UCRT DLLs.

Ref: https://github.com/microsoft/vcpkg-tool/pull/1662
Ref: https://github.com/microsoft/vcpkg/issues/45073

Follow-up to cd0ec4784c1c0f873939f33ec1a73c8739f276b9 #17089
Follow-up to e3912f0f9fac06d37cd1ab93cef4f01f33809f0b #17086
Follow-up to 15fb1dc7f86ad1832e0386ec7d92542f44ee9c44 #17069

Closes #17200

11 months agobuild: enable gcc-15 picky warnings
Viktor Szakats [Fri, 25 Apr 2025 14:39:45 +0000 (16:39 +0200)] 
build: enable gcc-15 picky warnings

Closes #17199

11 months agoopenssl: set the cipher string before doing private cert
Corinna Brandt [Tue, 29 Apr 2025 13:31:17 +0000 (15:31 +0200)] 
openssl: set the cipher string before doing private cert

... as this allows a set string to affect how OpenSSL deals with the
private keys/certs.

Closes #17227

11 months agomqtt: use conn/easy meta hash
Stefan Eissing [Tue, 29 Apr 2025 08:49:46 +0000 (10:49 +0200)] 
mqtt: use conn/easy meta hash

Remove mqtt structs from the unions at connectdata and
easy handle requests. Use meta hash at easy/connnection.

Make mqtt structs private to mqtt.c

Closes #17221

11 months agomulti_ev: remove redundant check for data
Daniel Stenberg [Tue, 29 Apr 2025 12:03:10 +0000 (14:03 +0200)] 
multi_ev: remove redundant check for data

Pointed out by CodeSonar

Closes #17226

11 months agoRELEASE-NOTES: synced
Daniel Stenberg [Tue, 29 Apr 2025 12:07:59 +0000 (14:07 +0200)] 
RELEASE-NOTES: synced

11 months agometa data handling for easy/conn fixes
Stefan Eissing [Tue, 29 Apr 2025 08:53:34 +0000 (10:53 +0200)] 
meta data handling for easy/conn fixes

- return error when adding to hash fails
- do not free passed in data, as ownership is taken by call

Closes #17219

11 months agoVULN-DISCLOSURE-POLICY: use of weak algos
Daniel Stenberg [Tue, 29 Apr 2025 09:10:19 +0000 (11:10 +0200)] 
VULN-DISCLOSURE-POLICY: use of weak algos

Not necessarily security problems.

Closes #17220

11 months agoopenssl: first unload the provider, then free the context
Daniel Stenberg [Tue, 29 Apr 2025 09:52:47 +0000 (11:52 +0200)] 
openssl: first unload the provider, then free the context

Doing it in the reversed order causes bad problems inside OpenSSL.

Closes #17223

11 months agoetag-save.md: mention how using both options is a good idea
Daniel Stenberg [Tue, 29 Apr 2025 07:27:08 +0000 (09:27 +0200)] 
etag-save.md: mention how using both options is a good idea

Ref: https://curl.se/mail/archive-2025-04/0011.html

Closes #17217

11 months agongtcp2+openssl: enable test 17_10
Stefan Eissing [Tue, 29 Apr 2025 08:20:34 +0000 (10:20 +0200)] 
ngtcp2+openssl: enable test 17_10

TLS session reuse in QUIC is also implemented for ngtcp2+openssl. Enable
the test.

Closes #17218

11 months agoopenssl: enable builds for *both* engines and providers
Daniel Stenberg [Tue, 8 Apr 2025 09:45:17 +0000 (11:45 +0200)] 
openssl: enable builds for *both* engines and providers

OpenSSL3 can in fact have both enabled at once. Load the provider and
key/cert appropriately. When loading a provider, the user can now also
set an associated "property string".

Work on this was sponsored by Valantic.

Closes #17165

11 months agolib: provide a getaddrinfo wrapper 17134/head
Daniel Stenberg [Tue, 22 Apr 2025 12:51:49 +0000 (14:51 +0200)] 
lib: provide a getaddrinfo wrapper

This uses c-ares under the hood and supports the CURL_DNS_SERVER
environment variable - for debug builds only. The getaddrinfo()
replacement function is only used if CURL_DNS_SERVER is set to make a
debug build work more like a release version without the variable set.

'override-dns' is a new feature for the test suite when curl can be told
to use a dedicated DNS server, and test 2102 is the first to require
this.

Requires c-ares 1.26.0 or later.

Closes #17134

11 months agocfilters: remove assert
Daniel Stenberg [Mon, 28 Apr 2025 15:05:14 +0000 (17:05 +0200)] 
cfilters: remove assert

The OSS-fuzz probe reaches this, so it can apparently in run-time. There
is already a run-time handling of the situation.

Closes #17211

11 months agobuildinfo: move from tests/server/ to src/, rename to curlinfo
Daniel Stenberg [Sun, 27 Apr 2025 15:35:20 +0000 (17:35 +0200)] 
buildinfo: move from tests/server/ to src/, rename to curlinfo

Since a16485a42ea5dabe6c, the test servers build with a different set of
options than the tool/lib - for example a different CURLDEBUG. To make
buildinfo better reflect the curl build, move it to src/ and build it
here using the local CURLDEBUG. Renamed to curlinfo to not get confused
with buildinfo.txt

I chose src/ and not lib/ because the file also uses tool-specific headers.

Assisted-by: Viktor Szakats
Closes #17187

11 months agoprogress: fix integer overflow check
Jay Satiro [Mon, 28 Apr 2025 17:35:44 +0000 (13:35 -0400)] 
progress: fix integer overflow check

- Fix logic typo.

Prior to this change the overflow check was reversed, meaning it did
not stop an overflow condition and also if there wasn't an overflow it
erroneously set the total expected transfer size to the maximum value.

Follow-up to 69ce9a7f from earlier today.

Closes https://github.com/curl/curl/pull/17213

11 months agopull_request_template.md: remove again
Daniel Stenberg [Mon, 28 Apr 2025 15:07:13 +0000 (17:07 +0200)] 
pull_request_template.md: remove again

It was just super annoying and bad

Closes #17212

11 months agoprogress: avoid integer overflow when gathering total transfer size
Daniel Stenberg [Mon, 28 Apr 2025 11:41:20 +0000 (13:41 +0200)] 
progress: avoid integer overflow when gathering total transfer size

Reported by OSS-fuzz

Closes #17207

11 months agosmb: avoid integer overflow on weird input date
Daniel Stenberg [Mon, 28 Apr 2025 11:35:02 +0000 (13:35 +0200)] 
smb: avoid integer overflow on weird input date

Found by OSS-fuzz

Closes #17206

11 months agopull_request_template.md: REUSE compliance
Daniel Stenberg [Mon, 28 Apr 2025 11:44:15 +0000 (13:44 +0200)] 
pull_request_template.md: REUSE compliance

Plus move it to .github

Closes #17208

11 months agopull_request_template.md: provide basic instructions
Daniel Stenberg [Mon, 28 Apr 2025 08:28:55 +0000 (10:28 +0200)] 
pull_request_template.md: provide basic instructions

This should appear on GitHub for pull-requests and asks users to submit
their PRs as draft to begin with, to help us know when PRs are ready.

Closes #17205

11 months agows: store protocol context as connection meta data
Stefan Eissing [Wed, 23 Apr 2025 08:34:12 +0000 (10:34 +0200)] 
ws: store protocol context as connection meta data

Eliminates union member on struct connectdata. Sample of how
other procotols can handle their connection related data.

This avoids potention mix-ups of the `proto` union of a
connection with other protocol instances.

Removed ws "disconnect" callback as meta data is automatically
destroyed when a connection is destroyed.

Closes #17146

11 months agoHTTPSRR.md: clarify somewhat
Daniel Stenberg [Mon, 28 Apr 2025 06:30:16 +0000 (08:30 +0200)] 
HTTPSRR.md: clarify somewhat

Closes #17204

11 months agotests: add basic ECH tests
sftcd [Fri, 25 Apr 2025 17:26:04 +0000 (18:26 +0100)] 
tests: add basic ECH tests

Test 4000 and 4001

Closes #17192

11 months agocmake: extend integration tests
Viktor Szakats [Sun, 27 Apr 2025 10:26:41 +0000 (12:26 +0200)] 
cmake: extend integration tests

- GHA: add cmake integration tests for Windows.
- make them run faster with prefill, unity, Ninja, omitting curl tool.
- also test static libcurl.
- add old-cmake support with auto-detection.
- auto-detect Ninja.
- run consumer test apps to see if they work.
- add support for Windows.
- make it more verbose.
- re-add `ExternalProject` cmake consumer test. It's broken.
- tidy up terminology.

Cherry-picked from #16973
Closes #17203

11 months agocurl_osslq: remove a leftover debug fprintf() call
Daniel Stenberg [Sat, 26 Apr 2025 21:18:43 +0000 (23:18 +0200)] 
curl_osslq: remove a leftover debug fprintf() call

Reported-by: xiadnoring on github
Fixes #17198
Closes #17202

11 months agoGHA: update actions/download-artifact digest to d3f86a1
renovate[bot] [Thu, 24 Apr 2025 17:47:17 +0000 (17:47 +0000)] 
GHA: update actions/download-artifact digest to d3f86a1

Closes #17174

11 months agoGHA: Update awslabs/aws-lc to v1.50.0
renovate[bot] [Fri, 25 Apr 2025 15:41:09 +0000 (15:41 +0000)] 
GHA: Update awslabs/aws-lc to v1.50.0

Closes #17191

11 months agoRELEASE-PROCEDURE.md: release candidate git tagging explained
Daniel Stenberg [Thu, 24 Apr 2025 20:57:51 +0000 (22:57 +0200)] 
RELEASE-PROCEDURE.md: release candidate git tagging explained

To help anyone wanting to build/reproduce release candidates, this is
the set git tag naming scheme to use. Similar to, but different, than
the "normal" release tags to not be possible to mixup.

Closes #17177

11 months agows: fix the header replace check
Daniel Stenberg [Fri, 25 Apr 2025 21:36:05 +0000 (23:36 +0200)] 
ws: fix the header replace check

It passed in the wrong header length to the check function, which made
it do duplicated headers in cases where the user provides its own set.

Reported-by: sbernatsky on github
Fixes #17170
Closes #17194
Closes #16178

11 months agoGHA/windows: add gcc-15 job
Viktor Szakats [Fri, 25 Apr 2025 14:32:27 +0000 (16:32 +0200)] 
GHA/windows: add gcc-15 job

It's taking 2.5 minutes and planned for removal when MSYS2 gcc-15 gets
deployed in CI.

15.0.1 builds significantly faster than 9.5.0. (But still slower than
7.3.0 and 6.4.0)

Ref: https://github.com/msys2/MINGW-packages/commit/f59921184b35858d4ceb91679578de0d62475cbf
Ref: https://github.com/msys2/MINGW-packages/pull/24037

Closes #17190

11 months agocmake: honor individual picky option overrides found in `CMAKE_C_FLAGS`
Viktor Szakats [Sat, 26 Apr 2025 07:34:55 +0000 (09:34 +0200)] 
cmake: honor individual picky option overrides found in `CMAKE_C_FLAGS`

Also to sync up with similar `./configure` feature via
`CURL_ADD_COMPILER_WARNINGS()`.

Example: `-DCMAKE_C_FLAGS=-Wno-xor-used-as-pow`

It may be useful as a workaround if a specific build combination hits
a picky warning within curl's source code. If such happens, we do
appreciate a report to fix it in curl itself.

Closes #17197

11 months agobuild: enable gcc-12/13+, clang-10+ picky warnings
Viktor Szakats [Sat, 26 Apr 2025 07:28:28 +0000 (09:28 +0200)] 
build: enable gcc-12/13+, clang-10+ picky warnings

Cherry-picked from #17190
Closes #17196

11 months agocmake: use `LIB_NAME` in `curl-config.cmake.in`
Viktor Szakats [Sat, 26 Apr 2025 07:17:32 +0000 (09:17 +0200)] 
cmake: use `LIB_NAME` in `curl-config.cmake.in`

Cherry-picked from #16973
Closes #17195

11 months agoGHA/linux: formatting nit [ci skip]
Viktor Szakats [Wed, 23 Apr 2025 18:12:42 +0000 (20:12 +0200)] 
GHA/linux: formatting nit [ci skip]

Cherry-picked from #16973

11 months agourlapi: redirecting to "" is considered fine
Daniel Stenberg [Fri, 25 Apr 2025 14:22:24 +0000 (16:22 +0200)] 
urlapi: redirecting to "" is considered fine

If the CURLU handle already holds a proper URL, otherwise it is an
error.

Verified by test 1560

Fixes #17188
Reported-by: zopsicle on github
Closes #17189

11 months agoGHA: update wolfSSL/wolfssl to v5.8.0
renovate[bot] [Fri, 25 Apr 2025 07:33:49 +0000 (07:33 +0000)] 
GHA: update wolfSSL/wolfssl to v5.8.0

Closes #17182

11 months agoGHA/macos: fix typo in comment [ci skip]
Viktor Szakats [Fri, 25 Apr 2025 19:08:59 +0000 (21:08 +0200)] 
GHA/macos: fix typo in comment [ci skip]

11 months agosectransp: fix building for macOS Sierra and older
Viktor Szakats [Fri, 25 Apr 2025 16:26:10 +0000 (18:26 +0200)] 
sectransp: fix building for macOS Sierra and older

Reported-by: Eric Knibbe
Bug: https://github.com/curl/curl/pull/16581#issuecomment-2830837500
Regression from 2d94439eaa8da4fe11f99872a8b44087f74f88b0 #16581

Closes #17193

11 months agotool_paramhlp: avoid integer overflow in secs2ms()
Daniel Stenberg [Fri, 25 Apr 2025 10:05:52 +0000 (12:05 +0200)] 
tool_paramhlp: avoid integer overflow in secs2ms()

The previous approach was wrong and could lead to wrong timeout values
getting used.

Reported-by: bsr13 on hackerone
Closes #17184

11 months agocf-socket: fix FTP accept connect
Andreas Westin [Thu, 17 Apr 2025 08:46:35 +0000 (10:46 +0200)] 
cf-socket: fix FTP accept connect

When cf_tcp_accept_connect() is called and it sets up a connection it
never indicates to the caller that the it's done.

Closes #17186

11 months agocmake: use `CMAKE_COMPILE_WARNING_AS_ERROR` if available
Viktor Szakats [Fri, 25 Apr 2025 08:52:39 +0000 (10:52 +0200)] 
cmake: use `CMAKE_COMPILE_WARNING_AS_ERROR` if available

It's available in CMake >= 3.24.

Ref: https://cmake.org/cmake/help/latest/variable/CMAKE_COMPILE_WARNING_AS_ERROR.html

Closes #17183

11 months agocmake: stop deleting `-W<n>` from `CMAKE_C_FLAGS` (MSVC)
Viktor Szakats [Thu, 24 Apr 2025 23:45:23 +0000 (01:45 +0200)] 
cmake: stop deleting `-W<n>` from `CMAKE_C_FLAGS` (MSVC)

1. `CMAKE_C_FLAGS` may apply to other projects, and deleting/altering it
   may be unexpected.

2. We pass `-W4`/`-Wall` internally now, which do override custom
   `-W<n>` options in all supported MSVC versions.
   (as tested with Visual Studio generators)
   Ref: https://ci.appveyor.com/project/curlorg/curl/builds/51945416

Follow-up to e86542038dda88dadf8959584e803895f979310c #17047
Ref: 866e02935deb28373130116dac578d84e057a03e #1711

Closes #17179

11 months agoGHA: skip updating man-db for faster installs (Ubuntu)
Viktor Szakats [Fri, 25 Apr 2025 07:19:31 +0000 (09:19 +0200)] 
GHA: skip updating man-db for faster installs (Ubuntu)

This step could take from 5 seconds to 5 minutes, sometimes making it
run out of its time slot. It affected 60 CI jobs.

Saving an estimated minimum of 5 minutes per CI run.

Also fixing:
```
Fri, 25 Apr 2025 06:19:14 GMT
Processing triggers for man-db (2.12.0-4build2) ...
Fri, 25 Apr 2025 06:23:40 GMT
Running kernel seems to be up-to-date.
[...]
Error: The action 'install packages' has timed out after 5 minutes.
```
Ref: https://github.com/curl/curl/actions/runs/14658212268/job/41136971525?pr=17180#step:2:169

Closes #17181

11 months agoRELEASE-NOTES: synced
Daniel Stenberg [Fri, 25 Apr 2025 07:49:59 +0000 (09:49 +0200)] 
RELEASE-NOTES: synced

11 months agotests/buildinfo: former "disabled" now provides more info
Daniel Stenberg [Fri, 25 Apr 2025 06:16:13 +0000 (08:16 +0200)] 
tests/buildinfo: former "disabled" now provides more info

This tool now contains ON/OFF information about features in the build.
This way, runtests gets both positive and negative feature presence with
this. Allows for more flexibility and avoids having to duplicate the
names.

Closes #17180

11 months agoaws-sigv4: allow a blank string
Daniel Stenberg [Thu, 24 Apr 2025 21:39:08 +0000 (23:39 +0200)] 
aws-sigv4: allow a blank string

make sure a zero length sigv4 gets the default value

Reported-by: Arian van Putten
Fixes #17176
Closes #17178

11 months agobuild: tidy up internal feature detection variables for wolfSSL
Viktor Szakats [Thu, 17 Apr 2025 21:47:37 +0000 (23:47 +0200)] 
build: tidy up internal feature detection variables for wolfSSL

Sync them with the function name they detect, and sync them between
cmake and autotools.

- rename `HAVE_WOLFSSL_BIO` to `HAVE_WOLFSSL_BIO_NEW`.
- rename `HAVE_WOLFSSL_FULL_BIO` to `HAVE_WOLFSSL_BIO_SET_SHUTDOWN`.
- autotools: rename `WOLFSSL_NTLM` to `HAVE_WOLFSSL_DES_ECB_ENCRYPT`
  (to sync with cmake).
- autotools: rename `WOLFSSL_BIO` to `HAVE_WOLFSSL_BIO_NEW`
  (to sync with cmake).
- autotools: simplify `HAVE_WOLFSSL_DES_ECB_ENCRYPT` detection.

Cherry-picked from #17082

Closes #17175

11 months agoGHA/windows: limit jobs to 15 minutes
Viktor Szakats [Thu, 24 Apr 2025 17:12:42 +0000 (19:12 +0200)] 
GHA/windows: limit jobs to 15 minutes

They typically finish (well) within 10 minutes.

A notable exception was vcpkg jobs when a rebuild was triggered.
With caching lost and reducing them to short builds, this is not
an issue at the moment.

The advantage of shorter timeouts is hung/crashed jobs giving back
control earlier for a manual retry.

Closes #17173

11 months agoautotools: detect `wolfSSL_set_quic_use_legacy_code` like cmake does
Viktor Szakats [Thu, 17 Apr 2025 14:27:53 +0000 (16:27 +0200)] 
autotools: detect `wolfSSL_set_quic_use_legacy_code` like cmake does

Cherry-picked from #17082

Closes #17172

11 months agocmake: tidy up and document feature detections in dependencies
Viktor Szakats [Thu, 17 Apr 2025 08:07:30 +0000 (10:07 +0200)] 
cmake: tidy up and document feature detections in dependencies

- update text on dependency feature detection variables, and move it
  to its own section in `docs/INSTALL-CMAKE.md`.
  Ref: #17032 (Discussion)

- tidy up descriptions/comments, alpha-sort.

- move comment to its own section in `docs/INSTALL-CMAKE.md`.

- split `HAVE_SSL_SET_QUIC_USE_LEGACY_CODEPOINT` to distinct names for
  each TLS backend API. To make the names more stable and to sync them
  with autotools.
  Follow-up to 07cc50f8ebc6ad4c2ad23642ca727d79dab8855e #17018
  Follow-up to 342a654ef32f6c4ff284d8680f85db6136534699 #15873

- drop redundant condition while detecting QUICTLS API.
  Follow-up to 07cc50f8ebc6ad4c2ad23642ca727d79dab8855e #17018

- add config-comparison exception for `HAVE_SSL_SET_QUIC_TLS_CBS`.
  Follow-up to 5eefdd71a394d135c0ffb56fb8ec117c87dbe4f0 #17027

- detect `wolfSSL_get_peer_certificate` like autotools does.

- detect `wolfSSL_UseALPN` like autotools does.

Closes #17082

11 months agoc-ares: really lazy init channel
Stefan Eissing [Thu, 24 Apr 2025 10:18:33 +0000 (12:18 +0200)] 
c-ares: really lazy init channel

Only initialize the c-ares channel when we start resolving and not
alreads when the application sets `CURLOPT_DNS_SERVERS` and friends.

Creating an ares channel takes considerable time and when we have the
DNS information for a transfer already cached, we do not need it.

Closes #17167

11 months agombedtls: TLS 1.3 is max when mbedtls has 1.3 support
Daniel Stenberg [Tue, 22 Apr 2025 14:05:42 +0000 (16:05 +0200)] 
mbedtls: TLS 1.3 is max when mbedtls has 1.3 support

Co-authored-by: Viktor Szakats
Reported-by: kkalganov on github
Fixes #17048
Closes #17137

11 months agotypecheck-gcc.h: fix the typechecks
Daniel Stenberg [Tue, 22 Apr 2025 20:20:27 +0000 (22:20 +0200)] 
typecheck-gcc.h: fix the typechecks

Refreshed, cleaned up, improved and now checks *all* options.

This must have stopped working at some point. gcc-14 least shows these
warnings with this change, not without.

Add test 745 to verify that all options listed in curl.h is also checked
by the typechecker.

This improved checker found almost 30 mistakes in the curl git
repository.

Closes #17143

11 months agocmake: fix option() and mark_as_advanced() mixed order
Sergey [Thu, 24 Apr 2025 01:45:17 +0000 (18:45 -0700)] 
cmake: fix option() and mark_as_advanced() mixed order

Closes #17163

11 months agocmake: install shell completions for cross-builds
Viktor Szakats [Wed, 23 Apr 2025 08:26:38 +0000 (10:26 +0200)] 
cmake: install shell completions for cross-builds

Also:
- omit auto-detecting `CURL_COMPLETION_FISH_DIR` via `pkg-config`
  for cross-builds and when `CMAKE_INSTALL_PREFIX` is set.
- flatten nested `if`s.

Note:
On macOS with Homebrew, `pkg-config --variable completionsdir fish`
returns the version-specific Cellar path instead of the permanent path
`/opt/homebrew/share/fish/vendor_completions.d/`. This mimics what
autotools does, but may need further fixing, possibly upstream.
https://github.com/Homebrew/homebrew-core/blob/9c13e62b009b8e814fda180e0fcc5096318daf31/Formula/f/fish.rb
https://github.com/fish-shell/fish-shell/blob/ce631fd2fb1f5b63f5f0f1b4041a30dfad823d22/cmake/Install.cmake#L15-L21

Ref: #17147
Ref: 51170b52d15256d4aaf74ed6eea9a9297f5d595c #17159
Bug: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1103938

Closes #17145

11 months agoopenssl-quic: Add missing include
Jochen Sprickerhof [Wed, 23 Apr 2025 13:54:21 +0000 (15:54 +0200)] 
openssl-quic: Add missing include

uint_hash, Curl_uint_hash_init and others are used in the file.

Regression from 657aae79c0

Closes #17156

11 months agomulti: init_do(): check result
Stefan Eissing [Wed, 23 Apr 2025 09:24:45 +0000 (11:24 +0200)] 
multi: init_do(): check result

Calls to `Curl_init_do()` did not check on result and missed failures to
properly and completely initialize a transfer request.

The main cause of such an init failure is the need to rewind the
READFUNCTION without a SEEKFUNCTION registered. Check the failure to
"rewind" the upload data immediately make test cases 1576 and friends
fail.

Reported-by: Travis Lane
Fixes #17139
Closes #17150

11 months agoasyn-base: remove the HTTPSRR_WORKS define
Daniel Stenberg [Wed, 23 Apr 2025 21:43:38 +0000 (23:43 +0200)] 
asyn-base: remove the HTTPSRR_WORKS define

It is done in asyn-ares.c since 179aeeaf228e

Closes #17161

11 months agolib/src/docs/test: improve curl_easy_setopt() calls
Daniel Stenberg [Wed, 23 Apr 2025 21:13:29 +0000 (23:13 +0200)] 
lib/src/docs/test: improve curl_easy_setopt() calls

Fix invokes where the argument was not the correct type.

Closes #17160

11 months agoares: add definition for HTTPSRR_WORKS
Niall [Wed, 23 Apr 2025 13:57:37 +0000 (14:57 +0100)] 
ares: add definition for HTTPSRR_WORKS

Closes #17157

11 months agolibcurl-tutorial.md: fix read callback explanation
Daniel Stenberg [Wed, 23 Apr 2025 12:36:02 +0000 (14:36 +0200)] 
libcurl-tutorial.md: fix read callback explanation

Fixes #17138
Reported-by: Thomas Klausner
Closes #17154

11 months agoautotools: install shell completion files on cross build
Helmut Grohne [Wed, 23 Apr 2025 08:54:28 +0000 (09:54 +0100)] 
autotools: install shell completion files on cross build

 Before 8.13.0, it was not possible to generate them as it required
 calling the compiled binary, but this has been fixed.

Co-authored-by: Samuel Henrique <samueloph@debian.org>
Closes #17159

11 months agoGHA/windows: fixup MSYS2 downgrade step
Viktor Szakats [Wed, 23 Apr 2025 17:30:39 +0000 (19:30 +0200)] 
GHA/windows: fixup MSYS2 downgrade step

Fix step failing when 3.6 is detected.
Ref: https://github.com/curl/curl/actions/runs/14620854081/job/41020237740?pr=17157#step:14:8

Follow-up to 20d9d3bcce5efe47ab14e5c9233c2889515fada1 #17151
Follow-up to b06c12b7248592cf001e621d7cd8dc78a827212b #16574

Closes #17158

11 months agoGHA: use more Ninja
Viktor Szakats [Wed, 23 Apr 2025 12:13:55 +0000 (14:13 +0200)] 
GHA: use more Ninja

Use it for AmigaOS, Android, dl-mingw 7.3.0 and 6.4.0 Windows builds.

Also drop explicit ninja installs.

dl-mingw:
Before:
7.3.0: https://github.com/curl/curl/actions/runs/14617346216/job/41008536465
6.4.0: https://github.com/curl/curl/actions/runs/14617346216/job/41008540878
After:
7.3.0: https://github.com/curl/curl/actions/runs/14617983032/job/41010584040?pr=17153
6.4.0: https://github.com/curl/curl/actions/runs/14617983032/job/41010586490?pr=17153

Follow-up to a36655224356c10d70bcc566ce60f82af795ca90 #17115
Ref: https://github.com/actions/runner-images/issues/11391

Closes #17153

11 months agoGHA/windows: apply MSYS2 runtime downgrades to v3.5.x, leave v3.6.x as-is
Viktor Szakats [Wed, 23 Apr 2025 10:12:02 +0000 (12:12 +0200)] 
GHA/windows: apply MSYS2 runtime downgrades to v3.5.x, leave v3.6.x as-is

windows-runners 20250420.1.0 come with msys2-runtime 3.6.x. It has
the perf regression issue fixed, so stop downgrading it.

This makes CI jobs settle on this version when supplied by
the runner image or the msys2/setup-msys2 action:
MINGW64_NT-10.0-20348 fv-az980-636 3.6.1-0cfedd4f.x86_64 2025-04-12 01:44 UTC x86_64 Msys

With 3.6.1, we've seen issues launching `perl.exe` before this patch:
https://github.com/curl/curl/discussions/14854#discussioncomment-12908214
https://github.com/curl/curl/discussions/14854#discussioncomment-12921007

Follow-up to b06c12b7248592cf001e621d7cd8dc78a827212b #16574
Closes #17151

11 months agocmake: fix `fish` install directory detection via `pkg-config`
Viktor Szakats [Wed, 23 Apr 2025 08:52:06 +0000 (10:52 +0200)] 
cmake: fix `fish` install directory detection via `pkg-config`

Follow-up to c8b0f0c9ad78eafc6c8f0005113de346ee797c21 #16833

Closes #17147

11 months agodoh: make sure CURLOPT_PROTOCOLS is set a with a "long" arg
Daniel Stenberg [Wed, 23 Apr 2025 06:19:56 +0000 (08:19 +0200)] 
doh: make sure CURLOPT_PROTOCOLS is set a with a "long" arg

Closes #17142

11 months agoruntests: fix indentation [ci skip]
Viktor Szakats [Tue, 22 Apr 2025 19:10:39 +0000 (21:10 +0200)] 
runtests: fix indentation [ci skip]

Cherry-picked from #16840

11 months agocmake: avoid 'target is imported but not globally visible' when consuming libcurl...
Viktor Szakats [Tue, 22 Apr 2025 08:36:16 +0000 (10:36 +0200)] 
cmake: avoid 'target is imported but not globally visible' when consuming libcurl with old cmake

Fixes:
```
CMake Error at bld-curl/_pkg/lib/cmake/CURL/CURLConfig.cmake:62 (add_library):
  add_library cannot create ALIAS target "CURL::libcurl" because target
  "CURL::libcurl_shared" is imported but not globally visible.
Call Stack (most recent call first):
  CMakeLists.txt:39 (find_package)
```

tests/cmake reproducer (requires #16973):
```shell
export CMAKE_CONSUMER=/path/to/CMake-3.12.0/bin/cmake
./test.sh find_package
```

I don't understand what this error says, why it happens in certain CMake
versions, and why a workaround is necessary for what seems like
a standard export/consume configuration. This patch is based on internet
suggestions and other projects ending up with this workaround.

Cherry-picked from #16973
Closes #17140

11 months agoopenssl-quic: avoid potential `-Wnull-dereference`, add assert
Viktor Szakats [Sun, 20 Apr 2025 08:13:52 +0000 (10:13 +0200)] 
openssl-quic: avoid potential `-Wnull-dereference`, add assert

Seen with curl-for-win, OpenSSL QUIC, gcc 14.2.0, cmake unity mode.

Silences:
```
In file included from _x86-win-ucrt-bld/lib/CMakeFiles/libcurl_object.dir/Unity/unity_5_c.c:55:
In function 'cf_osslq_check_and_unblock',
    inlined from 'cf_progress_egress' at lib/vquic/curl_osslq.c:1730:12:
lib/vquic/curl_osslq.c:1581:11: error: potential null pointer dereference [-Werror=null-dereference]
 1581 |           nghttp3_conn_unblock_stream(ctx->h3.conn, stream->s.id);
      |           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
lib/vquic/curl_osslq.c:1582:34: error: potential null pointer dereference [-Werror=null-dereference]
 1582 |           stream->s.send_blocked = FALSE;
      |                                  ^
```

Co-authored-by: Daniel Stenberg
Co-authored-by: Stefan Eissing
Closes #17107

11 months agoGHA: always use Ninja on macos runners
Viktor Szakats [Mon, 21 Apr 2025 02:00:36 +0000 (04:00 +0200)] 
GHA: always use Ninja on macos runners

It's installed by default on the macos runners now.

Closes #17115

11 months agoGHA/windows: bump cygwin/cygwin-install-action
dependabot[bot] [Mon, 21 Apr 2025 15:50:58 +0000 (15:50 +0000)] 
GHA/windows: bump cygwin/cygwin-install-action

to https://github.com/cygwin/cygwin-install-action/commit/f2009323764960f80959895c7bc3bb30210afe4d

Closes #17118

11 months agolib: add meta_hash to connection, eliminate hash_offt
Stefan Eissing [Fri, 18 Apr 2025 09:03:29 +0000 (11:03 +0200)] 
lib: add meta_hash to connection, eliminate hash_offt

With a meta_hash at each connection (similar to easy handle, let
multi_ev.c store its pollsets as meta data, no longer needing its own
hashes.

This eliminates the last use of Curl_hash_offt. Remove it.

Closes #17095

11 months agohttp: fix HTTP/2 handling of TE request header using "trailers"
Stefan Eissing [Tue, 22 Apr 2025 10:53:22 +0000 (12:53 +0200)] 
http: fix HTTP/2 handling of TE request header using "trailers"

A "TE" request header is allowed in HTTP/2 when it only carries the
"trailers" value. RFC 9113 ch. 8.2.2. Check client supplied TE values
for the "trailers" token and only pass that one in a HTTP/2 request.

Add test_01_17 to verify.

Fixes #17122
Reported-by: epicmkirzinger on github
Closes #17128

11 months agovquic: unblame netbsd
Stefan Eissing [Tue, 22 Apr 2025 12:23:31 +0000 (14:23 +0200)] 
vquic: unblame netbsd

it was innocent.

Follow-up to 4872dafd8075fab781b7a3ac

Closes #17133

11 months agoconnect: shutdown timer fix
Stefan Eissing [Tue, 22 Apr 2025 13:23:36 +0000 (15:23 +0200)] 
connect: shutdown timer fix

Fix a bug in timeout handling for connection shutdowns that led to
default timeout of 2 seconds not being in effect.

Only set the shutdown timeout expiry when operating on a non-admin
transfers. Admin handles are only temproarily tied to a connection.

Fixes #17130
Reported-by: Rasmus Melchior Jacobsen
Closes #17135

11 months agocares: fix missing lazy init for CURLOPT_DNS_SERVERS
Stefan Eissing [Tue, 22 Apr 2025 09:02:41 +0000 (11:02 +0200)] 
cares: fix missing lazy init for CURLOPT_DNS_SERVERS

When setting option CURLOPT_DNS_SERVERS, the ares channel was not
properly initialized and the setting failed.

Fixes #17119
Reported-by: calvin2021y on github
Closes #17127

11 months agovquic: init for every call to recvmsg
Stefan Eissing [Tue, 22 Apr 2025 11:12:24 +0000 (13:12 +0200)] 
vquic: init for every call to recvmsg

When calling recvmsg(), always set up the msg structures for
each call as there are OS implemenations that change members
of msg.

Fixes #17120
Reported-by: Harry Sintonen
Closes #17131

11 months agovquic: consistent name for the stream struct across backends
Daniel Stenberg [Sun, 20 Apr 2025 21:24:52 +0000 (23:24 +0200)] 
vquic: consistent name for the stream struct across backends

Now known as "struct h3_stream_ctx" in all four backends.

Also as a bonus: a single definition of the H3_STREAM_CTX macro

Closes #17113

11 months agocurl/curlver.h: next version is 8.14.0
Daniel Stenberg [Tue, 22 Apr 2025 07:44:34 +0000 (09:44 +0200)] 
curl/curlver.h: next version is 8.14.0

11 months agoRELEASE-NOTES: synced
Daniel Stenberg [Tue, 22 Apr 2025 07:43:55 +0000 (09:43 +0200)] 
RELEASE-NOTES: synced