Commit Graph

34209 Commits

Author SHA1 Message Date
Daniel Stenberg
ca88235102
KNOWN_BUGS: Heimdal memory leaks
Closes #14446
Closes #14604
2024-08-19 23:21:51 +02:00
Daniel Stenberg
145f87b9e8
build: use -Wno-format-overflow
-Wformat-overflow is not a warning that we want enabled as it does not
help us. It can only bring us false positives since it warns on bad uses
of sprintf and vsprintf ("that might overflow the destination buffer").
Two functions we explicitly ban in curl code.

The only way this flag triggers warnings in curl code is false positives
for functions we have marked with the CURL_PRINTF() macro.

Further: it seems -Wformat-trunaction option might in turn also enable
-Wformat-overflow, so if this second option is used, we need to
explicitly set -Wno-format-overflow - not just skip setting
-Wformat-overflow.

Reported-by: Viktor Szakats
Fixes #14168
Closes #14598
2024-08-19 23:20:45 +02:00
Viktor Szakats
c2e814f8d7
cmake/FindNettle: log message when found via pkg-config
The message mimics the CMake-native message (by
`find_package_handle_standard_args()`), with the header path and version number.

Closes #14596
2024-08-19 14:09:14 +02:00
Viktor Szakats
9fc2d7b8de
cmake: adjust GSSAPI option description
krb5 also builds with CMake, not only Heimdal.

Ref: 558814e16d

Closes #14595
2024-08-19 14:09:14 +02:00
Viktor Szakats
12399737c2
CI/azure: disable parallel tests, allow IDN tests
They started show the similar flakiness as the GHA ones after enabling
parallel tests (`-j2`) by default.

Example flaky run:
https://dev.azure.com/daniel0244/curl/_build/results?buildId=24763&view=results

Ubuntu:
```
FAIL 137: 'FTP download without size in RETR string' FTP, RETR, --data-binary
FAIL 336: 'FTP range download when SIZE doesn't work' FTP, PASV, TYPE A, RETR
FAIL 975: 'HTTP with auth redirected to FTP allowing auth to continue' HTTP, FTP, --location-trusted
FAIL 1378: 'FTP DL, file without Content-Disposition inside, using -o fname' FTP, RETR
```

MSYS2 mingw32:
```
FAIL 1501: 'FTP with multi interface and slow LIST response' FTP, RETR, multi, LIST, DELAY
```

MSYS2 mingw64:
```
FAIL 1501: 'FTP with multi interface and slow LIST response' FTP, RETR, multi, LIST, DELAY
```

Follow-up to 0324d557e4 #11510

Closes #14593
2024-08-19 14:09:14 +02:00
Viktor Szakats
47849be5d5
cmake/FindNettle: skip pkg-config for custom configs
If either `NETTLE_INCLUDE_DIR` or `NETTLE_LIBRARY` is set to customize
the `nettle` dependency, skip `pkg-config` and use the CMake-native
detection to honor these custom settings.

Closes #14584
2024-08-19 14:09:14 +02:00
Jan Venekamp
5b2a659ea6
mbedtls: fix setting tls version
TLS max values lower than 1.2 were automatically set to 1.2. Other SSL
backends (that dropped TLS 1.0 and 1.1) do not do that.

Closes #14588
2024-08-19 10:59:01 +02:00
Jan Venekamp
ff94698d31
wolfssl: fix setting tls version
The value CURL_SSLVERSION_TLSv1_0 was unsupported.

Closes #14587
2024-08-19 10:50:31 +02:00
Jan Venekamp
38fa458e51
rustls: fix setting tls version
The value CURL_SSLVERSION_TLSv1_0 was unsupported.

Closes #14586
2024-08-19 10:48:05 +02:00
Jan Venekamp
7a7c7a8995
bearssl: fix setting tls version
Previously version_max was ignored.

Closes #14585
2024-08-19 10:46:58 +02:00
Daniel Stenberg
73f62acaa2
RELEASE-NOTES: synced 2024-08-18 22:57:37 +02:00
Viktor Szakats
dcf5a5383c
cmake: fix cmakelint warnings
- keep line lengths below 132 characters.
- fix two "weird indentation" warnings.

Reported-by: Dan Fandrich
Bug: #14580

Closes #14583
2024-08-18 22:53:09 +02:00
Viktor Szakats
3e60f174ee
cmake: tidy up more in Find modules
- add `NAMES` where missing.
- document input variables (including deprecated ones.)
- comment cleanups.
- FindWolfSSL: drop stray `QUIET` from `pkg_check_modules()`.
  (`QUIET` may be re-added for all modules in the future.)

Closes #14579
2024-08-18 22:53:09 +02:00
Viktor Szakats
c57d3aeb55
appveyor: drop uploading artifacts
Uploading artifacts sometimes results in this error:
```
Uploading artifacts...
[1/1] _bld\src\curl.exe (2,022,912 bytes)...100%
Error uploading artifact to the storage: Remote server returned 503: Service Temporarily Unavailable
```
Ref: https://ci.appveyor.com/project/curlorg/curl/builds/50424126/job/e4envval6xkicv1i#L123

The artifacts are also probably not useful to upload for every run. Also
note that they were missing external DLL dependencies.

Leave the logic there commented, to make it easy to enable as needed for
debugging or testing artifacts locally.

Closes #14581
2024-08-18 12:22:53 +02:00
Viktor Szakats
1d29246534
cmake: tidy up around ngtcp2 and wolfSSL
- fix to add the `m` library without path.
  Follow-up to 8577f4ca08 #14343
  Authored-by: Tal Regev
  Fixes #14549

- move `m` library detection to wolfSSL Find module.
  `m` is necessary for wolfSSL (wolfcrypt) library functions called by
  `libngtcp2_crypto_wolfssl`.
  Follow-up to 8577f4ca08 #14343

- fix comment header about supported `COMPONENT` names.

- quote strings.

- lowercase local variables.

Closes #14576
2024-08-18 11:17:20 +02:00
Viktor Szakats
24889acbfb
cmake: do not unset the deprecated mixed-case variables
To avoid interference with the calling env.

(Keep unsetting for the DIRS/DIR cases in BearSSL and mbedTLS, because
the deprecated variables play a new role in the detection.)

Follow-up to 9fbda4ca75 #14574
2024-08-17 22:50:16 +02:00
Viktor Szakats
9fbda4ca75
cmake: rename wolfSSL and zstd config variables to uppercase
To match with other config variables and other projects.

Rename these CMake configuration variables:
- `WolfSSL_INCLUDE_DIR` -> `WOLFSSL_INCLUDE_DIR`
- `WolfSSL_LIBRARY`     -> `WOLFSSL_LIBRARY`
- `Zstd_INCLUDE_DIR`    -> `ZSTD_INCLUDE_DIR`
- `Zstd_LIBRARY`        -> `ZSTD_LIBRARY`

The old values continue to work, with a warning suggesting the new name.

Also:
- add similar warnings for earlier renames for mbedTLS and BearSSL.
- rename internal variables `PC_Zstd_*` to uppercase.

Follow-up to db39c668a8 #14542

Closes #14574
2024-08-17 21:23:51 +02:00
Daniel Stenberg
47a4864718
location: fix typo
Follow-up to 5fcf96930e
Bug: https://github.com/curl/curl/pull/14471#pullrequestreview-2244131475
Reported-by: Joshix-1 on github
2024-08-17 21:04:34 +02:00
XYenon
5fcf96930e
docs: add description of effect of --location-trusted on cookie
Closes #14471
2024-08-17 19:44:39 +02:00
Jan Venekamp
88727f7ed0
docs: improve cipher options documentation
Closes #14407
2024-08-17 11:14:21 +02:00
renovate[bot]
b2488afb18
GHA: update github/codeql-action digest to 429e197
Closes #14425
2024-08-17 11:03:09 +02:00
Viktor Petersson
6fc66e1676
SECURITY: mention OpenSSF best practices gold badge
Closes #14319
2024-08-17 11:01:16 +02:00
Justin Maggard
88cae14550
mbedtls: add more informative logging
After TLS handshare, indicate which TLS version was negotiated in
addition to the cipher in the handshake completed log message.

Also use the verify callback for certificate logging and collection.
This allows things to work even when MBEDTLS_SSL_KEEP_PEER_CERTIFICATE
is disabled in the mbedtls library.

And lastly, catch certificate validation errors later so we can give the
user more informative error messages that indicate what the failure was
from certificate validation.

Tested on both current LTS versions (2.28 and 3.6).

Closes #14444
2024-08-17 10:57:45 +02:00
renovate[bot]
2c4d04c4d3
GHA: update dependency gnutls/gnutls to v3.8.7
Closes #14554
2024-08-17 10:53:41 +02:00
Stefan Eissing
a58b50fca6
transfer: Curl_sendrecv() and event related improvements
- Renames Curl_readwrite() to Curl_sendrecv() to reflect that it
  is mainly about talking to the server, not reads or writes to the
  client. Add a `nowp` parameter since the single caller already
  has this.
- Curl_sendrecv() now runs all possible operations whenever it is
  called and either it had been polling sockets or the 'select_bits'
  are set.
  POLL_IN/POLL_OUT are not always directly related to send/recv
  operations. Filters like HTTP/2, QUIC or TLS may monitor reverse
  directions. If a transfer does not want to send (KEEP_SEND), it
  will not do so, as before. Same for receives.
- Curl_update_timer() now checks the absolute timestamp of an expiry
  and the last/new timeout to determine if the application needs
  to stop/start/restart its timer. This fixes edge cases where
  updates did not happen as they should have.
- improved --test-event curl_easy_perform() simulation to handle
  situations where no sockets are registered but a timeout is
  in place.
- fixed bug in events_socket() that complained about removing
  a socket that was unknown, when indeed it had removed the socket
  just before, only it was the last in the list
- fixed conncache's internal handle to carry the multi instance
  (where the cache has one) so that operations on the closure handle
  trigger event callbacks correctly.
- fixed conncache to not POLL_REMOVE a socket twice when a conneciton
  was closed.

Closes #14561
2024-08-17 10:52:53 +02:00
Viktor Szakats
432f2fd9ac
cmake: sync up version detection in Find modules
- use the same pattern across all Find modules:
  - verify if the version header exists before reading it.
  - use a single regex per lookup.
  - sync regexes between Find modules.
  - use generic temporary variable names.
  - improve readability.
  - make it simpler to transition to new CMake syntax in the future:
    ```cmake
    file(STRINGS "${CARES_INCLUDE_DIR}/ares_version.h" _version_str REGEX "<...>")
    unset(_version_str)
    set(CARES_VERSION "${CMAKE_MATCH_1}")
    ```
    Ref: https://cmake.org/cmake/help/latest/policy/CMP0159.html#policy:CMP0159

- fix zstd version detection to be CMake 3.7 compatible.
  Required 3.9 before this patch, for the `CMAKE_MATCH_<n>` feature.
  Follow-up to c5d506e9bb #12200

Follow-up to 4e2f3641f8 #14548

Closes #14572
2024-08-17 10:33:26 +02:00
Viktor Szakats
d8de4806e1
cmake: tidy-up continues
- move variable dump to a GHA foldable group.
- minimize scope for an include().
- rename `HIDES_CURL_PRIVATE_SYMBOLS` to `CURL_HIDES_PRIVATE_SYMBOLS`,
  to keep it in the curl namespace.
- drop quotes from a version number.
- add missing `Makefile.inc` var refs to comment.
- FindNGTCP2: rename internal var to underscore/lowercase.
- FindBearSSL, FindGSS: whitespace.

Closes #14571
2024-08-17 00:32:38 +02:00
Viktor Szakats
f3a03df6a1
cmake: revert to pkg_check_modules()
Prefer `pkg_check_modules()` over `pkg_search_module()`.

`pkg_check_modules()` logs a line when there is a hit, and also warnings
if a sub-dependency is missing. In `QUIET` mode, both are silent.

The extra info is useful to see if a detection happened via
`pkg-config`.

Keep `pkg_search_module()` in `FindGSS`. We pass two dependencies
there and we want to keep stopping on the first one.

Partially reverts c2889a7b41 #14388

Closes #14573
2024-08-17 00:31:52 +02:00
Viktor Szakats
4beb236478
cmake: fixup variable reference in FindZstd
Follow-up to 4e2f3641f8 #14548
2024-08-16 19:10:46 +02:00
Daniel Stenberg
f9f2eaaec3
internals/SPLAY.md: internal API documentation
Closes #14563
2024-08-16 17:13:37 +02:00
Daniel Stenberg
8f562f744c
curl: make the progress bar detect terminal width changes
And up the widest supported bar to 400 columns.

Fixes #14565
Reported-by: lolbinarycat on github
Closes #14570
2024-08-16 17:05:28 +02:00
Viktor Szakats
4e2f3641f8
cmake: add missing version detection to Find modules
- use `pkg-config` version when available and where it wasn't yet used.

- add manual version detection for dependencies where this is possible
  (via a public header) and where it wasn't done yet.

Closes #14548
2024-08-16 16:53:44 +02:00
Viktor Szakats
2bea3892e7
GHA/windows: delete redundant options, tidy up
- delete redundant `-DCURL_USE_LIBPSL=ON`.

- delete redundant `-DUSE_NGHTTP2=ON`.
  Follow-up to 87aa4ebd82 #14136

- reorder options.

Closes #14569
2024-08-16 16:05:36 +02:00
Viktor Szakats
453d032b26
tidy-up: misc build, tests, lib/macos.c
- mkhelp.pl: drop unused assigment.
- Makefile.mk: update a comment.
- lib/macos.c: delete redundant block.
- fix two typos.

Closes #14558
2024-08-16 16:05:36 +02:00
Daniel Stenberg
471b11a9fd
RELEASE-NOTES: synced 2024-08-16 14:52:34 +02:00
Daniel Stenberg
0e06603b23
docs: remove ALTSVC.md, HSTS.md, HTTP2.md and PARALLEL-TRANSFERS.md
These are files and documentation for established functionality that
should by now be covered properly and completely in the standard
documentation and in everything curl. Having these extra files provides
duplicated information where they risk being out of sync.

Closes #14553
2024-08-16 13:49:00 +02:00
Jan Venekamp
1e03d4bc0b
rustls: add support for setting TLS version and ciphers
Add support for CURLOPT_SSLVERSION, CURLOPT_TLS13_CIPHERS and
CURLOPT_SSL_CIPHER_LIST.

Closes #14535
2024-08-16 09:55:02 +02:00
Viktor Szakats
0d8fdd1c74
cmake: add wolfSSH support
Enable with CMake option `-DCURL_USE_WOLFSSH=ON`. Customize with
`-DWOLFSSH_INCLUDE_DIR=<path-to-wolfssh>/include`,
`-DWOLFSSH_LIBRARY=<path-to-wolfssh>/lib/libwolfssh.a`.

It requires the wolfSSL TLS backend.

Closes #14568
2024-08-16 09:36:57 +02:00
Jan Venekamp
3ff147f8ba
cmake: TLS 1.3 warning only for bearssl and sectranp
Closes #14566
2024-08-16 09:36:37 +02:00
Daniel Stenberg
dcb51bafab
splay: use access functions, add asserts, use Curl_timediff
- add set/get functions for the custom data in a tree node

- use Curl_timediff for time comparisons instead of the custom macro, as they
  do the exact same things.

- add asserts to catch mistakes better

- updated test 1309 accordingly

Closes #14562
2024-08-16 09:12:13 +02:00
Stefan Eissing
6c5a7af754
scorecard: tweak request measurements
Increase max-parallel up to 300, the curl max

Tweak output to just give the http response code

Closes #14564
2024-08-16 09:10:09 +02:00
Daniel Stenberg
20aa8d8f31
docs/internals: new subdirectory
For libcurl internal APIs and concepts.

Closes #14552
2024-08-16 08:59:25 +02:00
Daniel Stenberg
3932964793
test1707: output diff more for debugging differences in CI outputs 2024-08-16 08:57:19 +02:00
Daniel Stenberg
0066d169e8
managen: wordwrap long example lines in ASCII output
The entire ASCII version of the manpage word wraps at a fixed column,
while example command lines can easily go wider than so.

This change now makes manage work on wrapping long example command lines
to make them look nicer. And also to avoid triggering the build error
caused by too long lines in the output.

Quoted lines cannot be wrapped, so managen now errors out if they are
"too long". With this addition, the 'maxline' script is removed as it is
no longer needed.

Closes #14543
2024-08-16 08:57:19 +02:00
Jan Venekamp
178e8ba2d1
cmake: fix find rustls
Follow-up to 2784801977 #14545
Closes #14567
2024-08-15 23:09:09 +02:00
Daniel Stenberg
160f023359
multi: on socket callback error, remove socket hash entry nonetheless
Previously an error from the callback accidentally made libcurl keep the
hash entry which would lead to the entry remaining and then potentially
getting removed *again* which would lead to internal confusions.

This is an old issue (introduced in 2b3dd01b77), caught by the new
asserts from c0233a35da.

Closes #14557
2024-08-15 18:49:16 +02:00
Viktor Szakats
ef1d606d1b
libcurl.pc: add reference to libgsasl
Closes #14556
2024-08-15 15:30:09 +02:00
Viktor Szakats
b042d5297d
tidy-up: misc spelling (bit, ASCII)
Closes #14559
2024-08-15 15:30:09 +02:00
Daniel Stenberg
551baf7d64
tests: move the disabling of 500 for hyper from CI to DISABLED
Follow-up to 136504195a

Closes #14551
2024-08-15 14:02:40 +02:00
Daniel Stenberg
5603204448
curl: fix the -w urle.* variables
urle.scheme, urle.user, urle.password and urle.options mistakenly
operated on the original URL instead of the *effective* (last) URL.

Add test 474 to verify.

Reported-by: Gruber Glass
Fixes #14550
Closes #14560
2024-08-15 14:01:24 +02:00