]> git.ipfire.org Git - thirdparty/curl.git/log
thirdparty/curl.git
3 months agohttp: do the cookie list access under lock
David Zhuang [Wed, 3 Sep 2025 00:28:21 +0000 (17:28 -0700)] 
http: do the cookie list access under lock

A previous refactor of cookie logic changed Curl_cookie_getlist to no
longer return a list of copied cookies, but instead return a linked list
pointing to existing cookies. The returned linked list is accessed
outside of the scope of the cookie share lock in http_cookies, which
leads to issues if the shared cookie list is modified at the same time.
This is the relevant commit: be39ed1

Closes #18457

3 months agoGHA: Update cloudflare/quiche to v0.24.6
renovate[bot] [Wed, 3 Sep 2025 09:36:30 +0000 (09:36 +0000)] 
GHA: Update cloudflare/quiche to v0.24.6

Closes #18464

3 months agopytest: add tests for getting a non-existing ftp file
Stefan Eissing [Wed, 3 Sep 2025 09:21:42 +0000 (11:21 +0200)] 
pytest: add tests for getting a non-existing ftp file

Check that return code is 78.

Closes #18463

3 months agoidn: reject conversions that end up as a zero length hostname
Daniel Stenberg [Wed, 3 Sep 2025 07:41:29 +0000 (09:41 +0200)] 
idn: reject conversions that end up as a zero length hostname

Reported-by: RepoRascal on hackerone
Closes #18462

3 months agoGHA: update awslabs/aws-lc to v1.60.0
renovate[bot] [Wed, 3 Sep 2025 07:37:03 +0000 (07:37 +0000)] 
GHA: update awslabs/aws-lc to v1.60.0

Closes #18458

3 months agotool_getparam: warn on more unicode prefixes
Daniel Stenberg [Wed, 3 Sep 2025 07:52:36 +0000 (09:52 +0200)] 
tool_getparam: warn on more unicode prefixes

If a string argument is expected and the first two bytes are 0xe2 ex80
and the third has the 7th bit set, that's enough for curl to warn.

Previously we tried to detect and warn only for the unicode double
quote, but users might use single quotes, other quotes or even lead the
argument with one of the "zero widths" characters. This is an attempt to
detect many of those. Without triggering for "normal" IDN hostnames.

Closes #18459

3 months agoRELEASE-NOTES: synced
Daniel Stenberg [Wed, 3 Sep 2025 06:36:25 +0000 (08:36 +0200)] 
RELEASE-NOTES: synced

3 months agoprojects: fix Windows project 'clean' function
Jay Satiro [Wed, 27 Aug 2025 07:35:01 +0000 (03:35 -0400)] 
projects: fix Windows project 'clean' function

- Fix generate.bat "-clean" option.

- Change version template substitutes to match old files, eg go back to
  using format version "11.00" instead of "11.0".

- Limit the vcxproj filters file types that are filtered to c, h, rc.

- Get rid of the tmpl extension from template files and add a README
  to the tmpl directory explaining the purpose of the files.

- gitignore VCxx directories entirely rather than individual file types.

- Do not remove the VC directories during clean, instead remove just the
  generated project files.

Removing the VC directories has the unwanted behavior of removing files
other than those generated. Visual Studio will generate its own
preference files (like if you have some debug arguments in your .suo)
and those files sit in the VC directories. We ignore those files since
they are the user's files and should not be deleted. Also the user may
have their own untracked files that we shouldn't be deleting.

Follow-up to 57d349fe which consolidated the project templates.

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

3 months agodocs: fix typo (staring -> starting)
Florian Friedrich [Tue, 2 Sep 2025 07:44:07 +0000 (09:44 +0200)] 
docs: fix typo (staring -> starting)

Closes #18450

3 months ago.editorconfig: add
Michał Petryka [Tue, 26 Aug 2025 22:47:20 +0000 (00:47 +0200)] 
.editorconfig: add

This allows IDEs that support this standard to automatically use the
correct formatting options.

Closes #18409

3 months agoparsedate: make Curl_getdate_capped able to return epoch
Daniel Stenberg [Mon, 1 Sep 2025 14:36:53 +0000 (16:36 +0200)] 
parsedate: make Curl_getdate_capped able to return epoch

By returning error separately on parse errors and avoiding magic
numbers, this function can now return 0 or -1 as proper dates when such
a date string is provided.

Closes #18445

3 months agoCurl_http(), decomplexify
Stefan Eissing [Mon, 1 Sep 2025 13:52:30 +0000 (15:52 +0200)] 
Curl_http(), decomplexify

Split out adding of individual request headers into a switch. Check
the connection http version only on fresh connections, use separate
methods.

Add TE: header directly without allocation. Add bit for indicating
Connection: header has been added and custom headers should not do
that again.

Closes #18444

3 months agoCURLINFO_FILETIME*.md: correct the examples
Daniel Stenberg [Mon, 1 Sep 2025 21:38:44 +0000 (23:38 +0200)] 
CURLINFO_FILETIME*.md: correct the examples

Only -1 means bad value, all others are acceptable.

Ref: #18424
Closes #18447

3 months agotool_filetime: correct the conditions
Daniel Stenberg [Mon, 1 Sep 2025 21:21:58 +0000 (23:21 +0200)] 
tool_filetime: correct the conditions

The libcurl API for CURLINFO_FILETIME_T clearly says it contains -1 if
not set. Everything else is a valid time stamp so use that.

Follow-up to 54f1ef05d672453d75a5fc60
Closes #18446

3 months agoaws-lc: do not use large buffer
Stefan Eissing [Fri, 29 Aug 2025 15:38:45 +0000 (17:38 +0200)] 
aws-lc: do not use large buffer

test_10_08, uploading larger files for a h2 proxy, sporadically fails
with a decrpytion error on received data in AWS-LC. The frequency can
be increased by simulated network receive blocks.

Not setting a 4 * TLS record sized buffer, leaving AWS-LC at its
default buffer size seems to mitigate this problem.

Closes #18434

3 months agoautotools: make curl-config executable
Yedaya Katsman [Fri, 29 Aug 2025 14:09:00 +0000 (17:09 +0300)] 
autotools: make curl-config executable

This was already done when building using CMake:
https://github.com/curl/curl/blob/fa9151b41ad986e0514d99dd3fe149f26a7a57a3/CMakeLists.txt#L2391-L2394

Closes #18433

3 months agocw-out: add assert for data->conn
Daniel Stenberg [Sun, 31 Aug 2025 11:33:05 +0000 (13:33 +0200)] 
cw-out: add assert for data->conn

Instead of checking it runtime. CodeSonar pointed out that if it
actually CAN legitimately be NULL here, then we need to do more checks
for it...

Closes #18440

3 months agotool: move the error buffer to the per transfer struct
Daniel Stenberg [Sun, 31 Aug 2025 14:24:44 +0000 (16:24 +0200)] 
tool: move the error buffer to the per transfer struct

To avoid having to alloc or manage it separately.

Closes #18442

3 months agotool_filetime: accept setting negative filetime
Daniel Stenberg [Sun, 31 Aug 2025 21:21:43 +0000 (23:21 +0200)] 
tool_filetime: accept setting negative filetime

This allows --remote-time to set dates before 1970.

Due to a minor omission in the API, it will still avoid setting the time
if it is indeed exactly epoch 0 (jan 1 1970).

Verified by test 762

Fixes #18424
Reported-by: Terence Eden
Closes #18443

3 months agotest500: accept 81 allocations
Daniel Stenberg [Sun, 31 Aug 2025 20:39:36 +0000 (22:39 +0200)] 
test500: accept 81 allocations

In some configs they happen

Closes #18441

3 months agoGHA/http3-linux: update dependency ngtcp2/ngtcp2 to v1.15.1
renovate[bot] [Sun, 31 Aug 2025 09:29:04 +0000 (09:29 +0000)] 
GHA/http3-linux: update dependency ngtcp2/ngtcp2 to v1.15.1

Closes #18439

3 months agoGHA/windows: update msys2/setup-msys2 digest to fb197b7
renovate[bot] [Sat, 30 Aug 2025 20:29:06 +0000 (20:29 +0000)] 
GHA/windows: update msys2/setup-msys2 digest to fb197b7

https://github.com/msys2/setup-msys2/releases/tag/v2.29.0

Includes perl 5.40.3.

Ref: 5bb49a485c1d34a088e37c18035897364f961559 #18425

Closes #18438

3 months agourlglob: only accept 255 globs
Daniel Stenberg [Fri, 29 Aug 2025 21:25:50 +0000 (23:25 +0200)] 
urlglob: only accept 255 globs

- using {} with single entries makes little sense
- when using {} sets with two entry lists, there can only be 64 to reach
  maximum number of URLs

Verify the max check in test 761

3 months agocurl_setup.h: include `stdint.h` earlier
Viktor Szakats [Fri, 29 Aug 2025 09:02:55 +0000 (11:02 +0200)] 
curl_setup.h: include `stdint.h` earlier

To have it included by the time checking for `SIZE_MAX` and `SSIZE_MAX`.

Ref: 93f333c18fffc3c091b149f3e0ec2ca02b8dab40 #18426 #18406

Closes #18430

3 months agocw-out: handle error codes for 0len writes
Stefan Eissing [Fri, 29 Aug 2025 08:20:12 +0000 (10:20 +0200)] 
cw-out: handle error codes for 0len writes

Handle errors returned by the callback the same for 0-length writes as
for all the others.

Closes #18428

3 months agongtcp2: handshake timeout should be equal to --connect-timeout
XCas13 [Fri, 29 Aug 2025 09:52:25 +0000 (13:52 +0400)] 
ngtcp2: handshake timeout should be equal to --connect-timeout

Default timeout is hardcoded (10 seconds) and doesn't respect
--connect-timeout parameter. In some cases 10 seconds can be not enough
or too long to "establish a connection". Moreover the non-working
--connect-timeout parameter for http3 is confusing. This change makes
the handshake timeout equal to --connect-timeout, if it's set.
Discussion is here https://github.com/curl/curl/discussions/18427

Closes #18431

3 months agoGHA/windows: fix perl 5.40.3 bump fallout with custom-built modules
Viktor Szakats [Thu, 28 Aug 2025 20:36:47 +0000 (22:36 +0200)] 
GHA/windows: fix perl 5.40.3 bump fallout with custom-built modules

Perl got bumped from 5.38.4 to 5.40.3. The new version crashes when
loading the `Win32::Process*` modules built and cached in CI. The build
job uses Perl 5.38.4.

To avoid the crash, include the Perl version (hashed) in the cache key,
so that it's only loaded when the Perl version matches.

This solution is imperfect, because some of the jobs will not use the
Perl modules in transition periods, when different jobs use different
Perl versions. Anyway, can't think of a better one for now. Another
option is to drop the effort with these modules. After all they did not
help with crashes and hangs, nor with performance. While adding quite
a bit of CI complexity.

Also:
- test early if the modules load and log the result.

Follow-up to 52775a7fb4ba63d66d60067dea4a5293fb7c55a1 #18296

Closes #18425

3 months agocurl_setup: use SIZE_MAX instead of SIZE_T_MAX
Daniel Stenberg [Fri, 29 Aug 2025 07:24:39 +0000 (09:24 +0200)] 
curl_setup: use SIZE_MAX instead of SIZE_T_MAX

As SIZE_MAX exists in C99

Assisted-by: Stefan Eissing
Assisted-by: Jay Satiro
Ref: #18406
Closes #18426

3 months agoclang-tidy: disable `clang-analyzer-security.ArrayBound`
Viktor Szakats [Thu, 28 Aug 2025 12:26:43 +0000 (14:26 +0200)] 
clang-tidy: disable `clang-analyzer-security.ArrayBound`

It's causing false-positives with clang-tidy v21, in cases in system
headers (seen in `FD_ISSET()` with macOS SDK). In some cases in
tests/server, there was no distinct source line that was triggering it.

Example:
```
/Applications/Xcode_16.4.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX15.5.sdk/usr/include/sys/_types/_fd_def.h:83:10: error: Potential out of bound access to 'fds_read.fds_bits' with tainted index [clang-analyzer-security.ArrayBound,-warnings-as-errors]
   83 |                 return _p->fds_bits[(unsigned long)_fd / __DARWIN_NFDBITS] & ((__int32_t)(((unsigned long)1) << ((unsigned long)_fd % __DARWIN_NFDBITS)));
      |                        ^
[...]
/Users/runner/work/curl/curl/tests/server/socksd.c:679:5: note: Taking false branch
  679 |     if(rc < 0) {
      |     ^
```

Closes #18422

3 months agoDEPRECATE.md: drop old OpenSSL versions
Daniel Stenberg [Wed, 27 Aug 2025 06:01:17 +0000 (08:01 +0200)] 
DEPRECATE.md: drop old OpenSSL versions

Closes #18413

3 months agocookie: simplifications
Daniel Stenberg [Thu, 28 Aug 2025 09:42:49 +0000 (11:42 +0200)] 
cookie: simplifications

- add Curl_secure_context(), to have it determined in a single place.

- tweak the Curl_cookie_getlist() proto. Move some logic into the
  function - at is only called in a single place. Instead of forcing the
  caller to do it.

- make 'is_ip' a const

Closes #18419

3 months agorequests: fix uninitialized var
Stefan Eissing [Thu, 28 Aug 2025 10:06:39 +0000 (12:06 +0200)] 
requests: fix uninitialized var

init char whose address is passed for a 0-length buffer, clang does not
like it

Refs #18418
Closes #18420

3 months agowebsocket: improve handling of 0-len frames
Stefan Eissing [Mon, 18 Aug 2025 15:12:35 +0000 (17:12 +0200)] 
websocket: improve handling of 0-len frames

Write out 9-length frames to client's WRITEFUNCTION
Read 0-length frames from READFUNCTION *if* the function
started a new frame via `curl_ws_start_frame()`.

Fixes #18286
Closes #18332
Reported-by: Andriy Druk
3 months agoRELEASE-NOTES: synced
Daniel Stenberg [Thu, 28 Aug 2025 07:51:22 +0000 (09:51 +0200)] 
RELEASE-NOTES: synced

3 months agoHTTP3.md: avoid `configure` issue for ngtcp2 1.14.0+ compatibility
Viktor Szakats [Wed, 27 Aug 2025 14:23:58 +0000 (16:23 +0200)] 
HTTP3.md: avoid `configure` issue for ngtcp2 1.14.0+ compatibility

Applied the same workaround to the build examples as used earlier in CI.
That is, drop `<path> from `--with-ngtcp2=<path>` and configure env
`PKG_CONFIG_PATH` instead.

Till the root cause is fixed.

Ref: 99500660af19f89069e71c2251c13963401b3806 #18028

Reported-by: Pavel Kropachev
Fixes #18188
Closes #18415

3 months agoDEPRECATE.md: drop support for c-ares versions before 1.16.0
Daniel Stenberg [Tue, 26 Aug 2025 22:11:38 +0000 (00:11 +0200)] 
DEPRECATE.md: drop support for c-ares versions before 1.16.0

in March 2026

That month, c-ares 1.16.0 celebrates its sixth birthday.

Closes #18408

3 months agoschannel: fix renegotiation
Jay Satiro [Fri, 1 Aug 2025 07:57:12 +0000 (03:57 -0400)] 
schannel: fix renegotiation

- Move the schannel_recv renegotiation code to function
  schannel_recv_renegotiate.

- Save the state of a pending renegotiation.

- Pre-empt schannel_recv and schannel_send to continue a pending
  renegotation.

- Partially block during renegotiation if necessary.

Prior to this change, since a1850ad7 (precedes 8.13.0), schannel_recv
did not properly complete renegotiation before attempting to decrypt
data. In some cases that could cause an error SEC_E_CONTEXT_EXPIRED.
Most of the time though DecryptMessage would succeed by chance and
return SEC_I_RENEGOTIATE which allowed the renegotiation to continue.

Reported-by: stephannn@users.noreply.github.com
Reported-by: Dustin L. Howett
Fixes https://github.com/curl/curl/issues/18029
Closes https://github.com/curl/curl/pull/18125

3 months agoschannel: fix memory leak during handshake
Jay Satiro [Wed, 27 Aug 2025 02:33:38 +0000 (22:33 -0400)] 
schannel: fix memory leak during handshake

Follow-up to b6a5f672 which improved the handshake procedure.

Ref: https://github.com/curl/curl/pull/18323

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

3 months agotests: remove the QUIT filters
Daniel Stenberg [Tue, 26 Aug 2025 14:06:35 +0000 (16:06 +0200)] 
tests: remove the QUIT filters

Once added in cd4aee156f64f44bb1f1 to work around connection shutdown
issues.

Closes #18405

3 months agowolfssl: simplify Curl_wssl_ctx_init
Daniel Stenberg [Tue, 26 Aug 2025 13:15:19 +0000 (15:15 +0200)] 
wolfssl: simplify Curl_wssl_ctx_init

by splitting out functions for client certificate and setting min/max
TLS version

Closes #18402

3 months agoGHA/linux: build `-O3` job with unity batches to save 10-15s
Viktor Szakats [Thu, 14 Aug 2025 21:43:34 +0000 (23:43 +0200)] 
GHA/linux: build `-O3` job with unity batches to save 10-15s

Before (build, test run):
https://github.com/curl/curl/actions/runs/16974205126/job/48118716664 25s, 12m56
https://github.com/curl/curl/actions/runs/16973102133/job/48114977897 24s, 12m51

After, with batch size 50 (build, test run):
https://github.com/curl/curl/actions/runs/17250901063/job/48952645881?pr=18293 16s, 12m51
https://github.com/curl/curl/actions/runs/17250901063/job/48953665204?pr=18293 17s, 12m42

Closes #18293

3 months agoftp: simplify
Daniel Stenberg [Tue, 26 Aug 2025 14:03:24 +0000 (16:03 +0200)] 
ftp: simplify

- Avoid checking what's always true. The ftpcode pointer is always
  passed in, so use it.
- Simplified an indent level somewhat
- Split out two functions from the state machine

Closes #18403

3 months agoruntests: remove warning message
Daniel Stenberg [Tue, 26 Aug 2025 14:05:07 +0000 (16:05 +0200)] 
runtests: remove warning message

Every time we first run runtests with -j and then again *without* -j,
this message was shown:

  "Warning: $runnerid: cleardir(log) failed"

Not anymore.

Closes #18404

3 months agosocks_sspi: simplify, clean up Curl_SOCKS5_gssapi_negotiate
Daniel Stenberg [Mon, 18 Aug 2025 15:10:35 +0000 (17:10 +0200)] 
socks_sspi: simplify, clean up Curl_SOCKS5_gssapi_negotiate

This function returned error on MANY places, each with its own cleanup
sequence and by the look of it almost all of them were incomplete,
making them leak resources on errors.

This take now gotos to the error label where it cleans everything up
before returning error. This also simplifies the function a lot.

Closes #18315

3 months agotool_getparam: let --trace-config override -v
Daniel Stenberg [Fri, 22 Aug 2025 14:58:28 +0000 (16:58 +0200)] 
tool_getparam: let --trace-config override -v

If --trace-config is used to set a level before -v is used, don't reset
the state on first -v (to "-all") as it otherwise does. This way,
--trace-config can be used to set specific trace items before -v on the
command line and it still works.

Previously, the first -v use would otherwise reset and undo the earlier
--trace-config items.

Fixes #18346
Closes #18361

3 months agoGHA/http3-linux: add AWS-LC and BoringSSL jobs
Viktor Szakats [Sun, 24 Aug 2025 19:29:23 +0000 (21:29 +0200)] 
GHA/http3-linux: add AWS-LC and BoringSSL jobs

Closes #18391

3 months agoGHA/curl-for-win: drop x86, fix zlib-classic, switch back to libssh
Viktor Szakats [Tue, 26 Aug 2025 09:42:21 +0000 (11:42 +0200)] 
GHA/curl-for-win: drop x86, fix zlib-classic, switch back to libssh

- switch x86 job to x64. x86 is not longer actively maintained in
  curl-for-win.
  Ref: https://github.com/curl/curl-for-win/discussions/68

- switch back from libssh2 to libssh.
  Reverts af8e1aa4b06e9dc78a559b485348e5464bd5cff5 #18257

- fix to really build with zlib-classic.
  Follow-up to 80768248700ae1e33fdedffd2e8bd78167b793aa #17357

Closes #18400

3 months agowrite-out.md: header_json is not included the json object
Daniel Stenberg [Tue, 26 Aug 2025 07:58:58 +0000 (09:58 +0200)] 
write-out.md: header_json is not included the json object

Fixes #18390
Reported-by: Sebastian Carlos
Closes #18399

3 months agotool_urlglob: add integer overflow protection
Daniel Stenberg [Tue, 26 Aug 2025 06:56:07 +0000 (08:56 +0200)] 
tool_urlglob: add integer overflow protection

It is most likely impossible to actually overflow, but this makes it
certain.

Closes #18398

3 months agoprojects: generate from a single template
Viktor Szakats [Mon, 25 Aug 2025 15:44:47 +0000 (17:44 +0200)] 
projects: generate from a single template

The three projects (VC10, VC11, VC12) are identical except 5 repeated
strings in them. They also require running `generate.bat` before use,
to populate source files. Reduce the 3 almost identical projects to
a single template project and populate the repeated strings also via
`generate.bat`. This reduces the maintenance burden to a single copy of
the project files. Also saving 10000 LOCs.

Closes #18396

3 months agoRELEASE-NOTES: synced
Daniel Stenberg [Mon, 25 Aug 2025 20:52:55 +0000 (22:52 +0200)] 
RELEASE-NOTES: synced

3 months agodocs: point two broken links to archive.org
Viktor Szakats [Mon, 25 Aug 2025 13:29:25 +0000 (15:29 +0200)] 
docs: point two broken links to archive.org

Closes #18393

3 months agoprojects: drop unused logic from `generate.bat`
Viktor Szakats [Mon, 25 Aug 2025 16:50:33 +0000 (18:50 +0200)] 
projects: drop unused logic from `generate.bat`

Follow-up to 5a0644fae8493bc50959f46b0891d661b31f66e2 #8442

Closes #18397

3 months agoopenssl: assume `OPENSSL_VERSION_NUMBER`
Viktor Szakats [Sat, 23 Aug 2025 22:36:52 +0000 (00:36 +0200)] 
openssl: assume `OPENSSL_VERSION_NUMBER`

It's defined in all supported OpenSSL versions and forks.

Also formatting in `md4.c`.

Closes #18388

3 months agoopenssl: BoringSSL / AWS-LC tidy-ups
Viktor Szakats [Sat, 23 Aug 2025 21:12:04 +0000 (23:12 +0200)] 
openssl: BoringSSL / AWS-LC tidy-ups

- schannel: apply BoringSSL workaround to AWS-LC too.
  Affects Schannel + AWS-LC MultiSSL builds. (not tested in CI)
  Ref: 274940d7438af7ef92ce3e11d75620db94675932 #2643 #2634

- curl_ntlm_core: deduplicate macro defines.

- curl_ntlm_core: document version thresholds for an AWS-LC-specific
  workaround.
  It was necessary between v1.2.0 2022-09-01 and v1.30.1 2024-06-21.
  No longer necessary since v1.31.0 2024-07-01:
  https://github.com/aws/aws-lc/commit/ba94617d99c18949711e8e405721ea85a2b38c3f
  Follow-up to 34ef4fab22d93cf7ef1d6c2954a0bad19f323ea9 #10320

- lib758: drop redundant OpenSSL version guards.
  `OPENSSL_VERSION_NUMBER > 3` automatically guards against LibreSSL,
  BoringSSL and AWS-LC.
  Ref: https://github.com/curl/curl/pull/18288/commits/6ddd8f2c0bbfcb0847b1ee7f257fb772fa47310c
  Follow-up to a5f0ab7995bbb6e269feb3a516f804a65c753705 #18288

- dllmain, curl_sha512_256: formatting.

Closes #18387

3 months agoGHA/linux: add BoringSSL job, with runtests, pytests and cache
Viktor Szakats [Sat, 23 Aug 2025 19:32:08 +0000 (21:32 +0200)] 
GHA/linux: add BoringSSL job, with runtests, pytests and cache

Ref: cff4c16b83b1cc57469b2f729d1d06c7828f9f0f #18385
Cherry-picked from #18384
Closes #18386

3 months agodocs: fix link CONTRIBUTE.md link
Simon Dalvai [Fri, 22 Aug 2025 21:50:08 +0000 (23:50 +0200)] 
docs: fix link CONTRIBUTE.md link

Closes #18372

3 months agomdlinkcheck: handle links with a leading slash properly
Daniel Stenberg [Sat, 23 Aug 2025 14:37:07 +0000 (16:37 +0200)] 
mdlinkcheck: handle links with a leading slash properly

Ref: #18372
Closes #18382

3 months agopytest: fix test_17_09_ssl_min_max for BoringSSL
Viktor Szakats [Sat, 23 Aug 2025 20:02:03 +0000 (22:02 +0200)] 
pytest: fix test_17_09_ssl_min_max for BoringSSL

Ref: https://github.com/curl/curl/actions/runs/17179514833/job/48740057095

Also fix indent.

Cherry-picked from #18384
Closes #18385

3 months agoopenssl: sync an AWS-LC guard with BoringSSL
Viktor Szakats [Sat, 23 Aug 2025 18:52:16 +0000 (20:52 +0200)] 
openssl: sync an AWS-LC guard with BoringSSL

BoringSSL always used the same type:
https://boringssl.googlesource.com/boringssl/+/103ed08549a74af9f03363c633028faf9a475066
https://github.com/google/boringssl/commit/103ed08549a74af9f03363c633028faf9a475066

But, this codepath isn't built with BoringSSL, because it defines
`OPENSSL_NO_OCSP` via `opensslconf.h`.

Also drop an out-of-place `#endif` comment.

Ref: 20f4e94eebbdcfe590ae99cb8a3f2ca1b8f970a0 #11568

Closes #18384

3 months agoopenssl: drop single-use interim macro `USE_OPENSSL_SRP`
Viktor Szakats [Sat, 23 Aug 2025 18:29:38 +0000 (20:29 +0200)] 
openssl: drop single-use interim macro `USE_OPENSSL_SRP`

Closes #18383

3 months agoasyn-thrdd: more simplifications
Stefan Eissing [Sat, 23 Aug 2025 12:15:13 +0000 (14:15 +0200)] 
asyn-thrdd: more simplifications

- use wakeup sockets non-locked.
- send wakeup notify only in normal control flow (not cancel). close
  wakeup sockets in unlink only.
- remove 5ms thread lifetime wait crutch before pthread_cancel().

Closes #18380

3 months agoGHA/http3-linux: build ngtcp2 for LibreSSL too, add LibreSSL jobs
Viktor Szakats [Sat, 23 Aug 2025 09:24:20 +0000 (11:24 +0200)] 
GHA/http3-linux: build ngtcp2 for LibreSSL too, add LibreSSL jobs

Also: Build LibreSSL with cmake. It's 3x faster (90s -> 30s).

Follow-up to e724259bcbb5cf8b3b12e0ff0fd90d2aa47f8f46 #18379
Follow-up to 31e6798544bf8aafbd8aef61b08623b92312aa42 #18377
Cherry-picked from #18377
Closes #18381

3 months agobuild: support LibreSSL native crypto lib with ngtcp2 1.15.0+
Viktor Szakats [Sat, 23 Aug 2025 08:48:12 +0000 (10:48 +0200)] 
build: support LibreSSL native crypto lib with ngtcp2 1.15.0+

In ngtcp2 1.15.0 the LibreSSL crypto interface library got its own name:
`libngtcp2_crypto_libressl`. In previous versions it used
`libngtcp2_crypto_quictls`, shared with quictls itself (but not
compatible with).

Adapt autotools and cmake scripts to look for the new name first, and
fall back to the old one if not found.

Fallback to quictls tested OK in CI with both autotools and cmake:
https://github.com/curl/curl/actions/runs/17174994908?pr=18377

Ref: https://github.com/ngtcp2/ngtcp2/releases/tag/v1.15.0
Ref: https://github.com/ngtcp2/ngtcp2/pull/1716

Closes #18377

3 months agoGHA: update ngtcp2/ngtcp2 to v1.15.0
renovate[bot] [Sat, 23 Aug 2025 10:43:24 +0000 (10:43 +0000)] 
GHA: update ngtcp2/ngtcp2 to v1.15.0

Closes #18379

3 months agotool_operate: bail out better on no URL
Daniel Stenberg [Sat, 23 Aug 2025 08:16:49 +0000 (10:16 +0200)] 
tool_operate: bail out better on no URL

To avoid NULL derferences with many outputs and --next.

Follow-up to 034612cd515f249453a435f3d94b

Add test 760 to verify

Reported-by: BobodevMm on github
Fixes #18375
Closes #18376

3 months agoconfigure: tidy up internal names in ngtcp2 ossl detection logic
Viktor Szakats [Sat, 23 Aug 2025 09:33:31 +0000 (11:33 +0200)] 
configure: tidy up internal names in ngtcp2 ossl detection logic

Replace "quictls" with "ossl".

Follow-up to 5eefdd71a394d135c0ffb56fb8ec117c87dbe4f0 #17027
Cherry-picked from #18377
Closes #18378

3 months agotidy-up: formatting
Viktor Szakats [Thu, 31 Jul 2025 06:37:13 +0000 (08:37 +0200)] 
tidy-up: formatting

Closes #18373

3 months agoasyn-thrdd: fix no `HAVE_GETADDRINFO` builds
Viktor Szakats [Fri, 22 Aug 2025 21:55:47 +0000 (23:55 +0200)] 
asyn-thrdd: fix no `HAVE_GETADDRINFO` builds

mingw32ce, CM 4.4.0-arm schannel:
```
lib/asyn-thrdd.c: In function 'gethostbyname_thread':
lib/asyn-thrdd.c:349: error: too many arguments to function 'async_thrd_cleanup'
```
Ref: https://github.com/curl/curl/actions/runs/17158865566/job/48682687295?pr=18039#step:9:21

Follow-up to 88fc6c491f043ed184ea2cf1a17b651427fbbbf5 #18263
Closes #18371

3 months agocmake: `CURL_CA_FALLBACK` only works with OpenSSL
Viktor Szakats [Fri, 22 Aug 2025 15:54:23 +0000 (17:54 +0200)] 
cmake: `CURL_CA_FALLBACK` only works with OpenSSL

Ref: 2f6524ce3c3a8231c62d1e0c8af509fe5b0228a0 #18364
Ref: #18362

Closes #18365

3 months agoTODO: remove the expand ~ idea
Daniel Stenberg [Fri, 22 Aug 2025 15:21:11 +0000 (17:21 +0200)] 
TODO: remove the expand ~ idea

As we can expand evironment variables now, HOME can easily be used
instead.

Ref: #18240
Closes #18363

3 months agoacinclude: --with-ca-fallback only works with OpenSSL
Daniel Stenberg [Fri, 22 Aug 2025 15:30:36 +0000 (17:30 +0200)] 
acinclude: --with-ca-fallback only works with OpenSSL

Make it error if another TLS backend is used. Also tweaked the
documentation for it to make it more clear it is only for OpenSSL.

Follow-up to 9cf47593542c6f

Reported-by: Michael Osipov
Fixes #18362
Closes #18364

3 months agoopenssl: merge two `#if` blocks
Viktor Szakats [Fri, 22 Aug 2025 19:43:44 +0000 (21:43 +0200)] 
openssl: merge two `#if` blocks

Cherry-picked from #18330
Closes #18370

3 months agoopenssl: use `RSA_flags()` again with BoringSSL
Viktor Szakats [Fri, 22 Aug 2025 17:11:53 +0000 (19:11 +0200)] 
openssl: use `RSA_flags()` again with BoringSSL

Supported since 2017-12-18:
https://github.com/google/boringssl/commit/a0c87adbf0bc23810895ebd7f131790f137d2f6d

Follow-up to cd276c3cca4db23384f3272486468ce41b0a338b #2117

Closes #18369

3 months agoopenssl: enable `HAVE_KEYLOG_CALLBACK` for AWS-LC
Viktor Szakats [Fri, 22 Aug 2025 17:10:55 +0000 (19:10 +0200)] 
openssl: enable `HAVE_KEYLOG_CALLBACK` for AWS-LC

Supported by all AWS-LC versions:
https://github.com/aws/aws-lc/commit/6e3f5cc7e16b8ab1b0a924c60f14332cb1697217

Closes #18368

3 months agoopenssl: drop redundant `HAVE_OPENSSL_VERSION` macro
Viktor Szakats [Fri, 22 Aug 2025 16:36:30 +0000 (18:36 +0200)] 
openssl: drop redundant `HAVE_OPENSSL_VERSION` macro

It served as an extra guard over `OPENSSL_VERSION_STRING`.

Also, document that `OPENSSL_VERSION_STRING` is supported by OpenSSL 3+.

Closes #18367

3 months agoopenssl: add and use `HAVE_BORINGSSL_LIKE` internal macro
Viktor Szakats [Fri, 22 Aug 2025 14:24:26 +0000 (16:24 +0200)] 
openssl: add and use `HAVE_BORINGSSL_LIKE` internal macro

To cover the common case of guarding for both BoringSSL and AWS-LC.

Cherry-picked from #18330
Closes #18358

3 months agoopenssl: add and use `HAVE_OPENSSL3` internal macro
Viktor Szakats [Fri, 22 Aug 2025 14:38:32 +0000 (16:38 +0200)] 
openssl: add and use `HAVE_OPENSSL3` internal macro

Cherry-picked from #18330
Closes #18360

3 months agoopenssl: drop more legacy cruft
Viktor Szakats [Fri, 22 Aug 2025 14:42:06 +0000 (16:42 +0200)] 
openssl: drop more legacy cruft

- drop `ALLOW_RENEG` undocumented (insecure) build-time option.
- drop unnecessary check for `OPENSSL_VERSION_NUMBER`.
  It's present in all supported OpenSSL versions and forks.

Follow-up to 80c10c5d5dda78c471924b251e9db59d653aba1e #18351
Follow-up to 59311bd3df5da6342312b5dc9b6c91fc2be77d4f #3293 #3283

Closes #18359

3 months agotool_operate: use stricter curl_multi_setopt() arguments
Daniel Stenberg [Fri, 22 Aug 2025 14:15:11 +0000 (16:15 +0200)] 
tool_operate: use stricter curl_multi_setopt() arguments

To please the curl_multi_setopt() typechecker

- set multi callback protypes to match exactylu
- set CURLMOPT_MAX_HOST_CONNECTIONS as a long

Closes #18357

3 months agotypecheck-gcc: add type checks for curl_multi_setopt()
Daniel Stenberg [Fri, 22 Aug 2025 13:54:10 +0000 (15:54 +0200)] 
typecheck-gcc: add type checks for curl_multi_setopt()

Test 745 verifies that all options are tested.

Closes #18357

3 months agoruntests: show still running tests when nothing has happened for a while
Daniel Stenberg [Fri, 22 Aug 2025 09:44:35 +0000 (11:44 +0200)] 
runtests: show still running tests when nothing has happened for a while

... even if there are tests still pending. To help visualize tests that
might be hanging.

Attempts to set the limit at 10 seconds of silence.

Closes #18349

3 months agoasyn-thrdd: manage DEFERRED and locks better
Stefan Eissing [Fri, 22 Aug 2025 13:24:04 +0000 (15:24 +0200)] 
asyn-thrdd: manage DEFERRED and locks better

- cancel thread waits until thread start is at least 5ms in the past
  to give it some time to get its cancellation setup in place
- cancel thread without holding the mutex. It's supposed to be an
  async operation, but better be safe
- set DEFERRED cancel state explicitly, should be default in a pthread,
  but better be safe

Closes #18350

3 months agotop-complexity: maximum accepted set to 72
Daniel Stenberg [Fri, 22 Aug 2025 11:38:57 +0000 (13:38 +0200)] 
top-complexity: maximum accepted set to 72

Down from 80. Show all functions above 60.

Closes #18354

3 months agotool_urlglob: handle a zero length glob piece
Daniel Stenberg [Fri, 22 Aug 2025 11:30:30 +0000 (13:30 +0200)] 
tool_urlglob: handle a zero length glob piece

Follow-up to 034612cd515f249453a435f3d94b

Add test 759 to verify

Reported-by: Stanislav Osipov
Fixes #18352
Closes #18353

3 months agoopenssl: remove legacy cruft, document macro guards
Viktor Szakats [Fri, 22 Aug 2025 09:47:50 +0000 (11:47 +0200)] 
openssl: remove legacy cruft, document macro guards

- assume:
  - `BIO_CTRL_EOF`
  - `SSL_CTRL_SET_MSG_CALLBACK`
  - `SSL_CTRL_SET_MSG_CALLBACK`
  - `SSL_CTRL_SET_TLSEXT_HOSTNAME`
  - `SSL_MODE_ACCEPT_MOVING_WRITE_BUFFER`
  - `SSL_OP_DONT_INSERT_EMPTY_FRAGMENTS`
  - `SSL_OP_NETSCAPE_REUSE_CIPHER_CHANGE_BUG`
  - `SSL_OP_NO_COMPRESSION`
  - `SSL_OP_NO_TICKET`
  - `X509_V_FLAG_PARTIAL_CHAIN`
  - `X509_V_FLAG_TRUSTED_FIRST`
  They are present in all supported OpenSSL (and fork) versions.

- replace `SSL_ERROR_WANT_EARLY` with `SSL_ERROR_WANT_CLIENT_HELLO_CB`.
  The former appeared in OpenSSL 1.1.1-dev, but renamed before
  the stable release.

- document support for macros:
  - `ENGINE_CTRL_GET_CMD_FROM_NAME`
  - `SSL_ERROR_WANT_ASYNC_JOB`
  - `SSL_ERROR_WANT_ASYNC`
  - `SSL2_VERSION_MAJOR`
  - `TLS1_3_VERSION`

- drop legacy fallback for `CONF_MFLAGS_DEFAULT_SECTION`.
  It was there for OpenSSL 0.9.8 support.

- fix `SSL_CTRL_SET_MSG_CALLBACK` accidentally serving as a guard for
  OpenSSL (and forks) as a whole.

Tested OK with OpenSSL 1.0.2 and 1.1.0 in CI.

Closes #18351

3 months agospelling: file system
Viktor Szakats [Fri, 22 Aug 2025 09:07:50 +0000 (11:07 +0200)] 
spelling: file system

Closes #18348

3 months agoexamples: make `CURLPIPE_MULTIPLEX` fallback `long`
Viktor Szakats [Fri, 22 Aug 2025 11:50:39 +0000 (13:50 +0200)] 
examples: make `CURLPIPE_MULTIPLEX` fallback `long`

Closes #18356

3 months agotest1557: pass `long` type to `multi_setopt()`
Viktor Szakats [Fri, 22 Aug 2025 11:45:06 +0000 (13:45 +0200)] 
test1557: pass `long` type to `multi_setopt()`

A wrong type here has seen to manifest in CI failures with gcc-12 macOS.

Ref: https://github.com/curl/curl/pull/18348#issuecomment-3213881790
Ref: https://github.com/curl/curl/actions/runs/17153761944/job/48665734013?pr=18349

Follow-up to b63cce7fee30648e29a0453202f7ba05a01de79c #18339
Follow-up to 88fc6c491f043ed184ea2cf1a17b651427fbbbf5 #18263

Closes #18355

3 months agoasyn-thrdd: fix --disable-socketpair builds
Stefan Eissing [Fri, 22 Aug 2025 07:58:51 +0000 (09:58 +0200)] 
asyn-thrdd: fix --disable-socketpair builds

Regression from #18339

Reported-by: Marcel Raad
Closes #18347

3 months agoares: use `ares_strerror()` to retrieve error messages
Stefan Eissing [Mon, 11 Aug 2025 13:58:11 +0000 (15:58 +0200)] 
ares: use `ares_strerror()` to retrieve error messages

Add optional detail to `Curl_resolver_error()` to add to failure message
where available. This makes, for c-ares, the reason for a failed
resource available to the user without extra trace config.

When "dns" tracing enabled, print the c-ares server config at the start
of a resolve.

Closes #18251

3 months agoasyn-thrdd: remove condition variable
Stefan Eissing [Thu, 21 Aug 2025 19:50:20 +0000 (21:50 +0200)] 
asyn-thrdd: remove condition variable

Add a flag `thrd_don` to assess if the resolving thread has finished and
only destroy the context when *both* ref_count reaches 0 and thrd_done
is true.

Closes #18345

3 months agoRevert "asyn-thrdd: use condition var more carefully"
Daniel Stenberg [Fri, 22 Aug 2025 07:05:19 +0000 (09:05 +0200)] 
Revert "asyn-thrdd: use condition var more carefully"

This reverts commit bd4622bfaf0929141e6b81653c88ea06e47afe9e.

Not intended for merge!

3 months agoasyn-thrdd: use condition var more carefully
Stefan Eissing [Thu, 21 Aug 2025 19:19:27 +0000 (21:19 +0200)] 
asyn-thrdd: use condition var more carefully

When the thread started is too fast, the signal will come before the
wait. Add an additional check before the wait to catch the thread
having started or already ended.

Closes #18344

3 months agoschannel: improve handshake procedure
Jay Satiro [Wed, 20 Aug 2025 06:10:53 +0000 (02:10 -0400)] 
schannel: improve handshake procedure

- During handshake, do not require reading more data if unprocessed
  encrypted data that may be a complete TLS record is already available.

- During handshake, check that the socket is writeable before processing
  encrypted data that may require an immediate reply to the server.

These two fixes are for issues that were found during renegotiation
testing but could affect any handshake.

Prior to this change it was possible in some abnormal network conditions
for the Schannel TLS handshake procedure to erroneously wait or error.

Ref: https://github.com/curl/curl/pull/18125

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

3 months agoappveyor: drop testing with OpenSSL 1.1.0
Viktor Szakats [Thu, 21 Aug 2025 15:47:03 +0000 (17:47 +0200)] 
appveyor: drop testing with OpenSSL 1.1.0

Replace with 1.1.1.

Follow-up to 12a10ca77cedec4bf6f3cebe5c3a883387ccb0d2 #18337
Cherry-picked from #18330
Closes #18341

3 months agognutls: fix building with older supported GnuTLS versions
Viktor Szakats [Thu, 21 Aug 2025 10:09:17 +0000 (12:09 +0200)] 
gnutls: fix building with older supported GnuTLS versions

Also:
- GHA/linux-old: switch jobs from OpenSSL 1.0.2 to GnuTLS 3.5.8.

Ref: https://gitlab.com/gnutls/gnutls/blob/master/NEWS
Follow-up to fa0ccd9f1fbbbd77bf50b26e3ba231ea6c729474 #15774
Follow-up to 68bd759c2bfe74799c3355ad29265b795a7e6c62 #15667
Cherry-picked from #18330
Closes #18335

3 months agoappveyor: drop testing with OpenSSL 1.0.2
Viktor Szakats [Thu, 21 Aug 2025 11:40:05 +0000 (13:40 +0200)] 
appveyor: drop testing with OpenSSL 1.0.2

Cherry-picked from #18330
Closes #18337

3 months agoasyn-thrdd: addressing stalls in ci
Stefan Eissing [Thu, 21 Aug 2025 12:51:29 +0000 (14:51 +0200)] 
asyn-thrdd: addressing stalls in ci

Disable pthread_cancel in pushed cleanup function. Close wakeup socket
when shutting down resolving, since we no longer want wakeups.

Closes #18339

3 months agoGHA/non-native: drop MS-DOS jobs, requires OpenSSL 1.0.2
Viktor Szakats [Thu, 21 Aug 2025 11:42:32 +0000 (13:42 +0200)] 
GHA/non-native: drop MS-DOS jobs, requires OpenSSL 1.0.2

Cherry-picked from #18330
Closes #18338