Commit Graph

35235 Commits

Author SHA1 Message Date
Daniel Stenberg
8c2392e564
contrithanks.sh: drop set -e
Makes the script work again

Closes #16914
2025-04-02 11:44:26 +02:00
Daniel Stenberg
1c31498817
RELEASE-NOTES: synced 2025-04-02 07:46:30 +02:00
Daniel Stenberg
b0c5a1abdb
THANKS: new contributors from 8.13.0 release 2025-04-02 07:46:30 +02:00
Viktor Szakats
5ad32b05d5
GHA/windows: move libssh job from vcpkg to MSYS2
To avoid upstream issue where libssh no longer builds with vcpkg:
```
error: building libssh:x64-windows failed with: BUILD_FAILED
```
Ref: https://github.com/curl/curl/actions/runs/14206672441/job/39805869213?pr=16909#step:5:64

Bug: https://github.com/curl/curl/pull/16909#issuecomment-2770792320

Closes #16910
2025-04-02 01:38:12 +02:00
Viktor Szakats
c6a324d5b9
GHA/windows: make libssh2 install a per job config
To allow making per-job variations for SSH backends.

Also:
- fix Cygwin builds to not ignore per-job `install:` items.
  It worked by accident before this patch.
  Follow-up to 66313cc036 #16629

Closes #16911
2025-04-02 01:14:29 +02:00
Daniel Stenberg
63c1e6482a
vtls_scache: remove "Unreachable Call"
The condition required to reach this call could not happen, because
cf_ssl_scache_get() already checks the same condition and returns NULL
for 'scache' prior to this.

Found by CodeSonar

Closes #16896
2025-04-01 15:27:56 +02:00
Daniel Stenberg
49a87e93c3
tool_getparam: avoid redundant condition in set_rate
When the number parsing fails, the pointer is never moved so there's no
point in checking that.

Pointed out by CodeSonar

Closes #16895
2025-04-01 14:29:04 +02:00
Daniel Stenberg
50c1e62fa4
multi_ev: remove redundant check from mev_get_last_pollset
Pointed out by CodeSonar

Closes #16894
2025-04-01 14:28:18 +02:00
Stefan Eissing
1f844dd3f0
http2: fix stream assignemnt for pushes
When a PUSH_PROMISE was received, the h2_stream object was assigned
to the wrong `newhandle->mid` and was thereafter not found. This led
to internal confusion, because the nghttp2 stream user_data was not
cleared and an invalid easy handle was use for trace messages,
resulting in a crash.

Reported-by: Viktor Szakats
Fixes #16881
Closes #16905
2025-04-01 14:19:27 +02:00
Viktor Szakats
fe9c99e377
GHA/windows: drop GnuTLS-fork from vcpkg MultiSSL job
curl now has a working GnuTLS CI job, with tests, with MSYS2.
The MultiSSL build scenario is now tested on macOS.

The vcpkg GnuTLS package seems to have a deep dependency tree with large
packages that need to be rebuilt relatively frequently. Since they can't
fit into to the time limit, these cause CI failures.

To stabilize CI, drop the `shiftmedia-libgnutls` dependency.

Partial revert of e86f99824c #16623
Ref: https://github.com/curl/curl/actions/runs/14192680124/job/39760753274?pr=16902

Closes #16904
2025-04-01 12:48:04 +02:00
Viktor Szakats
fddc7a67ea
tests/README: document test bundles
Closes #16902
2025-04-01 12:48:04 +02:00
Viktor Szakats
93964c21f4
runtests: fix bundled test invocation with -g option
Fixes:
```
$ ./runtests.pl -g 1940
./libtest/libtests lib1940: No such file or directory.
Argument list to give program being debugged when it is started is "http://127.0.0.1:44547/1940".
```

Reported-by: Daniel Stenberg
Fixes #16893
Closes #16898
2025-04-01 11:46:17 +02:00
Daniel Stenberg
0042f11d6e
GHA: run random curl command lines for N seconds in CI
In the memory and address sanitizer builds.

Verify that nothing unexpected happens.

Starting out with 60 second runs.

The script does not set any seed so it runs with a new random every
time, meaning that if it fails in a single CI run it might not fail in a
subsequent one: but it should still show the full command that failed to
enable us to reproduce it locally. We can work on improving the seed
situation later if this script turns useful.

Closes #16884
2025-04-01 11:31:48 +02:00
Daniel Stenberg
0d85c8c49d
tool_paramhlp: make proto2num skip leading commas better
Closes #16892
2025-04-01 11:30:05 +02:00
Daniel Stenberg
66c95f05fa
tests/certs/Makefile.am: avoid superfluous cert re-generation
Fixes #16897
Closes #16899
2025-04-01 11:29:14 +02:00
Viktor Szakats
1dd361cde8
libssh2: show crypto backend in the verbose connect log
With libssh2 1.11.0 or newer.

Different crypto backends may offer different features, e.g. in the keys
and algos they support.

Examples:
```
*   Trying 127.0.0.1:22...
* Connected to localhost (127.0.0.1) port 22
* libssh2 crypto backend: openssl compatible
[or]
* libssh2 crypto backend: WinCNG
```

Also fix indentation and drop redundant curly braces.

Closes #16790
2025-03-31 22:49:18 +02:00
Daniel Stenberg
b4dc529fc4
prox/preproxy.md: document argument within <brackets>
... as the argument is mandatory and we use that symbol for all other
options.

Closes #16883
2025-03-31 13:42:29 +02:00
Daniel Stenberg
fb15a986c0
Revert "async-threaded resolver: use ref counter"
This reverts commit 19226f9bb1.

Due to flaky macos CI builds

Fixes #16880
Closes #16882
2025-03-31 12:42:26 +02:00
Daniel Stenberg
c31dd6631f
urlapi: remove percent encoded dot sequences from the URL path
Treat %2e and %2E to be "dot equivalents" in the function and remove
such sequences as well, according to RFC 3986 section 5.2.4. That is
also what the browsers do.

This DOES NOT consider %2f sequences in the path to be actual slashes,
so there is no removal of dots for those.

This function does not decode nor encode any percent sequences.

Also switched the code to use dynbuf.

Extends test 1395 and 1560 to verify.

Assisted-by: Demi Marie Obenour

Fixes #16869
Closes #16870
2025-03-31 08:52:26 +02:00
Daniel Stenberg
b2926e2248
asyn-thread: repair build with disabled socketpair
Reported-by: Abhinav Singhal
Bug: https://curl.se/mail/lib-2025-03/0031.html
Closes #16877
2025-03-31 08:20:42 +02:00
Daniel Stenberg
083da46c60
docs/cmdline-opts: use imperative form
Use 'set', not 'sets' etc. For consistency.

Closes #16879
2025-03-31 08:18:31 +02:00
Austin Moore
3978bd4498
aws_sigv4: merge repeated headers in canonical request
When multiple headers share the same name, AWS SigV4 expects them to be
merged into a single header line, with values comma-delimited in the
order they appeared.

Add libtest 1978 to verify.

Closes #16743
2025-03-31 00:01:55 +02:00
Viktor Szakats
fb4dbbac4a
build: drop build-certs as a test-run dependency
After adding it as a test executables dependency, it run twice in
MSBuild jobs. Also there is little reason to try building them in both
build and run tests targets.

(The reason MSBuild building it twice, is our use of
`TrackFileAccess=false` to improve build performance.)

https://github.com/curl/curl/actions/runs/14156797251/job/39662914155?pr=16840#step:15:31

Follow-up to 68609f0e33 #16866
Follow-up to 0c1ad21f97 #16845

Closes #16876
2025-03-30 23:36:18 +02:00
Viktor Szakats
3e2860f66d
genserv.pl: detect openssl in PATH, omit command -v
Before this patch the script relied on Perl `system()` finding `openssl`
in `PATH`, plus tried to display the full path of `openssl` by using
`command -v` (or `which` on Windows). `command -v` did not work in CI
for unknown reasons. To resolve it, this patch detects `openssl` in
`PATH` manually, displays the detected full path and calls `openssl`
with the detected full path, and stops relying on `system` for this.

It also follows how `sshhelp.pm` is detecting executables. Though this
patch uses Perl `-f` instead of `-e && -d` used there .

Silencing this in CI logs:
```
Can't exec "command": No such file or directory at ../../../tests/certs/genserv.pl line 51.
```
Ref: https://github.com/curl/curl/actions/runs/14145795884/job/39632942668?pr=16865#step:39:108

Closes #16868
2025-03-30 23:36:18 +02:00
Daniel Stenberg
8579cf4016
lib1560: test set path containing LR or CR
Ref: #16874
Closes #16875
2025-03-30 23:32:48 +02:00
Viktor Szakats
6f0bc43b08
easy: drop break after return
Also some whitespace tidy-ups.

Closes #16873
2025-03-30 21:13:31 +02:00
Daniel Stenberg
bc26289d37
libtest/first.c: remove the Test: stderr output for unity builds
That makes the output differ between builds which breaks libtests doing
stderr comparisons

Closes #16872
2025-03-30 14:32:33 +02:00
Viktor Szakats
68609f0e33
cmake: also build certs when building test executables
To support running tests directly via `runtests.pl` after building
the test targets. Also to sync with the same update for autotools.

Follow-up to 0c1ad21f97 #16845
Closes #16866
2025-03-30 13:35:09 +02:00
Viktor Szakats
f07d57b955
test313: disable via <features> for backends without CRL support
Instead of via `tests/data/DISABLED` file.

They are all missing CRL feature support, as opposed to being broken.

Follow-up to 8adee8824c #16862
Follow-up to 8b1b5cd4d2 #16660

Closes #16865
2025-03-30 13:35:09 +02:00
Daniel Stenberg
5c131c6c46
curl_trc: provide Curl_trc_dns dummy
Follow-up to 19226f9bb1

For building without verbose output.

Closes #16871
2025-03-29 22:34:26 +01:00
Daniel Stenberg
33ad7aabb5
curl/system.h: drop leftover comment about 32 bit curl_off_t
curl MUST have a 64 bit curl_off_t these days

Closes #16867
2025-03-29 15:54:00 +01:00
Daniel Stenberg
c4863e9d3b
docs/internals/PORTING.md: new document
The basic approach I use when porting libcurl to another OS when the
existing configure or cmake build setups are not suitable.

Closes #16860
2025-03-29 14:10:10 +01:00
Stefan Eissing
19226f9bb1
async-threaded resolver: use ref counter
Allocate the data shared between a transfer and an aync resolver
thread separately and use a reference counter to determine its
release.

Closes #16847
2025-03-29 14:06:03 +01:00
renovate[bot]
23dfb47595
GHA: update awslabs/aws-lc to v1.49.0
Closes #16864
2025-03-29 14:04:34 +01:00
Viktor Szakats
edd6e54e5f
runtests: support running tests under wine or qemu (cont.)
Respect `CURL_TEST_EXE_RUNNER` env in server verifications using
the in-tree curl, in `tests/servers.pm`.

Follow-up to 72b163c301 #16785
Closes #16863
2025-03-29 12:35:34 +01:00
Viktor Szakats
8adee8824c
test313: disable CRL test for Schannel due to lack of support and flakiness
The source code and documentation says that CRL is not supported by
curl's Schannel TLS backend.

It's also frequently flaky in CI with both MinGW and MSVC jobs, e.g.:
https://github.com/curl/curl/actions/runs/14134841988/job/39603994164 (Schannel)
https://github.com/curl/curl/actions/runs/14134841988/job/39606336445 (Schannel)
https://github.com/curl/curl/actions/runs/13981383629/job/39147183706 (LibreSSL)

```
curl returned 35, when expecting 60
```

This test was passing with Schannel because it misses the `--insecure`
option and thus always returns 60, regardless of passing `--crlfile` or
not:
```
curl: (60) schannel: CertGetCertificateChain trust error CERT_TRUST_REVOCATION_STATUS_UNKNOWN
More details here: https://curl.se/docs/sslcerts.html

curl failed to verify the legitimacy of the server and therefore could not
establish a secure connection to it. To learn more about this situation and
how to fix it, please visit the webpage mentioned above.
```

Closes #16862
2025-03-29 12:35:34 +01:00
Viktor Szakats
25eb2dbfbf
sshserver.pl: use Perl chmod
Instead of relying on the external/shell command. For portability.

Follow-up to 213c5aca7b #3899
Closes #16859
2025-03-29 12:35:34 +01:00
Viktor Szakats
7be2c421bf
runtests: rewrite genserv.sh in Perl
To remove POSIX shell as an extra dependency for runtests.

Also fix to `chmod 0600` the `.pem` file (was: `.prm`), and apply it
_before_ writing the keys.

Follow-up to 44341e736a #16824
Closes #16858
2025-03-29 12:35:33 +01:00
Daniel Stenberg
ad99067d92
RELEASE-NOTES: synced 2025-03-29 11:27:44 +01:00
Stefan Eissing
7cb079ad1b
c-ares httpsrr: fix ifdef
Fix the ifdef const when enabling HTTPSRR with c-ares.

Reported-by: Pavel Kropachev
Ref: #16855
Closes #16861
2025-03-28 23:44:48 +01:00
Viktor Szakats
c8b0f0c9ad
cmake: add shell completion support
Add the last (*) missing bit for feature parity with autotools.

Also test in CI. Add a new `cmake install` step to GHA/macos.

(*) AFAIK. Let us know if there's something else missing.

Closes #16833
2025-03-28 13:51:38 +01:00
Viktor Szakats
e95f509c66
tests/server: make the signal handler signal-safe
Before this patch the signal handler called `logmsg()` which in turn
called `printf()` variants (internal implementations), and `FILE *`
functions, `localtime()`. Some of these called `malloc`/`free`, which
isn't supported in s signal handler. Replace them with `write` calls,
losing some logging functionality.

Also:
- De-dupe and move `STD*_FILENO` macros to `lib/curl_setup.h`. Revert
  the `src` definition to point to `stderr`, instead of `tool_stderr`.
  Follow-up to e5bb88b8f8 #11958

POSIX specs with list of functions allowed in a signal handler:
2004: https://pubs.opengroup.org/onlinepubs/009695399/functions/xsh_chap02_04.html#tag_02_04_03
2017: https://pubs.opengroup.org/onlinepubs/9699919799/functions/V2_chap02.html#tag_15_04_03
2024: https://pubs.opengroup.org/onlinepubs/9799919799/functions/V2_chap02.html#tag_16_04_03

Linux CI run with the thread sanitizer going crazy when
hitting the signal handler in test 1238 and 1242 (TFTP):
```
WARNING: ThreadSanitizer: signal-unsafe call inside of a signal (pid=12582)
    #0 malloc <null> (servers+0x5ed70)
    #1 _IO_file_doallocate <null> (libc.so.6+0x851b4)
    #2 formatf /home/runner/work/curl/curl/bld/tests/server/../../lib/../../lib/mprintf.c:886:9 (servers+0xdff77)
[...]
WARNING: ThreadSanitizer: signal-unsafe call inside of a signal (pid=12582)
    #0 free <null> (servers+0x5f453)
    #1 fclose <null> (libc.so.6+0x8532f)
    #2 logmsg /home/runner/work/curl/curl/bld/tests/server/../../../tests/server/util.c:134:5 (servers+0xe684d)
```
Ref: https://github.com/curl/curl/actions/runs/14118903372/job/39555309490?pr=16851

Closes #16852
2025-03-28 12:02:38 +01:00
Viktor Szakats
3b6c7142f6
GHA/linux: move pytests to non-valgrind job variants, drop 2 redundant runs
- move pytest from the valgrind variant of the mbedTLS and Rustls jobs
  to their non-valgrind counterpart (they different in C compiler and
  build tool respectively). To parallelize more and finish the workflow
  faster.

- drop pytest from the valgrind variant of the two identical (other than
  the build tool) 'libressl heimdal' jobs. Saves 1.5 minutes CI time.

- drop pytest from the longest valgrind job to make the workflow finish
  almost 2 minutes faster. `sync-resolver` is its unique build propery.
  It wasn't pytested on Azure.

- explicitly install `libnghttp2-dev` and `libldap-dev` to keep them in
  jobs where pytest deps were installing them implicitly before this
  patch.

Before: https://github.com/curl/curl/actions/runs/14118080563
After: https://github.com/curl/curl/actions/runs/14118903372?pr=16851

Closes #16851
2025-03-28 01:25:48 +01:00
Viktor Szakats
8cc05992a8
GHA/linux: enable ECH in Rustls jobs
Closes #16850
2025-03-27 23:42:18 +01:00
Daniel McCarney
8836e65967
docs: add rustls --ca-native & CURLSSLOPT_NATIVE_CA
The one important caveat is that presently _only_ the native platform
verifier/CAs are consulted when this option is used w/ rustls.

Closes #16848
2025-03-27 22:54:24 +01:00
Stefan Eissing
a910f5ba6a
vquic: obey IOV_MAX
When using `recvmmsg()`, check `IOV_MAX` for limits to the iovec array
passed.

Reported-by: Teh Kok How
Fixes #16846
Closes #16849
2025-03-27 22:53:01 +01:00
Stefan Eissing
0c1ad21f97
tests/makefile: add dependency on build-certs
Closes #16845
2025-03-27 13:23:21 +01:00
Viktor Szakats
44341e736a
runtests: generate certs dynamically, bump to EC-256, tidy up
Before this patch the curl repository and source tarball distribution
contained test certificates as binary blobs. Used by runtests.

Drop these certificates in favor of generating them dynamically as
part of the build process. Both via autotools and CMake.

As part of this, improve certificates, the generator script and process,
file layout, and fix any issue to make it work fast and smooth both in
CI and local builds.

Note, cert generator scripts require OpenSSL >=1.0.2
(or LibreSSL >=3.1.0). Generation requires POSIX shell, also with CMake.
Without a POSIX shell tests relying on TLS (and stunnel) will fail.

Details:

- build: generate certs as part of the test run process.
- build, tests: generate certs in the build directory.
- binarycheck: drop concept of known binary files with hashes.
- binarycheck: move binary check logic into spacecheck and drop this
  separate checker tool.
- build: fix to clean all cert files.
- autotools: fix to not run leaf cert generators in parallel. To avoid
  confusion when updating the revocation database and counter.
- scripts: drop `scripts` subdir, merge two scripts into one,
  auto-generate root cert, allow generating multiple leafs at once.
- scripts: switch to EC-256 keys (was: RSA-2048). For key size and perf.
- scripts: drop `-x` echo, text dumps, most other output. To avoid log
  noise and make it quicker in CI.
- scripts: make it non-RSA-specific.
- scripts: delete unused code.
- scripts: use POSIX shell shebang. Some envs don't have bash (Alpine).
- scripts: pass test pseudo-secrets via the command-line. To avoid:
  ```
  + openssl genrsa -out test-ca.key -passout fd:0 2048
  Invalid password argument, starting with "fd:"
  ```
- cmake: fix to launch generator scripts via the detected POSIX shell.
- cmake: fix `build-certs` rule to not depend on `SRPFILES`
  (`srp-verifier-*`).
- cmake: drop `EXCLUDE_FROM_ALL` for the cert subdir. It makes
  the Visual Studio generator miss to create the `clean-certs`,
  `build-certs` targets. No target depend on them, so they don't execute
  implicitly anyway. Fixes:
  ```
  MSBUILD : error MSB1009: Project file does not exist.
  Switch: clean-certs.vcxproj
  ```
- cmake: add `VERBATIM USES_TERMINAL` to `build-certs` target.
- GHA/linux: install openssl on Alpine, for the cert generator scripts.

Follow-up to 556f722fe3 #16593
Follow-up to fa461b4eff #14486

Closes #16824
2025-03-27 10:21:57 +01:00
Daniel McCarney
1821ea8b14
rustls: support native platform verifier
e.g. `curl --ca-native ...`
2025-03-27 08:48:13 +01:00
Daniel McCarney
3143efd86a
docs: include rustls-ffi in ECH docs 2025-03-27 08:48:13 +01:00