Commit Graph

32273 Commits

Author SHA1 Message Date
Viktor Szakats
dbd626ab82
tests: fix TFTP test 2305 on Windows
Ref: #13692
Closes #13724
2024-05-20 21:20:02 +02:00
Jay Satiro
9aae9bf817 openssl: revert keylog_callback support for LibreSSL
- Revert to the legacy TLS 1.2 key logging code for LibreSSL.

- Document SSLKEYLOGFILE for LibreSSL is TLS 1.2 max.

Prior to this change if the user specified a filename in the
SSLKEYLOGFILE environment variable and was using LibreSSL 3.5.0+ then
an empty file would be created and no keys would be logged.

This is effectively a revert of e43474b4 which changed openssl.c to use
SSL_CTX_set_keylog_callback for LibreSSL 3.5.0+. Unfortunately LibreSSL
added that function only as a stub that doesn't actually do anything.

Reported-by: Gonçalo Carvalho

Fixes https://github.com/curl/curl/issues/13672
Closes https://github.com/curl/curl/pull/13682
2024-05-20 03:55:40 -04:00
renovate[bot]
bdfb41a04c
GHA: pin dependencies
Closes #13712
2024-05-19 23:37:59 +02:00
Viktor Szakats
2a9e08c2d0
appveyor: drop unnecessary --clean-first cmake option
In CI all machines are fresh on startup, making the `clean` operation
unnecessary. This can save some time/energy for each job run.

Closes #13707
2024-05-19 23:26:56 +02:00
Viktor Szakats
0b31c713a9
cmake: merge two if(BUILD_TESTING) branches
Closes #13708
2024-05-19 23:18:20 +02:00
Tatsuhiro Tsujikawa
7e932fac94
GHA: bump nghttp2 to v1.62.1
Use gcc-12 explicitly to compile C++20 source files.

Closes #13702
2024-05-19 23:15:00 +02:00
Viktor Szakats
90e644f944
GHA: add NetBSD, OpenBSD, FreeBSD/arm64 and OmniOS jobs
Add these jobs to GHA:
- NetBSD, cmake-unity, clang, OpenSSL, x86_64, with tests, w/o python,
  no parallelism (was flaky sometimes)
- OpenBSD, cmake-unity, clang, LibreSSL, x86_64, with tests,
  with python, -j8, TFTP results ignored due to #13623.
- FreeBSD, cmake-unity and autotools, clang, OpenSSL, arm64
  (Tests disabled for arm64, because they are slow. It's available for
  x86_64 with python, -j12.)
  Configuration matches our existing Cirrus CI one.
- OmniOS, autotools, gcc, OpenSSL, x86_64, with tests, -j12.

All build with websockets and examples.

Closes #13583
2024-05-19 23:06:54 +02:00
Viktor Szakats
df3f4340f2
GHA: disable TFTP test on native Windows
Some TFTP tests seem to enter into a loop and maybe hang?

E.g. 1007, 1009, 1238

Try fixing it by skipping all TFTP tests.

Ref: https://github.com/curl/curl/actions/runs/9141987545/job/25137038249?pr=13698

Also drop mingw-w64 test exclusions copy-pasted from MSYS jobs.

Possibly related: cffbcc3110 #5364

Close #13699
2024-05-19 13:02:51 +02:00
renovate[bot]
7c44d64a80
GHA: pin dependencies
Closes #13691
2024-05-18 22:52:10 +02:00
Viktor Szakats
8f30c96af4
cmake: do not pass linker flags to the static library tool
Do not add linker flags to the global CMake static library tool (aka
"static linker") (e.g. `ar`) flags list. They don't mix well. This was
only done after successfully detecting GSSAPI.

Linker flags seen on Old Linux CI:
```
-- |GSS_LINKER_FLAGS|-Wl,--enable-new-dtags -Wl,-rpath -Wl,/usr/lib/x86_64-linux-gnu/heimdal|
-- |CMAKE_STATIC_LINKER_FLAGS| -Wl,--enable-new-dtags -Wl,-rpath -Wl,/usr/lib/x86_64-linux-gnu/heimdal|
```
Ref: https://github.com/curl/curl/actions/runs/9138988036/job/25130791712#step:6:85

Causing:
```
/usr/bin/ar qc libcurltool.a  -Wl,--enable-new-dtags -Wl,-rpath -Wl,/usr/lib/x86_64-linux-gnu/heimdal
  CMakeFiles/curltool.dir/slist_wc.c.o CMakeFiles/curltool.dir/tool_binmode.c.o CMakeFiles/curltool.dir/tool_bname.c.o
  [...]
  CMakeFiles/curltool.dir/tool_writeout_json.c.o CMakeFiles/curltool.dir/tool_xattr.c.o CMakeFiles/curltool.dir/var.c.o
  CMakeFiles/curltool.dir/__/lib/base64.c.o CMakeFiles/curltool.dir/__/lib/dynbuf.c.o
/usr/bin/ar: invalid option -- 'W'
Usage: /usr/bin/ar [emulation options] [-]{dmpqrstx}[abcDfilMNoPsSTuvV] [--plugin <name>] [member-name] [count] archive-file file...
       /usr/bin/ar -M [<mri-script]
```
Ref: https://github.com/curl/curl/actions/runs/9138988036/job/25130791712#step:9:125

This problem is invisible at the moment because of another bug (#13698)
that misses building unit tests when not using either the
`ENABLE_DEBUG=ON` or `ENABLE_CURLDEBUG=ON` options (to set
`-DCURLDEBUG`):
```
test 1300 SKIPPED: curl lacks unittest support
```
Ref: https://github.com/curl/curl/actions/runs/9135571781/job/25123104557#step:9:2883

With that fixed, this becomes the next issue.

It's possible this bug also required an older CMake version and/or
a specific OS environment which uses linker flags in GSSAPI that are not
playing well with `ar` options, to reproduce.

Follow-up to 558814e16d (2014-09-25)
Ref: #13698
Closes #13697
2024-05-18 20:54:37 +02:00
Viktor Szakats
00560b95b4
GHA: ignore flaky test2302 results on Windows
WebSockets:
```
TESTFAIL: These test cases failed: 2302
```
Ref: https://github.com/curl/curl/actions/runs/9139155361/job/25131144383?pr=13689#step:14:9892

Follow-up to 36fd2dd6ee #13599
Ref: #13692
Closes #13696
2024-05-18 19:58:03 +02:00
Viktor Szakats
36fd2dd6ee
GHA: add MSYS, mingw-w64, Cygwin jobs
- re-implement autotools MSYS and Cygwin AppVeyor jobs in GHA.
  Now build with SSL and PSL to improve test coverage.
- re-implement MSYS2 mingw-w64 gcc 13 AppVeyor job in GHA.
  `CMake, mingw-w64, gcc 13, Debug, x64, Schannel, Static, Unicode`
- add new cmake Cygwin job (build-only).
- enable `-j14` parallelism when running tests.
- delete the 5 migrated jobs from AppVeyor CI.
- add 2 build-only mingw-w64 builds, gcc Release and clang OpenSSL.
- also enable brotli, libssh2, nghttp2 for more test coverage.

These jobs offer better performance, more flexibility and
parallelization compared to the AppVeyor ones they replace. It also
offloads AppVeyor, allowing to iterate faster. They also appear more
reliable than e.g. Azure Windows jobs, where runners are prone to fail
[1].

Closes #13599

[1]:
`Exit code 143 returned from process: file name 'C:\Windows\system32\docker.EXE',
arguments 'exec -i   6b13a669c6dfe7fb9f59414369872fd64d61c7182f880c3d39c135cb4c115c8f
C:\__a\externals\node\bin\node.exe C:\__w\_temp\containerHandlerInvoker.js'.`
2024-05-18 00:30:36 +02:00
Stefan Eissing
345557248e
pytest: fixes for recent python, add FTP tests
Fixes:
- in uds tests, abort also silently on os errors
- be conservative on the h3 goaway duration
- detect curl debug build and use in checks
- fix caddy version check for slight difference under linux
- set caddy default path fitting for linux
- fix deprecation warnings in valid time checks

FTP tests:
- add '--with-test-vsftpd=path' to configure
- use vsftpd default path suitable for linux
- add test_30 with plain FTP tests
- add test_31 with --ssl-reqd FTP tests
- add vsftpd to linux GHA for pytest workflows

Closes #13661
2024-05-17 16:53:17 +02:00
Stefan Eissing
afffd4c512
rustls: fix handshake done handling
- rustls report it has finished the TLS handshake *before*
  all relevant data has been sent off, e.g. it FINISHED message
- On connections the send data immediately, this was never noticed
  as the FINISHED in rustls buffers was send with the app data
- On passive FTP connections, curl does not send any data after
  the handshake, leaving FINISHED unsent and the server never
  responded as it was waiting on this.

Closes #13686
2024-05-17 16:51:45 +02:00
Daniel Stenberg
13ca4386ba
x509asn1: return error on missing OID
to avoid crash when dereferencing a NULL pointer.

Reported-by: Trzik on github
Patch-by: Trzik on github
Fixes #13684
Closes #13685
2024-05-17 14:54:41 +02:00
Daniel Stenberg
6d1e144f12
CURLOPT_WRITEFUNCTION.md: fix the callback proto in the example
Reported-by: Michael Litwak
Fixes #13681
Closes #13687
2024-05-17 14:36:59 +02:00
Viktor Szakats
1a89538347
src: tidy up types, add necessary casts
Cherry-picked from #13489
Closes #13614
2024-05-17 12:32:04 +02:00
Viktor Szakats
d0728c9109
lib: fix compiler warnings (gcc)
Seen when setting `ENABLE_DEBUG=ON` and `-DDEBUGBUILD` for mingw-w64
gcc 13.2.0 CMake unity builds in 'Release' configurations.

```
curl/lib/curl_gethostname.c:71:5: error: 'strncpy' specified bound 1025 equals destination size [-Werror=stringop-truncation]
   71 |     strncpy(name, force_hostname, namelen);
      |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from curl/_bld/lib/CMakeFiles/libcurl_object.dir/Unity/unity_0_c.c:175:
In function 'hostcache_timestamp_remove',
    inlined from 'Curl_hash_clean_with_criterium' at curl/lib/hash.c:265:19,
    inlined from 'Curl_hash_clean_with_criterium' at curl/lib/hash.c:247:1,
    inlined from 'hostcache_prune' at curl/lib/hostip.c:228:3,
    inlined from 'Curl_hostcache_prune' at curl/lib/hostip.c:256:21:
curl/lib/hostip.c:205:12: error: 'now' may be used uninitialized [-Werror=maybe-uninitialized]
  205 |     time_t age = prune->now - c->timestamp;
      |            ^~~
curl/lib/hostip.c: In function 'Curl_hostcache_prune':
curl/lib/hostip.c:241:10: note: 'now' was declared here
  241 |   time_t now;
      |          ^~~
In function 'hostcache_timestamp_remove',
    inlined from 'fetch_addr' at curl/lib/hostip.c:310:8:
curl/lib/hostip.c:205:23: error: 'user.now' may be used uninitialized [-Werror=maybe-uninitialized]
  205 |     time_t age = prune->now - c->timestamp;
      |                  ~~~~~^~~~~
curl/lib/hostip.c: In function 'fetch_addr':
curl/lib/hostip.c:304:33: note: 'user' declared here
  304 |     struct hostcache_prune_data user;
      |                                 ^~~~
In file included from curl/_bld/lib/CMakeFiles/libcurl_object.dir/Unity/unity_0_c.c:40:
curl/lib/cf-socket.c: In function 'cf_socket_send':
curl/lib/cf-socket.c:1294:10: error: 'c' may be used uninitialized [-Werror=maybe-uninitialized]
 1294 |     if(c >= ((100-ctx->wblock_percent)*256/100)) {
      |        ~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
curl/lib/cf-socket.c:1292:19: note: 'c' was declared here
 1292 |     unsigned char c;
      |                   ^
In file included from curl/_bld/lib/CMakeFiles/libcurl_object.dir/Unity/unity_0_c.c:364:
In function 'tftp_state_timeout',
    inlined from 'tftp_multi_statemach' at curl/lib/tftp.c:1230:27:
curl/lib/tftp.c:1208:5: error: 'current' may be used uninitialized [-Werror=maybe-uninitialized]
 1208 |   if(current > state->rx_time + state->retry_time) {
      |     ^
curl/lib/tftp.c: In function 'tftp_multi_statemach':
curl/lib/tftp.c:1192:10: note: 'current' was declared here
 1192 |   time_t current;
      |          ^~~~~~~
```
Ref: https://ci.appveyor.com/project/curlorg/curl/builds/49792835/job/91c8dj5qb36spfe0#L112
Ref: https://github.com/curl/curl/actions/runs/9082968838/job/24960616145#step:12:62

Ref: #13592
Closes #13643
2024-05-17 12:00:19 +02:00
Andrew
fd0d2ed74a
wakeup_create: use FD_CLOEXEC/SOCK_CLOEXEC
for `pipe()`/`socketpair()`

Fixes #13618
Closes #13625
2024-05-16 23:02:12 +02:00
Stefan Eissing
6eee810db4
rustls: fix partial send handling
When TLS bytes could not completely sent off, the amount of plain bytes
already added to rustls were forgotten. This lead to send those byte
duplicate, corrupting the request send to the server.

Closes #13676
2024-05-16 23:01:15 +02:00
Stefan Eissing
dad8c1e305
pytest: add DELETE tests, check server version
- add tests for DELETE working
- check apache version in keepalive test
- fix some comments

Closes #13679
2024-05-16 22:51:25 +02:00
Juliusz Sosinowicz
4c46e277b2
vquic-tls: use correct cert name check API for wolfSSL
wolfSSL_X509_check_host checks the peer name against the alt names and
the common name.

Fixes #13487
Closes #13680
2024-05-16 22:44:29 +02:00
Viktor Szakats
9e2bd56ec6
cmake: initialize BUILD_TESTING before first use
Before this patch `BUILD_TESTING` was used once, then initialized, then
used again. This caused the `curlu` library not being built when relying
on an implicit `BUILD_TESTING=ON` setting, and ending up with a link
error when building the `testdeps` target.

It did not cause issues when `BUILD_TESTING` was explicitly set.

Move the initialization before the first use to fix it.

Regression from aace27b096 #12287
Closes #13668
2024-05-16 17:22:08 +02:00
Daniel Stenberg
9b802e2d19
libtest: 2308 verifies CURLE_WRITE_ERROR after write callback error
Verifies that the issue in #13669 actually is fixed. This return code is
what the CURLOPT_WRITEFUNCTION manpage documents should be returned.

This code is mostly from the
Source-written-by: Trumeet on github
Closes #13671
2024-05-16 13:46:52 +02:00
Antoine Bollengier
7c5ad6d278
socketpair: fix compilation when USE_UNIX_SOCKETS is not defined
Closes #13666
2024-05-16 10:50:02 +02:00
Stefan Eissing
df4a8c7661
rustsls: fix error code on receive
- use CURLE_RECV_ERROR instead of CURLE_READ_ERROR when receiving
  data fails.

Closes #13670
2024-05-16 10:48:07 +02:00
Max Dymond
c7b0fa41e5
ci: disable Renovate dashboard
The Renovate dashboard insists on an open issue,
which is a problem. Disable the dashboard. Status
can still be seen at https://developer.mend.io/github/curl/curl.

Fixes #13630
Closes #13673
2024-05-16 10:44:20 +02:00
Daniel Stenberg
7dc376aab3
RELEASE-NOTES: synced 2024-05-16 08:44:21 +02:00
renovate[bot]
7ec3db1d36
GHA: update awslabs/aws-lc to v1.27.0
Closes #13667
2024-05-16 08:30:45 +02:00
Daniel Stenberg
76dba79028
curl_easy_pause.md: use correct defines in example
Spotted-by: Harry Sintonen
Closes #13664
2024-05-15 23:22:17 +02:00
Viktor Szakats
77ac610d08
appveyor: more tidy-ups
- use `--disable` when calling `curl --version`. Just in case.

- use single-quotes for a constant.

Closes #13662
2024-05-15 14:56:52 +02:00
Viktor Szakats
d927ab0ae9
reuse: migrate standalone license file to dep5
Follow-up to 73a3602120
Closes #13660
2024-05-15 14:15:25 +02:00
Viktor Szakats
ec498695fc
appveyor: guard against crash-build with VS2008
The combination of `-DDEBUGBUILD`, a shared `curl.exe`, and the VS2008
compiler creates a `curl.exe` segfaulting on startup:

```
+ _bld/src/curl.exe --version
./appveyor.sh: line 122:   793 Segmentation fault      "${curl}" --version
Command exited with code 139
```
Ref: https://ci.appveyor.com/project/curlorg/curl/builds/49817266/job/651iy6qn1e238pqj#L191

Add job that triggers the issue and add the necessary logic to skip
running the affected `curl.exe`.

Ref: #13592
Closes #13654
2024-05-15 14:15:24 +02:00
renovate[bot]
7398037abe
GHA: pin dependencies
Closes #13628
2024-05-15 13:35:45 +02:00
Orgad Shaneh
17fbed2008
socket: remove redundant call to getsockname
The result "add" is unused.

Closes #13655
2024-05-15 13:26:15 +02:00
renovate[bot]
6ce1d6f816
CI: renovate updates
- GHA: update actions/checkout action to v4
- GHA: update wolfSSL/wolfssh to v1.4.17
- GHA: update wolfSSL/wolfssl to v5.7.0
- Update the regex config in renovate.json

Closes #13632
Closes #13641
Closes #13658
Closes #13659
2024-05-15 11:38:28 +02:00
Max Dymond
2f50b2d9da
ci: fix renovate config for WolfSSL/WolfSSH tagging scheme
WolfSSL/WolfSSH use a different versioning scheme;
stable builds end with `-stable`. Renovate requires
some extra configuration to extract the version
from these types of tags.

Closes #13644
2024-05-15 11:12:12 +02:00
Max Dymond
a884885c21
ci: set semantic type as CI and include digests as CI operations
Replace "chore" with "ci" for renovate's semantic
type, and include digests with "pin" and
"pinDigest" as ci operations.

Closes #13644
2024-05-15 11:12:12 +02:00
Daniel Stenberg
27c9b375f6
DEPRECATE.md: TLS libraries without 1.3 support
curl drops support for TLS libraries without TLS 1.3 capability after
May 2025.

It requires that a curl build using the library should be able to
negotiate and use TLS 1.3, or else it is not good enough. We support a
vast amount of other TLS libraries that are likely to satisfy users
better.

Closes #13544
2024-05-15 10:32:55 +02:00
Daniel Stenberg
49140cd188
Revert "ci: update nghttp2/nghttp2 to v1.62.0"
This reverts commit 14f2c76755.

We need to also upgrade the C++ compiler for that bump to work.

Closes #13656
2024-05-15 09:46:35 +02:00
renovate[bot]
5111d6b7fd
Dockerfile: update debian digest to 911821c
Closes #13629
2024-05-15 08:16:49 +02:00
renovate[bot]
72e65b22c1
ci: update gnutls/gnutls to v3.8.5
Closes #13640
2024-05-15 08:08:18 +02:00
renovate[bot]
70b83061b4
ci: update awslabs/aws-lc to v1.26.0
Closes #13647
2024-05-15 08:01:21 +02:00
renovate[bot]
65d387ad1d
ci: update cloudflare/quiche to v0.21.0
Closes #13648
2024-05-15 08:00:25 +02:00
renovate[bot]
7b4f80ebae
ci: update libressl-portable/portable to v3.9.2
Closes #13649
2024-05-15 07:59:01 +02:00
renovate[bot]
14f2c76755
ci: update nghttp2/nghttp2 to v1.62.0
Closes #13650
2024-05-15 07:57:39 +02:00
renovate[bot]
69af91b88b
ci: update ngtcp2/nghttp3 to v1.3.0
Closes #13651
2024-05-15 07:57:13 +02:00
renovate[bot]
65855676b6
ci: update ngtcp2/ngtcp2 to v1.5.0
Closes #13652
2024-05-15 07:56:01 +02:00
Max Dymond
599fe1e4c5 ci: handle git submodules for mbedTLS 2024-05-14 16:26:11 +01:00
Max Dymond
443d29cc69 ci: reconfigure renovate
- set prefix for github actions updates to be gha:
- set prefix for other renovate actions to be ci:
- disable debian updates in linux-old.yml
2024-05-14 16:26:11 +01:00