]> git.ipfire.org Git - thirdparty/curl.git/log
thirdparty/curl.git
14 months agoGHA: increase timeout for Cygwin autotools build tests step
Orgad Shaneh [Wed, 22 May 2024 19:37:35 +0000 (22:37 +0300)] 
GHA: increase timeout for Cygwin autotools build tests step

Apparently 10 minutes are not (always) enough:
https://github.com/curl/curl/actions/runs/9197003907/job/25296439556#step:8:1936

Closes #13753

14 months agombedtls: send close-notify on close
Stefan Eissing [Wed, 22 May 2024 08:35:51 +0000 (10:35 +0200)] 
mbedtls: send close-notify on close

- send the TLS close notify message when cloding down
  the mbedtls connection filter
- this is a "least" effort version and, as other TLS filters,
  is lacking a graceful send/receive/timeout for a really
  clean shutdown.

Closes #13745

14 months agombedtls: check version for cipher id
Stefan Eissing [Wed, 22 May 2024 12:44:56 +0000 (14:44 +0200)] 
mbedtls: check version for cipher id

mbedtls_ssl_get_ciphersuite_id_from_ssl() seems to have been added in
mbedtls 3.2.0. Check for that version.

Closes #13749

14 months agocmake: fix building with both md4 and md5 in unity mode
Viktor Szakats [Tue, 21 May 2024 20:31:12 +0000 (22:31 +0200)] 
cmake: fix building with both md4 and md5 in unity mode

Macro and static function names were colliding between
`lib/md4.c` and
`lib/md5.c`.

Fix it by namespacing these symbols.

Seen with a basic macOS build using these options:
`-DCMAKE_UNITY_BUILD=ON -DCURL_USE_SECTRANSP=ON`

Closes #13737

14 months agodocs/Makefile.am: make curl-config.1 install
Daniel Stenberg [Wed, 22 May 2024 06:43:43 +0000 (08:43 +0200)] 
docs/Makefile.am: make curl-config.1 install

on "make install" like it should

Follow-up to 60971d665b9b1df87082

Closes #13741

14 months agoGHA: bump actions/checkout from 4.1.4 to 4.1.6
dependabot[bot] [Mon, 20 May 2024 14:25:03 +0000 (14:25 +0000)] 
GHA: bump actions/checkout from 4.1.4 to 4.1.6

Bumps [actions/checkout](https://github.com/actions/checkout) from 4.1.4 to 4.1.6.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/0ad4b8fadaa221de15dcec353f45205ec38ea70b...a5ac7e51b41094c92402da3b24376905380afc29)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Closes #13720

14 months agopytest: add ftp upload tests
Stefan Eissing [Tue, 21 May 2024 10:17:33 +0000 (12:17 +0200)] 
pytest: add ftp upload tests

- refs #13556
- allow anon uploads on vsftpd test server
- add test_30_05 for plain upload of 1k, 100k, 1m
- add test_31_05 for SSL upload of 1k, 100k, 1m
- verify file size and contents

Closes #13734

14 months agotest: add test1546, chunked not last transfer encoding
Stefan Eissing [Tue, 21 May 2024 13:51:51 +0000 (15:51 +0200)] 
test: add test1546, chunked not last transfer encoding

with more than one transfer-encoding, 'chunked' must be the last added
to the writer stack (and therefore the first to decode). RFC 9112, ch.
6.1.

Closes #13736

14 months agotest: add test1484, for HEAD with content
Stefan Eissing [Tue, 21 May 2024 13:22:47 +0000 (15:22 +0200)] 
test: add test1484, for HEAD with content

- test HEAD request with 'Transfer-Encoding:chunked' and
  non-encoded response content
- verifies #13725

Closes #13735

14 months agoRELEASE-NOTES: synced
Daniel Stenberg [Wed, 22 May 2024 06:53:19 +0000 (08:53 +0200)] 
RELEASE-NOTES: synced

bump to 8.8.1 for now

14 months ago(lib)curl.rc: set debug flag also for `CURLDEBUG` and `UNITTESTS`
Viktor Szakats [Tue, 21 May 2024 08:34:04 +0000 (10:34 +0200)] 
(lib)curl.rc: set debug flag also for `CURLDEBUG` and `UNITTESTS`

These macros also enable debug features in both libcurl and curl.
Enable `VS_FF_DEBUG` version resource flag when they are set.

Closes #13730

14 months agowinbuild: fix PE version info debug flag
Jay Satiro [Wed, 22 May 2024 05:39:44 +0000 (01:39 -0400)] 
winbuild: fix PE version info debug flag

- Only set PE file flag VS_FF_DEBUG if curl.exe and libcurl.dll were
  built with winbuild option DEBUG=yes which builds with debug info.

VS_FF_DEBUG is a PE flag (Portable Executable file flag - dll, exe, etc)
that indicates the file contains or was built with debug info.

Prior to this change when winbuild was used to build curl, curl.exe
and libcurl.dll always had VS_FF_DEBUG set, regardless of build option
DEBUG=yes/no, due to some bad logic.

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

14 months agoRELEASE-NOTES: synced curl-8_8_0
Daniel Stenberg [Wed, 22 May 2024 05:51:13 +0000 (07:51 +0200)] 
RELEASE-NOTES: synced

14 months agoTHANKS: add contributors from 8.8.0
Daniel Stenberg [Wed, 22 May 2024 05:54:14 +0000 (07:54 +0200)] 
THANKS: add contributors from 8.8.0

14 months agourl: remove duplicate call to Curl_conncache_remove_conn when pruning
Nathan Moinvaziri [Sun, 19 May 2024 19:33:21 +0000 (12:33 -0700)] 
url: remove duplicate call to Curl_conncache_remove_conn when pruning

- remove unnecessary prunedead struct from prune_dead_connections
- rename extract_if_dead to prune_if_dead for clarity

Closes #13710

14 months agocurl_setup.h: add support for IAR compiler
Joseph Chen [Tue, 21 May 2024 07:30:23 +0000 (15:30 +0800)] 
curl_setup.h: add support for IAR compiler

Closes #13728

14 months agodocs/ECH: typo/clarification
Stephen Farrell [Mon, 20 May 2024 20:53:01 +0000 (21:53 +0100)] 
docs/ECH: typo/clarification

Closes #13727

14 months agohash: delete unused debug function
Viktor Szakats [Tue, 21 May 2024 08:14:17 +0000 (10:14 +0200)] 
hash: delete unused debug function

It had no use in the curl codebase and was also protected by the macro
`AGGRESSIVE_TEST` (renamed in 2020), also with no local reference.

Added in ca6e77083768858aa34207f8c5dce38b3c05336d (2002-11-11)

Closes #13729

14 months agocontent_encoding: reject transfer-encoding after chunked
Stefan Eissing [Tue, 21 May 2024 09:38:47 +0000 (11:38 +0200)] 
content_encoding: reject transfer-encoding after chunked

reject a response that applies a transfer-encoding after a 'chunked'
encoding. RFC 9112 ch. 6.1 required chunked to be the final encoding.

Closes #13733

14 months agohttp: HEAD response body tolerance
Stefan Eissing [Tue, 21 May 2024 09:21:14 +0000 (11:21 +0200)] 
http: HEAD response body tolerance

- as reported in #13725, some servers wrongly send body bytes in
  responses to a HEAD request. This used to be tolerated in curl
  8.4 and before and leads to failed transfers in newer versions.
- restore previous behaviour for HTTP/1.1 and HTTP/2:
  * 1.1: do not add 'Transfer-Encoding' writers from HEAD
    responses. RFC 9112 says they do not apply.
  * 2: when the transfer expects 'no_body', to not report stream
    resets as error when all response headers have been received.

Reported-by: Jeroen Ooms
Fixes #13725
Closes #13732

14 months agotests: fix TFTP test 2305 on Windows
Viktor Szakats [Mon, 20 May 2024 17:13:26 +0000 (19:13 +0200)] 
tests: fix TFTP test 2305 on Windows

Ref: #13692
Closes #13724

14 months agoopenssl: revert keylog_callback support for LibreSSL
Jay Satiro [Fri, 17 May 2024 04:07:21 +0000 (00:07 -0400)] 
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

14 months agoGHA: pin dependencies
renovate[bot] [Sun, 19 May 2024 21:07:47 +0000 (21:07 +0000)] 
GHA: pin dependencies

Closes #13712

14 months agoappveyor: drop unnecessary `--clean-first` cmake option
Viktor Szakats [Sun, 19 May 2024 08:15:48 +0000 (10:15 +0200)] 
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

14 months agocmake: merge two `if(BUILD_TESTING)` branches
Viktor Szakats [Sat, 18 May 2024 09:31:24 +0000 (11:31 +0200)] 
cmake: merge two `if(BUILD_TESTING)` branches

Closes #13708

14 months agoGHA: bump nghttp2 to v1.62.1
Tatsuhiro Tsujikawa [Sat, 18 May 2024 07:40:27 +0000 (16:40 +0900)] 
GHA: bump nghttp2 to v1.62.1

Use gcc-12 explicitly to compile C++20 source files.

Closes #13702

14 months agoGHA: add NetBSD, OpenBSD, FreeBSD/arm64 and OmniOS jobs
Viktor Szakats [Fri, 10 May 2024 13:29:21 +0000 (15:29 +0200)] 
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

15 months agoGHA: disable TFTP test on native Windows
Viktor Szakats [Sat, 18 May 2024 20:38:58 +0000 (22:38 +0200)] 
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: cffbcc3110c1eda2e333f9cfe2e269154618793a #5364

Close #13699

15 months agoGHA: pin dependencies
renovate[bot] [Fri, 17 May 2024 22:31:56 +0000 (22:31 +0000)] 
GHA: pin dependencies

Closes #13691

15 months agocmake: do not pass linker flags to the static library tool
Viktor Szakats [Sat, 18 May 2024 12:37:57 +0000 (14:37 +0200)] 
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 558814e16d84aa202c5ccc0c8108a9d728e77a58 (2014-09-25)
Ref: #13698
Closes #13697

15 months agoGHA: ignore flaky test2302 results on Windows
Viktor Szakats [Sat, 18 May 2024 12:18:58 +0000 (14:18 +0200)] 
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 36fd2dd6ee874726c628e67fcf6415a2e52bfe29 #13599
Ref: #13692
Closes #13696

15 months agoGHA: add MSYS, mingw-w64, Cygwin jobs
Viktor Szakats [Sat, 11 May 2024 13:29:23 +0000 (15:29 +0200)] 
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'.`

15 months agopytest: fixes for recent python, add FTP tests
Stefan Eissing [Wed, 15 May 2024 12:20:11 +0000 (14:20 +0200)] 
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

15 months agorustls: fix handshake done handling
Stefan Eissing [Fri, 17 May 2024 11:23:19 +0000 (13:23 +0200)] 
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

15 months agox509asn1: return error on missing OID
Daniel Stenberg [Fri, 17 May 2024 10:05:24 +0000 (12:05 +0200)] 
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

15 months agoCURLOPT_WRITEFUNCTION.md: fix the callback proto in the example
Daniel Stenberg [Fri, 17 May 2024 11:36:55 +0000 (13:36 +0200)] 
CURLOPT_WRITEFUNCTION.md: fix the callback proto in the example

Reported-by: Michael Litwak
Fixes #13681
Closes #13687

15 months agosrc: tidy up types, add necessary casts
Viktor Szakats [Mon, 13 May 2024 10:17:33 +0000 (12:17 +0200)] 
src: tidy up types, add necessary casts

Cherry-picked from #13489
Closes #13614

15 months agolib: fix compiler warnings (gcc)
Viktor Szakats [Sat, 11 May 2024 21:38:25 +0000 (23:38 +0200)] 
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

15 months agowakeup_create: use FD_CLOEXEC/SOCK_CLOEXEC
Andrew [Mon, 13 May 2024 17:34:06 +0000 (22:34 +0500)] 
wakeup_create: use FD_CLOEXEC/SOCK_CLOEXEC

for `pipe()`/`socketpair()`

Fixes #13618
Closes #13625

15 months agorustls: fix partial send handling
Stefan Eissing [Thu, 16 May 2024 12:59:25 +0000 (14:59 +0200)] 
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

15 months agopytest: add DELETE tests, check server version
Stefan Eissing [Thu, 16 May 2024 15:53:19 +0000 (17:53 +0200)] 
pytest: add DELETE tests, check server version

- add tests for DELETE working
- check apache version in keepalive test
- fix some comments

Closes #13679

15 months agovquic-tls: use correct cert name check API for wolfSSL
Juliusz Sosinowicz [Thu, 16 May 2024 18:16:37 +0000 (20:16 +0200)] 
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

15 months agocmake: initialize `BUILD_TESTING` before first use
Viktor Szakats [Thu, 16 May 2024 00:56:37 +0000 (02:56 +0200)] 
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 aace27b0965c10394544d1dacc9c2cb2fe0de3d3 #12287
Closes #13668

15 months agolibtest: 2308 verifies CURLE_WRITE_ERROR after write callback error
Daniel Stenberg [Thu, 16 May 2024 07:07:31 +0000 (09:07 +0200)] 
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

15 months agosocketpair: fix compilation when USE_UNIX_SOCKETS is not defined
Antoine Bollengier [Wed, 15 May 2024 20:46:05 +0000 (22:46 +0200)] 
socketpair: fix compilation when USE_UNIX_SOCKETS is not defined

Closes #13666

15 months agorustsls: fix error code on receive
Stefan Eissing [Thu, 16 May 2024 06:55:14 +0000 (08:55 +0200)] 
rustsls: fix error code on receive

- use CURLE_RECV_ERROR instead of CURLE_READ_ERROR when receiving
  data fails.

Closes #13670

15 months agoci: disable Renovate dashboard
Max Dymond [Thu, 16 May 2024 08:02:36 +0000 (09:02 +0100)] 
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

15 months agoRELEASE-NOTES: synced
Daniel Stenberg [Thu, 16 May 2024 06:44:21 +0000 (08:44 +0200)] 
RELEASE-NOTES: synced

15 months agoGHA: update awslabs/aws-lc to v1.27.0
renovate[bot] [Wed, 15 May 2024 21:23:24 +0000 (21:23 +0000)] 
GHA: update awslabs/aws-lc to v1.27.0

Closes #13667

15 months agocurl_easy_pause.md: use correct defines in example
Daniel Stenberg [Wed, 15 May 2024 14:11:42 +0000 (16:11 +0200)] 
curl_easy_pause.md: use correct defines in example

Spotted-by: Harry Sintonen
Closes #13664

15 months agoappveyor: more tidy-ups
Viktor Szakats [Sun, 12 May 2024 22:34:54 +0000 (00:34 +0200)] 
appveyor: more tidy-ups

- use `--disable` when calling `curl --version`. Just in case.

- use single-quotes for a constant.

Closes #13662

15 months agoreuse: migrate standalone license file to dep5
Viktor Szakats [Wed, 15 May 2024 09:50:07 +0000 (11:50 +0200)] 
reuse: migrate standalone license file to dep5

Follow-up to 73a36021207284ad2b4340ffde34a51b0ba4d47a
Closes #13660

15 months agoappveyor: guard against crash-build with VS2008
Viktor Szakats [Wed, 15 May 2024 06:19:54 +0000 (08:19 +0200)] 
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

15 months agoGHA: pin dependencies
renovate[bot] [Wed, 15 May 2024 09:39:30 +0000 (09:39 +0000)] 
GHA: pin dependencies

Closes #13628

15 months agosocket: remove redundant call to getsockname
Orgad Shaneh [Wed, 15 May 2024 07:02:36 +0000 (10:02 +0300)] 
socket: remove redundant call to getsockname

The result "add" is unused.

Closes #13655

15 months agoCI: renovate updates
renovate[bot] [Tue, 14 May 2024 15:27:19 +0000 (15:27 +0000)] 
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

15 months agoci: fix renovate config for WolfSSL/WolfSSH tagging scheme
Max Dymond [Tue, 14 May 2024 16:16:14 +0000 (17:16 +0100)] 
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

15 months agoci: set semantic type as CI and include digests as CI operations
Max Dymond [Tue, 14 May 2024 15:44:37 +0000 (16:44 +0100)] 
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

15 months agoDEPRECATE.md: TLS libraries without 1.3 support
Daniel Stenberg [Mon, 6 May 2024 21:27:41 +0000 (23:27 +0200)] 
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

15 months agoRevert "ci: update nghttp2/nghttp2 to v1.62.0"
Daniel Stenberg [Wed, 15 May 2024 07:13:21 +0000 (09:13 +0200)] 
Revert "ci: update nghttp2/nghttp2 to v1.62.0"

This reverts commit 14f2c767555b7598d7783ccd9093670b84d28488.

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

Closes #13656

15 months agoDockerfile: update debian digest to 911821c
renovate[bot] [Tue, 14 May 2024 15:27:02 +0000 (15:27 +0000)] 
Dockerfile: update debian digest to 911821c

Closes #13629

15 months agoci: update gnutls/gnutls to v3.8.5
renovate[bot] [Tue, 14 May 2024 15:27:07 +0000 (15:27 +0000)] 
ci: update gnutls/gnutls to v3.8.5

Closes #13640

15 months agoci: update awslabs/aws-lc to v1.26.0
renovate[bot] [Tue, 14 May 2024 21:29:06 +0000 (21:29 +0000)] 
ci: update awslabs/aws-lc to v1.26.0

Closes #13647

15 months agoci: update cloudflare/quiche to v0.21.0
renovate[bot] [Tue, 14 May 2024 22:25:42 +0000 (22:25 +0000)] 
ci: update cloudflare/quiche to v0.21.0

Closes #13648

15 months agoci: update libressl-portable/portable to v3.9.2
renovate[bot] [Tue, 14 May 2024 22:25:47 +0000 (22:25 +0000)] 
ci: update libressl-portable/portable to v3.9.2

Closes #13649

15 months agoci: update nghttp2/nghttp2 to v1.62.0
renovate[bot] [Tue, 14 May 2024 22:25:54 +0000 (22:25 +0000)] 
ci: update nghttp2/nghttp2 to v1.62.0

Closes #13650

15 months agoci: update ngtcp2/nghttp3 to v1.3.0
renovate[bot] [Tue, 14 May 2024 22:26:02 +0000 (22:26 +0000)] 
ci: update ngtcp2/nghttp3 to v1.3.0

Closes #13651

15 months agoci: update ngtcp2/ngtcp2 to v1.5.0
renovate[bot] [Tue, 14 May 2024 22:26:08 +0000 (22:26 +0000)] 
ci: update ngtcp2/ngtcp2 to v1.5.0

Closes #13652

15 months agoci: handle git submodules for mbedTLS
Max Dymond [Tue, 14 May 2024 09:02:30 +0000 (10:02 +0100)] 
ci: handle git submodules for mbedTLS

15 months agoci: reconfigure renovate
Max Dymond [Tue, 14 May 2024 08:57:03 +0000 (09:57 +0100)] 
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

15 months agotidy-up: whitespace [ci skip]
Viktor Szakats [Tue, 14 May 2024 14:49:47 +0000 (16:49 +0200)] 
tidy-up: whitespace [ci skip]

15 months agowarnless: delete orphan declarations
Viktor Szakats [Tue, 14 May 2024 12:39:11 +0000 (14:39 +0200)] 
warnless: delete orphan declarations

Follow-up to 358f7e757781857c4b498a68634726609fa3884a #11932
Closes #13639

15 months agoBUG-BOUNTY.md: clarify the third party situation
Daniel Stenberg [Wed, 8 May 2024 09:45:37 +0000 (11:45 +0200)] 
BUG-BOUNTY.md: clarify the third party situation

We do not pay bounties for problems in other libraries.

Closes #13560

15 months agohttp tests: in CI skip test_02_23* for quiche
Stefan Eissing [Tue, 14 May 2024 10:32:09 +0000 (12:32 +0200)] 
http tests: in CI skip test_02_23* for quiche

For unknown reasons, these tests fail in CI often, but run fine locally.
Skip them in CI to avoid unrelated PRs to have failures.

Closes #13638

15 months agohsts: explicitly skip blank lines
Daniel Gustafsson [Tue, 14 May 2024 08:19:41 +0000 (10:19 +0200)] 
hsts: explicitly skip blank lines

Keep blank lines or lines containing only whitespace to make it all
the way to the more expensive sscanf call in hsts_add.

Closes: #13603
Reviewed-by: Daniel Stenberg <daniel@haxx.se>
15 months agoautotools: Only probe for SGI MIPS compilers on IRIX
Daniel Gustafsson [Tue, 14 May 2024 08:04:27 +0000 (10:04 +0200)] 
autotools: Only probe for SGI MIPS compilers on IRIX

MIPSPro and the predecessor compiler which was part of the IDO (IRIS
Development Option) were only ever shipped on the SGI IRIX operating
system (with MIPSPro on 6.0+ which was released in 1994).  Limit the
autoconf check to IRIX when probing for these compilers to save some
cycles on other platforms.

Closes: #13611
Reviewed-by: Daniel Stenberg <daniel@haxx.se>
15 months agotests: fix test 1167 to skip digit-only symbols
Viktor Szakats [Mon, 13 May 2024 20:45:56 +0000 (22:45 +0200)] 
tests: fix test 1167 to skip digit-only symbols

This avoids mistaking symbols with their numeric value when using
certain C preprocessors which output these numeric values at the
beginning of the line as part of an expression.

Seen on OpenBSD 7.5 + clang.

Example `test1167.pl -v` output, before this patch:
```
Source: cpp /home/runner/work/curl/curl/tests/../include/curl/curl.h
Symbol: 20000
Line #3835:   20000 +  142,
[...]
Bad symbols in public header files:
   20000
   [...]
```
Ref: https://github.com/curl/curl/actions/runs/9069136530/job/24918015357#step:3:7513

Ref: #13583
Closes #13634

15 months agolib: call Curl_strntolower instead of doing crafted loops
Daniel Stenberg [Mon, 13 May 2024 21:11:46 +0000 (23:11 +0200)] 
lib: call Curl_strntolower instead of doing crafted loops

Closes #13627

15 months agosetopt: acknowledge errors proper for CURLOPT_COOKIEJAR
Daniel Stenberg [Mon, 13 May 2024 15:31:44 +0000 (17:31 +0200)] 
setopt: acknowledge errors proper for CURLOPT_COOKIEJAR

Error out on error, do not continue.

Closes #13624

15 months agovtls: remove duplicate assign
Daniel Stenberg [Mon, 13 May 2024 18:00:23 +0000 (20:00 +0200)] 
vtls: remove duplicate assign

Curl_ssl_peer_cleanup() already clears the ->sni field, no point in
assigning it again.

Spotted by CodeSonar

Closes #13626

15 months agoGroup all non-major updates together to reduce PR spam
Max Dymond [Mon, 13 May 2024 15:20:34 +0000 (16:20 +0100)] 
Group all non-major updates together to reduce PR spam

15 months agoAdd the remainder of the workflows
Max Dymond [Mon, 13 May 2024 15:15:18 +0000 (16:15 +0100)] 
Add the remainder of the workflows

15 months agoAdd some basic versioning for some workflows to check whether this is detected properly
Max Dymond [Mon, 13 May 2024 14:45:30 +0000 (15:45 +0100)] 
Add some basic versioning for some workflows to check whether this is detected properly

15 months agoAdd renovate.json
renovate[bot] [Mon, 13 May 2024 13:54:50 +0000 (13:54 +0000)] 
Add renovate.json

15 months agovauth: make two functions void that always just returned OK
Daniel Stenberg [Mon, 13 May 2024 15:21:54 +0000 (17:21 +0200)] 
vauth: make two functions void that always just returned OK

Removes the need to check return values when they can never fail.

Pointed out by CodeSonar

Closes #13621

15 months agosetopt: remove check for 'option' that is always true
Daniel Stenberg [Mon, 13 May 2024 14:25:12 +0000 (16:25 +0200)] 
setopt: remove check for 'option' that is always true

- make sure that passing in option set to NULL clears the fields
  correctly

- remove the weird second take if Curl_parse_login_details() returns
  error

Follow-up to 7333faf00bf25db7cd1e0012d6b140

Spotted by CodeSonar

Closes #13619

15 months agotests: tidy up types in server code
Viktor Szakats [Sun, 12 May 2024 19:14:06 +0000 (21:14 +0200)] 
tests: tidy up types in server code

Cherry-picked from #13489
Closes #13610

15 months agosetopt: make the setstropt_userpwd args compulsory
Daniel Stenberg [Sun, 12 May 2024 14:52:51 +0000 (16:52 +0200)] 
setopt: make the setstropt_userpwd args compulsory

They were always used so no point in allowing them to be optional.

follow-up to 0e37b42dc956bd8a

Closes #13608
Reviewed-by: Daniel Gustafsson
15 months agoRELEASE-NOTES: synced
Daniel Stenberg [Mon, 13 May 2024 07:48:25 +0000 (09:48 +0200)] 
RELEASE-NOTES: synced

15 months agowebsocket: Avoid memory leak in error path
Daniel Gustafsson [Mon, 13 May 2024 07:11:23 +0000 (09:11 +0200)] 
websocket: Avoid memory leak in error path

In the errorpath for randstr being too long to copy into the buffer
we leak the randstr when returning CURLE_FAILED_INIT.  Fix by using
an explicit free on randstr in the errorpath.

Closes: #13602
Reviewed-by: Daniel Stenberg <daniel@haxx.se>
15 months agohsts: Remove single-use single-line function
Daniel Gustafsson [Mon, 13 May 2024 07:07:30 +0000 (09:07 +0200)] 
hsts: Remove single-use single-line function

The hsts_entry() function contains of a single line and is only
used in a single place in the code, so move the allocation into
hsts_create instead to improve code readability. C code usually
don't use the factory abstraction for object creation, and this
small example wasn't following our usual code style.

Closes: #13604
Reviewed-by: Daniel Stenberg <daniel@haxx.se>
15 months agolib: bump hash sizes to `size_t`
Viktor Szakats [Sun, 5 May 2024 15:45:11 +0000 (17:45 +0200)] 
lib: bump hash sizes to `size_t`

Follow-up to cc907e80a2498c0599253271a6f657f614b52a4e #13502
Cherry-picked from #13489
Closes #13601

15 months agotests: make the unit test result type `CURLcode`
Viktor Szakats [Sat, 11 May 2024 19:36:05 +0000 (21:36 +0200)] 
tests: make the unit test result type `CURLcode`

Before this patch, the result code was a mixture of `int` and
`CURLcode`.

Also adjust casts and fix a couple of minor issues found along the way.

Cherry-picked from #13489
Closes #13600

15 months agoappveyor: tidy-ups
Viktor Szakats [Sat, 11 May 2024 13:34:12 +0000 (15:34 +0200)] 
appveyor: tidy-ups

- delete a duplicate line.
- simplify a `make` call.
- merge two `if` branches.
- reorder autotools options for clarity.
- add `--enable-warnings` where missing (it's also the default.)
- add empty lines to YAML for readability.
- use lowercase install prefix/directory.

Closes #13598

15 months agodocs/cmdline-opts: mention STARTTLS for --ssl and --ssl-reqd
Daniel Stenberg [Fri, 10 May 2024 21:30:06 +0000 (23:30 +0200)] 
docs/cmdline-opts: mention STARTTLS for --ssl and --ssl-reqd

... since users might look for those terms in the manpage.

Closes #13590

15 months agosetopt: warn on Curl_set*opt() uses not using the return value
Daniel Stenberg [Fri, 10 May 2024 21:50:58 +0000 (23:50 +0200)] 
setopt: warn on Curl_set*opt() uses not using the return value

And switch the invokes that would "set" NULL to instead just plainly
free the pointer, as those were otherwise the invokes that would ignore
the return code. And possibly confuse static code analyzers.

Closes #13591

15 months agoautotools: delete unused functions
Orgad Shaneh [Sun, 12 May 2024 05:45:11 +0000 (08:45 +0300)] 
autotools: delete unused functions

Closes #13605

15 months agoexamples: fix/silence `-Wsign-conversion`
Viktor Szakats [Sat, 27 Apr 2024 19:09:01 +0000 (21:09 +0200)] 
examples: fix/silence `-Wsign-conversion`

- extend `FD_SET()` hack to all platforms (was only Cygwin).
  Warnings may also happen in other envs, e.g. OmniOS.
  Ref: https://github.com/libssh2/libssh2/actions/runs/8854199687/job/24316762831#step:3:2021

- tidy-up `CURLcode` vs `int` use.

- cast an unsigned to `long` before passing to `curl_easy_setopt()`.

Cherry-picked from #13489
Follow-up to 3829759bd042c03225ae862062560f568ba1a231 #12489
Closes #13501

15 months agocmake: fix `HAVE_IOCTLSOCKET_FIONBIO` test with gcc 14
Orgad Shaneh [Fri, 10 May 2024 10:13:32 +0000 (13:13 +0300)] 
cmake: fix `HAVE_IOCTLSOCKET_FIONBIO` test with gcc 14

The function signature has had u_long flags since ever. This is how it
is defined in the documentation, and implemented in MinGW.

The code that uses ioctlsocket in nonblock.c also has unsigned long.

Error:
CurlTests.c:275:41: error: passing argument 3 of 'ioctlsocket' from incompatible pointer type [-Wincompatible-pointer-types]
  275 |         if(0 != ioctlsocket(0, FIONBIO, &flags))
      |                                         ^~~~~~
      |                                         |
      |                                         int *
In file included from CurlTests.c:266:
/opt/mxe/usr/i686-w64-mingw32.static/include/winsock2.h:1007:76: note: expected 'u_long *' {aka 'long unsigned int *'} but argument is of type 'int *'
 1007 |   WINSOCK_API_LINKAGE int WSAAPI ioctlsocket(SOCKET s,__LONG32 cmd,u_long *argp);
      |                                                                    ~~~~~~~~^~~~

Closes #13578

15 months agoftp: fix build for CURL_DISABLE_VERBOSE_STRINGS
Jay Satiro [Fri, 10 May 2024 23:14:29 +0000 (19:14 -0400)] 
ftp: fix build for CURL_DISABLE_VERBOSE_STRINGS

This is a follow-up to b7c7dffe which changed the FTP state change
verbose debug text (aka infof) to tracing debug text (aka trc).

Prior to this change if libcurl was without DEBUGBUILD and built with
CURL_DISABLE_VERBOSE_STRINGS (ie --disable-verbose) the build would
error.

Caught by Circle CI job openssl-no-verbose.