]> git.ipfire.org Git - thirdparty/curl.git/log
thirdparty/curl.git
12 months agoTODO: consider OCSP stapling by default
Daniel Stenberg [Fri, 8 Nov 2024 06:58:48 +0000 (07:58 +0100)] 
TODO: consider OCSP stapling by default

Suggested-by: Nicolas F.
Closes #15483
Closes #15521

12 months agovtls: fix compile warning when ALPN is not available
Ben Greear [Thu, 7 Nov 2024 17:08:55 +0000 (18:08 +0100)] 
vtls: fix compile warning when ALPN is not available

Ref: https://curl.se/mail/lib-2024-11/0013.html

Closes #15515

12 months agocmdline/ech.md: formatting cleanups
Daniel Stenberg [Thu, 7 Nov 2024 22:21:14 +0000 (23:21 +0100)] 
cmdline/ech.md: formatting cleanups

Reported-by: Samuel Henrique
Fixes #15506
Closes #15517

12 months agonetrc: support large file, longer lines, longer tokens
Daniel Stenberg [Thu, 7 Nov 2024 16:03:54 +0000 (17:03 +0100)] 
netrc: support large file, longer lines, longer tokens

Regression from 3b43a05e000aa8f6 (shipped in 8.11.0)

Reported-by: Moritz
Fixes #15513
Closes #15514

12 months agosetopt: fix CURLOPT_HTTP_CONTENT_DECODING
Jesus Malo Poyatos [Thu, 7 Nov 2024 13:00:53 +0000 (14:00 +0100)] 
setopt: fix CURLOPT_HTTP_CONTENT_DECODING

Regression from 30da1f5974d34841b30c4f (shipped in 8.11.0)

Fixes #15511
Closes #15510

12 months agoRELEASE-NOTES: synced
Daniel Stenberg [Thu, 7 Nov 2024 12:16:47 +0000 (13:16 +0100)] 
RELEASE-NOTES: synced

Bump to 8.11.1

12 months agombedtls: call psa_crypt_init() in global init
Stefan Eissing [Thu, 7 Nov 2024 09:26:03 +0000 (10:26 +0100)] 
mbedtls: call psa_crypt_init() in global init

Run mbedtls' psa_crypt_init() in the general global init, optionally
protected by mbedtls locks when available.

CI: when building mbedtls, enabled thread safety

Reported-by: wxiaoguang on github
Fixes #15500
Closes #15505

12 months agoduphandle: also init netrc
Daniel Stenberg [Thu, 7 Nov 2024 07:52:38 +0000 (08:52 +0100)] 
duphandle: also init netrc

The netrc init was only done in the Curl_open, meaning that a duplicated
handle would not get inited properly.

Added test 2309 to verify. It does netrc auth with a duplicated handle.

Regression from 3b43a05e000aa8f65bda513f733a

Reported-by: tranzystorekk on github
Fixes #15496
Closes #15503

12 months agocookie: treat cookie name case sensitively
Daniel Stenberg [Wed, 6 Nov 2024 10:26:25 +0000 (11:26 +0100)] 
cookie: treat cookie name case sensitively

Extend test 31 to verify

Reported-by: delogicsreal on github
Fixes #15492
Closes #15493

12 months agoRELEASE-NOTES: synced curl-8_11_0
Daniel Stenberg [Wed, 6 Nov 2024 07:03:58 +0000 (08:03 +0100)] 
RELEASE-NOTES: synced

Release time

12 months agoTHANKS: contributors from the 8.11.0 release
Daniel Stenberg [Wed, 6 Nov 2024 07:03:57 +0000 (08:03 +0100)] 
THANKS: contributors from the 8.11.0 release

12 months agoGHA/non-native: fix installing OpenLDAP on OpenBSD
Viktor Szakats [Wed, 6 Nov 2024 01:01:05 +0000 (02:01 +0100)] 
GHA/non-native: fix installing OpenLDAP on OpenBSD

Also:
- drop failing manual install of perl. It's there by default now.
- add link to OpenBSD package management FAQ page.

Closes #15491

12 months agoGHA/macos: drop WebSockets from job names
Viktor Szakats [Wed, 6 Nov 2024 00:43:08 +0000 (01:43 +0100)] 
GHA/macos: drop WebSockets from job names

It's enabled in all jobs by default now.

Follow-up to cd63629733895c273b5ece82483d37114355f2ce #15076

12 months agoRELEASE-NOTES: update cmake LDAP-related entry [ci skip]
Viktor Szakats [Tue, 5 Nov 2024 20:17:26 +0000 (21:17 +0100)] 
RELEASE-NOTES: update cmake LDAP-related entry [ci skip]

Reported-by: Kai Pastor
Bug: https://github.com/curl/curl/pull/15255#issuecomment-2457558219
Follow-up to 2c90f7f69e117543a9f0102bb89112125f0032bd #15255

12 months agombedtls: remove failf() use from mbedtls_random
Daniel Stenberg [Tue, 5 Nov 2024 10:52:38 +0000 (11:52 +0100)] 
mbedtls: remove failf() use from mbedtls_random

Since data can be NULL in here, calling failf() can be bad. This should
also be a terribly rare error so the lack of error message for this
should be manageable.

Reported-by: wxiaoguang on github
Fixes #15485
Closes #15486

12 months agowolfssl: coexist with openssl, further work
Stefan Eissing [Mon, 4 Nov 2024 11:26:47 +0000 (12:26 +0100)] 
wolfssl: coexist with openssl, further work

Build wolfSSL master with

./configure --prefix=/path --enable-ip-alt-name --enable-quic
--enable-earlydata --enable-psk --enable-opensslcoexist

and configure curl with openssl + wolfssl. Normal tests run.

pytest session resumption fails, as wolfssl does not handle the
new_session callback without opensslextra right now.

Closes #15481

12 months agoRELEASE-NOTES: synced
Daniel Stenberg [Mon, 4 Nov 2024 09:40:42 +0000 (10:40 +0100)] 
RELEASE-NOTES: synced

12 months agowolfssl: no more use of the OpenSSL API
Daniel Stenberg [Mon, 4 Nov 2024 07:35:43 +0000 (08:35 +0100)] 
wolfssl: no more use of the OpenSSL API

Allows curl to build with a wolfSSL built without its OpenSSL API.

It should allow curl to (soon?) build with *both* wolfSSL and OpenSSL

This change makes curl use its own sha256 implementaion when built with
wolfSSL: room for improvement.

Closes #15480

12 months agoci: update dependency wolfSSL/wolfssh to v1.4.19
renovate[bot] [Sat, 2 Nov 2024 01:04:53 +0000 (01:04 +0000)] 
ci: update dependency wolfSSL/wolfssh to v1.4.19

Closes #15476

12 months agoopenssl: extend the OpenSSL error messages
Daniel Stenberg [Fri, 1 Nov 2024 16:05:15 +0000 (17:05 +0100)] 
openssl: extend the OpenSSL error messages

Previously there were three error situations that only added the (unhelpful)
OpenSSL error strings, now we prefix those with a short explanation for the
error situation.

Reported-by: Jeroen Ooms
Fixes #15473
Closes #15474

12 months agocurl_addrinfo: support operating systems with only getaddrinfo(3)
Jonas 'Sortie' Termansen [Fri, 1 Nov 2024 22:53:00 +0000 (23:53 +0100)] 
curl_addrinfo: support operating systems with only getaddrinfo(3)

The gethostbyname(3) family was removed in POSIX-1.2008 in favor of
getaddrinfo(3) introduced in POSIX-1.2001. Modern POSIX systems such as
Sortix does not have gethostbyname nor the related definitions and
structures.

curl already only uses getaddrinfo(3) if available and thread safe,
although there is mild breakage if the related gethostbyname definitions
are missing.

This change attempts to fix that breakage:

Remove an unnecessary configure error if gethostbyname is missing since
getaddrinfo is enough as a fallback.

Rewrite Curl_ip2addr to not use struct hostent as it no longer is
standardized and create the struct Curl_addrinfo directly.

Only define the Curl_he2ai function on non-getaddrinfo systems where it
is going to be used with struct hoestent.

Revoke the fallback logic for when it's unknown whether getaddrinfo is
thread safe. It doesn't appear to make any sense since h_errno is
unrelated to getaddrinfo. The logic prevents new POSIX.1-2024 systems
from passing the thread safety test since h_errno does not exist anymore
and POSIX already requires getaddrinfo to be thread safe. There's
already a denylist in place for operating systems with known buggy
implementations.

Closes #15475

13 months agopytest: include curl version string and python platform in log
Viktor Szakats [Fri, 1 Nov 2024 12:18:40 +0000 (13:18 +0100)] 
pytest: include curl version string and python platform in log

For the Test Clutch matrix.

https://testclutch.curl.se/static/reports/feature-matrix.html

Assisted-by: Dan Fandrich
Closes #15470

13 months agocerts: add missing `-CAcreateserial` option for LibreSSL
Viktor Szakats [Fri, 1 Nov 2024 13:59:48 +0000 (14:59 +0100)] 
certs: add missing `-CAcreateserial` option for LibreSSL

Also:
- display openssl path and version.
- quote a string.

Follow-up to 9b0c0d6ade052c46cf72d2fd43017bacb0ba07f6 #15129

Closes #15471

13 months agowinbuild: drop `gen_resp_file.bat`
Viktor Szakats [Thu, 31 Oct 2024 09:17:47 +0000 (10:17 +0100)] 
winbuild: drop `gen_resp_file.bat`

`gen_resp_file.bat` could be reduced to 3 lines.
Those lines are simple to use from `Makefile.vc` as-is.

Also drop the unnecessary tabs.

Closes #15463

13 months agotests: use a set for several of the curl_props
Dan Fandrich [Wed, 30 Oct 2024 01:23:33 +0000 (18:23 -0700)] 
tests: use a set for several of the curl_props

These are used for member-of testing, so a set is more appropriate and
efficient. Also, fix a couple cases of bad exceptions.

Closes #15462

13 months agovquic: recv_mmsg, use fewer, but larger buffers
Stefan Eissing [Wed, 30 Oct 2024 11:09:07 +0000 (12:09 +0100)] 
vquic: recv_mmsg, use fewer, but larger buffers

Reported-by: koujaz on github
Fixes #15267
Closes #15454

13 months agongtcp2: do not loop on recv
Stefan Eissing [Thu, 31 Oct 2024 11:47:05 +0000 (12:47 +0100)] 
ngtcp2: do not loop on recv

The vquic_recv_packets() function already loops when not all requested
packets can be received (until EAGAIN) and there is not need to do that
again in ngtcp2.

Closes #15466

13 months agoGHA/linux-old: adjust configure job name
Viktor Szakats [Thu, 31 Oct 2024 11:49:53 +0000 (12:49 +0100)] 
GHA/linux-old: adjust configure job name

13 months agounit1307: tidy up Apple OS detection
Viktor Szakats [Wed, 30 Oct 2024 20:09:06 +0000 (21:09 +0100)] 
unit1307: tidy up Apple OS detection

Use `__APPLE__` macro to detect Apple OS instead of relying on
the string in `CURL_OS`.

This also fixes detection with default CMake builds where `CURL_OS` is
`Darwin`. The code before this patch was expecting this substring in
lowercase.

Closes #15461

13 months agoschannel: fix TLS cert verification by IP SAN
edmcln [Sun, 27 Oct 2024 12:01:52 +0000 (08:01 -0400)] 
schannel: fix TLS cert verification by IP SAN

Reported-by: elvinasp on github
Fixes #15149
Closes #15421

13 months agobuild: fix clang-cl builds, add CI job
Viktor Szakats [Tue, 29 Oct 2024 15:13:45 +0000 (16:13 +0100)] 
build: fix clang-cl builds, add CI job

- appveyor: add build-only job for clang-cl.

- cmake: `-pedantic-errors` enables `-Werror,-Wlanguage-extension-token`
  automatically, which makes `__int64` detection fail.
  Explictly disable this compiler warning for clang-cl to make the
  feature detection work and to accept `__int64` in the source code.

- cmake: disable `-Wlanguage-extension-token` warning for clang-cl
  to fix these when encountering `__int64`:
  ```
  lib/formdata.c(797,29): error : extension used [-Werror,-Wlanguage-extension-token]
  lib/warnless.c(117,33): error : extension used [-Werror,-Wlanguage-extension-token]
  lib/warnless.c(60,28): message : expanded from macro 'CURL_MASK_SCOFFT'
  lib/warnless.c(59,38): message : expanded from macro 'CURL_MASK_UCOFFT'
  include\curl/system.h(352,40): message : expanded from macro 'CURL_TYPEOF_CURL_OFF_T'
  ```

- make `__GNUC__` warning suppressions apply to `__clang__` too.
  Necessary for clang-cl, which defines the latter, but not the former.
  (Regular clang defines both.)

- examples: fix clang-cl compiler warning in `http2-upload.c`.
  ```
  docs\examples\http2-upload.c(56,5): error : no previous prototype for function 'my_gettimeofday' [-Werror,-Wmissing-prototypes]
  docs\examples\http2-upload.c(56,1): message : declare 'static' if the function is not intended to be used outside of this translation unit
  ```

- unit2604: add missing `#pragma GCC diagnostic pop`.
  Follow-up to e53523fef07894991c69d907a7c7794c7ada4ff4 #14859

- unit1652: limit compiler warning suppression to GCC.
  They do not affect clang builds.
  Follow-up to 71cf0d1fca9e1f53524e1545ef0c08d174458d80 #14772

Closes #15449

13 months agotidy-up: whitespace, fix CI spacecheck for docs
Viktor Szakats [Fri, 25 Oct 2024 22:23:19 +0000 (00:23 +0200)] 
tidy-up: whitespace, fix CI spacecheck for docs

Also: fixup CI spacecheck to apply to docs again.

Closes #15423

13 months agoconfig: rename the OS define to CURL_OS to reduce collision risk
Daniel Stenberg [Wed, 30 Oct 2024 13:00:16 +0000 (14:00 +0100)] 
config: rename the OS define to CURL_OS to reduce collision risk

Reported-by: Jon Rumsey
Fixes #15455
Closes #15457

13 months agoMQTT: remove trailing newline
Daniel Stenberg [Wed, 30 Oct 2024 13:04:08 +0000 (14:04 +0100)] 
MQTT: remove trailing newline

13 months agoRELEASE-NOTES: synced
Daniel Stenberg [Wed, 30 Oct 2024 08:47:06 +0000 (09:47 +0100)] 
RELEASE-NOTES: synced

13 months agopytest: show curl features and protocols
Viktor Szakats [Tue, 29 Oct 2024 23:24:45 +0000 (00:24 +0100)] 
pytest: show curl features and protocols

For the Test Clutch matrix.

https://testclutch.curl.se/static/reports/feature-matrix.html

Closes #15452

13 months agomqtt: fix mqtt.md wording and add clearer explanation
Marwan Yassini [Tue, 29 Oct 2024 17:22:03 +0000 (17:22 +0000)] 
mqtt: fix mqtt.md wording and add clearer explanation

Some of the wording in the mqtt.md confused me as to how the commands
were used and what they did, so I cleared up some of the wording to
better explain what each command does.

Closes #15451

13 months agowinbuild/README: consolidate command prompt section
Jay Satiro [Wed, 16 Oct 2024 22:19:40 +0000 (18:19 -0400)] 
winbuild/README: consolidate command prompt section

- Remove reference to 'Developer Command Prompt for Visual Studio'
  shortcut since it opens in x86 mode.

That prompt may confuse users since it is not easily switched to x64.
Our instruction says vcvarsall can be used to change the platform but it
is not in the path in any version that I checked (VS 2010, 2013, 2022).

Instead users will now only see the remaining instruction to use a
platform specific command prompt to build curl, like "x64 Native Tools".

There's several links as well to Microsoft documentation for users that
have more complicated requirements, such as using vcvarsall.

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

13 months agoci: update rojopolis/spellcheck-github-actions digest to 74c2a14
renovate[bot] [Fri, 25 Oct 2024 08:40:52 +0000 (08:40 +0000)] 
ci: update rojopolis/spellcheck-github-actions digest to 74c2a14

Closes #15412

13 months agoOS400: don't delete source files when building with debug
Jon Rumsey [Mon, 28 Oct 2024 17:53:01 +0000 (17:53 +0000)] 
OS400: don't delete source files when building with debug

Debugger not able to work against curl *SRVPGM when using temporary
source files.

Fixes #15445
Closes #15446

13 months agopytest: fix run against multissl curl
Stefan Eissing [Tue, 29 Oct 2024 09:07:34 +0000 (10:07 +0100)] 
pytest: fix run against multissl curl

Changes to make a curl built with OpenSSL + GnuTLS to run successfully
in our pytests. Run

CURL_SSL_BACKEND=openssl pytest

to test a TLS backend other than the default.

Closes #15443

13 months agocurl/config2setopts: move SSH related options into same block
Daniel Stenberg [Tue, 29 Oct 2024 09:15:53 +0000 (10:15 +0100)] 
curl/config2setopts: move SSH related options into same block

Move the code setting SSH specific libcurl options into the same block
to avoid having a separate almost identical condition later.

Closes #15444

13 months agotool_operate: url_proto improvements
Daniel Stenberg [Tue, 29 Oct 2024 08:21:37 +0000 (09:21 +0100)] 
tool_operate: url_proto improvements

- renamed to url_proto_and_rewrite to better reveal what it does
- clarify the functionality in the top comment
- make it return CURLE_OUT_OF_MEMORY appropriately
- remove check for URL being set, use assert instead

Closes #15442

13 months agomulti: fix "Useless Assignment"
Daniel Stenberg [Tue, 29 Oct 2024 07:13:02 +0000 (08:13 +0100)] 
multi: fix "Useless Assignment"

CodeSonar pointed out "This code assigns the variable the same value it
already had"

Follow-up to e77326403d3d27e7e

Closes #15441

13 months agosetopt: return error for bad input to CURLOPT_RTSP_REQUEST
Daniel Stenberg [Tue, 29 Oct 2024 07:09:32 +0000 (08:09 +0100)] 
setopt: return error for bad input to CURLOPT_RTSP_REQUEST

And leave the value untouched. Previously, an unrecognized argument
would reset it to RTSPREQ_NONE (and still return OK).

Closes #15440

13 months agoruntests: add comment for handle64 pathsep requirement [ci skip]
Viktor Szakats [Tue, 29 Oct 2024 08:26:34 +0000 (09:26 +0100)] 
runtests: add comment for handle64 pathsep requirement [ci skip]

Cherry-picked from #14949

13 months agosetopt_cptr: make overflow check only done when needed
Daniel Stenberg [Tue, 29 Oct 2024 07:01:47 +0000 (08:01 +0100)] 
setopt_cptr: make overflow check only done when needed

An overflow check for if the value of a curl_off_t is larger than a
size_t can hold, is only necessary if the two types are actually
differently sized, now checked by the preprocessor. To avoid
"Unreachable Conditional".

Closes #15439

13 months agoGHA/windows: avoid curl.exe libtool wrapper
Viktor Szakats [Tue, 29 Oct 2024 00:41:32 +0000 (01:41 +0100)] 
GHA/windows: avoid curl.exe libtool wrapper

Avoid the `curl.exe` wrapper binary created by libtool, and run the real
`curl.exe` directly for tests and version information.

This solution was used in Azure jobs. I missed it when migrating jobs
to GHA.

Applies to tests run in the `mingw, AM x86_64 c-ares U` job, which has
seen unexplained flakiness.

Ref: 354afc891df4b60b8017fc5d35a05daedb2cd812 #6049
Follow-up to e53523fef07894991c69d907a7c7794c7ada4ff4 #14859

Closes #15437

13 months agoruntests: pass single backslashes with Windows Perl
Viktor Szakats [Fri, 4 Oct 2024 20:38:14 +0000 (22:38 +0200)] 
runtests: pass single backslashes with Windows Perl

handle/handle64 requires a literal match with the filenames it's
listing.

Also:
- make handle64 log messages more unique to help text searches.
- update a comment with Windows Perl info.

Cherry-picked from #14949
Closes #15436

13 months agosrc/lib: remove redundant ternary operators
Daniel Stenberg [Mon, 28 Oct 2024 16:26:19 +0000 (17:26 +0100)] 
src/lib: remove redundant ternary operators

Closes #15435

13 months agolib: msnprintf tidy-ups
Daniel Stenberg [Mon, 28 Oct 2024 15:55:13 +0000 (16:55 +0100)] 
lib: msnprintf tidy-ups

doh: avoid an msnprintf()

openssl: skip a superfluous return code check

Closes #15434

13 months agotls: avoid abusing CURLE_SSL_ENGINE_INITFAILED
Daniel Stenberg [Mon, 28 Oct 2024 12:27:58 +0000 (13:27 +0100)] 
tls: avoid abusing CURLE_SSL_ENGINE_INITFAILED

That error code was introduced and has been used for OpenSSL ENGINE
things and not others, so switch the other use cases over to other TLS
related error codes.

Closes #15430

13 months agoRELEASE-NOTES: synced
Daniel Stenberg [Mon, 28 Oct 2024 15:01:08 +0000 (16:01 +0100)] 
RELEASE-NOTES: synced

13 months agotests/http: add --insecure tests
Stefan Eissing [Mon, 28 Oct 2024 10:59:06 +0000 (11:59 +0100)] 
tests/http: add --insecure tests

Add two test cases that connection using a hostname the server has no
certificate for. First, verify that the peer verification fail, as
expected. Second, provide '--insecure' to test that the connection
succeeded and returned some data.

Closes #15429

13 months agotests/scorecard: allow remote server test
Stefan Eissing [Fri, 25 Oct 2024 12:15:17 +0000 (14:15 +0200)] 
tests/scorecard: allow remote server test

New args for scorecard.py:
* --remote ip:port to run tests against a remote server
* --start-only: to only start the servers, listing their ports

Start the server using "scorecard.py --start-only" on one machine and
then run the tests with "scorecard.py --remote ip:port" against that
machine.

Closes #15415

13 months agoCI: bump wolfSSH and wolfSSL 15427/head
Daniel Stenberg [Mon, 28 Oct 2024 08:22:33 +0000 (09:22 +0100)] 
CI: bump wolfSSH and wolfSSL

- wolfSSH 1.4.18
- wolfSSL 5.7.4

Closes #15427

13 months agotool_getparam: drop unused time() call
Daniel Stenberg [Sun, 27 Oct 2024 10:50:48 +0000 (11:50 +0100)] 
tool_getparam: drop unused time() call

The second argument to curl_getdate() once took a time argument, but
that feature has been gone for decades, thus passing in a date there
makes no difference.

Closes #15420

13 months agoappveyor: fix job names, tidy-up
Viktor Szakats [Fri, 25 Oct 2024 10:05:46 +0000 (12:05 +0200)] 
appveyor: fix job names, tidy-up

- add 'Shared' to job names where missing.
- dedupe setting the default `HTTP_ONLY` env.
- fix typo in job name.

Cherry-picked from #15414
Closes #15422

13 months agocmake: tweaks around debug mode and hidden symbols
Viktor Szakats [Fri, 25 Oct 2024 08:47:25 +0000 (10:47 +0200)] 
cmake: tweaks around debug mode and hidden symbols

- emit warning for `ENABLE_DEBUG` builds.

- add words to clarify that `ENABLE_DEBUG` is meant for developing curl
  itself.

- add comment saying `CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS=ON`
  CMake option may export extra, non-curl symbols.
  Ref: https://github.com/microsoft/vcpkg/issues/41761
  Unexplained exports seen also in curl CI:
  ```
  [ 742] _tcschr
  [ 743] _tcsncmp
  [ 744] _tcsncpy
  [ 745] _tcspbrk
  ```
  https://ci.appveyor.com/project/curlorg/curl/builds/50864041/job/lolledrg4h7hu6e4?fullLog=true#L2160
  CMake extracts these symbols from `.obj` files:
  https://gitlab.kitware.com/cmake/cmake/-/issues/22092#note_943718
  I have not found any new MSVC option that helps fixing this without
  decorating all functions in-source or maintaining a manual list of
  internal function names used for tests:
  https://learn.microsoft.com/cpp/build/reference/wholearchive-include-all-library-object-files

Closes #15414

13 months agobuild: disable warning `-Wunreachable-code-break`
Viktor Szakats [Fri, 25 Oct 2024 20:31:29 +0000 (22:31 +0200)] 
build: disable warning `-Wunreachable-code-break`

This warning remains silent in unity builds. Since we're using unity
in CI for most jobs, warnings remain undetected there.
Disable them for all builds to avoid a surprise warning outside our CI.

The issue caught by the warning is useful for a tidy codebase, but
doesn't affect executed code. It was enabled in
84338c4de2d7c798e3c270c9610d51a4ad18a90b #12331 (2023-11-15).

llvm source: https://github.com/llvm/llvm-project/blob/fee2953f23bd8a8a71e574e6a8db08033778d3a4/clang/lib/Sema/AnalysisBasedWarnings.cpp#L125-L134
llvm issue: https://github.com/llvm/llvm-project/issues/71046

Follow-up to 7c023c3f6e2c454fbac7277d8dc038854c192d72 #15384
Closes #15416

13 months agomulti: split multi_runsingle into sub functions
Daniel Stenberg [Sat, 26 Oct 2024 20:12:41 +0000 (22:12 +0200)] 
multi: split multi_runsingle into sub functions

Introduce five functions named after the state they serve:

- state_connect for MSTATE_CONNECT
- state_do for MSTATE_DO
- state_performing for MSTATE_PERFORMING
- state_ratelimiting for MSTATE_RATELIMITING
- state_resolving for MSTATE_RESOLVING

Closes #15418

13 months agolib: remove Curl_ prefix from static functions
Daniel Stenberg [Sat, 26 Oct 2024 21:38:38 +0000 (23:38 +0200)] 
lib: remove Curl_ prefix from static functions

'Curl_' is a prefix used for library global functions (cross-files).
Static functions should thus not use it.

Closes #15419

13 months agodocs: clarify FTP over HTTP proxy functionality somewhat
Daniel Stenberg [Sat, 26 Oct 2024 21:13:02 +0000 (23:13 +0200)] 
docs: clarify FTP over HTTP proxy functionality somewhat

Reported-by: newfunction
Closes #15417

13 months agocmake: fix missing spacing in log message
Viktor Szakats [Fri, 25 Oct 2024 08:23:02 +0000 (10:23 +0200)] 
cmake: fix missing spacing in log message

Follow-up to e89491e1f015bab8b4050ed73d1cedc17419336f #15337
Closes #15411

13 months agocmake: clear package version after `pkg-config` detection
Viktor Szakats [Fri, 25 Oct 2024 01:01:58 +0000 (03:01 +0200)] 
cmake: clear package version after `pkg-config` detection

`pkg_check_modules()` seems to leave `<PACKAGE>_VERSION` defined with an
empty value, if the package is not found.

When the package is also not found in the fallback branch,
`find_package_handle_standard_args()` logs and error message. In this
message it includes the bogus empty value as: `(found version "")`:
```
Could NOT find Libssh2 (missing: LIBSSH2_INCLUDE_DIR LIBSSH2_LIBRARY) (found version "")
```
https://github.com/curl/curl/actions/runs/11509727553/job/32040378958?pr=15408#step:31:99

Clear the version number to avoid the confusion:
```
Could NOT find Libssh2 (missing: LIBSSH2_INCLUDE_DIR LIBSSH2_LIBRARY)
```
https://github.com/curl/curl/actions/runs/11510022503/job/32041149129?pr=15408#step:31:99

Seen with CMake v3.30.5.

Follow-up to 7bab201abe3915a0167c002f9308950cb8a06e4b #15193
Closes #15409

13 months agoINSTALL-CMAKE: fix punctuation and a typo [ci skip]
Viktor Szakats [Thu, 24 Oct 2024 21:21:00 +0000 (23:21 +0200)] 
INSTALL-CMAKE: fix punctuation and a typo [ci skip]

13 months agocmake: document `-D` and env build options
Viktor Szakats [Thu, 24 Oct 2024 00:04:22 +0000 (02:04 +0200)] 
cmake: document `-D` and env build options

Extend `INSTALL-CMAKE` document with the list of available options,
a short description and default values.

The list may not be 100% complete.

There are no component boundaries in CMake, so the line is blurry
between curl options, CMake options, CMake Find modules options.
I included certain CMake options that seemed useful, and/or have
dedicated use withing curl's CMake source. But, all CMake built-in
options are usable, as documented upstream in CMake.

The naming of the options has a heritage and the inconsistencies with
it, including a lack of clear namespace. This may be subject to future
updates, also after figuring out which name has special meaning within
CMake and/or CMake projects out of unwritten convention or something
more tangible.

CMake allows to initialize any internal variable via `-D`. This may be
useful to pre-initialize/override feature check results. The list
doesn't contain these, and they remain officially undocumented.

Also:
- make adjustments to keep the spellchecker happy.
- retrofit description changes to the cmake sources.
- stop documenting deprecated `Find*` variables.

Reported-by: Daniel Stenberg
Fixes https://github.com/curl/curl/discussions/14885
Closes #15388

13 months agocmake: mark as advanced some internal Find* variables
Viktor Szakats [Thu, 24 Oct 2024 20:44:06 +0000 (22:44 +0200)] 
cmake: mark as advanced some internal Find* variables

To sync with other similar variables and hide them from cmake UIs.

Follow-up to 7bab201abe3915a0167c002f9308950cb8a06e4b #15193
Closes #15407

13 months agocmake: tidy up and shorten symbol hiding initialization
Viktor Szakats [Thu, 24 Oct 2024 10:15:44 +0000 (12:15 +0200)] 
cmake: tidy up and shorten symbol hiding initialization

- drop redundant local variables.

- drop extra Intel C feature check that always returned success due
  to not passing the tested compiler option. Nobody reported an issue
  with this since 2016, suggesting the version check alone is enough.

Closes #15400

13 months agocmake: tidy up picky warning initialization
Viktor Szakats [Thu, 24 Oct 2024 14:58:17 +0000 (16:58 +0200)] 
cmake: tidy up picky warning initialization

- use CMake 3.12 syntax when available, in clang-cl branch.
  Follow-up to e89491e1f015bab8b4050ed73d1cedc17419336f #15337

- rename internal variables to underscore-lowercase.
  Follow-up to d8de4806e1463f589a1b54de1da7d6396de94d11 #14571

- update comment.

Closes #15404

13 months agocmake: rename local variables to underscore-lowercase
Viktor Szakats [Wed, 23 Oct 2024 22:27:19 +0000 (00:27 +0200)] 
cmake: rename local variables to underscore-lowercase

Also drop `_curl` prefix, which isn't necessary for underscore variables
and wasn't used in most other cases.

Follow-up to d8de4806e1463f589a1b54de1da7d6396de94d11 #14571
Closes #15397

13 months agocmake: limit `CURL_STATIC_CRT` to MSVC
Viktor Szakats [Thu, 24 Oct 2024 14:50:33 +0000 (16:50 +0200)] 
cmake: limit `CURL_STATIC_CRT` to MSVC

`CURL_STATIC_CRT` supports MSVC only. Limit its effect to this compiler.

Closes #15403

13 months agocmake: use `list(APPEND)` on `CURL_INCLUDES`
Viktor Szakats [Wed, 23 Oct 2024 22:48:34 +0000 (00:48 +0200)] 
cmake: use `list(APPEND)` on `CURL_INCLUDES`

It does the same as the `set()` used before this patch.
Makes the code easier to read.

Closes #15399

13 months agocmake: tidy up `CURL_DISABLE_FORM_API` initialization
Viktor Szakats [Wed, 23 Oct 2024 23:39:59 +0000 (01:39 +0200)] 
cmake: tidy up `CURL_DISABLE_FORM_API` initialization

Initialization of `CURL_DISABLE_FORM_API` depends on another option.
Make sure the other option is initialized before this one.

Due to the defaults and logic this did not cause an issue.

Also fix the order of two other lines to match with the rest.

Closes #15394

13 months agocmake: drop obsolete items from `TODO` and `INSTALL-CMAKE`
Viktor Szakats [Thu, 24 Oct 2024 15:53:24 +0000 (17:53 +0200)] 
cmake: drop obsolete items from `TODO` and `INSTALL-CMAKE`

- INSTALL-CMAKE: delete `Current flaws in the curl CMake build` section.
  #1123 was fixed in 7e93637acd9f5741ac4c09bbca353ac8da42bb17 #2443

- TODO: delete item 3.2.
  Follow-up to 1cb4f5d6e8e470638759a48ba99fda230089712f #1879

Closes #15405

13 months agodocs/libcurl/opts/Makefile.inc: alphasort the options list
Daniel Stenberg [Thu, 24 Oct 2024 14:20:36 +0000 (16:20 +0200)] 
docs/libcurl/opts/Makefile.inc: alphasort the options list

13 months agocurl: detect ECH support dynamically, not at build time
Daniel Stenberg [Thu, 24 Oct 2024 13:49:51 +0000 (15:49 +0200)] 
curl: detect ECH support dynamically, not at build time

Closes #15402

13 months agoquic: use the session cache with wolfSSL as well
Stefan Eissing [Tue, 22 Oct 2024 12:13:00 +0000 (14:13 +0200)] 
quic: use the session cache with wolfSSL as well

Use session cache for QUIC when built with quictls or wolfSSL.

Add test_017_10 for verifying QUIC TLS session reuse when built with
quictls, gnutls or wolfssl.

Closes #15358

13 months agongtcp2: set max window size to 10x of initial (128KB)
Kazuho Oku [Thu, 24 Oct 2024 09:43:46 +0000 (18:43 +0900)] 
ngtcp2: set max window size to 10x of initial (128KB)

Just as the quiche backend does

Closes #15392

13 months agobearssl: improved session handling, test exceptions
Stefan Eissing [Thu, 24 Oct 2024 10:36:41 +0000 (12:36 +0200)] 
bearssl: improved session handling, test exceptions

Add length to session saves, making it clear that we are storing a byte
blob and allowing memcmp() on sameness check.

Remove some pytest skips for bearssl to see if they now work properly in
CI.

Closes #15395

13 months agombedtls: handle session as blobs
Stefan Eissing [Thu, 24 Oct 2024 11:38:15 +0000 (13:38 +0200)] 
mbedtls: handle session as blobs

Use mbedtls_ssl_session_load() and mbedtls_ssl_session_save() to convert
TLS sessions to byte blobs for the session cache.

Fix a skip message to better indicate why the test is skipped for
mbedtls.

Closes #15398

13 months agoRELEASE-NOTES: synced
Daniel Stenberg [Thu, 24 Oct 2024 12:35:24 +0000 (14:35 +0200)] 
RELEASE-NOTES: synced

13 months agourl.md: clarify
Daniel Stenberg [Thu, 24 Oct 2024 10:48:07 +0000 (12:48 +0200)] 
url.md: clarify

- the specified URL can also get data sent to it
- rephrase the scheme guessing part
- mention target options for each URL for saving data
- mention --remote-name-all
- remove "warning" and make it into normal text

Closes #15396

13 months agoversion: minor cleanups
Daniel Stenberg [Thu, 24 Oct 2024 10:27:21 +0000 (12:27 +0200)] 
version: minor cleanups

- remove typecasts and parentheses in zstd_version()
- create and use oldap_version() for OpenLDAP
- create and use psl_version() for libpsl
- reduce the size of the 40 byte buffers to 30 bytes
- use the brotil/zstd like the others (add the lib name in the functions)
- create and use idn_version for IDN builds
- handle (unlikely) error from ldap_get_option

Closes #15393

13 months agoschannel: reclassify extra-verbose schannel_recv messages
Jay Satiro [Sun, 8 Sep 2024 06:47:35 +0000 (02:47 -0400)] 
schannel: reclassify extra-verbose schannel_recv messages

- Create a new macro SCH_DEV() to manage verbose debug messages that are
  only useful for debugging Schannel recv decryption.

schannel_recv contains a lot of useful debug messages to help debug the
function, however in practice they are not otherwise useful and showing
them in debug builds adds a lot of noise.

To show these messages curl must now be built with
CURL_SCHANNEL_DEV_DEBUG defined.

Prior to this change many, but not all, extra-verbose messages were
wrapped in DEBUGF() so they were only shown in debug builds.

Ref: https://github.com/curl/curl/issues/14807

Closes #14826

13 months agomprintf: treat `%o` as unsigned, add tests for `%o`, `%x`, `%X`
ArtSin [Tue, 22 Oct 2024 10:24:45 +0000 (14:24 +0400)] 
mprintf: treat `%o` as unsigned, add tests for `%o`, `%x`, `%X`

`%x` and `%X` were already treated as unsigned, but `%o` was not, even
though it was used with unsigned numbers.

Closes #15348

13 months agomprintf: do not ignore length modifiers of `%o`, `%x`, `%X`
ArtSin [Mon, 21 Oct 2024 15:48:37 +0000 (19:48 +0400)] 
mprintf: do not ignore length modifiers of `%o`, `%x`, `%X`

There are uses of `%lx` and `%zx` in the codebase, but `parsefmt`
interpreted them as `%x`.

Closes #15348

13 months agoschannel: ignore error on recv beyond close notify
Stefan Eissing [Wed, 23 Oct 2024 09:12:47 +0000 (11:12 +0200)] 
schannel: ignore error on recv beyond close notify

When receiving data, schannel does a recv from the lower filters, e.g.
the socket, *before* it decrypts and analyses the buffered data it
already has. When that buffer contains a close-notify, e.g. the end of
the TLS stream, any error on the previous receive from the socket are
not applicable to its return codes.

Example from #153345: a server sends a close notify and closes its
connection. The encrypted data, including the close notify is received.
Another receive on the sockets gets a CONNABORTED which curl reports as
CURLE_RECV_ERROR. Schannel analyses its bufferi, sees the close notify
and early returns to the caller. On this return, the error on the
attempted receive does not apply.

Closes #15381

13 months agoGHA: update five dependencies
renovate[bot] [Sat, 19 Oct 2024 23:17:04 +0000 (23:17 +0000)] 
GHA: update five dependencies

- rojopolis/spellcheck-github-actions digest to ab8ac45
- nghttp2/nghttp2 to v1.64.0
- actions/cache digest to 6849a64
- github/codeql-action digest to 6624720
- Update actions/checkout digest to 11bd719

Closes #15341
Closes #15346
Closes #15365
Closes #15366
Closes #15387

13 months agotool_operate: split up the huge single_transfer into sub functions 15385/head
Daniel Stenberg [Wed, 23 Oct 2024 09:56:29 +0000 (11:56 +0200)] 
tool_operate: split up the huge single_transfer into sub functions

- split up in a few smaller and easier to read functions
- simplify several sections
- avoid superfluous extra allocations
- remove unused debug code

Closes #15385

13 months agosetopt: split Curl_vsetopt() into several sub functions
Daniel Stenberg [Tue, 22 Oct 2024 14:48:05 +0000 (16:48 +0200)] 
setopt: split Curl_vsetopt() into several sub functions

Reduce the ~3000 line super function into smaller pieces, easier to read and
manage.

Extract the option's argument earlier and use a fixed type instead of using
va_arg() everywhere.

Closes #15376

13 months agocmake: avoid setting `BUILD_TESTING`
Viktor Szakats [Tue, 22 Oct 2024 11:22:39 +0000 (13:22 +0200)] 
cmake: avoid setting `BUILD_TESTING`

`BUILD_TESTING` variable is used by other projects and CMake internally.
Replace `cmake_dependent_option()` with `option()` and introduce an
internal variable to track if want and can do testing.

Follow-up to #6036
Follow-up to 3a1e798009799be1e9fad30666351b66f250befb #6072

Reported-by: Robert Maynard
Fixes #15351
Closes #15355

13 months agolibssh2: delete duplicate `break`
Viktor Szakats [Wed, 23 Oct 2024 13:40:18 +0000 (15:40 +0200)] 
libssh2: delete duplicate `break`

```
lib/vssh/libssh2.c:2495:7: warning: 'break' will never be executed [-Wunreachable-code-break]
      break;
      ^~~~~
```

CI did not catch it due to llvm skipping this check for all #included
files. It's designed this way to avoid performance issues and false
positive when checking headers:
https://github.com/llvm/llvm-project/issues/71046

Closes #15384

13 months agoGHA: drop "3" from openssl names and keys
Viktor Szakats [Wed, 23 Oct 2024 12:50:26 +0000 (14:50 +0200)] 
GHA: drop "3" from openssl names and keys

Also:
- drop patch suffix from cache key for thread-sanitizer local build
  Follow-up to 73d2779196f5b4d5b45945e06b4bbdec11b6d921 #15379

Closes #15383

13 months agocmake: tidy up line order [ci skip]
Viktor Szakats [Wed, 23 Oct 2024 11:13:01 +0000 (13:13 +0200)] 
cmake: tidy up line order [ci skip]

13 months agoGHA/windows: work around Git for Windows perf regression
Viktor Szakats [Wed, 23 Oct 2024 09:06:27 +0000 (11:06 +0200)] 
GHA/windows: work around Git for Windows perf regression

Fix the significant perf regression for vcpkg jobs by switching to the
MSYS2 shell environment from Git for Windows. This env is already used
for old-mingw-w64 job that remained unaffected by this issue.

The issue began with the windows-runner update 20241015.1.0. It bumped
Git for Windows from Git 2.46.2.windows.1 to Git 2.47.0.windows.1. GfW
bumped its MSYS2 components, including `msys-2.0.dll`. That's Cygwin
code, which may have contributed to this. Pipes were involved and
`runtests.pl` relies on pipes heavily in parallel mode. (The issue was
not seen with parallel tests disabled, in retrospect.)

This is useful as a permanent solution too. It drop GfW as a dependency
and makes Windows jobs use one less shell/env flavour.

Long term it might help to use native Windows Perl to avoid the MSYS
layer completely, if there is a way to make that work.

Assortment of possibly related links:
https://cygwin.com/pipermail/cygwin/2024-August/256398.html
https://github.com/cygwin/cygwin/commit/f78009cb1ccf84cc343cf2441c76196461d87532
https://github.com/cygwin/cygwin/commit/7f3c22532577ae0a926e8eb8ad63787c9841abbf

https://github.com/actions/runner-images/issues/10843
https://github.com/git-for-windows/git/issues/5199
https://github.com/git-for-windows/msys2-runtime/pull/75
https://github.com/git-for-windows/msys2-runtime/commit/7913a41703dbc476ad3cf1b85e6939ebbe524251
https://github.com/git-for-windows/msys2-runtime/commit/555afcb2f3a6638084912ce1011bd6acef59ea79
https://github.com/cygwin/cygwin/commit/1c5f4dcdc5ec3344e3fd741c43fa359d0e1323c0

Follow-up to c33174d42fc8a4a0625b46f1d09f5e79eb2abbf1 #15364
Follow-up to 1e0305973c22b1d84036fe0c4eee34aea5cd40cc #15356

Closes #15380

13 months agoGHA/linux: drop patch from openssl3 thread sanitizer
Viktor Szakats [Wed, 23 Oct 2024 08:54:14 +0000 (10:54 +0200)] 
GHA/linux: drop patch from openssl3 thread sanitizer

The patch is now part of the 3.4.0 stable release.
(Turns out it was part of 3.3.2 already.)

Also:
- rename this local build to match the scheme used with wolfssl.
- drop '3' from local openssl build name.
- sync job name with others.
- quote step names where missing.

Follow-up to a2bcec0ee0895c23b98aea8e72ad4e9278fa67c8 #14751
Closes #15379

13 months agoCI: update dependency openssl/openssl to v3.4.0
renovate[bot] [Wed, 23 Oct 2024 08:41:58 +0000 (08:41 +0000)] 
CI: update dependency openssl/openssl to v3.4.0

Closes #15377

13 months agoruntests: use deterministic sort for `TESTINFO` lines
Viktor Szakats [Tue, 17 Sep 2024 16:43:17 +0000 (18:43 +0200)] 
runtests: use deterministic sort for `TESTINFO` lines

Sort TESTINFO lines by description within the number of skipped test.
It makes the list of skipped test groups easier to diff/compare between
jobs and runs.

Closes #15374

13 months agoci: fix renovate's matching for OpenSSL and quictls
Max Dymond [Tue, 22 Oct 2024 12:31:22 +0000 (13:31 +0100)] 
ci: fix renovate's matching for OpenSSL and quictls

Renovate only matches on the raw version numbers of a package, but
OpenSSL includes `openssl-` as a prefix in the version number. This
change means that the match string now expects the `openssl-` prefix
and will just update the version portion.

This also updates quictls so that renovate can detect and update the
version correctly.

Closes #15359