Commit Graph

32254 Commits

Author SHA1 Message Date
Jan Venekamp
87d14e77b7 tool_cfgable: free {proxy_}cipher13_list on exit
Author: Jan Venekamp
Reviewed-by: Daniel Gustafsson <daniel@yesql.se>
Closes: #13531
2024-05-05 11:13:06 +02:00
RainRat
63a07a7230 doh: Fix typo in comment
Closes: #13504
Author: RainRat on Github
Reviewed-by: Daniel Stenberg <daniel@haxx.se>
Reviewed-by: Daniel Gustafsson <daniel@yesql.se>
2024-05-04 11:52:58 +02:00
Christian Schmitz
62e45ce9cd dynbuf: Fix returncode on memory error
Curl_dyn_vaddf should return a proper error code in case allocating
memory failed.

Closes: #13533
Author: Christian Schmitz <support@monkeybreadsoftware.de>
Reviewed-by: Daniel Gustafsson <daniel@yesql.se>
2024-05-04 11:44:27 +02:00
Daniel Stenberg
b8435242ba
RELEASE-NOTES: synced 2024-05-03 14:39:39 +02:00
Jan Venekamp
6e4b7abfd3
bearssl: use common code for cipher suite lookup
Take advantage of the Curl_cipher_suite_walk_str() and
Curl_cipher_suite_get_str() functions introduced in commit fba9afeb.

This also fixes CURLOPT_SSL_CIPHER_LIST not working at all for bearssl
due to commit ff74cef5.

Closes #13464
2024-05-02 13:17:02 +02:00
Daniel Stenberg
eb06c1b25b
curl.h: change CURL_SSLVERSION_* from enum to defines
C++20 and later compilers emit a deprecation warning if values from two
different enums are combined with a bitwise operation the way the
CURL_SSLVERSION_* values were previously created.

Reported-by: Michael Kaufmann
Fixes #13510
Closes #13511
2024-05-02 10:40:32 +02:00
Daniel Stenberg
137aecfbf1
configure: error on missing perl if docs or manual is enabled
Fixes #13508
Reported-by: Harmen Stoppels
Closes #13514
2024-05-02 09:45:22 +02:00
Daniel Stenberg
5f4aaf8b66
tool_cb_rea: limit rate unpause for -T . uploads
To avoid getting stuck in a busy-loop when nothing is read from stdin,
this function now checks the call rate and might enforce a short sleep
when called repeatedly without uploading anything. It is a crude
work-around to avoid a 100% busy CPU.

Reported-by: magisterquis on hackerone
Fixes #13174
Closes #13506
2024-05-02 09:43:30 +02:00
Viktor Szakats
38593db4a0
appveyor: enable websockets for VS2017 jobs
Follow-up to eb4fe6c634 #13232
Closes #13513
2024-05-01 20:03:21 +02:00
Daniel Stenberg
0199104e94
if2ip: make the buf_size arg a size_t
sizes should be size_t

Ref: #13489
Closes #13505
2024-04-30 14:22:11 +02:00
Daniel Stenberg
3583ed8b77
cf-https-connect: use timeouts as unsigned ints
To match the type used in 'set.happy_eyeballs_timeout'.

Ref: #13489
Closes #13503
2024-04-30 11:23:20 +02:00
Daniel Stenberg
cc907e80a2
hash: change 'slots' to size_t from int
- an unsigned type makes more sense
- size_t seems suitable
- on 64 bit args, the struct alignment makes the new Curl_hash remain
  the same size

Closes #13502
2024-04-30 10:23:32 +02:00
Viktor Szakats
602fc213ae
libssh2: replace access() with stat()
Prefer `stat()` to verify the presence of key files.

This drops the last uses of `access()` in the codebase, which was
reported to cause issues in some cases.

Also add `access()` to the list of banned functions in checksrc.

Ref: https://github.com/curl/curl/pull/13412#issuecomment-2065505415
Ref: https://github.com/curl/curl/pull/13482#issuecomment-2078980522
Ref: #13497
Co-authored-by: Jay Satiro
Closes #13498
2024-04-30 10:03:16 +02:00
Daniel Stenberg
7f7ad97bf1
multi: remove useless assignment
Spotted by CodeSonar

Closes #13500
2024-04-30 09:24:07 +02:00
Daniel Stenberg
97cc653b95
RELEASE-NOTES: synced 2024-04-30 09:08:57 +02:00
fuzzard
86805bfcda
cmake: FindNGHTTP2 add static lib name to find_library call
Add the static library name, nghttp2_static as a name to search.

This provides cmake parity with the winbuild Makefile.vc allowing
the cmake build to find and allow the link to static nghttp2 library.
2024-04-29 16:49:06 +02:00
Viktor Szakats
b6305011ec
DISTROS: add patch and issues link for curl-for-win
curl-for-win sometimes includes curl patches that were already merged in
master, but not yet part of a stable release.

Also include the Issues link. Build-specific issues are handled there.

Ref: #13493
Closes #13499
2024-04-29 16:45:58 +02:00
Daniel Stenberg
fc81bf42be
mime: avoid using access()
If stat() fails, there is no point in calling access()

Also: return error immediately if the stat() fails.

Ref: #13482
Closes #13497
2024-04-29 16:30:09 +02:00
Stefan Eissing
b06619d0a3
tests: add SNI and peer name checks
- connect to DNS names with trailing dot
- connect to DNS names with double trailing dot
- rustls, always give `peer->hostname` and let it
  figure out SNI itself
- add SNI tests for ip address and localhost
- document in code and TODO that QUIC with ngtcp2+wolfssl
  does not do proper peer verification of the certificate
- mbedtls, skip tests with ip address verification as not
  supported by the library

Closes #13486
2024-04-29 08:20:35 +02:00
Daniel Stenberg
c04664ad35
curl_getdate.md: document two-digit year handling
Mentioned-by: Paul Gilmartin
Ref: https://curl.se/mail/archive-2024-04/0014.html
Closes #13494
2024-04-29 08:16:20 +02:00
Viktor Szakats
dfdd978f7c
cmake: add BUILD_EXAMPLES option to build examples
You can enable it with `-DBUILD_EXAMPLES=ON`.

To match autotools' `make examples` feature.
Windows (static) builds not tested.

Also enable examples in a pair of CI jobs.

Apply related updates to the macOS CI workflow:
- drop unused `CXX` envs.
- drop no longer needed `-Wno-error=undef -Wno-error=conversion` flags.
- pass `-Wno-deprecated-declarations` to GCC too (for `BUILD_EXAMPLES`).
- document why `-Wno-deprecated-declarations` is necessary.

Closes #13491
2024-04-29 00:26:50 +02:00
Stefan Eissing
c8e0cd1de8
http3: quiche+ngtcp2 improvements
- quiche: error transfers that try to receive on a closed
  or draining connection
- ngtcp2: use callback for extending max bidi streams. This
  allows more precise calculation of MAX_CONCURRENT as we
  only can start a new stream when the server acknowledges
  the close - not when we locally have closed it.
- remove a fprintf() from h2-download client to avoid excess
  log files on tests timing out.

Closes #13475
2024-04-26 14:03:05 +02:00
Stefan Eissing
fb22459dc1
vtls: TLS session storage overhaul
- add session with destructor callback
- remove vtls `session_free` method
- let `Curl_ssl_addsessionid()` take ownership
  of session object, freeing it also on failures
- change tls backend use
- test_17, add tests for SSL session resumption

Closes #13386
2024-04-26 13:58:36 +02:00
Stefan Eissing
2d2c27e5a3
multi: multi_wait improvements
- only call `multi_getsock()` once for all transfers
 - realloc pollset array on demand
 - fold repeated sockets

Closes #13150
2024-04-25 23:31:59 +02:00
Philip H.
303bb8785c
ci: remove microsoft-prod.list
This is added by default, and it is often broken, but we don't need
anything from it.

Closes #13473
2024-04-25 23:27:42 +02:00
Evgeny Grin
382717d7f1
curl_setup.h: detect 'inline' support
Closes #13355
2024-04-25 22:38:00 +02:00
Daniel Stenberg
3572dd65bb
multi: avoid memory-leak risk
'newurl' is allocated in some conditions and used in a few scenarios,
but there were theoretical combinations in which it would not get freed.
Move the free to happen unconditionally. Never triggered by tests, but
spotted by Coverity.

Closes #13471
2024-04-25 22:32:32 +02:00
Johann Sebastian Schicho
31d7cf42fd
sendf: Curl_cwriter_write: remove comment disallowing zero length writes
They are needed to pass CLIENTWRITE_EOS.

Closes #13477
2024-04-25 22:28:20 +02:00
Stefan Eissing
dd8ffa73ff
CI: macos fixes for new ARM GHA images
- based on #13478 with additions from #13476
- make homebrew install path flexible
- fix OpenSSL pkgconfig files libdir
- add path to --with-libssh2 target
- disable gcc securetransport due to linker
  errors (missing symbols), probably because
  the os version is no longer low enough

Assisted-by: Viktor Szakats

Closes #13479
2024-04-25 22:25:12 +02:00
Stefan Eissing
886899143f
content_encoding: ignore duplicate chunked encoding
- ignore duplicate "chunked" transfer-encodings from
  a server to accomodate for broken implementations
- add test1482 and test1483

Reported-by: Mel Zuser
Fixes #13451
Closes #13461
2024-04-25 17:50:16 +02:00
Daniel Stenberg
9fc4b2c78c
tool: move tool_ftruncate64 to tool_util.c
... and the prototype to tool_setup.h, to make them both available more
widely and accurately.

Follow-up to 00bef95946

Fixes #13458
Closes #13459
2024-04-25 09:20:38 +02:00
Viktor Szakats
03cf1c7b8c
lib: silence -Wsign-conversion in base64, strcase, mprintf
Closes #13467
2024-04-24 23:29:30 +02:00
Viktor Szakats
1972588d26
CI: retain failure code after ./configure with Circle CI
Suggested-by: Dan Fandrich
Follow-up to 43299e93c0 #13462
Follow-up to d7332e3e46 #12635
Closes #13468
2024-04-24 23:29:30 +02:00
Daniel Stenberg
ac7670b158
RELEASE-NOTES: synced 2024-04-24 14:34:39 +02:00
Jan Venekamp
fba9afebba
mbedTLS: implement CURLOPT_SSL_CIPHER_LIST option
Use a lookup list to set the cipher suites, allowing the
ciphers to be set by either openssl or IANA names.

To keep the binary size of the lookup list down we compress
each entry in the cipher list down to 2 + 6 bytes using the
C preprocessor.

Closes #13442
2024-04-24 14:30:37 +02:00
Viktor Szakats
43299e93c0
CI: show more failed config.log on Circle CI
Show last 1000 lines of `config.log` if `./configure` fails. This was
already done for one job, this patch extends it to all.

Ref: #13438
Closes #13462
2024-04-24 12:30:54 +02:00
Daniel Stenberg
a090111613
telnet: check return code from fileno()
and return error if necessary

Spotted by CodeSonar

Closes #13457
2024-04-24 10:51:53 +02:00
Viktor Szakats
f33ee2e73b
tls: fix SecureTransport + BearSSL cmake unity builds
Avoid clashing static function names by namespacing them.

Pointed-out-by: Jan Venekamp
Ref: https://github.com/curl/curl/pull/13442#discussion_r1576350700
Closes #13450
2024-04-24 10:08:24 +02:00
Jay Satiro
7860f575fe dllmain: Call OpenSSL thread cleanup for Windows and Cygwin
- Call OPENSSL_thread_stop on thread termination (DLL_THREAD_DETACH)
  to prevent a memory leak in case OpenSSL is linked statically.

- Warn in libcurl-thread.3 that if OpenSSL is linked statically then it
  may require thread cleanup.

OpenSSL may need per-thread cleanup to stop a memory leak. For Windows
and Cygwin if libcurl was built as a DLL then we can do that for the
user by calling OPENSSL_thread_stop on thread termination. However, if
libcurl was built statically then we do not have notification of thread
termination and cannot do that for the user.

Also, there are several other unusual cases where it may be necessary
for the user to call OPENSSL_thread_stop, so in the libcurl-thread
warning I added a link to the OpenSSL documentation.

Co-authored-by: Viktor Szakats

Reported-by: southernedge@users.noreply.github.com
Reported-by: zmcx16@users.noreply.github.com

Ref: https://www.openssl.org/docs/man3.0/man3/OPENSSL_thread_stop.html#NOTES

Fixes https://github.com/curl/curl/issues/12327
Closes https://github.com/curl/curl/pull/12408
2024-04-24 04:04:25 -04:00
Jan Venekamp
3b8db84c1b
rustls: remove incorrect SSLSUPP_TLS13_CIPHERSUITES flag
The rustls backend advertises SSLSUPP_TLS13_CIPHERSUITES, but
the code does not actually seem to support it (yet?). Removed
the flag and corrected documentation.

Closes #13452
2024-04-24 08:59:14 +02:00
Stefan Eissing
cfb9991723
quiche: expire all active transfers on connection close
- when a connection close is detected, all ongoing transfers
  need to expire bc no more POLL events are likely to happen
  for them.

Fixes #13439
Reported-by: Jay Satiro
Closes #13447
2024-04-24 08:31:37 +02:00
Dan Fandrich
7237ee2c3d tests: fix feature case in test1481
This test was being skipped everywhere because the feature never
matched.

Closes #13445
2024-04-23 08:46:17 -07:00
Gusted
00bef95946
tool_operate: don't truncate the etag save file by default
This fixes a regression of 75d79a4486. The
code in tool-operate truncated the etag save file, under the assumption
that the file would be written with a new etag value. However since
75d79a4486 that might not be the case
anymore and could result in the file being truncated when --etag-compare
and --etag-save was used and that the etag value matched with what the
server responded. Instead the truncation should not be done when a new
etag value should be written.

Test 3204 was added to verify that the file with the etag value doesn't
change the contents when used by --etag-compare and --etage-save and
that value matches with what the server returns on a non 2xx response.

Closes #13432
2024-04-23 11:33:20 +02:00
Abdullah Alyan
f8011ffa1e
tests: enable test 1117 for hyper
Closes #13436
2024-04-22 13:30:14 +02:00
Daniel Stenberg
999bdfc47e
sendf: useless assignment in cr_lc_read()
Spotted by CodeSonar

Closes #13437
2024-04-22 12:58:30 +02:00
Daniel Stenberg
cf337d851a
tool_paramhlp: remove duplicate assign
Spotted by CodeSonar

Closes #13433
2024-04-21 10:51:12 +02:00
Daniel Stenberg
8a5fe04c7b
transfer: remove useless assignment
in Curl_xfer_recv_resp

Spotted by CodeSonar

Closes #13435
2024-04-21 10:50:37 +02:00
Daniel Stenberg
727c946d82
http: acknowledge a returned error code
... and do not overwrite it with a new value that could then hide the
problem.

Spotted by CodeSonar

Closes #13434
2024-04-21 10:49:48 +02:00
Daniel Stenberg
5fa594ab7b
tool_operate: init vars unconditionally in post_per_transfer
In case of (the unlikely) early return, they could otherwise remain
uninitialized

Spotted by CodeSonar

Closes #13430
2024-04-20 22:47:42 +02:00
Daniel Stenberg
d1a8b3519f
RELEASE-NOTES: synced 2024-04-19 23:59:43 +02:00