]> git.ipfire.org Git - thirdparty/curl.git/log
thirdparty/curl.git
7 hours agoperl: `|| die` -> `or die` master
Viktor Szakats [Sun, 14 Jun 2026 23:26:04 +0000 (01:26 +0200)] 
perl: `|| die` -> `or die`

Usage was fifty-fifty between these syntaxes before this patch.

Closes #22036

8 hours agosetopt: mark function argument as unused *properly*
Daniel Stenberg [Mon, 15 Jun 2026 20:58:19 +0000 (22:58 +0200)] 
setopt: mark function argument as unused *properly*

Closes #22035

9 hours agoverify-release: don't unpack in git repo
Daniel Stenberg [Mon, 15 Jun 2026 15:11:53 +0000 (17:11 +0200)] 
verify-release: don't unpack in git repo

- Clarify that the tarball to verify should be put in the same dir you
  run the script.

- Verify that the curl version number in the file name matches the
  version number within the tarball. To reduce risk for mistakes.

- When verifying using git, do not unpack the tarball. It avoids the
  security risk with malicious tarball contents playing tricks on git.

- Only unpack the tarball for git-less verfication.

- Move the source tarball into _tarballs/ instead of overwriting it,
  which can be useful in case the verification fails

Closes #22032

9 hours agocf-https-connect: do not engage on proxy origin
Stefan Eissing [Mon, 15 Jun 2026 15:13:00 +0000 (17:13 +0200)] 
cf-https-connect: do not engage on proxy origin

When talking to a forwarding proxy, do not start HTTPS Eyeballing.
We might support this in the future, but for now, the --httpx.x
arguments to do not apply to such a setup.

Add a test case for forward proxying without use of ALPN.

Closes #22033

9 hours agocookie: use origin scheme for secure context check
Dave Walker [Mon, 15 Jun 2026 11:57:42 +0000 (12:57 +0100)] 
cookie: use origin scheme for secure context check

`Curl_secure_context()` checked `conn->scheme` to determine if Secure
cookies may be sent. Since 73daec6, `conn->scheme` is set to the proxy's
scheme when using an HTTPS forwarding proxy, causing the function to
return TRUE for HTTP origins. This leaked Secure cookies over the
plaintext connection between proxy and origin.

Use `data->state.origin->scheme` instead, which always reflects the
origin's scheme regardless of proxy configuration.

Not an approved vulnerability because the regression was introduced
after the last release and is not present in any released version.

Verified by test 3401

Follow-up to 73daec6620bf9983df89e8df3660bfa3b8fd501d
Reported-by: daviey on hackerone
URL: https://hackerone.com/reports/3803415
Closes #22024

9 hours agotls: wolfssl: fixes for PQC key shares
Tobias Frauenschläger [Mon, 15 Jun 2026 14:51:18 +0000 (16:51 +0200)] 
tls: wolfssl: fixes for PQC key shares

This PR makes the wolfssl TLS backend work properly for PQC key
exchanges. The following issues are fixed:
* WOLFSSL_HAVE_KYBER is not present anymore in upstream wolfssl (for a
  long time actually), so it has no use and the ML-KEM functionality was
  never turned on properly.
* Key share group selection (via --curves) is now handled via the
  generic wolfSSL_CTX_set1_groups_list() method instead of the prior
  wolfSSL_CTX_set1_curves_list() and the additonal PQC handling. This
  removes a lot of PQC related special handling and the behavior now
  matches the OpenSSL backend.
* The default QUIC group setting has been removed. For QUIC, the key
  share as well as the list in the supported_groups extension is now
  handled all within wolfssl. This also supports --curves properly now.

Closes #22030

10 hours agoservers: silence `-Wunused-result` with pragma
Viktor Szakats [Mon, 15 Jun 2026 19:27:51 +0000 (21:27 +0200)] 
servers: silence `-Wunused-result` with pragma

In some configurations the `write()` functions gets the
`warn_unused_result` attribute, that makes casting to `(void)`
ineffective to silence this warning. Seen with glibc, in 5 CI jobs.
The warning option appeared in GCC 4.5 and comes enabled by default.

```
tests/server/util.c:329:5: error: ignoring return value of ‘write’ declared with attribute ‘warn_unused_result’ [-Werror=unused-result]
  329 |     write(STDERR_FILENO, msg, sizeof(msg) - 1);
      |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
```
Ref: https://github.com/curl/curl/actions/runs/27548333990/job/81427544632

Refs:
https://github.com/curl/curl/pull/22023#issuecomment-4708455631
https://gcc.gnu.org/onlinedocs/gcc-16.1.0/gcc/Warning-Options.html#index-Wunused-result
https://gcc.gnu.org/onlinedocs/gcc-16.1.0/gcc/Common-Attributes.html#index-warn_005funused_005fresult
https://stackoverflow.com/questions/40576003/ignoring-warning-wunused-result

Follow-up to c8d8f081fd62c68c588f8963a8e441c730a23b5b #22023
Follow-up to e95f509c66abdd88ae02e3243cdc217f19c4a330 #16852

Closes #22034

13 hours agoservers: fix off-by-3 OOB write for large `loghex()` inputs
Viktor Szakats [Mon, 15 Jun 2026 15:04:44 +0000 (17:04 +0200)] 
servers: fix off-by-3 OOB write for large `loghex()` inputs

Spotted by GitHub Code Quality

Closes #22031

13 hours agowinldap: avoid NULL pointer deref on `ldap_get_dn()` fail
Viktor Szakats [Sun, 14 Jun 2026 10:12:53 +0000 (12:12 +0200)] 
winldap: avoid NULL pointer deref on `ldap_get_dn()` fail

In non-Unicode builds.

Assisted-by: Jay Satiro
Closes #22000

15 hours agocurl_formdata: fix to pass long where missing, document `CURLFORM_NAMELENGTH`
Viktor Szakats [Mon, 15 Jun 2026 09:47:05 +0000 (11:47 +0200)] 
curl_formdata: fix to pass long where missing, document `CURLFORM_NAMELENGTH`

- lib650: pass `long` to `CURLFORM_NAMELENGTH` in test.
  Spotted by Copilot.
  https://github.com/curl/curl/pull/22011#discussion_r3412407235
  Follow-up to 3620e569b312476f1e63b298106f942079b5afe8

- lib650: drop an interim variable, and interim casts.
  Follow-up to 60776a0515c2a8f572902ad5bcc9f63eeaeafa84 #2747

- curl_formdata.md: document `CURLFORM_NAMELENGTH` on man page.

- curl_formdata.md: pass `long` to `CURLFORM_BUFFERLENGTH` on man page.

- formdata: pass `long` to `CURLFORM_CONTENTSLENGTH` in comment.

Closes #22017

15 hours agoservers: accept `lstat()` failing due to the file missing
Viktor Szakats [Mon, 15 Jun 2026 09:18:14 +0000 (11:18 +0200)] 
servers: accept `lstat()` failing due to the file missing

In `bind_unix_socket()`, before retrying `bind()`.

Before this patch the code wanted to check if the to-be-deleted unix
socket path was indeed a socket, before deleting it and retrying to
bind. If `lstat()` failed for any reason, it skipped retry. Fix to retry
if `lstat()` failed because of the file missing.

Ref: https://pubs.opengroup.org/onlinepubs/9799919799/functions/lstat.html

Follow-up to 0882e3951d910b923f3463fa98604df9fcb13a0c #22026
Follow-up to 03bc93bd327e06e86af0b0c14a888f7482affedc #22021
Follow-up to e70f8ebd34edade24df442152f52b361abaf4309 #22020
Follow-up to 30e491e5c921aecca5a16083d8185840dc64eccd #7034
Follow-up to 99fb36797a3f0b64ad20fcb8b83026875640f8e0

Closes #22010

16 hours agoratelimits: use minimal burst rate
Stefan Eissing [Mon, 15 Jun 2026 08:19:56 +0000 (10:19 +0200)] 
ratelimits: use minimal burst rate

Some protocols (and servers) prefer to batch IO and will not send data
unless the window is of sufficient size. Set the burst rate for our
rate limits to a minimum of 32KB to prevent stalling.

Reported-by: Tatsuhiro Tsujikawa
Closes #22016

16 hours agocf-setup: own source file
Stefan Eissing [Mon, 15 Jun 2026 11:48:24 +0000 (13:48 +0200)] 
cf-setup: own source file

Move the setup filter into its own source file.

Move the main connect driving function, `Curl_conn_connect()`,
from cfilters.c to connect.c.

Closes #22022

16 hours agolib668: do not assume null-terminator in test input data
Viktor Szakats [Mon, 15 Jun 2026 12:41:19 +0000 (14:41 +0200)] 
lib668: do not assume null-terminator in test input data

For correctness. Did not cause an issue, because the null-terminator is
present.

Also:
- change a size type to avoid casts.
- reuse input length value.

Spotted by GitHub Code Quality

Follow-up to 1e4cb333ef632bf081045bb7b36f0736bec52708 #4826

Closes #22027

16 hours agoservers: accept `unlink()` failing due to the file missing
Viktor Szakats [Mon, 15 Jun 2026 13:08:09 +0000 (15:08 +0200)] 
servers: accept `unlink()` failing due to the file missing

In `bind_unix_socket()`, before retrying `bind()`.

This patch uses `ENOENT`. This was last time in source between
d25b0503795f1fbf557632ce870298f52f2a78c1 (2018) and
dffd996e3b54a0c9314b1c93c7f837a5b2b1fc3d (2023), and also earlier. Also
defined by supported Windows envs. Seems safe to use.

Reported-by CodeQL
Follow-up to 99fb36797a3f0b64ad20fcb8b83026875640f8e0
Cherry-picked from #22010

Closes #22028

16 hours agoverify-release: verify more thoroughly with git
Daniel Stenberg [Mon, 15 Jun 2026 10:15:56 +0000 (12:15 +0200)] 
verify-release: verify more thoroughly with git

If the script is invoked in a git repository it verifies the tarball
better.

Closes #22018

16 hours agocf-capsule: complete filter
Stefan Eissing [Mon, 15 Jun 2026 10:34:09 +0000 (12:34 +0200)] 
cf-capsule: complete filter

Make the capsule filter complete, implement:

- pollset handling
- flush handling and querying
- shutdown handling
- replace allocated send buffer with a bufq

Closes #22019

17 hours agosrc/test: avoid (void)! constructs
Daniel Stenberg [Mon, 15 Jun 2026 11:52:52 +0000 (13:52 +0200)] 
src/test: avoid (void)! constructs

The reason to use them seems to be that just (void) before a function
call is not enough to silence compiler warnings when return codes are
ignored and -Werror=unused-result is used.

While (void)! apparently works to silence those warnings, it is just too
weird and surprising to readers to use.

It is rather a reason to reconsider the usefulness of the warning.

Closes #22023

17 hours agochecksrc: detect and warn for (void)!
Daniel Stenberg [Mon, 15 Jun 2026 11:51:52 +0000 (13:51 +0200)] 
checksrc: detect and warn for (void)!

It's plain weird. Don't do it.

Closes #22023

17 hours agoVULN-DISCLOSURE-POLICY: non-released code
Daniel Stenberg [Mon, 15 Jun 2026 12:03:20 +0000 (14:03 +0200)] 
VULN-DISCLOSURE-POLICY: non-released code

Closes #22025

17 hours agoservers: mask to `S_IFMT` in unix socket path attribute check
Viktor Szakats [Mon, 15 Jun 2026 12:03:07 +0000 (14:03 +0200)] 
servers: mask to `S_IFMT` in unix socket path attribute check

Instead of `S_IFSOCK` before this patch. For correctness; it is probably
not an issue in most environments.

Spotted by Copilot
Bug: https://github.com/curl/curl/pull/22021#discussion_r3413049506
Follow-up to 99fb36797a3f0b64ad20fcb8b83026875640f8e0

Closes #22026

18 hours agotransfer: adapt Curl_xfer_is_secure()
Stefan Eissing [Mon, 15 Jun 2026 07:10:28 +0000 (09:10 +0200)] 
transfer: adapt Curl_xfer_is_secure()

Now that `conn->origin` can be the proxy, we need to change how
Curl_xfer_is_secure() and some other places work.

Pointed out by Codex Security

Closes #22015

18 hours agoservers: drop unix socket path attribute check on Windows
Viktor Szakats [Mon, 15 Jun 2026 11:11:30 +0000 (13:11 +0200)] 
servers: drop unix socket path attribute check on Windows

On Windows there is no `lstat()`, which was later substituted with
normal `stat()`, but on Windows `S_IFSOCK` is never defined, which meant
the output of stat was not actually used, reducing this to checking for
the presence of the file, and bailing out without retry if missing.

Follow-up to 30e491e5c921aecca5a16083d8185840dc64eccd #7034
Follow-up to 99fb36797a3f0b64ad20fcb8b83026875640f8e0

Cherry-picked from #22010

Closes #22021

18 hours agoservers: fix error message if unix socket path is not a socket
Viktor Szakats [Mon, 15 Jun 2026 10:48:59 +0000 (12:48 +0200)] 
servers: fix error message if unix socket path is not a socket

Follow-up to 99fb36797a3f0b64ad20fcb8b83026875640f8e0
Cherry-picked from #22010

Closes #22020

20 hours agolibtests: prefer `sizeof()` over `strlen()`, fix potential OOB read in 1591
Viktor Szakats [Sun, 14 Jun 2026 19:54:06 +0000 (21:54 +0200)] 
libtests: prefer `sizeof()` over `strlen()`, fix potential OOB read in 1591

- test1591: fix potential OOB read.
  Spotted by GitHub Code Quality
  Follow-up to f464535bfdd9a83140d8a13c3fe3d937239d1c2a #3350

Closes #22011

23 hours agourlapi: refactor and simplify curl_url_set
Daniel Stenberg [Sun, 14 Jun 2026 20:56:14 +0000 (22:56 +0200)] 
urlapi: refactor and simplify curl_url_set

Create and make use of:

- url_encode_part()
- url_uppercasehex_part()
- url_append_query()
- url_sethost()

Closes #22012

28 hours agotidy-up: prefer spelling 'flavor', where missing
Viktor Szakats [Mon, 15 Jun 2026 00:44:59 +0000 (02:44 +0200)] 
tidy-up: prefer spelling 'flavor', where missing

In comments and two internal build variables.

Closes #22014

29 hours agocmake/FindGSS: fix comment, adjust custom flavor property name
Viktor Szakats [Mon, 15 Jun 2026 00:14:13 +0000 (02:14 +0200)] 
cmake/FindGSS: fix comment, adjust custom flavor property name

- fix property name in comment.
- rename `INTERFACE_CURL_GSS_FLAVOUR` ->
  `INTERFACE_CURL_GSS_FLAVOR` to match preferred usage.

Follow-up to 8aeefd0b353021053688e53fc3a4b0edef85dcc7 (subcommit)
Follow-up to 16f073ef49f94412000218c9f6ad04e3fd7e4d01 #16973

Closes #22013

35 hours agotidy-up: miscellaneous
Viktor Szakats [Thu, 11 Jun 2026 22:33:40 +0000 (00:33 +0200)] 
tidy-up: miscellaneous

- `N byte` -> `N-byte` or `N bytes`.
- INTERNALS.md: language tweaks.
- schannel: language tweak in comment/error message.
- socks_gssapi, socks_sspi: simplify composing an error message.
  (at a cost of 8 extra constant string bytes.)
- m4/curl-compilers.m4: fix typo in link (in comment).
- contrithanks.sh: fix indent, drop stray `;` terminator.
- lib, src, tests: drop/fix a bunch of badwords.
- fix typos in comments.
- fix indent, stray spaces.

Some of these spotted by GitHub Code Quality and Copilot

Closes #22009

37 hours agosocks_sspi: store socks5_gssapi_enctype
Daniel Stenberg [Sun, 14 Jun 2026 10:44:44 +0000 (12:44 +0200)] 
socks_sspi: store socks5_gssapi_enctype

Store the unwrapped protection level in `conn->socks5_gssapi_enctype` to
prevent the proxy from contuning unprotected. Matches the GSSAPI version
of the code.

Reported-by: Trail of Bits
Closes #22004

37 hours agosmb: integer overflow proof a size check
Daniel Stenberg [Sun, 14 Jun 2026 10:19:49 +0000 (12:19 +0200)] 
smb: integer overflow proof a size check

By using size_t for the vars instead of shorts.

Pointed out by Zeropath

Closes #22001

38 hours agoservers: drop single-use interim result variables
Viktor Szakats [Sun, 14 Jun 2026 11:51:24 +0000 (13:51 +0200)] 
servers: drop single-use interim result variables

Closes #22008

39 hours agoservers: minor socket error handling fixes
Viktor Szakats [Sun, 14 Jun 2026 12:36:24 +0000 (14:36 +0200)] 
servers: minor socket error handling fixes

- sws: fix socket error code in `select()` failure message.
  Spotted by Copilot
  Bug: https://github.com/curl/curl/pull/21998#discussion_r3409469444
- sws: do not call `SOCKERRNO` twice on error.
- dnsd: do not call `SOCKERRNO` twice on error.
- dnsd: replace `goto` with `while()` to sync with rest of code.
- dnsd: `sendto()` fail message fixes:
  - replace `int` cast with `%zu` mask.
  - drop redundant newline.
  - show socket error string like rest of code.
  - report not-fully-sent error separately from socket errors.

Closes #22007

39 hours agortspd: sync up sleep loop with sws
Viktor Szakats [Sun, 14 Jun 2026 12:29:13 +0000 (14:29 +0200)] 
rtspd: sync up sleep loop with sws

Check for `!got_exit_signal` as part of the `while()` expression,
instead of doing it after calling `curlx_wait_ms()`. To simplify and
improve consistency with rest of code.

Follow-up to 0653fa107f6fb03555d49da86a1fbfc659873f5b
Follow-up to 123c92c904b2f258ae69e211aa2663e80cb5429a

Closes #22006

41 hours agotests/servers: do not interpret `unlink()` retval as `errno`
Viktor Szakats [Sun, 14 Jun 2026 10:44:57 +0000 (12:44 +0200)] 
tests/servers: do not interpret `unlink()` retval as `errno`

In `socksd` and `sws` error messages.

Also:
- show the messages only if `unlink()` failed.
- rename a return code variable and sync a message text for consistency.

Ref: https://pubs.opengroup.org/onlinepubs/9699919799/functions/unlink.html

Spotted by Copilot in `socksd.c`
Bug: https://github.com/curl/curl/pull/21998#discussion_r3409395013
Follow-up to 80eb71a3f5146f2ab5c5f8d8655d6861b5472668 #8687

Closes #22005

41 hours agoperl: switch from backticks to `qx()`
Viktor Szakats [Tue, 19 May 2026 15:41:07 +0000 (17:41 +0200)] 
perl: switch from backticks to `qx()`

To make it easier to find external command invocation in the source.

Also drop backticks from a comment.

To find external command invocations in Perl code use:
```sh
git grep -E "((exec|qx|open2|open3|system)\(|open\(.+-\|)" $(<perlfiles>)
```

Refs:
https://perldoc.perl.org/functions/qx
https://perldoc.perl.org/perlop#Simpler-Quote-Like-Operators

Closes #21994

41 hours agokrb5_sspi: fix error message on `DecryptMessage()` fail
Viktor Szakats [Sun, 14 Jun 2026 10:18:46 +0000 (12:18 +0200)] 
krb5_sspi: fix error message on `DecryptMessage()` fail

Spotted by GitHub Code Quality

Closes #22003

41 hours agotelnet: drop an `int` cast no longer necessary
Viktor Szakats [Sun, 14 Jun 2026 10:26:46 +0000 (12:26 +0200)] 
telnet: drop an `int` cast no longer necessary

Spotted-by GitHub Code Quality

Follow-up to c5637baa06046d317c383d420f6cbc9ddb3b0870
Follow-up to 83a5e390654fb1e77c7c5d7bd32ba147ff022cbd

Closes #22002

41 hours agosocket: use name `sockerr` for socket error variables
Viktor Szakats [Fri, 12 Jun 2026 21:42:50 +0000 (23:42 +0200)] 
socket: use name `sockerr` for socket error variables

Also:
- add comment explaining a `sockerr = errno` (vs. `SOCKERRNO`)
  assigment.

Closes #21998

43 hours agosocks_sspi: invalid response length is a fatal error
Daniel Stenberg [Sun, 14 Jun 2026 10:13:42 +0000 (12:13 +0200)] 
socks_sspi: invalid response length is a fatal error

Pointed out by Zeropath
Closes #21999

44 hours agoldap: base64 encode binary LDIF values with WinLDAP
Saud Alshareef [Fri, 12 Jun 2026 02:02:04 +0000 (05:02 +0300)] 
ldap: base64 encode binary LDIF values with WinLDAP

The WinLDAP backend only base64 encoded LDAP values when the attribute
name ended in ;binary. This made attributes such as jpegPhoto get
written as raw bytes, producing malformed LDIF output.

Match the OpenLDAP backend by also base64 encoding values with leading
or trailing blanks or non-printable bytes.

Fixes #21926
Reported-by: oreadvanthink on github
Closes #21982

2 days agosspi: free libcurl allocated memory with curlx_free
Daniel Stenberg [Fri, 12 Jun 2026 12:37:55 +0000 (14:37 +0200)] 
sspi: free libcurl allocated memory with curlx_free

DecryptMessage() decrypts the buffer in place, overwriting the original
contents. It does not allocate any new buffer so the single original
buffer should be freed using the same memory "system" that allocated it.

Reported-by: Trail of Bits
Closes #21990

3 days agotelnet: drop redundant interim variables
Viktor Szakats [Fri, 12 Jun 2026 21:50:03 +0000 (23:50 +0200)] 
telnet: drop redundant interim variables

Also reduce scope of a declaration.

Closes #21995

3 days agolib: transfer origin and proxy handling
Stefan Eissing [Fri, 12 Jun 2026 10:02:08 +0000 (12:02 +0200)] 
lib: transfer origin and proxy handling

Add `data->state.origin` as the origin the transfer is sending the
current request to/gets the response from. Use it for request specific
properties like authentication, hsts and cookie handling, etc.

Unless talking to a forwarding HTTP proxy (e.g. not tunneling),
`data->state.origin` and `conn->origin` are the same.

With a forwarding HTTP proxy in play, `conn->origin` is set to
`conn->http_proxy.peer` and `conn->bits.origin_is_proxy` (a new bit) is
set.

Remove the connection bits, now replaced with:

* `conn->bits.socksproxy` -> `conn->socks_proy.peer`
* `conn->bits.httpproxy` -> `conn->http_proy.peer`
* `conn->bits.proxy` -> `(conn->socks_proy.peer || conn->http_proy.peer`)
* `conn->bits.tunnel_proxy` -> (`conn->http_proy.peer && !conn->bits.origin_is_proxy`)
* `(conn->bits.httpproxy && !conn->bits.tunnel_proxy)` -> `conn->bits.origin_is_proxy`

Rename `noproxy.[ch]` to `proxy.[ch]`. Move the connection proxy setup
code from `url.c` to `proxy.c`.

Remove `data->info.conn_remote_port` as no one uses it.

Add test_40_02b for a SOCKS connection to a forwarding HTTPS proxy.

Update internal documentation about peers and creds.

Closes #21967

3 days agobuild: enable `-Wlogical-op` picky warning for GCC 4.4+
Viktor Szakats [Sat, 6 Jun 2026 12:24:29 +0000 (14:24 +0200)] 
build: enable `-Wlogical-op` picky warning for GCC 4.4+

Follow-up to 879a1514c3cf41926fd565db9e9ae62ab9733554 #21992

Closes #21893

3 days agosocket: introduce `SOCK_EAGAIN()` and use it
Viktor Szakats [Sun, 7 Jun 2026 23:21:44 +0000 (01:21 +0200)] 
socket: introduce `SOCK_EAGAIN()` and use it

To contain the logic of checking for both `EWOULDBLOCK` and/or `EAGAIN`
depending on platform/availability. Also to avoid checking for both if
they mapp to the same value, and to avoid PP guards around use.

This also ensures `EAGAIN` is consistently not checked on Windows, where
headers defined it, but `SOCKERRNO` never returns it, because curl maps
it to `WSAGetLastError()`.

If they map to the same value, checking them both in an `if` expression
trips GCC warning `-Wlogical-op` (the same way it triggers duplicate
case value error in `switch`).

Also:
- replace two `switch()` statements with the new macro.
- tests/server/sws: make two outliers use the new macro that were only
  checking for `EWOULDBLOCK` before this patch, in `connect_to()`.
- move variables to the left-side of expressions, where missing.
- rustls: use a variant of this macro that uses raw `EWOULDBLOCK`.
  Tried tracing it back to the origins, but I couldn't figure out if
  this is working as expected on all supported Windows versions in
  Rust. It seems to be using `GetLastError()`, according to
  https://docs.rs/system_error/0.2.0/system_error/, which would be
  probably incorrect.

Notes:
- it's probably a good idea to assign `SOCKERRNO` to a variable before
  passing it to this macro.

Cherry-picked from #21893

Closes #21992

3 days agoAmigaOS: fix build fallouts, re-add to CI
Viktor Szakats [Fri, 12 Jun 2026 15:51:22 +0000 (17:51 +0200)] 
AmigaOS: fix build fallouts, re-add to CI

Fix build issues:
- src: adjust `toolx_ftruncate()`.
- libtests/cli_ftp_upload: make `struct timeval` initialization portable.
- libtests/lib1960: do unconst in local `inet_pton()` macro.
- tests/server/dnsd: make it stub instead of failing the build.
- tests/server: make them link AmiSSL for `SocketBase`.

Also:
- bump AmiSSL to the latest release.
- add download hash checks and toolchain cache.
- sync restored code with local updates made since last year.

It takes 30 seconds per job, 1 minute in total.

Thanks-to: Bebbo
Thanks-to: Darren Banfi
Ref: https://github.com/curl/curl/pull/21989#issuecomment-4691380623
Follow-up to 7a14898264e9aa48f7f84f631288d728cade5d57 #17486

Closes #21993

3 days agoschannel: fix https proxy for client cert and certinfo
Stefan Eissing [Fri, 12 Jun 2026 10:33:44 +0000 (12:33 +0200)] 
schannel: fix https proxy for client cert and certinfo

When schannel operates in front of a proxy, it needs to use the proxy
ssl configs, not the transfers ones. Choose the configs as it is done in
other TLS backends.

Prior to this change the client cert for the destination was mistakenly
also used as the client cert for the proxy.

Prior to this change the proxy server certificate info was mistakenly
saved as the destination cert info. However, if the destination was a
TLS connection, the real destination cert info would overwrite the
proxy cert info. libcurl currently does not support proxy server cert
info AFAICT (see discussion in #21986).

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

3 days agotelnet: fix old copy-paste typo in variable name
Viktor Szakats [Thu, 11 Jun 2026 22:42:55 +0000 (00:42 +0200)] 
telnet: fix old copy-paste typo in variable name

This code lacks tests, though we agreed it looks plausible enough to
merge it based on surrounding code. Even though this line has been
present for a long time. If you use this code, please report any results
or issues.

Reported by GitHub Code Quality

Follow-up to ae1912cb0d494b48d514d937826c9fe83ec96c4d

Closes #21979

3 days agoruntests: exit hard on duplicate test name
Daniel Stenberg [Fri, 12 Jun 2026 12:52:18 +0000 (14:52 +0200)] 
runtests: exit hard on duplicate test name

To make the mistake more noticeable

Closes #21991

3 days agomailmap: Darren Banfi
Daniel Stenberg [Fri, 12 Jun 2026 12:48:12 +0000 (14:48 +0200)] 
mailmap: Darren Banfi

3 days agoAmigaOS: curl_setup.h avoid explicit_bzero with clib2
Darren Banfi [Fri, 12 Jun 2026 11:12:06 +0000 (12:12 +0100)] 
AmigaOS: curl_setup.h avoid explicit_bzero with clib2

clib2 defines __NEWLIB__ after its system headers are included, but it
does not provide explicit_bzero().

curl therefore selects the explicit_bzero() path and fails to build with
m68k-amigaos-gcc:

```
../lib/curl_setup.h:1650:35: error: implicit declaration of function 'explicit_bzero' [-Werror=implicit-function-declaration]
 1650 | #define curlx_memzero(buf, size)  explicit_bzero(buf, size)
      |                                   ^~~~~~~~~~~~~~
curlx/strdup.c:115:5: note: in expansion of macro 'curlx_memzero'
  115 |     curlx_memzero(buf, size);
      |     ^~~~~~~~~~~~~
```

Excluding __CLIB2__ from the generic __NEWLIB__ branch makes curl use
its existing portable curlx_memzero() fallback. The full AmigaOS build
then completes successfully.

I've tested the following on Amiga OS 3.2.3 with this patch and latest
build.

- HTTP and HTTPS transfers
- AmiSSL certificate handling
- redirects
- downloads and file output
- timeout handling with the expected exit code 28
- repeated execution with clean exits
- no crashes or regressions observed

Follow-up to 066478f6346a2d987a9ecc3bd3bf45764d69c1c4 #21598

Closes #21989

3 days agoGHA/distcheck: switch to parse `info.json`
Viktor Szakats [Fri, 12 Jun 2026 11:26:49 +0000 (13:26 +0200)] 
GHA/distcheck: switch to parse `info.json`

Refs:
https://github.com/curl/curl-www/commit/c569aaa16136a615f5b299ea63168996a995521b
https://github.com/curl/curl-www/pull/596

Follow-up to b3bc61ab6853924e8114184b22538fb81f28ba0f #21978

Closes #21988

3 days agoruntests: error out on duplicate test names
Daniel Stenberg [Fri, 12 Jun 2026 08:54:47 +0000 (10:54 +0200)] 
runtests: error out on duplicate test names

Closes #21984

3 days agoconfig2setopts: use default protocol properly
Daniel Stenberg [Fri, 12 Jun 2026 07:01:22 +0000 (09:01 +0200)] 
config2setopts: use default protocol properly

Verified by test 1724, 1725 and 2036

Closes #21983

3 days agochecksrc: silence `-b` option debug message
Viktor Szakats [Fri, 12 Jun 2026 09:55:29 +0000 (11:55 +0200)] 
checksrc: silence `-b` option debug message

Closes #21985

4 days agoGHA: drop `brew update` from all jobs
Viktor Szakats [Fri, 12 Jun 2026 00:13:03 +0000 (02:13 +0200)] 
GHA: drop `brew update` from all jobs

After adding it a month ago (where missing) to fix a failure.

Removing this time to fix a different failure (on Linux), and also to
improve CI performance. Some install steps take over a minute, most of
that spent on `brew update`.

GH runner images also enabled extra taps which may contribute to further
delays, and seen to make it more fragile if GH itself struggles (taps
are hosted there.)

Refs:
https://github.com/curl/curl/actions/runs/27384213554/job/80927624171
https://github.com/curl/curl/actions/runs/27382368348/job/80921910973

Follow-up to db5d8886738ca8a335898c497ae4808f65ea7781 #21608

Closes #21981

4 days agolib695, lib757: fix truncated newline in error messages
Viktor Szakats [Thu, 11 Jun 2026 22:51:57 +0000 (00:51 +0200)] 
lib695, lib757: fix truncated newline in error messages

Closes #21980

4 days agoGHA/distcheck: use `https://curl.se/info`
Viktor Szakats [Thu, 11 Jun 2026 22:27:05 +0000 (00:27 +0200)] 
GHA/distcheck: use `https://curl.se/info`

Suggested-by: Daniel Stenberg
Ref: https://github.com/curl/curl/pull/21977#issuecomment-4684764838
Follow-up to 0cd0a64de4731ad5da138f3b4a314c735cd1dc02 #21977

Closes #21978

4 days agoRELEASE-NOTES: synced
Daniel Stenberg [Thu, 11 Jun 2026 21:28:30 +0000 (23:28 +0200)] 
RELEASE-NOTES: synced

4 days agolibtests: add and use tutil_throwaway_cb
Daniel Stenberg [Thu, 11 Jun 2026 14:58:28 +0000 (16:58 +0200)] 
libtests: add and use tutil_throwaway_cb

This is an implementation of a CURLOPT_WRITEFUNCTION callback that just
throws away the content and returns success. Saves us from having to
reimplement it many times in different tests.

Closes #21971

4 days agotests: add the "--resolve" keyword to tests that lack it
Fabian Keil [Sun, 7 Jun 2026 11:52:46 +0000 (13:52 +0200)] 
tests: add the "--resolve" keyword to tests that lack it

... even though they use the curl option "--resolve".

This makes it more convenient to choose or skip the tests.

For example Privoxy's cts test framework relies on the "--resolve"
keyword when executing the "upstream-tests" scenario to skip curl
tests that aren't expected to work when the requests are made through
Privoxy. While some of the modified tests are already skipped for
other reasons through other means when testing Privoxy, it's good to
be consistent.

Closes #21930

4 days agoGHA/distcheck: fix parsing the download page
Viktor Szakats [Thu, 11 Jun 2026 20:02:31 +0000 (22:02 +0200)] 
GHA/distcheck: fix parsing the download page

Fixing:
```
curl: (3) URL rejected: Malformed input to a URL function
```
Ref: https://github.com/curl/curl/actions/runs/27370389568/job/80880800780

Refs:
https://github.com/curl/curl-www/commit/1735f6af6ae75af08e646c0407cdc69cf6a0855d
https://github.com/curl/curl-www/pull/593

Follow-up to 2cc171cbd4a9eac84f5c62c5b987347e5f8880e1 #21759

Closes #21977

4 days agotelnet: fix error message typos
Viktor Szakats [Thu, 11 Jun 2026 18:01:18 +0000 (20:01 +0200)] 
telnet: fix error message typos

Spotted by GitHub Code Quality

Closes #21976

4 days agoruntests: fix tests for curl builds with embedded CA bundle
Viktor Szakats [Thu, 11 Jun 2026 15:08:05 +0000 (17:08 +0200)] 
runtests: fix tests for curl builds with embedded CA bundle

Reported-by: Rainer Jung
Co-authored-by: Rainer Jung
Fixes #21970
Follow-up to 8a3740bc8e558b9a9d4a652b74cf27a0961d7010 #14059

Closes #21973

4 days agotidy-up: add spaces around equal operators where missing
Viktor Szakats [Thu, 11 Jun 2026 15:22:30 +0000 (17:22 +0200)] 
tidy-up: add spaces around equal operators where missing

Found via regex search: `=[^~>= ]`

Closes #21975

4 days agotidy-up: miscellaneous
Viktor Szakats [Tue, 9 Jun 2026 09:10:00 +0000 (11:10 +0200)] 
tidy-up: miscellaneous

- GHA/windows: drop redundant double-quotes.
- CMake/PickyWarnings: improve/shorten comment.
- INTERNALS: fix typo in LibreSSL release date.
- drop redundant parentheses from single variables and sole `#if`
  expressions.
- cf-ip-happy: fix missing space from error string.
- telnet: fix parentheses in commented PP code.
- lib1922: fix typo test output text.
- smbserver: unfold lines.
- smbserver: use f-string.
- smbserver: initialize binary string as b``.
- fix typos in comments.

Closes #21972

4 days agoasyn-thrdd: add IPv6 guards
sourceturner [Sat, 6 Jun 2026 15:23:49 +0000 (17:23 +0200)] 
asyn-thrdd: add IPv6 guards

It seems that the usual '#ifdef USE_IPV6' guards have been overlooked in
lib/asyn-thrdd.c.

This commit makes sure that the code compiles if IPv6 is not available.

Closes #21881

4 days agoGHA: update debian:bookworm-slim Docker digest to 96e378d
renovate[bot] [Thu, 11 Jun 2026 11:30:28 +0000 (11:30 +0000)] 
GHA: update debian:bookworm-slim Docker digest to 96e378d

Closes #21958

4 days agoGHA/windows: bump Cygwin Action and adjust version number
Viktor Szakats [Thu, 11 Jun 2026 15:41:21 +0000 (17:41 +0200)] 
GHA/windows: bump Cygwin Action and adjust version number

It seems the commit hash behind the v6.1 tag is changing, and the latest
version is actually v6.0.2, which is currently mapped to the v6.1 hash.

Fixing:
```
warning[ref-version-mismatch]: action's hash pin has mismatched or missing version comment
  --> .github/workflows/windows.yml:98:87
   |
98 |       - uses: cygwin/cygwin-install-action@711d29f3da23c9f4a1798e369a6f01198c13b11a # v6.1
   |         ---------------------------------------------------------------------------   ^^^^ points to commit 3f0a3f9f988f
   |         |
   |         is pointed to by tag v6.0.1
```

Ref: https://github.com/cygwin/cygwin-install-action/issues/59

Closes #21974

4 days agohttp_digest: return better error
Daniel Stenberg [Thu, 11 Jun 2026 13:46:23 +0000 (15:46 +0200)] 
http_digest: return better error

It is not a content encoding error.

Found by the GitHub AI thing.

Closes #21969

4 days agoCURLOPT_WRITEFUNCTION.md: remove stray reference to HSTS
Daniel Stenberg [Thu, 11 Jun 2026 13:39:06 +0000 (15:39 +0200)] 
CURLOPT_WRITEFUNCTION.md: remove stray reference to HSTS

It appears to have landed here by mistake

Closes #21968

4 days agocf-ip-happy.c: minor comment typo
Daniel Stenberg [Thu, 11 Jun 2026 13:44:28 +0000 (15:44 +0200)] 
cf-ip-happy.c: minor comment typo

4 days agocontent_encoding: fix non-last chunked rejection
Daniel Stenberg [Thu, 11 Jun 2026 08:59:05 +0000 (10:59 +0200)] 
content_encoding: fix non-last chunked rejection

Even when two 'chunked' are listed and neither is the last encoding the
transfer is rejected.

Verified by test 1722 and 1723

Reported-by: violet12331 on hackerone
Closes #21966

4 days agoCURLINFO_CONTENT_LENGTH_UPLOAD_T.md: expand
Daniel Stenberg [Wed, 10 Jun 2026 21:41:51 +0000 (23:41 +0200)] 
CURLINFO_CONTENT_LENGTH_UPLOAD_T.md: expand

Fixes #21953
Reported-by: BazaarAcc32 on github
Closes #21956

4 days agomulti: remove a stale comment
Daniel Stenberg [Thu, 11 Jun 2026 07:29:22 +0000 (09:29 +0200)] 
multi: remove a stale comment

It tricks humans and AIs alike.

Closes #21961

4 days agoSECURITY-ADVISORY.md: expand
Daniel Stenberg [Thu, 11 Jun 2026 07:46:09 +0000 (09:46 +0200)] 
SECURITY-ADVISORY.md: expand

Fill in missing information and rephrase a little

Closes #21964

4 days agoh3proxy: no stream userdata
Stefan Eissing [Thu, 11 Jun 2026 07:37:46 +0000 (09:37 +0200)] 
h3proxy: no stream userdata

Do not set the easy handle opening a proxy tunnel as userdata on the
stream. The ease handle might go out of scope long before the tunnel
stream is closed.

Closes #21962

4 days agocf-ip-happy: update documentation
Stefan Eissing [Thu, 11 Jun 2026 06:29:22 +0000 (08:29 +0200)] 
cf-ip-happy: update documentation

Reported-by: correctmost on github
Fixes #21957
Closes #21959

4 days agocf-socket: make Curl_addr2string static
Stefan Eissing [Wed, 10 Jun 2026 11:18:30 +0000 (13:18 +0200)] 
cf-socket: make Curl_addr2string static

Move as sockaddr2string() into cf-socket.c where its only callers are.

Mark as UNITTEST for unit1609.

Move "struct Curl_sockaddr_ex" into sockaddr.h, so connect.h and
cf-socket.h can be included without all the system headers needed.

Closes #21946

4 days agodigest: flush proxy state on proxy or credential change
alhudz [Wed, 10 Jun 2026 13:00:13 +0000 (18:30 +0530)] 
digest: flush proxy state on proxy or credential change

Closes #21951

5 days agoCURLOPT_WRITEFUNCTION.md: mention redirects
Daniel Stenberg [Wed, 10 Jun 2026 12:01:11 +0000 (14:01 +0200)] 
CURLOPT_WRITEFUNCTION.md: mention redirects

Reported-by: BazaarAcc32 on github
Fixes #21945
Closes #21950

5 days agoconnect: turn conn_get_first_origin into static
Daniel Stenberg [Wed, 10 Jun 2026 11:37:22 +0000 (13:37 +0200)] 
connect: turn conn_get_first_origin into static

This function is only used within this source file.

Closes #21948

5 days agotidy-up: drop stray comparisons with literal zero
Viktor Szakats [Wed, 10 Jun 2026 11:03:41 +0000 (13:03 +0200)] 
tidy-up: drop stray comparisons with literal zero

Drop from:
- strcmp, strcmpi, strncmp, memcmp, lstat, getrlimit, setrlimit, fseek,
  fstat
- autotools detection snippets.
- smooth-gtk-thread: simplify `!var != 0` expression.

Closes #21947

5 days agobuild: enable `-Wformat-signedness`, fix issues found
Viktor Szakats [Thu, 16 Apr 2026 08:52:57 +0000 (10:52 +0200)] 
build: enable `-Wformat-signedness`, fix issues found

Adjust code to avoid `-Wformat-signedness` warnings, while making sure
that enums are always cast to a known type when passing them to `printf`
functions, to support compilers and compiler settings where enums are
not default-size signed ints.

- cast integers printed as hex to `unsigned`. (63 times, 20 of them in
  `mbedtls.c`)
- cast misc enums to `int` for printing. (31 times)
- cast `CURL_LOCK_DATA_*` enums to `int`. (4 times)
- cast `CURL_FORMADD_*` enums to `int`. (13 times)
- cast `CURLSHE_*` enums to `int`. (3 times)
- cast `CURLUE_*` enums to `int`. (33 times)
- cast `CURLMSG_*` enums to `int`. (6 times)
- cast `CURLE_*` enums to `int`. (~380 times)
- unit1675: fix mask.
  Follow-up to 7c34365ccea19949317878c7fcd5f7376e2e09f1 #21879

Ref: #18343 (initial attempt)

Closes #20848

5 days agomqtt: return error on truncated Remaining Length
Daniel Stenberg [Wed, 10 Jun 2026 11:52:13 +0000 (13:52 +0200)] 
mqtt: return error on truncated Remaining Length

Pointed out by: Zeropath

Closes #21949

5 days agoGHA: update awslabs/aws-lc from v1.73.0 to v5.0.0
renovate[bot] [Wed, 10 Jun 2026 01:46:49 +0000 (01:46 +0000)] 
GHA: update awslabs/aws-lc from v1.73.0 to v5.0.0

Closes #21941

5 days agoGHA: update ruff from v0.15.12 to v0.15.16
renovate[bot] [Wed, 10 Jun 2026 01:46:44 +0000 (01:46 +0000)] 
GHA: update ruff from v0.15.12 to v0.15.16

Closes #21940

5 days agongtcp2: share common functionality
Stefan Eissing [Fri, 5 Jun 2026 10:55:50 +0000 (12:55 +0200)] 
ngtcp2: share common functionality

Share common functions/structs between ngtcp2 HTTP/3 and the proxy
version.

Fix bugs in proxy implementation when it comes to stream and pollset
handling and transfer lifetimes.

Curl_multi_xfer_sockbuf_borrow: work without multi

When a connection gets shutdown by a share, the easy handle used is
share->admin and it does not have a multi handle. In that case let
Curl_multi_xfer_sockbuf_borrow() allocate a buffer to be freed on
release.

This happens when a TLS filter sends its last notify through a HTTP/3
proxy tunnel.

Closes #21871

5 days agotest 527: bring back, not a dupe
Daniel Stenberg [Wed, 10 Jun 2026 06:14:10 +0000 (08:14 +0200)] 
test 527: bring back, not a dupe

Fixed the name to clarify the difference to 526.

Follow-up to 4ead4285a6af5d5645d4ad
Closes #21942

5 days agodigest: flush state on origin or credential change
Daniel Stenberg [Wed, 10 Jun 2026 08:27:50 +0000 (10:27 +0200)] 
digest: flush state on origin or credential change

Verified by test 1686

Closes #21944

5 days agotests: restore 1030 and 611
Daniel Stenberg [Tue, 9 Jun 2026 16:44:21 +0000 (18:44 +0200)] 
tests: restore 1030 and 611

They were not exact duplicates. Tweaked their names to clarify.

Also renamed 608 accordingly.

Follow-up to 4ead4285a6af5d5645d4a

Spotted-by: Dan Fandrich
Closes #21938

6 days agoappveyor: bump 3 VS2022 jobs to VS2026
Viktor Szakats [Tue, 9 Jun 2026 17:57:38 +0000 (19:57 +0200)] 
appveyor: bump 3 VS2022 jobs to VS2026

Also:
- install CMake 4.2.1 manually for VS2026 jobs, because the preinstalled
  version (4.1.2) does not yet support the compatible generator.
- VisualStudioSolution VS2010 job to VS2015 worker image (from VS2013).
  VS2013 is no longer listed on the AppVeyor support page.
- downgrade OpenSSL to 3.5 (from 3.6) for the VS2022 job, to add
  variation.

Note: the jobs run much slower after bumping to VS2026. This seems to be
due slower configure and build steps.

Refs:
https://github.com/appveyor/website/commit/9ef4152eda92d0f8a486ab67824a6d420e1151e4
https://github.com/appveyor/website/pull/912
https://github.com/appveyor/build-images/commit/fa7f7b928ebee4e2cfc6eccc953d2dec95374114
https://github.com/appveyor/build-images/pull/175
https://www.appveyor.com/docs/windows-images-software/
https://cmake.org/cmake/help/latest/generator/Visual%20Studio%2018%202026.html

Closes #21939

6 days agosmbserver: update internal id generation for Python 3
Viktor Szakats [Tue, 9 Jun 2026 15:44:05 +0000 (17:44 +0200)] 
smbserver: update internal id generation for Python 3

Also:
- make next id based on highest in list + 1.
  (was: last id in list + 1)
- unfold a line.

Spotted by GitHub Code Quality

Ref: https://portingguide.readthedocs.io/en/latest/dicts.html?highlight=keys

Closes #21937

6 days agoRELEASE-NOTES: synced
Daniel Stenberg [Tue, 9 Jun 2026 14:58:21 +0000 (16:58 +0200)] 
RELEASE-NOTES: synced

6 days agohsts: duplicate live HSTS data in curl_easy_duphandle
A Johnston [Mon, 1 Jun 2026 21:52:23 +0000 (14:52 -0700)] 
hsts: duplicate live HSTS data in curl_easy_duphandle

Verified by test 1922

Closes #21809

6 days agotests: enhance names, remove duplicates
Daniel Stenberg [Tue, 9 Jun 2026 12:25:51 +0000 (14:25 +0200)] 
tests: enhance names, remove duplicates

- test 1030: remove, duplicate of 154
- test 1105: make name unique
- test 161: make name reflect what it tests
- test 2074: correct the name
- test 310: improve name
- test 358: correct the name
- test 409: removed, duplicate of 401
- test 472: clarify the test name (how it differs from 439)
- test 1509: update name
- test 527: duplicate of 526
- test 758: separate the name from 530
- test 611: duplicate of 608, remove
- test 639: adjust the name
- test 688: minor name tweak to clarify
- test 708: enhance name
- test 800/847: clarify the names
- test 1520: dedupe the name
- test 962: enhance name
- test 1196/2203: enhanced names
- test 1211: name tweak
- test 1256/1257: enhance the names
- test 1483: fix name
- test 1541: fix name
- test 1553: fix name
- test 1609: removed, exact duplicate of 1607
- test 2200: fix name
- test 3031: corret the name
- test 3016/3203: fix names and keywords
- test 3201/3220: enhance names
- test 3212: fix name
- add missing FILE keywords
- drop FAILURE as keyword

Closes #21936

6 days agotidy-up: drop redundant `== NULL` syntax
Viktor Szakats [Tue, 9 Jun 2026 12:18:02 +0000 (14:18 +0200)] 
tidy-up: drop redundant `== NULL` syntax

Where missed by checksrc.

Closes #21935

6 days agotidy-up: drop redundant `!= NULL` syntax
Viktor Szakats [Tue, 9 Jun 2026 11:38:17 +0000 (13:38 +0200)] 
tidy-up: drop redundant `!= NULL` syntax

Where missed by checksrc.

Closes #21932

6 days agoGHA: update dependency openssl/openssl to v4.0.1
renovate[bot] [Tue, 9 Jun 2026 12:06:35 +0000 (12:06 +0000)] 
GHA: update dependency openssl/openssl to v4.0.1

Closes #21934