]> git.ipfire.org Git - thirdparty/curl.git/log
thirdparty/curl.git
14 months agotests: tweak use of impacket in smbserver 14669/head
Dan Fandrich [Fri, 23 Aug 2024 23:09:17 +0000 (16:09 -0700)] 
tests: tweak use of impacket in smbserver

The missing message only uses a single line now and has a consistent
prefix making it easier for log parsers to skip. Remove a precheck test
looking for impacket in test1451 because it's incomplete, unnecessary
and in the wrong layer; the test harness will automatically discover
that the smbserver won't start and the test was only checking a single
dependency.  Also update the tests README to no longer mention Python 2.
The servers were switched to Python 3 several years ago and no attempt
is being made to maintain Python 2 compatibility

Closes #14669

14 months agoGHA/macos: ignore flaky tests 2041 and 2037
Viktor Szakats [Fri, 23 Aug 2024 17:20:07 +0000 (19:20 +0200)] 
GHA/macos: ignore flaky tests 2041 and 2037

- FAIL 2037: 'simple HTTPS GET with PEM public key pinning' HTTPS, HTTP GET, PEM certificate
  https://github.com/curl/curl/actions/runs/10529314166/job/29176801513?pr=14658

- FAIL 2041: 'simple HTTPS GET with base64-sha256 public key pinning' HTTPS, HTTP GET, PEM certificate
  https://github.com/curl/curl/actions/runs/10529181645/job/29176408976#step:16:4363
  https://github.com/curl/curl/actions/runs/10529019749/job/29175882809#step:13:5235
  https://github.com/curl/curl/actions/runs/10528920874/job/29175559070#step:16:4363
  https://github.com/curl/curl/actions/runs/10528759817/job/29175043048#step:16:4274
  https://github.com/curl/curl/actions/runs/10525250422/job/29163662307#step:16:4366
  https://github.com/curl/curl/actions/runs/10525250422/job/29163662602#step:13:3569

  Happened with cmake, autotools, gcc, clang and various TLS backends.

Follow-up to fa461b4eff52b413f88debf543b5350a6cef4724 #14486

Closes #14667

14 months agoGHA/windows: add Linux -> mingw-w64 cross-build (cmake, autotools)
Viktor Szakats [Fri, 23 Aug 2024 10:58:51 +0000 (12:58 +0200)] 
GHA/windows: add Linux -> mingw-w64 cross-build (cmake, autotools)

Also:
- add a line to CMake log output showing the host and target OS and CPU
  when doing cross-builds.
- reduce excessive timeout for `curl -V` steps.

Closes #14661

14 months agocmake: sync code between test/example targets
Viktor Szakats [Thu, 22 Aug 2024 07:10:07 +0000 (09:10 +0200)] 
cmake: sync code between test/example targets

- reuse local variable names.
- sync `PROJECT_LABEL`, add where missing.
- namespace all target names.
- bind header directories to each target.
- tests/server: limit `CURL_STATICLIB` to Windows (as in autotools.)
- drop functions with a single caller.

Closes #14660

14 months agoGHA: add yamlcheck
Viktor Szakats [Thu, 22 Aug 2024 18:14:17 +0000 (20:14 +0200)] 
GHA: add yamlcheck

Uses `yamllint`.

Also:
- fix warning for existing YAML files:
  ```
  [truthy] truthy value should be one of [false, true]
  ```

Closes #14650

14 months agoCI: consolidate workflows for source and docs check
Dan Fandrich [Fri, 23 Aug 2024 04:24:03 +0000 (21:24 -0700)] 
CI: consolidate workflows for source and docs check

A bunch of tiny jobs that run various source or documentation checks are
consolidated into two workflow files: checksrc.yml and checkdocs.yml.
This reduces the proliferation of new files containing one-line checks
and brings those that operate similarly together for better reasoning
about them. The man-examples check is also now running again for the
first time in 7 months.

Various calls to find, xargs and git ls-files are changed where possible
to use NUL line terminators in pipes to avoid issues with oddly-named
files that might find their way into the repo.

Closes #14654

14 months agodocs: fix some examples in man pages
Dan Fandrich [Fri, 23 Aug 2024 05:17:43 +0000 (22:17 -0700)] 
docs: fix some examples in man pages

The man-examples job hasn't been running for a few months to verify
that these compile, so some mistakes slipped in.

Ref: #14654

14 months agoRELEASE-NOTES: synced
Daniel Stenberg [Fri, 23 Aug 2024 12:08:26 +0000 (14:08 +0200)] 
RELEASE-NOTES: synced

14 months agourlapi: verify URL *decoded* hostname when set
Daniel Stenberg [Fri, 23 Aug 2024 08:41:26 +0000 (10:41 +0200)] 
urlapi: verify URL *decoded* hostname when set

It was previously wrongly verifying the input in its URL encoded format
when setting the hostname component with curl_url_set(), so it wrongly
rejected '%'.

Now it URL decodes the name appropriately before the check.

Added tests to lib1560 to verify that a fine %-code is okay and that a
bad %-code (that decodes to '%') is rejected.

Regression from 0a0c9b6dfa0de4a4c, shipped in 8.0.0

Fixes #14656
Reported-by: Venkat Krishna R
Closes #14657

14 months agoGHA/macos: enable HTTPS tests with stunnel
Aki [Wed, 7 Aug 2024 14:57:43 +0000 (22:57 +0800)] 
GHA/macos: enable HTTPS tests with stunnel

- Install stunnel.

- Regenerate certificates (as SecureTransport requires a validity period
  less than 398 days).

- Restart server if it is unresponsive.

- Do not hardcode the SHA-256 base64 public pinned key.

- Ignore test 313 as SecureTransport does not support crl file.

- Ignore tests 1631 and 1632 as SecureTransport is not yet able to shut
  down FTP over HTTPS gracefully.

- Add a CMake target for generating certificates.

Closes #14486

14 months agocmake: respect cflags/libdirs of native pkg-config detections
Viktor Szakats [Thu, 22 Aug 2024 15:05:54 +0000 (17:05 +0200)] 
cmake: respect cflags/libdirs of native pkg-config detections

In Find modules with native pkg-config detection (libgsasl, libidn2,
libssh, libuv, nettle) use the C compiler flags returned by pkg-config.
Also use the library paths, and return the pathless library names.

Also:
- add these library paths to `libcurl.pc`/`curl-config`.
- fix libgsasl detection to use the detected header directory.

FindGSS already did this before this patch.

Fixes #14641

Closes #14652

14 months agocmake/FindGSS: bring closer to other Find modules
Viktor Szakats [Thu, 22 Aug 2024 14:14:44 +0000 (16:14 +0200)] 
cmake/FindGSS: bring closer to other Find modules

- add pkg-config-specific 'Found' message to the Find module.

- update non-pkg-config 'Found' message to show the flavour instead of
  the library name. (= the first value listed after `REQUIRED_VARS`)

- delete extra 'Found' message from `CMakeLists.txt`.

- rename internal result variables to match with default pkg-config
  names, in preparation of introducing them in other Find modules:
  - `GSS_LINK_DIRECTORIES` -> `GSS_LIBRARY_DIRS`
  - `GSS_LINKER_FLAGS` -> `GSS_LDFLAGS`
  - `GSS_COMPILER_FLAGS` -> `GSS_CFLAGS`

  Ref: #14652

Closes #14651

14 months agogha labeler: make labeler.yml human-readable
Jan Venekamp [Fri, 23 Aug 2024 01:33:39 +0000 (03:33 +0200)] 
gha labeler: make labeler.yml human-readable

Split the strings containing the globs over multiple lines, with
each line having one glob.

Closes #14649

14 months agoFEATURES.md: fix typo
Daniel Stenberg [Fri, 23 Aug 2024 06:25:32 +0000 (08:25 +0200)] 
FEATURES.md: fix typo

Fixes #14653
Reported-by: Jason Hood
Closes #14655

14 months agotest1521: verify setting options to NULL better
Daniel Stenberg [Wed, 21 Aug 2024 12:58:57 +0000 (14:58 +0200)] 
test1521: verify setting options to NULL better

Previously this test allowed several error values when setting options.
This made this test miss #14629.

Now, errors are generally not accepted for setopts:

 - numerical setopts accept CURLE_BAD_FUNCTION_ARGUMENT for funny input
 - the first setopt to an option accepts CURLE_NOT_BUILT_IN or
   CURLE_UNKNOWN_OPTION for when they are disabled/not built-in
 - there is an allowlist concept for some return code for some variables,
   managed at the top of the mk-lib1521.pl script

In curl.h: remove the OBSOLETE named values from the setopt list.

Closes #14634

14 months agosetopt: make CURLOPT_TFTP_BLKSIZE accept bad values
Daniel Stenberg [Thu, 22 Aug 2024 13:55:09 +0000 (15:55 +0200)] 
setopt: make CURLOPT_TFTP_BLKSIZE accept bad values

... and just move them into the accepted range. Like how buffersize and
a few other options work.

Closes #14634

14 months agosetopt: let CURLOPT_ECH set to NULL reset to default
Daniel Stenberg [Thu, 22 Aug 2024 11:17:27 +0000 (13:17 +0200)] 
setopt: let CURLOPT_ECH set to NULL reset to default

Because NULL is documented as default and most options that take
pointers accept NULL to reset back to internal default.

Closes #14634

14 months agogetinfo: return zero for unsupported options (when disabled)
Daniel Stenberg [Wed, 21 Aug 2024 21:21:26 +0000 (23:21 +0200)] 
getinfo: return zero for unsupported options (when disabled)

instead of returning an error code to the getinfo() call. Like other
info variables work.

Closes #14634

14 months agosrc: replace copy of printf mappings with an include
Viktor Szakats [Thu, 22 Aug 2024 15:12:09 +0000 (17:12 +0200)] 
src: replace copy of printf mappings with an include

Closes #14648

14 months agocmake: pkg-config 'found' message sync with native CMake
Viktor Szakats [Thu, 22 Aug 2024 14:39:50 +0000 (16:39 +0200)] 
cmake: pkg-config 'found' message sync with native CMake

Cherry-picked from #14610

14 months agoGHA: trim markdown headers before proselinting
Daniel Stenberg [Thu, 22 Aug 2024 10:47:16 +0000 (12:47 +0200)] 
GHA: trim markdown headers before proselinting

Allow interface.md to use more exclamation marks.

Closes #14645

14 months agoGHA: add a checksrc job
Daniel Stenberg [Wed, 21 Aug 2024 07:19:27 +0000 (09:19 +0200)] 
GHA: add a checksrc job

This job unconditionally runs checksrc on ALL .c and .h files present in
git.

checksrc.pl: fixed to look for ".checksrc" in the same directory from
where it loads the file to check so that it an be invoked like this

Closes #14625

14 months agomisc: general C style cleanups
Daniel Stenberg [Thu, 22 Aug 2024 09:04:17 +0000 (11:04 +0200)] 
misc: general C style cleanups

... in code that previously was not checksrc'ed

Closes #14625

14 months agotidy-up: spelling WebSockets
Viktor Szakats [Wed, 21 Aug 2024 21:47:31 +0000 (23:47 +0200)] 
tidy-up: spelling WebSockets

Closes #14646

14 months agosrc: delete `curlx_m*printf()` aliases
Viktor Szakats [Thu, 22 Aug 2024 12:58:14 +0000 (14:58 +0200)] 
src: delete `curlx_m*printf()` aliases

A couple of seemingly random calls used them.
They were all mapped to `curl_m*printf()`.

Closes #14647

14 months agoconfigure: fix indentation
Viktor Szakats [Wed, 21 Aug 2024 09:08:54 +0000 (11:08 +0200)] 
configure: fix indentation

Also:
- move `then`s and an `in` inline.
- whitespace.

Closes #14628

14 months agodocs: Clarify OpenSSF Best Practices vs Scorecard
Chris Swan [Wed, 21 Aug 2024 13:26:59 +0000 (14:26 +0100)] 
docs: Clarify OpenSSF Best Practices vs Scorecard

SECURITY.md has a recently added section titled OpenSSF Scorecard
that actually documents OpenSSF Best Practices. Scorecard [0] is a
different OpenSSF project, that incorporates Best Practices, but is
distinct in its objectives and how it achieves them.
This change clarifies the terminology, and also removes any
implication that Gold Best Practices is an award rather than a self
certification programme.
As curl was a leader in implementing Best Practices some folk may be
more familiar with the earlier Core Infrastructure Initiative (CII)
naming, so a reference to that has been added.

[0] https://scorecard.dev/

Signed-off-by: Chris Swan <478926+cpswan@users.noreply.github.com>
Ref: #14319
Closes #14635

14 months agosectransp: fix setting tls version
Jan Venekamp [Wed, 21 Aug 2024 23:16:59 +0000 (01:16 +0200)] 
sectransp: fix setting tls version

Had multiple failures on test_17_09_ssl_min_max with --tlsv1 and
--tlsv1.3.

Closes #14621

14 months agotests: constrain http pytest to tests/http directory
Jan Venekamp [Wed, 21 Aug 2024 17:54:19 +0000 (19:54 +0200)] 
tests: constrain http pytest to tests/http directory

Running the http pytest had to be done from tests directory or above,
because the repeat argument fixture was defined in tests/conftest.py.
However, the repeat argument is not needed because its functionality
can be provided by pytest-repeat as documented in the test's
README.md. So, removed the pytest_addoption function for the repeat
argument and the pytest_report_header function is moved to
tests/http/conftest.py.

TODO: Remove repeat argument from all tests. As a stopgap, a
one-element list is defined for it for now.

Closes #14611

14 months agogtls: fix OCSP stapling management
Daniel Stenberg [Tue, 20 Aug 2024 14:14:39 +0000 (16:14 +0200)] 
gtls: fix OCSP stapling management

Reported-by: Hiroki Kurosawa
Closes #14642

14 months agobuild: make `CURL_FORMAT_CURL_OFF_T[U]` work with mingw-w64 <=7.0.0
Viktor Szakats [Wed, 21 Aug 2024 22:21:51 +0000 (00:21 +0200)] 
build: make `CURL_FORMAT_CURL_OFF_T[U]` work with mingw-w64 <=7.0.0

Add tweak for mingw-w64 when building tests/http/client programs to
avoid a bogus `-Wformat` warning when using mingw-w64 v7.0.0 or older.
The warning is bogus because these programs use curl's `printf()`
implementation that is guaranteed to support that format spec.

Add this for both CMake and autotools. (But only CMake is CI tested with
an old toolchain.)

Apply the workaround to `docs/examples`, and fix an example to use
curl's `printf()` with `CURL_FORMAT_CURL_OFF_T`.

Reintroduce curl `printf()` calls into `tests/http/client`, via #14625.
Also restore large number masks to a printf, changed earlier in #14382.

Follow-up to 232302f88a152a1d1722da9f69c383a766528918 #14382
Ref: https://github.com/curl/curl/pull/14625#issuecomment-2302361737

Closes #14640

14 months agosrc: fix potential macro confusion in cmake unity builds
Viktor Szakats [Wed, 21 Aug 2024 11:36:29 +0000 (13:36 +0200)] 
src: fix potential macro confusion in cmake unity builds

Sources used `lib/curlx.h` with both `ENABLE_CURLX_PRINTF` set and unset
before including it.

In a cmake "unity" batch where the first included source had it unset,
the next sources did not get the macros requested with
`ENABLE_CURLX_PRINTF` because `lib/curl.x` had already been included
without them.

Fix it by by making the macros enabled permanently and globally for
internal sources, and dropping `ENABLE_CURLX_PRINTF`.

This came up while testing unity builds with smaller batches. The full,
default unity build where all `src` is bundled up in a single unit, was
not affected.

Fixes:
```
$ cmake -B build -DCMAKE_UNITY_BUILD=ON -DCMAKE_UNITY_BUILD_BATCH_SIZE=15
$ make -C build
...
curl/src/tool_getparam.c: In function ‘getparameter’:
curl/src/tool_getparam.c:2409:11: error: implicit declaration of function ‘msnprintf’; did you mean ‘vsnprintf’? [-Wimplicit-function-declaration]
 2409 |           msnprintf(buffer, sizeof(buffer), "%" CURL_FORMAT_CURL_OFF_T "-",
      |           ^~~~~~~~~
      |           vsnprintf
curl/src/tool_getparam.c:2409:11: warning: nested extern declaration of ‘msnprintf’ [-Wnested-externs]
[...]
```

Reported-by: Daniel Stenberg
Bug: https://github.com/curl/curl/pull/14626#issuecomment-2301663491

Closes #14632

14 months agoRELEASE-NOTES: synced
Daniel Stenberg [Thu, 22 Aug 2024 07:44:54 +0000 (09:44 +0200)] 
RELEASE-NOTES: synced

14 months agoCURLOPT_XFERINFOFUNCTION: clarify the callback return codes
Daniel Stenberg [Wed, 21 Aug 2024 21:35:31 +0000 (23:35 +0200)] 
CURLOPT_XFERINFOFUNCTION: clarify the callback return codes

also done in CURLOPT_PROGRESSFUNCTION.md

This changes the wording to say that 1 should be returned instad of
non-zero to return error from the callback. I did this to simplify, even
if other non-zero values still do the same thing I figure we might just
as well just leave out the others from the documentation.

Fixes #14627
Reported-by: Benjamin Riefenstahl Mecom
Closes #14637

14 months agolib: delete stray undefs for `vsnprintf`, `vsprintf`
Viktor Szakats [Wed, 21 Aug 2024 11:30:54 +0000 (13:30 +0200)] 
lib: delete stray undefs for `vsnprintf`, `vsprintf`

Stop #undefining macros that were not redefined or used in the code.

Closes #14631

14 months agocmake: tidy up option descriptions
Viktor Szakats [Wed, 21 Aug 2024 05:59:27 +0000 (07:59 +0200)] 
cmake: tidy up option descriptions

- capitalize.
- impartive voice.
- stick to `Build ...`, `Use ...`, `Enable ...`, `Disable ...` with
  a couple of exceptions.
- drop period.
- fix wolfSSH, WebSockets casing.

Closes #14636

14 months agocmake: honor custom `CMAKE_UNITY_BUILD_BATCH_SIZE`
Viktor Szakats [Wed, 21 Aug 2024 07:27:18 +0000 (09:27 +0200)] 
cmake: honor custom `CMAKE_UNITY_BUILD_BATCH_SIZE`

This value tells how many sources files to bundle in a single "unity"
compilation unit.

The CMake default is 8 sources, curl's CMake set this to 0, meaning
to bundle all sources into a single unit.

This patch makes it possible to override the 0 value, and potentially
optimize the build process further by better utilizing multiple cores
in conjunction with `make -jN`.

The number of sources in lib is 172 at the time of writing this. For
a 12-core CPU, this can give a job for them all:
`-DCMAKE_UNITY_BUILD_BATCH_SIZE=15`

(Compile time may be affected by a bunch of other factors.)

Closes #14626

14 months agoGHA/windows: fix indentation in the MSVC section
Viktor Szakats [Wed, 21 Aug 2024 14:13:04 +0000 (16:13 +0200)] 
GHA/windows: fix indentation in the MSVC section

14 months agosetopt: allow CURLOPT_INTERFACE to be set to NULL
Daniel Stenberg [Wed, 21 Aug 2024 09:07:06 +0000 (11:07 +0200)] 
setopt: allow CURLOPT_INTERFACE to be set to NULL

Ref: https://github.com/curl/curl/discussions/14299#discussioncomment-10393909
Regression from 3060557af702dd591 (shipped in 8.9.0)

Closes #14629

14 months agobuild: add `iphlpapi` lib for libssh on Windows
Viktor Szakats [Tue, 20 Aug 2024 21:10:31 +0000 (23:10 +0200)] 
build: add `iphlpapi` lib for libssh on Windows

vcpkg doesn't need it because it fixes this with a libssh patch.
All other Windows builds need it.

(autotools build not tested.)

Closes #14618

14 months agocmake: drop libssh CONFIG-style detection
Viktor Szakats [Tue, 20 Aug 2024 13:44:28 +0000 (15:44 +0200)] 
cmake: drop libssh CONFIG-style detection

Drop `find_package(libssh CONFIG)` detection method in favour of
the Find module that supports both `pkg-config`, and CMake-native
(since #14555) detection.

This aligns `libssh` detection with other dependencies. It makes the
build honor custom configuration via `LIBSSH_INCLUDE_DIR`,
`LIBSSH_LIBRARY`.

Also enable libssh in a GHA/macos cmake job for build coverage.

Fixing:
- curl-for-win requiring a hack to configure libssh:
  https://github.com/curl/curl-for-win/blob/4f9acbed92fd4aac0e874c9a591bec7d621cd9f2/curl.sh#L255-L263
- after #14555, GHA/windows gnutls vcpkg job no longer auto-detected
  libssh, due to a regression missing to enable libssh when
  found via `find_package(libssh CONFIG)`.
  Ref: https://github.com/curl/curl/actions/runs/10470138955/job/28994650338

Follow-up to 422696f0a4f3a9e20d4ba9f12726bb066f1c34fc #14555

Closes #14614

14 months agounit1300: fix checksrc longline warnings
Jay Satiro [Wed, 21 Aug 2024 06:30:50 +0000 (02:30 -0400)] 
unit1300: fix checksrc longline warnings

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

14 months agohttp2: fix GOAWAY message sent to server
Jay Satiro [Wed, 21 Aug 2024 06:23:55 +0000 (02:23 -0400)] 
http2: fix GOAWAY message sent to server

- fix typo in GOAWAY debug message "shutown" -> "shutdown"

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

14 months agobuildconf.bat: fix tool_hugehelp.c generation
Jay Satiro [Wed, 21 Aug 2024 05:25:14 +0000 (01:25 -0400)] 
buildconf.bat: fix tool_hugehelp.c generation

- Fix showhelp() function prototype in tool_hugehelp.c.cvs.

Follow-up to 9a0cf564 which added the function.

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

14 months agocmake: fixup linking libgsasl when detected via CMake-native
Viktor Szakats [Wed, 21 Aug 2024 07:21:29 +0000 (09:21 +0200)] 
cmake: fixup linking libgsasl when detected via CMake-native

Found in local tests.

Follow-up to 422696f0a4f3a9e20d4ba9f12726bb066f1c34fc #14555
which added CMake-native detection.

14 months agotidy-up: spelling wolfSSL [ci skip]
Viktor Szakats [Wed, 21 Aug 2024 06:52:54 +0000 (08:52 +0200)] 
tidy-up: spelling wolfSSL [ci skip]

14 months agombedtls: fix incorrect macro condition mbed_dump_cert_info
Jan Venekamp [Tue, 20 Aug 2024 18:33:59 +0000 (20:33 +0200)] 
mbedtls: fix incorrect macro condition mbed_dump_cert_info

Follow-up to 88cae145509c7

14 months agodocs/SSLCERTS: rewrite
Daniel Stenberg [Tue, 20 Aug 2024 16:04:37 +0000 (18:04 +0200)] 
docs/SSLCERTS: rewrite

cleanup, modernize, refresh

Remove libcurl solutions, only do curl command lines.

Closes #14616

14 months agoGHA/macos: enable brotli and zstd in autotools and cmake jobs
Viktor Szakats [Tue, 20 Aug 2024 21:42:01 +0000 (23:42 +0200)] 
GHA/macos: enable brotli and zstd in autotools and cmake jobs

They were missing from macOS builds:
https://testclutch.curl.se/static/reports/feature-matrix.html

Closes #14619

14 months agoversion: fix shadowing a `libssh.h` symbol
Viktor Szakats [Tue, 20 Aug 2024 19:51:44 +0000 (21:51 +0200)] 
version: fix shadowing a `libssh.h` symbol

```
/Users/runner/work/curl/curl/lib/version.c: In function 'curl_version_info':
/Users/runner/work/curl/curl/lib/version.c:584:15: error: declaration of 'ssh_buffer' shadows a global declaration [-Werror=shadow]
  584 |   static char ssh_buffer[80];
      |               ^~~~~~~~~~
In file included from /Users/runner/work/curl/curl/lib/vssh/ssh.h:35,
                 from /Users/runner/work/curl/curl/lib/urldata.h:185,
                 from /Users/runner/work/curl/curl/lib/altsvc.c:32,
                 from /Users/runner/work/curl/curl/bld/lib/CMakeFiles/libcurl_shared.dir/Unity/unity_0_c.c:4:
/opt/homebrew/include/libssh/libssh.h:99:35: note: shadowed declaration is here
   99 | typedef struct ssh_buffer_struct* ssh_buffer;
      |                                   ^~~~~~~~~~
```
Ref: https://github.com/curl/curl/actions/runs/10477958747/job/29020250670#step:9:48

Tested via #14614

Closes #14617

14 months agossh: deduplicate SSH backend includes (and fix libssh cmake unity build)
Viktor Szakats [Tue, 20 Aug 2024 13:07:38 +0000 (15:07 +0200)] 
ssh: deduplicate SSH backend includes (and fix libssh cmake unity build)

For libssh, it fixes a "unity" build issue where libssh deprecation
warnings were not suppressed before this patch, because the suppression
macro was only set before just one of the two `libssh.h` includes.
If the other was compiled first in unity mode, the warnings appeared.

Seen in local curl-for-win build (`CW_CONFIG=test-x64-libssh-quictls`)
with libssh 0.11.0. (Also in a GHA/macos cmake job upcoming in #14614)

Use this opportunity to drop duplicate SSH header includes from the SSH
modules. It's enough to include them via the common `ssh.h` header.

Closes #14612

14 months agotidy-up: spelling 'built-in'
Viktor Szakats [Tue, 20 Aug 2024 13:34:26 +0000 (15:34 +0200)] 
tidy-up: spelling 'built-in'

Closes #14613

14 months agobuild: improve compiler version detection portability
Dan Fandrich [Tue, 20 Aug 2024 17:56:59 +0000 (10:56 -0700)] 
build: improve compiler version detection portability

POSIX sed doesn't support extended regular expressions, so convert a
call to the basic format. This caused a problem on AIX. Also, use the
detected sed binary name instead of hard-coding one.

14 months agoGHA/windows: add missing time limit for msys2 autotools test runs
Viktor Szakats [Tue, 20 Aug 2024 13:59:32 +0000 (15:59 +0200)] 
GHA/windows: add missing time limit for msys2 autotools test runs

The new mingw job (the first msys2/mingw job to run tests) is seen
hanging frequently.

Follow-up to 9f23c8f201f55f1a148b41b16a5e71f3385faa5e #14541

14 months agotests: add test_17_09_ssl_min_max
Jan Venekamp [Tue, 20 Aug 2024 00:53:26 +0000 (02:53 +0200)] 
tests: add test_17_09_ssl_min_max

Test setting all combinations of --tlsv1.x and --tls-max.

Closes #14590

14 months agotests: improve test_17_07_ssl_ciphers
Jan Venekamp [Tue, 20 Aug 2024 00:53:19 +0000 (02:53 +0200)] 
tests: improve test_17_07_ssl_ciphers

Change TLS proto version on the test httpd server to test setting
combinations of --tls13-ciphers and --ciphers.

To not let the changed config of the httpd server bleed into the next
test, clean and reload on each test. Because a reload is slow, only
do this if the config is different than the loaded config. For this
the httpd.reload_if_config_changed() method is added.

Overloading of autouse fixtures does not seem to work. For the test
httpd server to be reloaded with a clean config in test_18_methods,
to not be affected by the config changes in test_17_ssl_use, the two
class scope fixtures of test_18_methods are now combined.

Closes #14589

14 months agombedtls: no longer use MBEDTLS_SSL_VERIFY_OPTIONAL
Jan Venekamp [Mon, 19 Aug 2024 01:59:08 +0000 (03:59 +0200)] 
mbedtls: no longer use MBEDTLS_SSL_VERIFY_OPTIONAL

With mbedTLS if the minimum version of TLS is set to 1.3,
MBEDTLS_SSL_VERIFY_OPTIONAL is not available in client mode. See:
https://github.com/Mbed-TLS/mbedtls/blob/2ca6c285/library/ssl_tls.c#L1357
Also, there might be plans to remove it completely in future mbedTLS
versions.

Switch to always use MBEDTLS_SSL_VERIFY_REQUIRED. If verifypeer or
verifyhost are disabled the corresponding error flags are cleared in the
verify callback function. That is also where verification errors are
logged.

Closes #14591

14 months agoGHA: update github/codeql-action digest to 883d858
renovate[bot] [Mon, 19 Aug 2024 21:21:56 +0000 (21:21 +0000)] 
GHA: update github/codeql-action digest to 883d858

Closes #14608

14 months agocmake: migrate dependency detections to Find modules
Viktor Szakats [Mon, 19 Aug 2024 12:27:51 +0000 (14:27 +0200)] 
cmake: migrate dependency detections to Find modules

For: libgsasl, libidn2, libssh, libuv.

The new Find modules retain using `pkg-config` natively, not as a "hint"
for the CMake-native detection. Of the pre-existing Find modules, only
FindNettle, and FindGSS (with customized code) work this way. Align
detection code for the new modules and add version detection for the
CMake-native paths.

Also, add CMake-native detection for `libgsasl`.

The remaining outlier in `CMakeLists.txt` is GnuTLS, which has
a CMake built-in Find module, but which lacks `pkg-config` support,
required for vcpkg. It remains unchanged.

Another part-outlier is `libssh`, which keeps requiring the trick
`find_package(libssh CONFIG QUIET)` for reasons I could not yet figure
out.

Closes #14555

14 months agocmake: add `find_package()` missing from `USE_MSH3` option
Viktor Szakats [Mon, 19 Aug 2024 23:13:14 +0000 (01:13 +0200)] 
cmake: add `find_package()` missing from `USE_MSH3` option

The original patch added the Find module and CMake option. But the logic
missed a `find_package(MSH3)` call to use that Find module, leaving the
referenced `MSH3_INCLUDE_DIRS`, `MSH3_LIBRARIES` variables undefined.

Blind fix.

Follow-up to 37492ebbfa24ba4e700e6655b3dbc2bdd65c894a #8517

Closes #14609

14 months agocf-socket: prevent KEEPALIVE_FACTOR being set to 1000 for Windows
Sam Jessup [Mon, 19 Aug 2024 15:37:59 +0000 (17:37 +0200)] 
cf-socket: prevent KEEPALIVE_FACTOR being set to 1000 for Windows

Fixes #14368
Reported-by: feelingseas on github
Closes #14606

14 months agocurl: find curlrc in XDG_CONFIG_HOME without leading dot
Daniel Stenberg [Mon, 19 Aug 2024 21:22:56 +0000 (23:22 +0200)] 
curl: find curlrc in XDG_CONFIG_HOME without leading dot

If XDG_CONFIG_HOME is set, look for XDG_CONFIG_HOME/curlrc - without a
leading dot in the filename.

Fixes #12129
Reported-by: Jat Satiro
Closes #14600

14 months agoGHA/windows: unblock TFTP MQTT WebSockets SMTP FTP tests
Viktor Szakats [Mon, 19 Aug 2024 17:05:36 +0000 (19:05 +0200)] 
GHA/windows: unblock TFTP MQTT WebSockets SMTP FTP tests

Run them now. Also ignore results for now.

Closes #14607

14 months agocmake: limit `pkg-config` to UNIX and MSVC+vcpkg by default
Viktor Szakats [Fri, 16 Aug 2024 23:08:45 +0000 (01:08 +0200)] 
cmake: limit `pkg-config` to UNIX and MSVC+vcpkg by default

Limits `pkg-config` to UNIX and MSVC with vcpkg, by default. Compared to
curl 8.9.1, this unlocks `pkg-config` on MSVC with vcpkg.

This condition might be updated in the future depending on where
`pkg-config` can be useful without breaking things. (e.g. to non-cross
MINGW, or all MINGW).

In the meantime everyone is free to override the default and test their
build with `pkg-config` by setting the `CURL_USE_PKGCONFIG=ON` CMake
option.

Closes #14575

14 months agocmake: rename Find modules
Viktor Szakats [Mon, 19 Aug 2024 22:47:55 +0000 (00:47 +0200)] 
cmake: rename Find modules

- `FindCARES`   -> `FindCares`
- `FindLibPSL`  -> `FindLibpsl`
- `FindLibSSH2` -> `FindLibssh2`
- `FindQUICHE`  -> `FindQuiche`
- `Findrustls`  -> `FindRustls`

Our convention for naming Find modules (the part after the `Find`
prefix, also called as 'package name') is:

Always start with uppercase. Follow with lowercase, unless there is
a clear preference for a stylized name. E.g. the project itself uses it
that way with a matching `<Name>Config.cmake` file, or we use it that
way elsewhere, or the name is an acronym.

Ref: #14580

Closes #14601

14 months agocmake: fix Find module and package names
Viktor Szakats [Mon, 19 Aug 2024 10:31:11 +0000 (12:31 +0200)] 
cmake: fix Find module and package names

- fix BearSSL warning about name mismatch.
- fix Nettle Find module not found on Linux.
- tidy-up: drop quotes from a package name.

Package names must match case-sensitively to work on all platforms:
- `find_package(<NAME> ...)` in `CMakeLists.txt`.
- `CMake/Find<NAME>.cmake` filenames.
- `find_package_handle_standard_args(<NAME> ...` in Find modules.
- `message(STATUS "Found <NAME> ...` in Find modules.
  (to match the message shown by `find_package_handle_standard_args()`)

Closes #14599

14 months agotidy-up: spelling quiche and Rustls
Viktor Szakats [Mon, 19 Aug 2024 14:53:40 +0000 (16:53 +0200)] 
tidy-up: spelling quiche and Rustls

Closes #14605

14 months agotidy-up: adjust casing of project names (continued)
Viktor Szakats [Mon, 19 Aug 2024 13:08:37 +0000 (15:08 +0200)] 
tidy-up: adjust casing of project names (continued)

Replace remaining `LibSSH2` with `libssh2`.

Follow-up to 6343034dd12fabfa88c998eb1182cbc6394afe25 #14160

Closes #14602

14 months agopingpong: drain the input buffer when reading responses
Daniel Stenberg [Mon, 19 Aug 2024 10:00:15 +0000 (12:00 +0200)] 
pingpong: drain the input buffer when reading responses

As the data might be held by TLS buffers, leaving some and expecting to
get called again is error prone.

Reported-by: ralfjunker on github
Fixes #14201
Closes #14597

14 months agoKNOWN_BUGS: Heimdal memory leaks
Daniel Stenberg [Mon, 19 Aug 2024 14:39:44 +0000 (16:39 +0200)] 
KNOWN_BUGS: Heimdal memory leaks

Closes #14446
Closes #14604

14 months agobuild: use -Wno-format-overflow
Daniel Stenberg [Mon, 19 Aug 2024 12:17:55 +0000 (14:17 +0200)] 
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

14 months agocmake/FindNettle: log message when found via `pkg-config`
Viktor Szakats [Wed, 14 Aug 2024 21:27:33 +0000 (23:27 +0200)] 
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

14 months agocmake: adjust GSSAPI option description
Viktor Szakats [Mon, 19 Aug 2024 09:12:15 +0000 (11:12 +0200)] 
cmake: adjust GSSAPI option description

krb5 also builds with CMake, not only Heimdal.

Ref: 558814e16d84aa202c5ccc0c8108a9d728e77a58

Closes #14595

14 months agoCI/azure: disable parallel tests, allow IDN tests
Viktor Szakats [Mon, 19 Aug 2024 07:28:17 +0000 (09:28 +0200)] 
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 0324d557e4b4f754ea89636ea9164065f6446560 #11510

Closes #14593

14 months agocmake/FindNettle: skip `pkg-config` for custom configs
Viktor Szakats [Sat, 17 Aug 2024 22:10:39 +0000 (00:10 +0200)] 
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

14 months agombedtls: fix setting tls version
Jan Venekamp [Mon, 19 Aug 2024 01:59:02 +0000 (03:59 +0200)] 
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

14 months agowolfssl: fix setting tls version
Jan Venekamp [Mon, 19 Aug 2024 02:00:43 +0000 (04:00 +0200)] 
wolfssl: fix setting tls version

The value CURL_SSLVERSION_TLSv1_0 was unsupported.

Closes #14587

14 months agorustls: fix setting tls version
Jan Venekamp [Mon, 19 Aug 2024 02:02:12 +0000 (04:02 +0200)] 
rustls: fix setting tls version

The value CURL_SSLVERSION_TLSv1_0 was unsupported.

Closes #14586

14 months agobearssl: fix setting tls version
Jan Venekamp [Mon, 19 Aug 2024 02:03:16 +0000 (04:03 +0200)] 
bearssl: fix setting tls version

Previously version_max was ignored.

Closes #14585

14 months agoRELEASE-NOTES: synced
Daniel Stenberg [Sun, 18 Aug 2024 20:57:25 +0000 (22:57 +0200)] 
RELEASE-NOTES: synced

14 months agocmake: fix `cmakelint` warnings
Viktor Szakats [Sun, 18 Aug 2024 11:59:31 +0000 (13:59 +0200)] 
cmake: fix `cmakelint` warnings

- keep line lengths below 132 characters.
- fix two "weird indentation" warnings.

Reported-by: Dan Fandrich
Bug: #14580

Closes #14583

14 months agocmake: tidy up more in Find modules
Viktor Szakats [Sat, 17 Aug 2024 21:39:49 +0000 (23:39 +0200)] 
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

14 months agoappveyor: drop uploading artifacts
Viktor Szakats [Sun, 18 Aug 2024 07:26:22 +0000 (09:26 +0200)] 
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

14 months agocmake: tidy up around ngtcp2 and wolfSSL
Viktor Szakats [Fri, 16 Aug 2024 23:41:23 +0000 (01:41 +0200)] 
cmake: tidy up around ngtcp2 and wolfSSL

- fix to add the `m` library without path.
  Follow-up to 8577f4ca084b8a3926b869a48a29d41a810eceb5 #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 8577f4ca084b8a3926b869a48a29d41a810eceb5 #14343

- fix comment header about supported `COMPONENT` names.

- quote strings.

- lowercase local variables.

Closes #14576

14 months agocmake: do not unset the deprecated mixed-case variables
Viktor Szakats [Sat, 17 Aug 2024 20:45:38 +0000 (22:45 +0200)] 
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 9fbda4ca75483ee0a43289526e88d8f1e8ca2a78 #14574

14 months agocmake: rename wolfSSL and zstd config variables to uppercase
Viktor Szakats [Fri, 16 Aug 2024 16:56:49 +0000 (18:56 +0200)] 
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 db39c668a8e33e064b9eb20892cd027f46302f77 #14542

Closes #14574

14 months agolocation: fix typo
Daniel Stenberg [Sat, 17 Aug 2024 19:04:34 +0000 (21:04 +0200)] 
location: fix typo

Follow-up to 5fcf96930efc
Bug: https://github.com/curl/curl/pull/14471#pullrequestreview-2244131475
Reported-by: Joshix-1 on github
14 months agodocs: add description of effect of --location-trusted on cookie
XYenon [Fri, 9 Aug 2024 09:30:40 +0000 (17:30 +0800)] 
docs: add description of effect of --location-trusted on cookie

Closes #14471

14 months agodocs: improve cipher options documentation
Jan Venekamp [Fri, 16 Aug 2024 09:45:26 +0000 (11:45 +0200)] 
docs: improve cipher options documentation

Closes #14407

14 months agoGHA: update github/codeql-action digest to 429e197
renovate[bot] [Wed, 14 Aug 2024 16:54:43 +0000 (16:54 +0000)] 
GHA: update github/codeql-action digest to 429e197

Closes #14425

14 months agoSECURITY: mention OpenSSF best practices gold badge
Viktor Petersson [Tue, 30 Jul 2024 17:24:13 +0000 (18:24 +0100)] 
SECURITY: mention OpenSSF best practices gold badge

Closes #14319

14 months agombedtls: add more informative logging
Justin Maggard [Mon, 5 Aug 2024 17:21:35 +0000 (10:21 -0700)] 
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

14 months agoGHA: update dependency gnutls/gnutls to v3.8.7
renovate[bot] [Thu, 15 Aug 2024 08:18:03 +0000 (08:18 +0000)] 
GHA: update dependency gnutls/gnutls to v3.8.7

Closes #14554

14 months agotransfer: Curl_sendrecv() and event related improvements
Stefan Eissing [Thu, 15 Aug 2024 11:16:53 +0000 (13:16 +0200)] 
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

14 months agocmake: sync up version detection in Find modules
Viktor Szakats [Fri, 16 Aug 2024 13:04:25 +0000 (15:04 +0200)] 
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 c5d506e9bbf0669d7605d1d00865ae7e229b2409 #12200

Follow-up to 4e2f3641f80e233738147d82218317f331369c50 #14548

Closes #14572

14 months agocmake: tidy-up continues
Viktor Szakats [Thu, 15 Aug 2024 08:47:54 +0000 (10:47 +0200)] 
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

14 months agocmake: revert to `pkg_check_modules()`
Viktor Szakats [Fri, 16 Aug 2024 16:19:25 +0000 (18:19 +0200)] 
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 c2889a7b4180fc963ae30811f59ab547b6eb03cd #14388

Closes #14573

14 months agocmake: fixup variable reference in FindZstd
Viktor Szakats [Fri, 16 Aug 2024 17:09:08 +0000 (19:09 +0200)] 
cmake: fixup variable reference in FindZstd

Follow-up to 4e2f3641f80e233738147d82218317f331369c50 #14548

14 months agointernals/SPLAY.md: internal API documentation
Daniel Stenberg [Thu, 15 Aug 2024 14:18:30 +0000 (16:18 +0200)] 
internals/SPLAY.md: internal API documentation

Closes #14563

14 months agocurl: make the progress bar detect terminal width changes
Daniel Stenberg [Fri, 16 Aug 2024 09:15:36 +0000 (11:15 +0200)] 
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