]> git.ipfire.org Git - thirdparty/curl.git/log
thirdparty/curl.git
4 months agolibtests: make test 1503,1504,1505 use the 1502 binary
Daniel Stenberg [Wed, 11 Jun 2025 09:58:27 +0000 (11:58 +0200)] 
libtests: make test 1503,1504,1505 use the 1502 binary

Adjust the differences at runtime instead of build-time, to avoid
extra buillds.

Set the `CURL_TESTNUM` env variable to pass test numbers to tests.

Make libtest/first.c use that env variable to set the `testnum` global
variable to allow tests to differ based on which test that runs it.

Closes #17591

4 months agoopenssl: enable readahead
Edwin Török [Fri, 6 Jun 2025 15:23:29 +0000 (16:23 +0100)] 
openssl: enable readahead

Speeds up TLS operations up to ~%13.

Closes #17548

Signed-off-by: Edwin Török <edwin.torok@cloud.com>
4 months agolib: unify recv/send function signatures
Stefan Eissing [Wed, 11 Jun 2025 08:18:15 +0000 (10:18 +0200)] 
lib: unify recv/send function signatures

cfilter/conn: change send/recv function signatures. Unify the
calling/return conventions in our send/receive handling.

Curl_conn_recv(), adjust pnread type

Parameter `pnread` was a `ssize_t *`, but `size_t *` is better since the
function returns any error in its `CURLcode` return value.

Closes #17546

4 months agotidy-up: drop BearSSL and Secure Transport reference remains
Viktor Szakats [Wed, 11 Jun 2025 06:16:33 +0000 (08:16 +0200)] 
tidy-up: drop BearSSL and Secure Transport reference remains

Follow-up to 08a3e8e19a59d1530bfb208e187ac7c34c978dfd #16677

Closes #17582

4 months agoopenssl: error on SSL_ERROR_SYSCALL
Stefan Eissing [Wed, 4 Jun 2025 09:12:28 +0000 (11:12 +0200)] 
openssl: error on SSL_ERROR_SYSCALL

Convert the debug-only handling of SSL_ERROR_SYSCALL so that it is
enabled in all builds with openssl. This should not make a difference in
supported OpenSSL versions, but if whatever version or fork we link
against *does* return SSL_ERROR_SYSCALL, handle this as a fatal error.

Fixes #17471
Reported-by: Michael Kaufmann
Closes #17531

4 months agohttp_ntlm: protect against null deref
Daniel Stenberg [Wed, 11 Jun 2025 07:33:04 +0000 (09:33 +0200)] 
http_ntlm: protect against null deref

Closes #17585

4 months agopytest test_07_70, weaken early data check
Stefan Eissing [Tue, 10 Jun 2025 15:14:00 +0000 (17:14 +0200)] 
pytest test_07_70, weaken early data check

Since the amount of early data sent in the upload test_07_70 varies
much with how fast the server respondes and completes the handshake,
assert that we did sent at least *some* early data instead of relying
on a specific amount.

Closes #17575

4 months agoRELEASE-NOTES: synced
Daniel Stenberg [Wed, 11 Jun 2025 07:25:01 +0000 (09:25 +0200)] 
RELEASE-NOTES: synced

Bump to 8.15.0

4 months agoRELEASE-PROCEDURE.md: update docs/VERSIONS
Daniel Stenberg [Wed, 11 Jun 2025 06:56:12 +0000 (08:56 +0200)] 
RELEASE-PROCEDURE.md: update docs/VERSIONS

Add it as an item to fix in each release

Closes #17584

4 months agoVERSIONS.md: update
Orgad Shaneh [Wed, 11 Jun 2025 06:38:59 +0000 (09:38 +0300)] 
VERSIONS.md: update

Closes #17583

4 months agourl: fix connection lifetime checks
Stefan Eissing [Tue, 10 Jun 2025 08:11:40 +0000 (10:11 +0200)] 
url: fix connection lifetime checks

The checks for a connection being "too long idle" or "too old" where
rounding down the elapsed time to seconds before comparing to the
configured max values. This caused connections to be reused for up to
999ms longer than intended.

Change the compares to scale the configured seconds up to ms, so
connection will properly be "too old" 1 ms after the coonfigured values.

Fixes sporadic failures of test1542 on platforms where "sleep(2)"
returnes before 2 full seconds on the internal clock where passed.

Reported-by: Christian Weisgerber
URL: https://curl.se/mail/lib-2025-06/0004.html
Closes #17571

4 months agourlapi: simplify and split into sub functions
Daniel Stenberg [Mon, 9 Jun 2025 15:22:28 +0000 (17:22 +0200)] 
urlapi: simplify and split into sub functions

Closes #17565

4 months agolibssh: de-complex myssh_statemach_act()
Stefan Eissing [Tue, 10 Jun 2025 12:43:09 +0000 (14:43 +0200)] 
libssh: de-complex myssh_statemach_act()

Make static functions for the largest state handling code
with a common signature and naming scheme.

Closes #17573

4 months agoTLS: remove support for Secure Transport and BearSSL
Daniel Stenberg [Mon, 9 Jun 2025 12:07:21 +0000 (14:07 +0200)] 
TLS: remove support for Secure Transport and BearSSL

These libraries do not support TLS 1.3 and have been marked for removal
for over a year. We want to help users select a TLS dependency that is
future-proof and reliable, and not supporting TLS 1.3 in 2025 does not
infer confidence. Users who build libcurl are likely to be served better
and get something more future-proof with a TLS library that supports
1.3.

Closes #16677

4 months agocmake: replace `cmakelint` with `cmake-lint` from `cmakelang`, fix issues
Viktor Szakats [Tue, 10 Jun 2025 16:25:57 +0000 (18:25 +0200)] 
cmake: replace `cmakelint` with `cmake-lint` from `cmakelang`, fix issues

This linter detects formatting and naming issues with minimal amount of
noise. It seems to be an improvement over the existing linter which was
only detecting line width overruns.

Also: fix to exclude `CurlTests.c` from linter.

Ref: https://cmake-format.readthedocs.io/en/latest/cmake-lint.html
Ref: https://github.com/cheshirekow/cmake_format

Closes #17576

4 months agobuild: assume `sys/socket.h`, `sys/time.h` on non-Windows (as in `curl/curl.h`)
Viktor Szakats [Mon, 2 Jun 2025 15:06:08 +0000 (17:06 +0200)] 
build: assume `sys/socket.h`, `sys/time.h` on non-Windows (as in `curl/curl.h`)

Public `curl/curl.h` includes these headers for non-Windows platforms
without further conditions. This makes it safe to assume these headers
do exist, allowing to save two feature checks for non-Windows targets.

`sys/time.h` is also assumed on Windows with mingw-w64, for declaring
`gettimeofday()`.

Closes #17522

4 months agocmake: drop never propagated C macros
Viktor Szakats [Tue, 10 Jun 2025 16:25:31 +0000 (18:25 +0200)] 
cmake: drop never propagated C macros

Delete macros from `curl_config.h.cmake` that were never set by
the CMake script: `_LARGE_FILES`, `_THREAD_SAFE`, `const`, `size_t`.

Also:
- lib/config-riscos.h: drop `#undef _LARGE_FILES`. This is an
  IBM-specific macro, no need to unset it on other platforms.

Cherry-picked from #17576

Closes #17580

4 months agoDockerfile: update debian:bookworm-slim Docker digest to e5865e6
renovate[bot] [Wed, 11 Jun 2025 03:40:30 +0000 (03:40 +0000)] 
Dockerfile: update debian:bookworm-slim Docker digest to e5865e6

Closes #17579

4 months agoGHA/non-native: skip OpenBSD WebSocket tests to mitigate job timeouts
Viktor Szakats [Mon, 9 Jun 2025 16:30:48 +0000 (18:30 +0200)] 
GHA/non-native: skip OpenBSD WebSocket tests to mitigate job timeouts

Trying to avoid the occasional ~6-minute long delays seen in the OpenBSD
since last week. The long delay causes the CI job to timeout and fail:
https://github.com/curl/curl/actions/workflows/non-native.yml?page=2&query=branch%3Amaster

The exact reason is or test number is unknown. I base this attempt on
looking at the first occurrences and possible patches that may be
related.

The issue was first seen in CI within PR #17136:
```
[...]
Wed, 07 May 2025 07:10:30 GMT test 3014...[Check if %{num_headers} returns correct number of headers]
Wed, 07 May 2025 07:10:30 GMT s-p----e--- OK (1743 out of 1778, remaining: 00:02, took 0.195s, duration: 01:43)
Wed, 07 May 2025 07:10:30 GMT test 3016...[GET a directory using file://]
[long delay here]
Wed, 07 May 2025 07:16:17 GMT -------
Wed, 07 May 2025 07:16:17 GMT Error: The operation was canceled.
```
Ref: https://github.com/curl/curl/actions/runs/14877264415/job/41776966626#step:3:5566
Ref: https://github.com/curl/curl/actions/runs/14900320627/job/41850699301#step:3:5561 (next in PR)

Then in master, shortly after merging it via d3594be6531df3d5eafcdd09f84ad9dee1777028:
```
[...]
Mon, 02 Jun 2025 09:23:55 GMT test 3201...[HTTP GET when PROXY Protocol enabled and spoofed client IP]
Mon, 02 Jun 2025 09:23:55 GMT --p----e--- OK (1777 out of 1788, remaining: 00:00, took 0.222s, duration: 01:42)
Mon, 02 Jun 2025 09:23:55 GMT RUN: failed to start the HTTP/2 server
Mon, 02 Jun 2025 09:23:55 GMT test 3202...[HTTP-IPv6 GET with PROXY protocol with spoofed client IP]
[long delay here]
Mon, 02 Jun 2025 09:29:48 GMT --p----e--- OK (1778 out of 1788, remaining: 00:00, took 0.1
Mon, 02 Jun 2025 09:29:48 GMT Error: The operation was canceled.
```
Ref: https://github.com/curl/curl/actions/runs/15388587165/job/43292652793#step:3:5097
Ref: https://github.com/curl/curl/actions/runs/15390589464/job/43298911578#step:3:5097 (next in master)

Closes #17562

4 months agotests: drop mk-bundle exceptions
Viktor Szakats [Tue, 27 May 2025 19:20:36 +0000 (21:20 +0200)] 
tests: drop mk-bundle exceptions

Using a mixture of techniques to avoid symbols collisions:
- reduce scope.
- add `t*_` / `T*_` prefix.
- move shared functions to `testutil.c`.
  (`suburl()`, `rlim2str()`)
- clone re-used lib*.c sources.
  (lib587, lib645)
- include shared symbols just once in re-used `lib*.c` sources.
  (using `LIB*_C` guards.)
- drop re-used `lib*.c` sources where they were identical or
  unused.
- make macros global.
- #undef macros before use.

What remain is the entry functions `test`, and `unit_setup`,
`unit_stop` in unit tests.

Also:
- fix formatting and other minor things along the way.
- add `const` where possible.
- sync some symbol names between tests.
- drop `mk-bundle-hints.sh` that's no longer necessary.

Closes #17468

4 months agoschannel: drop Windows 2000 compatibility logic
Viktor Szakats [Sun, 25 May 2025 11:42:22 +0000 (13:42 +0200)] 
schannel: drop Windows 2000 compatibility logic

curl requires Windows XP as a minimum.

Co-authored-by: Jay Satiro
Closes #17447

4 months agowindows: reduce/stop loading DLLs at runtime
Viktor Szakats [Wed, 21 May 2025 17:37:55 +0000 (19:37 +0200)] 
windows: reduce/stop loading DLLs at runtime

- replace dynamic `InitSecurityInterface()` call with early binding and
  link `secur32` system DLL.
  The library and function are available in all supported curl Windows
  targets, meaning WinXP or newer.  Add small hack for mingw32ce to
  make it build.

- detect and use `if_nametoindex()` on Windows when available. Link
  `iphlpapi` system DLL. Requires targeting Vista or newer.
  Replacing the dynamic call and the pre-load optimization for lib3026.

Suggested-by: Jay Satiro
Closes #17413

4 months agoGHA/windows: make MSVC jobs use MSYS2 libraries: psl, OpenSSL, H2, libssh2
Viktor Szakats [Mon, 9 Jun 2025 14:07:05 +0000 (16:07 +0200)] 
GHA/windows: make MSVC jobs use MSYS2 libraries: psl, OpenSSL, H2, libssh2

Extend MSVC jobs with the option to use MSYS2 binary package as DLL
dependencies. Allow to use them alone (without vcpkg) or combined with
vcpkg packages. This saves the trouble of building these packages from
source and cache them manually.

This solution requires two tricks:
- workaround for zlib which installs a target-specific `zconf.h` that's
  not portable between platforms and C compilers.
- manual dependency configuration in CMake to ensure linking against
  the MSYS2 DLLs (and not it static libs). Static libs aren't portable
  to MSVC due to missing symbols `__chkstk_ms`, `_stack_chk_fail`,
  `_memcpy_chk`, `_stack_chk_guard`, and potentially other issues. CMake
  in MSVC mode, `linker.exe` and `pkg-config` pick the static libs by
  default. To pick `.dll.a` in favour of `.a`, these tools would have
  to be taught about this convention. An alternative is deleting static
  libs and see if `.dll.a` are picked-up automatically.

Using MSYS2 packages adds an install step taking 15-45 seconds per job.

It allowed to:
- re-enable libpsl for all MSVC jobs.
- convert the Intel 64-bit job to use MSYS2 without vcpkg, enabling
  brotli, zstd, OpenSSL 3.5.0, libssh2 (with OpenSSL cryprography) and
  nghttp2.

Using the same technique it's possible to re-enable more features
in MSVC builds, e.g. GnuTLS (also with H3), LibreSSL, mbedTLS, nghttp3,
ngtcp2, libssh, c-ares, gsasl, and replace vcpkg zlib, for faster runs.
What's missing compared to vcpkg is BoringSSL and wolfSSL
(the MSYS2-supplied build doesn't fit curl's requirements IIRC). These
could be built and cached manually.

Also:
- add workaround for zlib (classic) which uses a generated `zconf.h`,
  rendering the MSYS2 zlib header incompatible with MSVC.
- set the correct `msystem` for arm64.
- allow using MSVC without vcpkg.

Follow-up to cd0ec4784c1c0f873939f33ec1a73c8739f276b9 #17089

Closes #17561

4 months agocmake: document OpenSSL and ngtcp2 crypto lib custom variables
Viktor Szakats [Tue, 10 Jun 2025 08:42:26 +0000 (10:42 +0200)] 
cmake: document OpenSSL and ngtcp2 crypto lib custom variables

Cherry-picked from #17561

Closes #17574

4 months agoGHA/checksrc: `yq` is pre-installed, drop manual install
Viktor Szakats [Mon, 9 Jun 2025 14:26:58 +0000 (16:26 +0200)] 
GHA/checksrc: `yq` is pre-installed, drop manual install

Follow-up to 17a669426f36b467dfd945b4b35f6211598b7977 #17537

Cherry-picked from #17561

4 months agovauth: move auth structs to conn meta data
Stefan Eissing [Mon, 9 Jun 2025 13:09:28 +0000 (15:09 +0200)] 
vauth: move auth structs to conn meta data

Remove structs for negotiate, krb5, ntlm and gsasl from connectdata and
store them as connection meta data with auto cleanup.

De-complexify sasl mech selection by moving code into static functions.

Closes #17557

4 months agotests: fail torture if !valgrind&threaded resolver
Yedaya Katsman [Sat, 7 Jun 2025 18:44:35 +0000 (21:44 +0300)] 
tests: fail torture if !valgrind&threaded resolver

We don't check the memory debug output with the threaded resolver, so
the only way to do it with with valgrind.

Also move the disabling of memory tracking to where we log that we're
doing it.

Closes #17501

4 months agotests: torture: don't duplicate valgrind command
Yedaya Katsman [Wed, 4 Jun 2025 18:22:35 +0000 (21:22 +0300)] 
tests: torture: don't duplicate valgrind command

When running torture tests with valgrind enabled, the torture function
got a command line that already had the valgrind invocation in it. It
added another, at the end resulting in an empty valgrind log file.

Remove the duplicate logic adding valgrind, which already had a bit of
different logic that wasn't updated when the other one was.

Closes #17501

4 months agoRELEASE-NOTES: synced
Daniel Stenberg [Tue, 10 Jun 2025 05:48:17 +0000 (07:48 +0200)] 
RELEASE-NOTES: synced

4 months agocurl.h: remove the "RESERVED" error codes 17563/head
Daniel Stenberg [Mon, 9 Jun 2025 20:36:12 +0000 (22:36 +0200)] 
curl.h: remove the "RESERVED" error codes

Return codes for tests should be kept private.

Follow-up to 9465327084c920deee7ba5abbcd

Closes #17563

4 months agolib: make curlx_inet_ntop()
Daniel Stenberg [Mon, 9 Jun 2025 07:39:40 +0000 (09:39 +0200)] 
lib: make curlx_inet_ntop()

move function to curlx/, change all callers

Closes #17560

4 months agoGHA/hacktoberfest-accepted: prefer `GH_TOKEN`
Viktor Szakats [Sun, 8 Jun 2025 11:02:44 +0000 (13:02 +0200)] 
GHA/hacktoberfest-accepted: prefer `GH_TOKEN`

For the `gh` tool, over `GITHUB_TOKEN`. It accepts both, of which
the former seems to be preferred according to the source code and
documentation.

GHA/appveyor-status already uses `GH_TOKEN`.

Closes #17556

4 months agocurl_path: make SFTP handle a path like /~ properly.
Carlos Henrique Lima Melara [Thu, 5 Jun 2025 12:29:06 +0000 (14:29 +0200)] 
curl_path: make SFTP handle a path like /~ properly.

... without a trailing slash.

Fixes #17534
Closes #17542

4 months agopingpong: on disconnect, check for unflushed pingpong state
Stefan Eissing [Sun, 8 Jun 2025 10:00:00 +0000 (12:00 +0200)] 
pingpong: on disconnect, check for unflushed pingpong state

When a pingpong based protocol tries to perform a connection disconnect,
it sends a sort of "logout" command to the server, unless the connection
is deemed dead.

But the disconnect might happen before pingpong data has been completely
sent, in which case sending the "logout" will not work. Check the
pingpong state and do not "logout" when data is pending.

This was detected as a condition in fuzzing that triggered a debug
assert in the pingpong sending.

Closes #17555

4 months agotool_operate: fix return code when --retry is used but not triggered
Daniel Stenberg [Mon, 9 Jun 2025 06:37:49 +0000 (08:37 +0200)] 
tool_operate: fix return code when --retry is used but not triggered

Verify with test 752

Reported-by: fjaell on github
Fixes #17554
Closes #17559

5 months agoGHA: enclose `if` expressions in `${{ }}` where missing
Viktor Szakats [Fri, 6 Jun 2025 21:29:22 +0000 (23:29 +0200)] 
GHA: enclose `if` expressions in `${{ }}` where missing

Enclosing expressions in `${{ }}` is optional, but sometimes required.
It seems more straighforward to use it always rather than decide on
a case-by-case basis. Before this patch 71 `if`s were enclosed and 49
were not. Enclosing these makes it easy to grep and recognize these
whereever used.

https://docs.github.com/actions/writing-workflows/choosing-when-your-workflow-runs/using-conditions-to-control-job-execution

Closes #17550

5 months agotool_getparam: fix --ftp-pasv
Dan Fandrich [Fri, 6 Jun 2025 17:21:09 +0000 (10:21 -0700)] 
tool_getparam: fix --ftp-pasv

This boolean option was moved to the wrong handling function. Make it
an ARG_NONE and move it to the correct handler and add a test to
verify that the option works.

Follow-up to 698491f44

Reported-by: fjaell on github
Fixes #17545
Closes #17547

5 months agoGHA: tidy up single-line `run` blocks
Viktor Szakats [Fri, 6 Jun 2025 20:15:02 +0000 (22:15 +0200)] 
GHA: tidy up single-line `run` blocks

Also double quote a shell variable.

Closes #17552

5 months agotests/servers.pm: add more ways to figure out current user
Daniel Stenberg [Thu, 5 Jun 2025 21:37:59 +0000 (23:37 +0200)] 
tests/servers.pm: add more ways to figure out current user

Some CI tests fail due to "Can't start ssh server due to lack of USER name" -
add more ways to try to figure it out if no environment variable works: the
whoami and id commands.

Closes #17544

5 months agoGHA/hacktoberfest-accepted: tidy up item order
Viktor Szakats [Fri, 6 Jun 2025 20:30:12 +0000 (22:30 +0200)] 
GHA/hacktoberfest-accepted: tidy up item order

`if`, then `env`, then `run`.

Also tidy up quotes in env entries.

Closes #17551

5 months agoCI: fix zizmor 1.9.0 warnings, shellcheck verify CI shell code, fix fallouts
Viktor Szakats [Thu, 5 Jun 2025 07:58:34 +0000 (09:58 +0200)] 
CI: fix zizmor 1.9.0 warnings, shellcheck verify CI shell code, fix fallouts

zizmor 1.9.0 effectively bans using GHA macros within shell script
snippets. Rework them to pass GHA macro values via envs and use those
envs in shell snippets. `${{ env.* }}` macros could be converted
to native env references after making their names shell-compatible.

Envs and shell commands can no longer be used in GHA macro values. Most
cases could be fixed by using literals. Passing quoted values with
spaces combined with other args also doesn't work anymore. This was
replaced by passing them separately.

Despite the initial complications, avoiding GHA macros in scripts does
seems to make the CI code reasonable cleaner. It also makes it possible
to analyze the scripts with shellcheck, finding subtle issues that went
unnoticed till now.

Also:
- un-ignore and fix three existing zizmor `template-injection` issues.
- add script to extract and shellcheck all shell code stored within GHA
  and Circle CI YAML files.
- add CI job to run this script.
- fix shellcheck issues discovered.
- fix minor differences between cmake and autotools FreeBSD jobs.
- merge cmake/autotools FreeBSD jobs to avoid developing unwanted
  differences again.
- fix/sync quote use across shell code.
- replace `$HOME` with `~` or literal where it made sense.
- replace most `brew --prefix` with literals.
- move all curl install tests to the `curl-install*` prefix.
- add missing curl install tests to cygwin/msys/mingw/*bsd.
- pipe to `tar` instead of storing downloads on disk.
- drop unnecessary `PKG_CONFIG_PATH` when building nghttp3.

Ref: https://github.com/curl/curl/actions/runs/15461461371/job/43523546041
Ref: https://github.com/zizmorcore/zizmor/releases/tag/v1.9.0

Follow-up to e522f47986bb72f194636e155191d7dccdc2d4fc #17278

Closes #17537

5 months agoRELEASE-NOTES: synced
Daniel Stenberg [Thu, 5 Jun 2025 11:54:53 +0000 (13:54 +0200)] 
RELEASE-NOTES: synced

Bump to 8.14.2 - a tentative version we probably will not release.

5 months agopytest: adapt for runs with openssl-1.1.1
Stefan Eissing [Thu, 5 Jun 2025 08:37:24 +0000 (10:37 +0200)] 
pytest: adapt for runs with openssl-1.1.1

Fix use of nghttpx fixture to be present even when h3 is not
available in curl. Fix TLS protocol versions expectations for
older openssl versions.

Closes #17538

5 months agopytest: disable test_07_37 and test_07_36 with openssl's quic
Stefan Eissing [Thu, 5 Jun 2025 08:44:32 +0000 (10:44 +0200)] 
pytest: disable test_07_37 and test_07_36 with openssl's quic

These tests fail often in CI and I have no motivation to find out why.
Disable the tests for openssl's own QUIC.

Closes #17539

5 months agofuzzer: get the deadlock unstuck
Stefan Eissing [Thu, 5 Jun 2025 11:17:02 +0000 (13:17 +0200)] 
fuzzer: get the deadlock unstuck

Change the workflow name to change the concurrency lock name so
that the invoked Fuzzer workflow does no longer lock the same name.

Closes #17541

5 months agocurl.h: make CURLSSLOPT_* symbols defined as longs
Daniel Stenberg [Thu, 5 Jun 2025 06:07:04 +0000 (08:07 +0200)] 
curl.h: make CURLSSLOPT_* symbols defined as longs

Help users get them used right.

Closes #17535

5 months agoINSTALL.md: cygwin details and add source code link
John Haugabook [Thu, 29 May 2025 23:51:10 +0000 (19:51 -0400)] 
INSTALL.md: cygwin details and add source code link

Added more details to help with cygwin install, adding links to curl
source code where relevant to help save people a little time.

Closes #17485

5 months agodocs/examples: add ftp-delete.c
Daniel Stenberg [Thu, 5 Jun 2025 09:05:38 +0000 (11:05 +0200)] 
docs/examples: add ftp-delete.c

To show how to delete a single file after a transfer

Closes #17540

5 months agosystem.h: remove some macros
Daniel Stenberg [Sat, 31 May 2025 16:47:23 +0000 (18:47 +0200)] 
system.h: remove some macros

Since curl_off_t is always 64 bit these days, we can simplify and avoid
using some macros.

Closes #17498

5 months agoCI: fix OpenBSD tests stall
Stefan Eissing [Wed, 4 Jun 2025 12:32:12 +0000 (14:32 +0200)] 
CI: fix OpenBSD tests stall

impacket could not be used as it neeeds package six

- openbsd does not find python3, add package six
- http2-server.pl: only warn about unknown parameter if not empty string

Closes #17532

5 months agoSCP/SFTP: avoid busy loop after EAGAIN
Stefan Eissing [Wed, 4 Jun 2025 13:26:55 +0000 (15:26 +0200)] 
SCP/SFTP: avoid busy loop after EAGAIN

The ssh libraries do not reveal if they still have data buffered from
the peer. Only when their buffers are read empty can curl be sure that
it is safe to rely on socket polling.

This change adds detection of EGAIN on receive in the transfer loop and
allows SFTP/SCP transfers to avoid a busy loop in such a case (which
should happen often when CPU exceeds network bandwidth).

Closes #17533

5 months agotest1117: reduce write delays
Stefan Eissing [Wed, 4 Jun 2025 07:40:32 +0000 (09:40 +0200)] 
test1117: reduce write delays

Test1117 seems to verify that a response, incoming slowly, is read
completely before sending another request on the same connection.

The previsou write delay of 1000ms made the test last 23+ seconds.
A delay of 100ms seems to achieve the same test on modern machines, but
the overall run time is less than 3 seconds.

Closes #17530

5 months agoRELEASE-NOTES: synced curl-8_14_1
Daniel Stenberg [Wed, 4 Jun 2025 05:40:18 +0000 (07:40 +0200)] 
RELEASE-NOTES: synced

8.14.1 release

5 months agoTHANKS: add names from 8.14.1 release
Daniel Stenberg [Wed, 4 Jun 2025 05:40:18 +0000 (07:40 +0200)] 
THANKS: add names from 8.14.1 release

5 months agocmake: enable `-std=gnu99` for Windows CE CeGCC
Viktor Szakats [Mon, 2 Jun 2025 19:15:45 +0000 (21:15 +0200)] 
cmake: enable `-std=gnu99` for Windows CE CeGCC

To sync with autotools, which auto-detects this option and enables it by
default.

It also makes it possible to compile unsuffixed long long integer
literals correctly, allowing to drop some legacy macros without bumping
into build errors like:
```
lib/vtls/schannel.c: In function 'schannel_send':
lib/vtls/schannel.c:1815: error: integer constant is too large for 'long' type
```
Ref: https://github.com/curl/curl/actions/runs/15374705821/job/43286736583?pr=17498#step:9:20

Bug: https://github.com/curl/curl/pull/17498#issuecomment-2925507481
Reported-by: Daniel Stenberg
Closes #17523

5 months agodllmain: exclude from Cygwin builds
Jeremy Drake [Tue, 3 Jun 2025 17:35:46 +0000 (10:35 -0700)] 
dllmain: exclude from Cygwin builds

On Cygwin, it is unsafe to call POSIX functions from DllMain, which
OPENSSL_thread_stop does.  Additionally, it should be unnecessary as
OpenSSL uses pthread_key_create to register a thread destructor to do
thread cleanup in a POSIX way.

Reported-by: Yuyi Wang
Ref: https://cygwin.com/pipermail/cygwin/2025-June/258235.html

Fixes #17262
Closes https://github.com/curl/curl/pull/17528

5 months agotls BIOs: handle BIO_CTRL_EOF correctly
Stefan Eissing [Tue, 3 Jun 2025 09:54:40 +0000 (11:54 +0200)] 
tls BIOs: handle BIO_CTRL_EOF correctly

Needs to return 1 if EOF from underlying filter has been seen.

Fixes #17471
Reported-by: Michael Kaufmann
Closes #17526

5 months agocurl: make -N handled correctly
Daniel Stenberg [Tue, 3 Jun 2025 11:34:08 +0000 (13:34 +0200)] 
curl: make -N handled correctly

Options marked ARG_NO should have their 'toggle' value reverted when the
short option is used as it implies using the --no- prefix.

-N happens be the only short option flag for a --no- long option.

Reported-by: Stefan Eissing
Closes #17527

5 months agoautotools: recognize more Linux targets when setting `-D_GNU_SOURCE`
Viktor Szakats [Mon, 2 Jun 2025 22:38:20 +0000 (00:38 +0200)] 
autotools: recognize more Linux targets when setting `-D_GNU_SOURCE`

To set `-D_GNU_SOURCE`.

Required to declare `accept4` on uclibc targets. `host_os` can have
the value `uclinux-uclibcgnueabi` in this case.

Fixing:
```
cf-socket.c: In function 'cf_tcp_accept_connect':
cf-socket.c:2141:18: error: implicit declaration of function 'accept4'; did you mean 'accept'? [-Werror=implicit-function-declaration]
 2141 |     s_accepted = accept4(ctx->sock, (struct sockaddr *) &add, &size,
```

Follow-up to 3d02872be7cfe6dcdef4b02321b47af19e1ce268 #16979

Reported-by: Kadambini Nema
Fixes #17512
Closes #17524

5 months agocmdline-docs: mention HTTP resumed uploads to be shaky
Daniel Stenberg [Mon, 2 Jun 2025 12:16:25 +0000 (14:16 +0200)] 
cmdline-docs: mention HTTP resumed uploads to be shaky

In the documentation for the --continue-at and --range options.

A future version could implement support for the new standard HTTP resumed
uploads mechanism.

Ref: #17510
Closes #17521

5 months agopytest: do not use reserved chars in url queries
Stefan Eissing [Mon, 26 May 2025 15:07:37 +0000 (17:07 +0200)] 
pytest: do not use reserved chars in url queries

Closes #17458

5 months agoscorecard: rework format and add json print
Stefan Eissing [Fri, 30 May 2025 10:58:34 +0000 (12:58 +0200)] 
scorecard: rework format and add json print

Improve the JSON result format to be more descriptive and
easier to parse.

Add --print option to scorecard.py that prints a saved JSON file
Add date field to score card.

Closes #17465

5 months agotest1498: verify "-T ."
Daniel Stenberg [Mon, 2 Jun 2025 10:35:49 +0000 (12:35 +0200)] 
test1498: verify "-T ."

Closes #17519

5 months agoRELEASE-NOTES: synced
Daniel Stenberg [Mon, 2 Jun 2025 11:02:12 +0000 (13:02 +0200)] 
RELEASE-NOTES: synced

5 months agocurl: upload from '.' fix
Stefan Eissing [Mon, 2 Jun 2025 10:12:13 +0000 (12:12 +0200)] 
curl: upload from '.' fix

CURLOPT_NOPROGRESS is being set twice, if a file is uploaded from '.'.

Fix order of options so that '.' can override the global setting. Without
this, the `tool_readbusy_cb()` is never inoked and cannot unpause a
transfer waiting for more input.

Fixes #17513
Reported-by: denandz on github
Closes #17517

5 months agotool_getparam: make --no-anyauth not be accepted
Daniel Stenberg [Sun, 1 Jun 2025 16:21:52 +0000 (18:21 +0200)] 
tool_getparam: make --no-anyauth not be accepted

It was previously just ignored, now it triggers an error. It was never
documented (nor intended) to work.

Fixes #17508
Reported-by: Dan Fandrich
Closes #17511

5 months agows: tests and fixes
Ruocco, Calvin [Mon, 14 Apr 2025 15:59:45 +0000 (17:59 +0200)] 
ws: tests and fixes

This started out as regression tests for the `curl_ws_recv()` and
`curl_ws_send()` implementation and ended up with a bugfix, additional
protocol validation and minor logging improvements.

- Fix reset of fragmented message decoder state when a PING/PONG is
  received in between message fragments.

- Fix undefined behavior (applying zero offset to null pointer) in
  curl_ws_send() when the given buffer is NULL.

- Detect invalid overlong PING/PONG/CLOSE frames.
- Detect invalid fragmented PING/PONG/CLOSE frames.
- Detect invalid sequences of fragmented frames.

  - a) A continuation frame (0x80...) is received without any ongoing
    fragmented message.
  - b) A new fragmented message is started (0x81/0x01/0x82/0x02...)
    before the ongoing fragmented message has terminated.

- Made logs for invalid opcodes easier to understand.
- Moved noisy logs to the `CURL_TRC_WS` log level.
- Unified the prefixes for WebSocket log messages: `[WS] ...`

- Add env var `CURL_WS_FORCE_ZERO_MASK` in debug builds.

  - If set, it forces the bit mask applied to outgoing payloads to
    0x00000000, which effectively means the payload is not masked at
    all. This drastically simplifies defining the expected `<protocol>`
    data in test cases.

- 2700: Frame types
- 2701: Invalid opcode 0x3
- 2702: Invalid opcode 0xB
- 2703: Invalid reserved bit RSV1 _(replaces 2310)_
- 2704: Invalid reserved bit RSV2
- 2705: Invalid reserved bit RSV3
- 2706: Invalid masked server message
- 2707: Peculiar frame sizes _(part. replaces 2311)_
- 2708: Automatic PONG
- 2709: No automatic PONG _(replaces 2312)_
- 2710: Unsolicited PONG
- 2711: Empty PING/PONG/CLOSE
- 2712: Max sized PING/PONG/CLOSE
- 2713: Invalid oversized PING _(replaces 2307)_
- 2714: Invalid oversized PONG
- 2715: Invalid oversized CLOSE
- 2716: Invalid fragmented PING
- 2717: Invalid fragmented PONG
- 2718: Invalid fragmented CLOSE
- 2719: Fragmented messages _(part. replaces 2311)_
- 2720: Fragmented messages with empty fragments
- 2721: Fragmented messages with interleaved pong
- 2722: Invalid fragmented message without initial frame
- 2723: Invalid fragmented message without final frame

- 2305: curl_ws_recv() loop reading three larger frames
  - This test involuntarily sent an invalid sequence of opcodes (0x01...,0x01...,0x81...) , but neither libcurl nor the test caught this! The correct sequence was tested in 2311 (0x01...,0x00...,0x80...). See below for 2311.
  - Validation of the opcode sequence was added to libcurl and is now tested in 2723.
  - Superseded by 2719 (fragmented message) and 2707 (large frames).
- 2307: overlong PING payload
  - The tested PING payload length check was actually missing, but the test didn't catch this since it involuntarily sent an invalid opcode (0x19... instead of 0x89...) so that the expected error occurred, but for the wrong reason.
  - Superseded by 2713.
- 2310: unknown reserved bit set in frame header
  - Superseded by 2703 and extended by 2704 and 2705.
- 2311: curl_ws_recv() read fragmented message
  - Superseded by 2719 (fragmented message) and 2707 (large frames).
- 2312: WebSockets no auto ping
  - Superseded by 2709.

- No tests for `CURLOPT_WRITEFUNCTION`.
- No tests for sending of invalid frames/fragments.

Closes #17136

5 months agotests: improve server start reliability
Stefan Eissing [Mon, 2 Jun 2025 08:41:20 +0000 (10:41 +0200)] 
tests: improve server start reliability

Fix all lookups of the port a server is using by
- unlinking the portfile before the start
- waiting `timeout` seconds for the port file to exist
  and contain a positive number
- check results and fail server start when port could
  not be determined

Closes #17516

5 months agotest1510: fix expectation
Stefan Eissing [Mon, 2 Jun 2025 07:55:33 +0000 (09:55 +0200)] 
test1510: fix expectation

The test had `Closing connection 0` in its expectations, but a stripfile
expression that removes such lines. No recent changes, but started failing
this morning.

Too little coffee for me? Or what triggered this?

Closes #17515

5 months agoasyn-thrdd: fix cleanup when RR fails due to OOM
Daniel Stenberg [Mon, 2 Jun 2025 06:47:03 +0000 (08:47 +0200)] 
asyn-thrdd: fix cleanup when RR fails due to OOM

Fixes #17507
Closes #17514

5 months agoGHA/non-native: un-ignore tests on OpenBSD, bump to `-j8` for NetBSD/FreeBSD
Viktor Szakats [Sun, 1 Jun 2025 06:01:23 +0000 (08:01 +0200)] 
GHA/non-native: un-ignore tests on OpenBSD, bump to `-j8` for NetBSD/FreeBSD

- un-ignore tests (3017, FTP, TFTP) on OpenBSD
Patch-by: Jacob Mealey
  Ref: https://github.com/curl/curl/issues/13623#issuecomment-2925129037
Fixes: #13623
- KNOWN_BUGS: drop TFTP failures issue on OpenBSD.
Fixes: #13623
- bump test parallelism to `-j8` (from `-j4`) for NetBSD, FreeBSD,
  to match OpenBSD.
  Before: https://github.com/curl/curl/actions/runs/15371760479
  After: https://github.com/curl/curl/actions/runs/15371937205

- FreeBSD: sync cmake `TFLAGS` with autotools. (This branch is not
  currently hit in CI.)
  Follow-up to 7f3d598276e988a46558fe6a2951b1ae354afcdf #15040

Closes #17505

5 months agotests: re-enable 1510, unignore 2027 2051 in GHA/macos, document heimdal memleak
Viktor Szakats [Tue, 27 May 2025 05:40:19 +0000 (07:40 +0200)] 
tests: re-enable 1510, unignore 2027 2051 in GHA/macos, document heimdal memleak

- test1510: it was marked flaky, then disabled. Keep the flaky flag
  and allow it to run again.
  Ref: ef02da315604acd72c39264e732661a2aea2c583
  Ref: 0110cced2a44a0c89fd5f98c30e80afeb208c0e0

- GHA/linux: extend information about the heimdal valgrind failures.

- GHA/macos: unignore 2037 2041 in torture tests. They no longer
  appear flaky.
  Follow-up to 4b791dca37c3130bbe0d4cae12326866c2d553ae #14667

Closes #17462

5 months agodocs/tests: remove mention of hyper
Yedaya Katsman [Sat, 31 May 2025 18:47:26 +0000 (21:47 +0300)] 
docs/tests: remove mention of hyper

Closes #17500

5 months agolicense: update some copyright links to curl.se
Yedaya Katsman [Sat, 31 May 2025 20:24:33 +0000 (23:24 +0300)] 
license: update some copyright links to curl.se

Instead of curl.haxx.se

Also widen the .gitignore for libtest, since it missed libtest751,
so ignore three digit tests that start with 5-9 instead of just 5-6.

Closes #17502

5 months agomemanalyze.pl: fix getaddrinfo/freeaddrinfo checks
Daniel Stenberg [Sat, 31 May 2025 21:25:39 +0000 (23:25 +0200)] 
memanalyze.pl: fix getaddrinfo/freeaddrinfo checks

It did not parse them correctly. Problem never shows before we don't run
torture tests with these functions - yet.

Seen when enabling torture tests with the threaded resolver.

Closes #17503

5 months agoVULN-DISCLOSURE-POLICY.md: the distros list wants <= 7 days embargo
Daniel Stenberg [Sat, 31 May 2025 15:46:19 +0000 (17:46 +0200)] 
VULN-DISCLOSURE-POLICY.md: the distros list wants <= 7 days embargo

Closes #17497

5 months agows: handle blocked sends better
z2_ [Sat, 31 May 2025 12:22:00 +0000 (14:22 +0200)] 
ws: handle blocked sends better

Closes #17496

5 months agotests: test mtls also w/ clientAuth EKU only
Yedaya Katsman [Fri, 30 May 2025 15:59:14 +0000 (18:59 +0300)] 
tests: test mtls also w/ clientAuth EKU only

The google chrome root program will stop allowing roots that have both
clientAuth and ServerAuth [1].

In one of the mtls tests, use a certificate with only the clientAuth
EKU.

[1] https://googlechrome.github.io/chromerootprogram/#322-pki-hierarchies-included-in-the-chrome-root-store

Closes #17493

5 months agotests: test mtls with --insecure
Yedaya Katsman [Fri, 30 May 2025 15:43:05 +0000 (18:43 +0300)] 
tests: test mtls with --insecure

Closes #17493

5 months agotests: fix checks for https-mtls proto
Yedaya Katsman [Fri, 30 May 2025 15:37:47 +0000 (18:37 +0300)] 
tests: fix checks for https-mtls proto

If there were two tests using the "https-mtls" server there was a perl
unbound variable error, since certfile wan't set. Additionally, once the
responsiveserver function was actually called, it failed finding a
responsiveness function. For now I made it use the `verifypid` function,
since the curl execution in `verifyhttp` doesn't know about client
certificates.

Closes #17493

5 months agoftp: fix teardown of DATA connection in done
Stefan Eissing [Fri, 30 May 2025 10:05:14 +0000 (12:05 +0200)] 
ftp: fix teardown of DATA connection in done

When ftp_done() is called to terminate the transfer, it needs to tear
down any open SECONDARY filter chain. The condition on when to do that
was relying on there to be a valid socket. This is not sufficient as the
socket is only set *after* happy eyeballing has decided on one.

Instead of checking for a valid conn->sock, check if any connection
filter is installed.

Fixes #17482
Reported-by: Rasmus Melchior Jacobsen
Closes #17491

5 months agoRELEASE-NOTES: synced
Daniel Stenberg [Sat, 31 May 2025 13:12:43 +0000 (15:12 +0200)] 
RELEASE-NOTES: synced

5 months agotests: await portfile to be complete
Stefan Eissing [Sat, 31 May 2025 11:31:03 +0000 (13:31 +0200)] 
tests: await portfile to be complete

When running under load, a started server may not produce a valid portfile
before the runner starts reading it. If the read is not successful, wait
for 100ms and try again, timing out after 15 seconds.

Fixes #17492
Closes #17495

5 months agospelling: call it null-terminate consistently
Daniel Stenberg [Fri, 30 May 2025 09:20:05 +0000 (11:20 +0200)] 
spelling: call it null-terminate consistently

With a dash, using two Ls. Also for different forms of the word.

Use NULL in all uppercase if it means a zero pointer.

Follow-up to 307b7543ea1e73ab04e062bdbe4b

Closes #17489

5 months agowolfssl: fix sending of early data
Stefan Eissing [Fri, 30 May 2025 09:08:42 +0000 (11:08 +0200)] 
wolfssl: fix sending of early data

Early data was reported as being sent, but was not. While everything was
aligned with the Gods and early data was reported as accepted, the
actual sending required another call to wolfSSL.

Fixes #17481
Reported-by: Ethan Everett
Closes #17488

5 months agospelling: 'a' vs 'an'
Daniel Stenberg [Fri, 30 May 2025 08:27:35 +0000 (10:27 +0200)] 
spelling: 'a' vs 'an'

Closes #17487

5 months agoGHA/non-native: drop AmigaOS jobs, toolchain no longer available
Viktor Szakats [Fri, 30 May 2025 08:21:47 +0000 (10:21 +0200)] 
GHA/non-native: drop AmigaOS jobs, toolchain no longer available

Fixing:
```
[...] https://github.com/bebbo/amiga-gcc/releases/download/Mechen/amiga-gcc.tgz
curl: (22) The requested URL returned error: 404
```
Ref: https://github.com/curl/curl/actions/runs/15342088546/job/43170188027#step:2:17

Reason:
"As a sign of protest against the refusal to restore 2FA accounts,
this account is now empty."
Ref: https://github.com/bebbo/

If someone happens to have a local copy of the toolchain, we may use it
to restore the AmigaOS jobs.

Closes #17486

5 months agolibssh: adjust indentation
Viktor Szakats [Fri, 30 May 2025 07:57:32 +0000 (09:57 +0200)] 
libssh: adjust indentation

Follow-up to 54d04e2536d82d4f859f0e3dd63163f584e3061b #17478

5 months agomisc: we write *an* IPv6 address
Daniel Stenberg [Thu, 29 May 2025 22:52:25 +0000 (00:52 +0200)] 
misc: we write *an* IPv6 address

Add it as a "bad word"

Closes #17484

5 months agotool_getparam: remove two nextarg NULL checks
Daniel Stenberg [Thu, 29 May 2025 08:45:52 +0000 (10:45 +0200)] 
tool_getparam: remove two nextarg NULL checks

Because by checking for NULL when the argument can never be NULL, they
mislead the static analyzers into thinking it *can* be NULL and then the
analyzers tend to warn about other places in the code *without* the
check!

Closes #17483

5 months agodocs: fix typos
Samuel Henrique [Wed, 28 May 2025 22:12:47 +0000 (23:12 +0100)] 
docs: fix typos

After Gmail called out the typo I fixed on
532d89a866b5641d380a88144270b1c3ca6ba84e, I've decided to paste the
whole man page into Google docs and check what other issues it would
spot.

I know, it sounds silly, but I've just spent the last hour and a half
going over each one of them and fixing everything which was a true
finding and non-controversial.

Closes #17480

5 months agomisc: fix spelling
John Bampton [Wed, 28 May 2025 21:31:57 +0000 (07:31 +1000)] 
misc: fix spelling

Closes #17479

5 months agocmake: fix missed version number for multi-pkg-config detections
Viktor Szakats [Wed, 28 May 2025 16:21:17 +0000 (18:21 +0200)] 
cmake: fix missed version number for multi-pkg-config detections

It broke cmake builds with OpenSSL 3.5.0 and ngtcp2 1.12.0 or newer,
when detected via `pkg-config`.

For brotli, mbedtls, LDAP, ngtcp2 builds, it caused their version
numbers missing from the configure log when detected via `pkg-config`.

Regression from 01e45f81bddb2fef27fe35b7dd32032062a183f6 #16980
Regression from 3b501976a9adcf20218ffb96d9041806432227e4 #16479

Bug: https://github.com/curl/curl/pull/16980#issuecomment-2916811388
Reported-by: x-xiang on github
Closes #17476

5 months agomisc: fix spelling
John Bampton [Wed, 28 May 2025 19:53:23 +0000 (05:53 +1000)] 
misc: fix spelling

Closes #17478

5 months agotests: move test docs into /docs
Daniel Stenberg [Tue, 27 May 2025 06:06:37 +0000 (08:06 +0200)] 
tests: move test docs into /docs

In an attempt to make them easier to find.

The man pages runtests.md and testcurl.md are in /docs

The rest of the test documentation is in /docs/tests

Closes #17463

5 months agoRELEASE-NOTES: synced
Daniel Stenberg [Wed, 28 May 2025 12:55:59 +0000 (14:55 +0200)] 
RELEASE-NOTES: synced

Bumped to 8.14.1

5 months agohttp: fail early when rewind of input failed when following redirects
Stefan Eissing [Wed, 28 May 2025 11:27:19 +0000 (13:27 +0200)] 
http: fail early when rewind of input failed when following redirects

When inspecting a possible follow HTTP request, the result of a rewind
of the upload data was ignored as it was not clear at that point in time
if the request would become a GET.

This initiated the followup, rewound again, which failed again and
terminated the follow up.

This was confusing to users as it was not clear of the follow up was
done or not.

Fix: fail the early rewind when the request is not converted to GET.

Fixes #17472
Closes #17474
Reported-by: Jeroen Ooms
5 months agomulti: fix add_handle resizing
Stefan Eissing [Wed, 28 May 2025 12:04:31 +0000 (14:04 +0200)] 
multi: fix add_handle resizing

Due to someone being stupid, the resizing of the multi's transfer
table was actually shrinking it. Oh my.

Add test751 to reproduce, add code assertion.

Fixes #17473
Reported-by: Jeroen Ooms
Closes #17475

5 months agotool_getparam: refactored, simplified
Daniel Stenberg [Sun, 25 May 2025 10:24:49 +0000 (12:24 +0200)] 
tool_getparam: refactored, simplified

- add dedicated option functions for bools/none/strings
- simplify clearing (some) arguments, use '*' instead of ' '
- scripts/top-complexity: remove getparameter from whitelist
- handle --help separately
- getstr and getstrn do not allow a NULL input
- improve the ;auto check, it needs to be trailing
- add toggle bit helper function
- unify an error message for bad --no- use
- introduce generic handling of deprecated options: ARG_DEPR
- handle --no- prefix on more booleans:

    --cert-status
    --doh-cert-status
    --false-start
    --mptcp
    --ssl-no-revoke
    --ssl-revoke-best-effort
    --tcp-fastopen

Closes #17448

5 months agoBUG-BOUNTY.md. mention the medium bounty amount in 2025
Daniel Stenberg [Wed, 28 May 2025 06:29:40 +0000 (08:29 +0200)] 
BUG-BOUNTY.md. mention the medium bounty amount in 2025

Closes #17470