]> git.ipfire.org Git - thirdparty/curl.git/log
thirdparty/curl.git
2 years agohttp: return error when receiving too large header set
Daniel Stenberg [Wed, 2 Aug 2023 21:34:48 +0000 (23:34 +0200)] 
http: return error when receiving too large header set

To avoid abuse. The limit is set to 300 KB for the accumulated size of
all received HTTP headers for a single response. Incomplete research
suggests that Chrome uses a 256-300 KB limit, while Firefox allows up to
1MB.

Closes #11582

2 years agohttp2: upgrade tests and add fix for non-existing stream
Stefan Eissing [Tue, 1 Aug 2023 08:31:58 +0000 (10:31 +0200)] 
http2: upgrade tests and add fix for non-existing stream

- check in h2 filter recv that stream actually exists
  and return error if not
- add test for parallel, extreme h2 upgrades that fail if
  connections get reused before fully switched
- add h2 upgrade upload test just for completeness

Closes #11563

2 years agotests: ensure `libcurl.def` contains all exports
Viktor Szakats [Tue, 1 Aug 2023 22:02:43 +0000 (22:02 +0000)] 
tests: ensure `libcurl.def` contains all exports

Add `test1279` to verify that `libcurl.def` lists all exported API
functions found in libcurl headers.

Also:

- extend test suite XML `stdout` tag with the `loadfile` attribute.

- fix `tests/extern-scan.pl` and `test1135` to include websocket API.

- use all headers (sorted) in `test1135` instead of a manual list.

- add options `--sort`, `--heading=` to `tests/extern-scan.pl`.

- add `libcurl.def` to the auto-labeler GHA task.

Follow-up to 2ebc74c36a19a1700af394c16855ce144d9878e3

Closes #11570

2 years agourl: change default value for CURLOPT_MAXREDIRS to 30
Daniel Stenberg [Wed, 2 Aug 2023 16:03:59 +0000 (18:03 +0200)] 
url: change default value for CURLOPT_MAXREDIRS to 30

It was previously unlimited by default, but that's not a sensible
default. While changing this has a remote risk of breaking an existing
use case, I figure it is more likely to actually save users from loops.

Closes #11581

2 years agolib: fix a few *printf() flag mistakes
Daniel Stenberg [Wed, 2 Aug 2023 14:02:48 +0000 (16:02 +0200)] 
lib: fix a few *printf() flag mistakes

Reported-by: Gisle Vanem
Ref: #11574
Closes #11579

2 years agoopenssl: make aws-lc version support OCSP
Samuel Chiang [Mon, 31 Jul 2023 23:09:39 +0000 (23:09 +0000)] 
openssl: make aws-lc version support OCSP

And bump version in CI

Closes #11568

2 years agotool: make the length argument an int for printf()-.* flags
Daniel Stenberg [Wed, 2 Aug 2023 12:08:26 +0000 (14:08 +0200)] 
tool: make the length argument an int for printf()-.* flags

Closes #11578

2 years agotool_operate: fix memory leak when SSL_CERT_DIR is used
Daniel Stenberg [Wed, 2 Aug 2023 11:29:23 +0000 (13:29 +0200)] 
tool_operate: fix memory leak when SSL_CERT_DIR is used

Detected by Coverity

Follow-up to 29bce9857a12b6cfa726a5

Closes #11577

2 years agotool/var: free memory on OOM
Daniel Stenberg [Wed, 2 Aug 2023 11:20:08 +0000 (13:20 +0200)] 
tool/var: free memory on OOM

Coverity detected this memory leak in OOM situation

Follow-up to 2e160c9c652504e

Closes #11575

2 years agogha: bump libressl and mbedtls versions
Viktor Szakats [Wed, 2 Aug 2023 09:05:54 +0000 (09:05 +0000)] 
gha: bump libressl and mbedtls versions

Closes #11573

2 years agoschannel: fix user-set legacy algorithms in Windows 10 & 11
Jay Satiro [Sun, 19 Mar 2023 08:05:08 +0000 (04:05 -0400)] 
schannel: fix user-set legacy algorithms in Windows 10 & 11

- If the user set a legacy algorithm list (CURLOPT_SSL_CIPHER_LIST) then
  use the SCHANNEL_CRED legacy structure to pass the list to Schannel.

- If the user set both a legacy algorithm list and a TLS 1.3 cipher list
  then abort.

Although MS doesn't document it, Schannel will not negotiate TLS 1.3
when SCHANNEL_CRED is used. That means setting a legacy algorithm list
limits the user to earlier versions of TLS.

Prior to this change, since 8beff435 (precedes 7.85.0), libcurl would
ignore legacy algorithms in Windows 10 1809 and later.

Reported-by: zhihaoy@users.noreply.github.com
Fixes https://github.com/curl/curl/pull/10741
Closes https://github.com/curl/curl/pull/10746

2 years agovariable.d: setting a variable again overwrites it
Daniel Stenberg [Wed, 2 Aug 2023 06:31:21 +0000 (08:31 +0200)] 
variable.d: setting a variable again overwrites it

Reported-by: Niall McGee
Bug: https://twitter.com/niallmcgee/status/1686523075423322113
Closes #11571

2 years agoCURLOPT_PROXY_SSL_OPTIONS.3: sync formatting
Jay Satiro [Wed, 2 Aug 2023 06:06:03 +0000 (02:06 -0400)] 
CURLOPT_PROXY_SSL_OPTIONS.3: sync formatting

- Re-wrap CURLSSLOPT_ALLOW_BEAST description.

2 years agoRELEASE-NOTES: synced
Daniel Stenberg [Wed, 2 Aug 2023 06:37:42 +0000 (08:37 +0200)] 
RELEASE-NOTES: synced

2 years agoresolve: use PF_INET6 family lookups when CURL_IPRESOLVE_V6 is set
Daniel Stenberg [Tue, 1 Aug 2023 14:47:34 +0000 (16:47 +0200)] 
resolve: use PF_INET6 family lookups when CURL_IPRESOLVE_V6 is set

Previously it would always do PF_UNSPEC if CURL_IPRESOLVE_V4 is not
used, thus unnecessarily asking for addresses that will not be used.

Reported-by: Joseph Tharayil
Fixes #11564
Closes #11565

2 years agodocs: link to the website versions instead of markdowns
Daniel Stenberg [Tue, 1 Aug 2023 21:38:16 +0000 (23:38 +0200)] 
docs: link to the website versions instead of markdowns

... to make the links work when the markdown is converted to webpages on
https://curl.se

Reported-by: Maurício Meneghini Fauth
Fixes https://github.com/curl/curl-www/issues/272
Closes #11569

2 years agocmake: cache more config and delete unused ones
Viktor Szakats [Sun, 30 Jul 2023 16:13:02 +0000 (16:13 +0000)] 
cmake: cache more config and delete unused ones

- cache more Windows config results for faster initialization.

- delete unused config macros `HAVE_SYS_UTSNAME_H`, `HAVE_SSL_H`.

- delete dead references to `sys/utsname.h`.

Closes #11551

2 years agoegd: delete feature detection and related source code
Viktor Szakats [Mon, 31 Jul 2023 11:52:44 +0000 (11:52 +0000)] 
egd: delete feature detection and related source code

EGD is Entropy Gathering Daemon, a socket-based entropy source supported
by pre-OpenSSL v1.1 versions and now deprecated. curl also deprecated it
a while ago.

Its detection in CMake was broken all along because OpenSSL libs were
not linked at the point of feature check.

Delete detection from both cmake and autotools, along with the related
source snippet, and the `--with-egd-socket=` `./configure` option.

Closes #11556

2 years agotests: fix h3 server check and parallel instances
Stefan Eissing [Mon, 31 Jul 2023 08:56:00 +0000 (10:56 +0200)] 
tests: fix h3 server check and parallel instances

- fix check for availability of nghttpx server
- add `tcp` frontend config for same port as quic, as
  without this, port 3000 is bound which clashes for parallel
  testing

Closes #11553

2 years agodocs/cmdline-opts: spellfixes, typos and polish
Daniel Stenberg [Tue, 1 Aug 2023 12:11:50 +0000 (14:11 +0200)] 
docs/cmdline-opts: spellfixes, typos and polish

To make them accepted by the spell checker

Closes #11562

2 years agoCI/spellcheck: build curl.1 and spellcheck it
Daniel Stenberg [Tue, 1 Aug 2023 12:11:50 +0000 (14:11 +0200)] 
CI/spellcheck: build curl.1 and spellcheck it

Added acceptable words

Closes #11562

2 years agomisc: fix various typos
Alexander Jaeger [Tue, 1 Aug 2023 09:19:58 +0000 (09:19 +0000)] 
misc: fix various typos

Closes #11561

2 years agohttp2: avoid too early connection re-use/multiplexing
Daniel Stenberg [Mon, 31 Jul 2023 15:27:03 +0000 (17:27 +0200)] 
http2: avoid too early connection re-use/multiplexing

HTTP/1 connections that are upgraded to HTTP/2 should not be picked up
for reuse and multiplexing by other handles until the 101 switching
process is completed.

Lots-of-debgging-by: Stefan Eissing
Reported-by: Richard W.M. Jones
Bug: https://curl.se/mail/lib-2023-07/0045.html
Closes #11557

2 years agoRevert "KNOWN_BUGS: build for iOS simulator on macOS 13.2 with Xcode 14"
Daniel Stenberg [Tue, 1 Aug 2023 08:21:52 +0000 (10:21 +0200)] 
Revert "KNOWN_BUGS: build for iOS simulator on macOS 13.2 with Xcode 14"

This reverts commit 2e8a3d7cb73c85a9aa151e263315f8a496dbb9d4.

It's a user error for supplying incomplete information to the build system.

Reported-by: Ryan Schmidt
Ref: https://github.com/curl/curl/issues/11215#issuecomment-1658729367

2 years agocmake: add support for single libcurl compilation pass
Viktor Szakats [Sun, 30 Jul 2023 12:14:23 +0000 (12:14 +0000)] 
cmake: add support for single libcurl compilation pass

Before this patch CMake builds used two separate compilation passes to
build the shared and static libcurl respectively. This patch allows to
reduce that to a single pass if the target platform and build settings
allow it.

This reduces CMake build times when building both static and shared
libcurl at the same time, making these dual builds an almost zero-cost
option.

Enable this feature for Windows builds, where the difference between the
two passes was the use of `__declspec(dllexport)` attribute for exported
API functions for the shared builds. This patch replaces this method
with the use of `libcurl.def` at DLL link time.

Also update `Makefile.mk` to use `libcurl.def` to export libcurl API
symbols on Windows. This simplifies (or fixes) this build method (e.g.
in curl-for-win, which generated a `libcurl.def` from `.h` files using
an elaborate set of transformations).

`libcurl.def` has the maintenance cost of keeping the list of public
libcurl API symbols up-to-date. This list seldom changes, so the cost
is low.

Closes #11546

2 years agocmake: detect `SSL_set0_wbio` in OpenSSL
Viktor Szakats [Mon, 31 Jul 2023 10:52:56 +0000 (10:52 +0000)] 
cmake: detect `SSL_set0_wbio` in OpenSSL

Present in OpenSSL 1.1.0 and BoringSSL.
Missing from LibreSSL 3.8.0.

Follow-up to f39472ea9f4f4e12cfbc0500c4580a8d52ce4a59

While here, also fix `RAND_egd()` detection which was broken, likely all
along. This feature is probably broken with CMake builds and also
requires a sufficiently obsolete OpenSSL version, so this part of the
update was not tested.

Closes #11555

2 years agocmake: fixup H2 duplicate symbols for unity builds
Viktor Szakats [Mon, 31 Jul 2023 08:09:57 +0000 (08:09 +0000)] 
cmake: fixup H2 duplicate symbols for unity builds

Closes #11550

2 years agoopenssl: Support async cert verify callback
Pablo Busse [Thu, 22 Jun 2023 06:13:07 +0000 (06:13 +0000)] 
openssl: Support async cert verify callback

- Update the OpenSSL connect state machine to handle
  SSL_ERROR_WANT_RETRY_VERIFY.

This allows libcurl users that are using custom certificate validation
to suspend processing while waiting for external I/O during certificate
validation.

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

2 years agotool_cb_wrt: fix invalid unicode for windows console
Jay Satiro [Tue, 4 Apr 2023 09:10:52 +0000 (05:10 -0400)] 
tool_cb_wrt: fix invalid unicode for windows console

- Suppress an incomplete UTF-8 sequence at the end of the buffer.

- Attempt to reconstruct incomplete UTF-8 sequence from prior call(s)
  in current call.

Prior to this change, in Windows console UTF-8 sequences split between
two or more calls to the write callback would cause invalid "replacement
characters" U+FFFD to be printed instead of the actual Unicode
character. This is because in Windows only UTF-16 encoded characters are
printed to the console, therefore we convert the UTF-8 contents to
UTF-16, which cannot be done with partial UTF-8 sequences.

Reported-by: Maksim Arhipov
Fixes https://github.com/curl/curl/issues/9841
Closes https://github.com/curl/curl/pull/10890

2 years agosectransp: prevent CFRelease() of NULL
Daniel Stenberg [Mon, 31 Jul 2023 09:01:51 +0000 (11:01 +0200)] 
sectransp: prevent CFRelease() of NULL

When SecCertificateCopyCommonName() returns NULL, the common_name
pointer remains set to NULL which apparently when calling CFRelease() on
(sometimes?) crashes.

Reported-by: Guillaume Algis
Fixes #9194
Closes #11554

2 years agovtls: clarify "ALPN: offers" message
Jay Satiro [Sun, 30 Jul 2023 02:46:40 +0000 (22:46 -0400)] 
vtls: clarify "ALPN: offers" message

Before:
* ALPN: offers h2,http/1.1

After:
* ALPN: curl offers h2,http/1.1

Bug: https://curl.se/mail/lib-2023-07/0041.html
Reported-by: Richard W.M. Jones
Closes #11544

2 years agourlapi: make sure zoneid is also duplicated in curl_url_dup
Daniel Stenberg [Mon, 31 Jul 2023 08:07:35 +0000 (10:07 +0200)] 
urlapi: make sure zoneid is also duplicated in curl_url_dup

Add several curl_url_dup() tests to the general lib1560 test.

Reported-by: Rutger Broekhoff
Bug: https://curl.se/mail/lib-2023-07/0047.html
Closes #11549

2 years agourlapi: fix heap buffer overflow
Sergey [Mon, 31 Jul 2023 23:27:25 +0000 (23:27 +0000)] 
urlapi: fix heap buffer overflow

`u->path = Curl_memdup(path, pathlen + 1);` accesses bytes after the null-terminator.

```
==2676==ERROR: AddressSanitizer: heap-buffer-overflow on address 0x04d48c75 at pc 0x0112708a bp 0x006fb7e0 sp 0x006fb3c4
READ of size 78 at 0x04d48c75 thread T0
    #0 0x1127089 in __asan_wrap_memcpy D:\a\_work\1\s\src\vctools\asan\llvm\compiler-rt\lib\sanitizer_common\sanitizer_common_interceptors.inc:840
    #1 0x1891a0e in Curl_memdup C:\actions-runner\_work\client\client\third_party\curl\lib\strdup.c:97
    #2 0x18db4b0 in parseurl C:\actions-runner\_work\client\client\third_party\curl\lib\urlapi.c:1297
    #3 0x18db819 in parseurl_and_replace C:\actions-runner\_work\client\client\third_party\curl\lib\urlapi.c:1342
    #4 0x18d6e39 in curl_url_set C:\actions-runner\_work\client\client\third_party\curl\lib\urlapi.c:1790
    #5 0x1877d3e in parseurlandfillconn C:\actions-runner\_work\client\client\third_party\curl\lib\url.c:1768
    #6 0x1871acf in create_conn C:\actions-runner\_work\client\client\third_party\curl\lib\url.c:3403
    #7 0x186d8dc in Curl_connect C:\actions-runner\_work\client\client\third_party\curl\lib\url.c:3888
    #8 0x1856b78 in multi_runsingle C:\actions-runner\_work\client\client\third_party\curl\lib\multi.c:1982
    #9 0x18531e3 in curl_multi_perform C:\actions-runner\_work\client\client\third_party\curl\lib\multi.c:2756
```

Closes #11560

2 years agocurl: make %output{} in -w specify a file to write to
Daniel Stenberg [Sun, 30 Jul 2023 22:00:20 +0000 (00:00 +0200)] 
curl: make %output{} in -w specify a file to write to

It can be used multiple times. Use %output{>>name} to append.

Add docs. Test 990 and 991 verify.

Idea: #11400
Suggested-by: ed0d2b2ce19451f2
Closes #11416

2 years agoRELEASE-NOTES: synced
Daniel Stenberg [Mon, 31 Jul 2023 09:58:26 +0000 (11:58 +0200)] 
RELEASE-NOTES: synced

2 years agotool: add "variable" support
Daniel Stenberg [Mon, 31 Jul 2023 09:50:28 +0000 (11:50 +0200)] 
tool: add "variable" support

Add support for command line variables. Set variables with --variable
name=content or --variable name@file (where "file" can be stdin if set
to a single dash (-)).

Variable content is expanded in option parameters using "{{name}}"
(without the quotes) if the option name is prefixed with
"--expand-". This gets the contents of the variable "name" inserted, or
a blank if the name does not exist as a variable. Insert "{{" verbatim
in the string by prefixing it with a backslash, like "\\{{".

Import an environment variable with --variable %name. It makes curl exit
with an error if the environment variable is not set. It can also rather
get a default value if the variable does not exist, using =content or
@file like shown above.

Example: get the USER environment variable into the URL:

 --variable %USER
 --expand-url = "https://example.com/api/{{USER}}/method"

When expanding variables, curl supports a set of functions that can make
the variable contents more convenient to use. It can trim leading and
trailing white space with "trim", output the contents as a JSON quoted
string with "json", URL encode it with "url" and base 64 encode it with
"b64". To apply functions to a variable expansion, add them colon
separated to the right side of the variable. They are then performed in
a left to right order.

Example: get the contents of a file called $HOME/.secret into a variable
called "fix". Make sure that the content is trimmed and percent-encoded
sent as POST data:

  --variable %HOME=/home/default
  --expand-variable fix@{{HOME}}/.secret
  --expand-data "{{fix:trim:url}}"
  https://example.com/

Documented. Many new test cases.

Co-brainstormed-by: Emanuele Torre
Assisted-by: Jat Satiro
Closes #11346

2 years agoKNOWN_BUGS: cygwin: make install installs curl-config.1 twice
Daniel Stenberg [Mon, 31 Jul 2023 06:55:26 +0000 (08:55 +0200)] 
KNOWN_BUGS: cygwin: make install installs curl-config.1 twice

Closes #8839

2 years agoKNOWN_BUGS: build for iOS simulator on macOS 13.2 with Xcode 14
Daniel Stenberg [Mon, 31 Jul 2023 06:53:55 +0000 (08:53 +0200)] 
KNOWN_BUGS: build for iOS simulator on macOS 13.2 with Xcode 14

Closes #11215

2 years agoKNOWN_BUGS: cmake outputs: no version information available
Daniel Stenberg [Mon, 31 Jul 2023 06:51:32 +0000 (08:51 +0200)] 
KNOWN_BUGS: cmake outputs: no version information available

Closes #11158

2 years agoKNOWN_BUGS: APOP authentication fails on POP3
Daniel Stenberg [Mon, 31 Jul 2023 06:47:22 +0000 (08:47 +0200)] 
KNOWN_BUGS: APOP authentication fails on POP3

Closes #10073

2 years agoKNOWN_BUGS: hyper is slow
Daniel Stenberg [Mon, 31 Jul 2023 06:45:33 +0000 (08:45 +0200)] 
KNOWN_BUGS: hyper is slow

Closes #11203

2 years agoconfigure, cmake, lib: more form api deprecation
Patrick Monnerat [Tue, 15 Nov 2022 16:50:22 +0000 (17:50 +0100)] 
configure, cmake, lib: more form api deprecation

Introduce a --enable-form-api configure option to control its inclusion
in builds. The condition name defined for it is CURL_DISABLE_FORM_API.

Form api code is dependent of MIME: configure and CMake handle this
dependency automatically: CMake by making it a dependent option
explicitly, configure by inheriting the MIME value by default and
rejecting explicit incompatible values.

"form-api" is now a new hidden test feature.

Update libcurl modules to respect this option and adjust tests
accordingly.

Closes #9621

2 years agomailmap: add Derzsi Dániel
Daniel Stenberg [Mon, 31 Jul 2023 06:29:16 +0000 (08:29 +0200)] 
mailmap: add Derzsi Dániel

2 years agowolfssl: support loading system CA certificates
Disyer [Mon, 17 Jul 2023 13:46:34 +0000 (16:46 +0300)] 
wolfssl: support loading system CA certificates

Closes #11452

2 years agonss: delete more NSS references
Viktor Szakats [Sun, 30 Jul 2023 19:12:52 +0000 (19:12 +0000)] 
nss: delete more NSS references

Fix the distcheck CI failure and delete more NSS references.

Follow-up to 7c8bae0d9c9b2dfeeb008b9a316117d7b9675175

Reviewed-by: Marcel Raad
Reviewed-by: Daniel Stenberg
Closes #11548

2 years agonss: remove support for this TLS library
Daniel Stenberg [Sat, 29 Jul 2023 21:44:28 +0000 (23:44 +0200)] 
nss: remove support for this TLS library

Closes #11459

2 years agomacOS: fix target detection more
Ryan Schmidt [Tue, 25 Jul 2023 09:32:59 +0000 (04:32 -0500)] 
macOS: fix target detection more

Now SCDynamicStoreCopyProxies is called (and the required frameworks are
linked in) on all versions of macOS and only on macOS. Fixes crash due
to undefined symbol when built with the macOS 10.11 SDK or earlier.

CURL_OSX_CALL_COPYPROXIES is renamed to CURL_MACOS_CALL_COPYPROXIES and
is now only defined when SCDynamicStoreCopyProxies will actually be
called. Previously, it was defined when ENABLE_IPV6 was not defined but
SCDynamicStoreCopyProxies is not called in that case.

TARGET_OS_OSX is only defined in the macOS 10.12 SDK and later and only
when dynamic targets are enabled. TARGET_OS_MAC is always defined but
means any Mac OS or derivative including macOS, iOS, tvOS, and watchOS.
TARGET_OS_IPHONE means any Darwin OS other than macOS.

Follow-up to c73b2f82

Fixes #11502
Closes #11516

2 years agotool_operate: allow SSL_CERT_FILE and SSL_CERT_DIR
Daniel Stenberg [Thu, 27 Jul 2023 21:36:36 +0000 (23:36 +0200)] 
tool_operate: allow SSL_CERT_FILE and SSL_CERT_DIR

... used at once.

Reported-by: Gabriel Corona
Fixes #11325
Closes #11531

2 years agoCI: remove Lift's configuration
Thomas M. DuBuisson [Sat, 29 Jul 2023 15:11:06 +0000 (08:11 -0700)] 
CI: remove Lift's configuration

The Lift tool is being retired. Their site reads:

"Sonatype Lift will be retiring on Sep 12, 2023, with its analysis
stopping on Aug 12, 2023."

Closes #11541

2 years agoRevert "schannel: reverse the order of certinfo insertions"
Nathan Moinvaziri [Fri, 28 Jul 2023 19:20:09 +0000 (12:20 -0700)] 
Revert "schannel: reverse the order of certinfo insertions"

This reverts commit 8986df802db9b5338d9d50a54232ebae4dbcf6dd.

Windows does not guarantee a particular certificate ordering, even
though TLS may have its own ordering/relationship guarantees. Recent
versions of Windows 11 reversed the ordering of ceritifcates returned by
CertEnumCertificatesInStore, therefore this commit no longer works as
initially intended. libcurl makes no guarantees about certificate
ordering if the operating system can't.

Ref: https://github.com/curl/curl/issues/9706

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

2 years agowinbuild: improve check for static zlib
wangzhikun [Fri, 28 Jul 2023 03:00:06 +0000 (11:00 +0800)] 
winbuild: improve check for static zlib

- Check for zlib static library name zlibstatic.lib.

zlib's static library has a different name depending on how it was
built. zlibstatic.lib is output by cmake. zlibstat.lib is output by
their pre-generated Visual Studio project files (in the contrib
directory) and defines ZLIB_WINAPI (ie it's meant to use stdcall
instead of cdecl if you end up exporting the zlib functions).

Prior to this change the makefile only checked for the latter.

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

2 years agoconfigure: use the pkg-config --libs-only-l flag for libssh2
Daniel Stenberg [Fri, 28 Jul 2023 21:27:20 +0000 (23:27 +0200)] 
configure: use the pkg-config --libs-only-l flag for libssh2

... instead of --libs, as that one also returns -L flags.

Reported-by: Wilhelm von Thiele
Fixes #11538
Closes #11539

2 years agocmake: support building static and shared libcurl in one go
Viktor Szakats [Thu, 22 Jun 2023 09:24:37 +0000 (09:24 +0000)] 
cmake: support building static and shared libcurl in one go

This patch adds the ability to build a static and shared libcurl library
in a single build session. It also adds an option to select which one to
use when building the curl executable.

New build options:
- `BUILD_STATIC_LIBS`. Default: `OFF`.
  Enabled automatically if `BUILD_SHARED_LIBS` is `OFF`.
- `BUILD_STATIC_CURL`. Default: `OFF`.
  Requires `BUILD_STATIC_LIBS` enabled.
  Enabled automatically if building static libcurl only.
- `STATIC_LIB_SUFFIX`. Default: empty.
- `IMPORT_LIB_SUFFIX`. Default: `_imp` if implib filename would collide
  with static lib name (typically with MSVC) in Windows builds.
  Otherwise empty.

Also:

- Stop setting the `CURL_STATICLIB` macro via `curl_config.h`, and pass
  it directly to the compiler. This also allows to delete a condition
  from `tests/server/CMakeLists.txt`.

- Complete a TODO by following the logic used in autotools (also for
  `LIBCURL_NO_SHARED`), and set `-DCURL_STATICLIB` in `Cflags:` of
  `libcurl.pc` for _static-only_ curl builds.

- Convert an existing CI test to build both shared and static libcurl.

Closes #11505

2 years agoCI/awslc: add cache for build awslc library
Stefan Eissing [Fri, 28 Jul 2023 10:46:42 +0000 (12:46 +0200)] 
CI/awslc: add cache for build awslc library

Closes #11535

2 years agoGHA/linux.yml: add caching
Stefan Eissing [Fri, 28 Jul 2023 06:56:50 +0000 (08:56 +0200)] 
GHA/linux.yml: add caching

Closes #11532

2 years agoRELEASE-NOTES: synced
Daniel Stenberg [Thu, 27 Jul 2023 21:58:06 +0000 (23:58 +0200)] 
RELEASE-NOTES: synced

Bump working version to 8.3.0

2 years agourl: remove infof() output for "still name resolving"
Daniel Stenberg [Thu, 27 Jul 2023 15:41:54 +0000 (17:41 +0200)] 
url: remove infof() output for "still name resolving"

The message does not help and might get spewed a lot during times.

Reported-by: yushicheng7788 on github
Fixes #11394
Closes #11529

2 years agoKNOWN_BUGS: cygwin: "WARNING: UNPROTECTED PRIVATE KEY FILE!"
Daniel Stenberg [Thu, 27 Jul 2023 21:43:28 +0000 (23:43 +0200)] 
KNOWN_BUGS: cygwin: "WARNING: UNPROTECTED PRIVATE KEY FILE!"

Closes #11244

2 years agoCI: quiche updates
Stefan Eissing [Thu, 27 Jul 2023 12:26:39 +0000 (14:26 +0200)] 
CI: quiche updates

- remove quiche from standard `linux` workflow
- add mod_h2 caching to quiche workflow
- rename quiche to quiche-linux
- move version definitions into env section

Closes #11528

2 years agohttp2: disable asssertion blocking OSSFuzz testing
Stefan Eissing [Tue, 25 Jul 2023 15:14:21 +0000 (17:14 +0200)] 
http2: disable asssertion blocking OSSFuzz testing

- not clear how this triggers and it blocks OSSFuzz testing other
  things. Since we handle the case with an error return, disabling the
  assertion for now seems the best way forward.

Fixes #11500
Closes #11519

2 years agohttp2: fix in h2 proxy tunnel: progress in ingress on sending
Stefan Eissing [Thu, 27 Jul 2023 10:59:03 +0000 (12:59 +0200)] 
http2: fix in h2 proxy tunnel: progress in ingress on sending

- depending on what is tunneled, the proxy may never get invoked for
  receiving data explicitly. Not progressing ingress may lead to stalls
  due to missed WINDOW_UPDATEs.

CI:
- add a chache for building mod_h2

Closes #11527

2 years agoCI ngtcp2+quictls: use nghttpx cache as in quiche build
Stefan Eissing [Thu, 27 Jul 2023 07:55:36 +0000 (09:55 +0200)] 
CI ngtcp2+quictls: use nghttpx cache as in quiche build

2 years agobearssl: don't load CA certs when peer verification is disabled
Jay Satiro [Fri, 21 Jul 2023 07:26:14 +0000 (03:26 -0400)] 
bearssl: don't load CA certs when peer verification is disabled

We already do this for other SSL backends.

Bug: https://github.com/curl/curl/pull/11457#issuecomment-1644587473
Reported-by: kyled-dell@users.noreply.github.com
Closes https://github.com/curl/curl/pull/11497

2 years agoeasy: remove #ifdefs to make code easier on the eye
Daniel Stenberg [Wed, 26 Jul 2023 16:23:52 +0000 (18:23 +0200)] 
easy: remove #ifdefs to make code easier on the eye

Closes #11525

2 years agoGHA: adding quiche workflow
Stefan Eissing [Tue, 25 Jul 2023 13:38:42 +0000 (15:38 +0200)] 
GHA: adding quiche workflow

- adding separate quiche workflow to also build nghttpx server for testing

Closes #11517

2 years agoRELEASE-NOTES: synced curl-8_2_1
Daniel Stenberg [Wed, 26 Jul 2023 06:10:40 +0000 (08:10 +0200)] 
RELEASE-NOTES: synced

curl 8.2.1 release

2 years agoTHANKS: add contributors from 8.2.1
Daniel Stenberg [Wed, 26 Jul 2023 06:10:40 +0000 (08:10 +0200)] 
THANKS: add contributors from 8.2.1

2 years agodocs: provide more see also for cipher options
Daniel Stenberg [Tue, 25 Jul 2023 08:28:18 +0000 (10:28 +0200)] 
docs: provide more see also for cipher options

More cross references. Hide nroff errors.

Closes #11513

2 years agodocs: mark two TLS options for TLS, not SSL
Daniel Stenberg [Tue, 25 Jul 2023 08:31:42 +0000 (10:31 +0200)] 
docs: mark two TLS options for TLS, not SSL

Closes #11514

2 years agocurl_multi_wait.3: fix arg quoting to doc macro .BR
bch [Mon, 24 Jul 2023 22:31:50 +0000 (15:31 -0700)] 
curl_multi_wait.3: fix arg quoting to doc macro .BR

Closes #11511

2 years agoRELEASE-NOTES: synced
Daniel Stenberg [Mon, 24 Jul 2023 21:03:23 +0000 (23:03 +0200)] 
RELEASE-NOTES: synced

2 years agocmake: update ngtcp2 detection
Viktor Szakats [Mon, 24 Jul 2023 12:42:56 +0000 (12:42 +0000)] 
cmake: update ngtcp2 detection

Replace `OpenSSL` with `quictls` to follow the same change
in the v0.17.0 ngtcp2 release.

Follow-up to e0093b4b732f6495b0fb1cd6747cbfedcdcf63ed

Closes #11508

2 years agohttp: VLH, very large header test and fixes
Stefan Eissing [Mon, 24 Jul 2023 13:38:04 +0000 (15:38 +0200)] 
http: VLH, very large header test and fixes

- adding tests using very large passwords in auth
- fixes general http sending to treat h3 like h2, and
  not like http1.1
- eliminate H2_HEADER max definitions and use the commmon
  DYN_HTTP_REQUEST everywhere, different limits do not help
- fix http2 handling of requests denied by nghttp2 on send
  to immediately report the refused stream

Closes #11509

2 years agoCONTRIBUTE: drop mention of copyright year ranges
Andrei Rybak [Sun, 23 Jul 2023 21:33:45 +0000 (23:33 +0200)] 
CONTRIBUTE: drop mention of copyright year ranges

Year ranges in copyrights were dropped in commits [1] and [2].
Verification of year ranges in copyrights was dropped from script
'scripts/copyright.pl' in commit [3].  However, the corresponding
passages in file 'docs/CONTRIBUTE.md' weren't updated.

Drop mentions of copyright year ranges from 'docs/CONTRIBUTE.md'.

[1] 2bc1d775f (copyright: update all copyright lines and remove year
    ranges, 2023-01-02)
[2] c46761bd8 (tests/http: remove year ranges from copyrights,
    2023-03-14)
[3] 0e293bacb (copyright.pl: cease doing year verifications, 2023-01-28)

Closes #11504

2 years agoCONTRIBUTE: fix syntax in commit message description
Andrei Rybak [Sun, 23 Jul 2023 21:32:45 +0000 (23:32 +0200)] 
CONTRIBUTE: fix syntax in commit message description

File 'docs/CONTRIBUTE.md' includes a description of how one should write
commit messages in the curl project.  Different possible parts of the
message are enclosed in square brackets.  One exception is the section
describing how the curl project doesn't use "Signed-off-by" commit
trailers [1], which is enclosed in an opening curly brace paired with a
closing square bracket.

Fix the enclosing square brackets in description of "Signed-off-by"
trailers in commit messages in file 'docs/CONTRIBUTE.md'.

[1] See description of option '--signoff' in Git documentation:
    https://git-scm.com/docs/git-commit

Closes #11504

2 years agosrc/mkhelp: strip off escape sequences
Daniel Stenberg [Sun, 23 Jul 2023 14:27:57 +0000 (16:27 +0200)] 
src/mkhelp: strip off escape sequences

At some point the nroff command stopped stripping off escape sequences,
so then this script needs to do the job instead.

Reported-by: VictorVG on github
Fixes #11501
Closes #11503

2 years agoKNOWN_BUGS: building for old macOS fails with gcc
Daniel Stenberg [Sun, 23 Jul 2023 15:00:29 +0000 (17:00 +0200)] 
KNOWN_BUGS: building for old macOS fails with gcc

Closes #11441

2 years agorustls: update rustls-ffi 0.10.0
Jacob Hoffman-Andrews [Wed, 29 Mar 2023 21:01:55 +0000 (14:01 -0700)] 
rustls: update rustls-ffi 0.10.0

This brings in version 0.21.0 of the upstream rustls implementation,
which notable includes support for IP address certificates.

Closes #10865

2 years agowebsocket: rename arguments/variables to match docs
bch [Thu, 20 Jul 2023 22:03:16 +0000 (15:03 -0700)] 
websocket: rename arguments/variables to match docs

Pedantry/semantic-alignment between functions, docs, comments with
respect to websocket protocol code; No functional change intended.

* "totalsize", "framesize" becomes "fragsize" (we deal in frame fragments).

* "sendflags" becomes "flags"

* use canonical CURL *handle

Closes #11493

2 years agobug_report: use issue forms instead of markdown template
Jan Macku [Wed, 19 Jul 2023 14:31:11 +0000 (16:31 +0200)] 
bug_report: use issue forms instead of markdown template

Issue forms allow you to define web-like input forms using YAML
syntax. It allows you to guide the reporter to get the required
information.

Signed-off-by: Jan Macku <jamacku@redhat.com>
Closes #11474

2 years agoTODO: Obey Retry-After in redirects
Daniel Stenberg [Fri, 21 Jul 2023 11:53:47 +0000 (13:53 +0200)] 
TODO: Obey Retry-After in redirects

(remove "Set custom client ip when using haproxy protocol" which was
shipped in 8.2.0)

Mentioned-by: Yair Lenga
Closes #11447

2 years agoRELEASE-NOTES: synced
Daniel Stenberg [Fri, 21 Jul 2023 10:47:47 +0000 (12:47 +0200)] 
RELEASE-NOTES: synced

2 years agoamissl: fix AmiSSL v5 detection
Futaura [Wed, 19 Jul 2023 18:49:09 +0000 (19:49 +0100)] 
amissl: fix AmiSSL v5 detection

Due to changes in the AmiSSL SDK, the detection needed adjusting.

Closes #11477

2 years agounittest/makefile: remove unneeded unit1621_LDADD
Alois Klink [Thu, 20 Jul 2023 00:10:02 +0000 (01:10 +0100)] 
unittest/makefile: remove unneeded unit1621_LDADD

The `unit1621_LDADD` variable has the exact same value as the `LDADD`
flag in `Makefile.am`, except without `@LDFLAGS@ @LIBCURL_LIBS@`.

This was originally added by [98e6629][], but I can't see any reason
why it exists, so we should remove it to clean things up.

[98e6629]: https://github.com/curl/curl/commit/98e6629154044e4ab1ee7cff8351c7ebcb131e88

Closes #11494

2 years agounittest/makefile: remove unneeded unit1394_LDADD
Alois Klink [Wed, 19 Jul 2023 23:42:38 +0000 (00:42 +0100)] 
unittest/makefile: remove unneeded unit1394_LDADD

These custom `unit1394_LDADD` and similar automake overrides are no
longer neded. They were originally added by added by [8dac7be][] for
metalink support, but are no longer after [265b14d][] removed metalink.

[8dac7be]: https://github.com/curl/curl/commit/8dac7be438512a8725d3c71e9139bdfdcac1ed8c
[265b14d]: https://github.com/curl/curl/commit/265b14d6b37c4298bd5556fabcbc37d36f911693

Closes #11494

2 years agocmake: add `libcurlu`/`libcurltool` for unit tests
Alois Klink [Sun, 16 Jul 2023 05:32:45 +0000 (06:32 +0100)] 
cmake: add `libcurlu`/`libcurltool` for unit tests

Add a `libcurlu`/`libcurltool` static library that is compiled only for
unit tests. We use `EXCLUDE_FROM_ALL` to make sure that they're not
built by default, they're only built if unit tests are built.

These libraries allow us to compile every unit test with CMake.

Closes #11446

2 years agotest979: test -u with redirect to (the same) absolute host
Daniel Stenberg [Thu, 20 Jul 2023 21:20:50 +0000 (23:20 +0200)] 
test979: test -u with redirect to (the same) absolute host

Verifies #11492

2 years agotransfer: do not clear the credentials on redirect to absolute URL
Daniel Stenberg [Thu, 20 Jul 2023 21:28:19 +0000 (23:28 +0200)] 
transfer: do not clear the credentials on redirect to absolute URL

Makes test 979 work. Regression shipped in 8.2.0 from commit
dd4d1a26959f63a2c

Fixes #11486
Reported-by: Cloudogu Siebels
Closes #11492

2 years agoos400: correct EXPECTED_STRING_LASTZEROTERMINATED
Jon Rumsey [Wed, 19 Jul 2023 13:49:34 +0000 (14:49 +0100)] 
os400: correct EXPECTED_STRING_LASTZEROTERMINATED

Correct EXPECTED_STRING_LASTZEROTERMINATED to account for
CURLOPT_HAPROXY_CLIENT_IP which requires EBCDIC to ASCII conversion when
passed into curl_easy_setopt().

Closes #11476

2 years agoamissl: add missing signal.h include
Futaura [Wed, 19 Jul 2023 18:54:40 +0000 (19:54 +0100)] 
amissl: add missing signal.h include

In some environments, signal.h is already included, but not in others
which cause compilation to fail, so explictly include it.

Closes #11478

2 years agoamigaos: fix sys/mbuf.h m_len macro clash
Futaura [Wed, 19 Jul 2023 18:58:44 +0000 (19:58 +0100)] 
amigaos: fix sys/mbuf.h m_len macro clash

The updated Curl_http_req_make and Curl_http_req_make2 functions spawned
a parameter called m_len. The AmigaOS networking headers, derived from
NetBSD, contain "#define m_len m_hdr.mh_len" which clashes with
this. Since we do not actually use mbuf, force the include file to be
ignored, removing the clash.

Closes #11479

2 years agosocks: print ipv6 address within brackets
Daniel Stenberg [Thu, 20 Jul 2023 09:14:37 +0000 (11:14 +0200)] 
socks: print ipv6 address within brackets

Fixes #11483
Closes #11484

2 years agolibcurl-errors.3: add CURLUE_OK
MonkeybreadSoftware [Thu, 20 Jul 2023 11:45:14 +0000 (13:45 +0200)] 
libcurl-errors.3: add CURLUE_OK

Closes #11488

2 years agocfilters: rename close/connect functions to avoid clashes
Futaura [Thu, 20 Jul 2023 17:07:49 +0000 (18:07 +0100)] 
cfilters: rename close/connect functions to avoid clashes

Rename `close` and `connect` in `struct Curl_cftype` for
consistency and to avoid clashes with macros of the same name
(the standard AmigaOS networking connect() function is implemented
via a macro).

Closes #11491

2 years agohttp2: fix regression on upload EOF handling
Stefan Eissing [Thu, 20 Jul 2023 11:08:00 +0000 (13:08 +0200)] 
http2: fix regression on upload EOF handling

- a regression introduced by c9ec85121110d7cbbbed2990024222c8f5b8afe5
  where optimization of small POST bodies leads to a new code path
  for such uploads that did not trigger the "done sending" event
- add triggering this event for early "upload_done" situations

Fixes #11485
Closes #11487
Reported-by: Aleksander Mazur
2 years agoconfigure: check for nghttp2_session_get_stream_local_window_size
Daniel Stenberg [Wed, 19 Jul 2023 13:48:05 +0000 (15:48 +0200)] 
configure: check for nghttp2_session_get_stream_local_window_size

The http2 code uses it now. Introduced in nghttp2 1.15.0 (Sep 2016)

Fixes #11470
Reported-by: Paul Howarth
Closes #11473

2 years agoquiche: fix segfault and other things
Stefan Eissing [Wed, 19 Jul 2023 08:42:07 +0000 (10:42 +0200)] 
quiche: fix segfault and other things

- refs #11449 where a segfault is reported when IP Eyeballing did
  not immediately connect but made several attempts
- The transfer initiating the eyeballing was initialized  too early,
  leadding to references to the filter instance that was then
  replaced in the subsequent eyeball attempts. That led to a use
  after free in the buffer handling for the transfer
- transfers are initiated now more lazy (like in the ngtcp2 filter),
  when the stream is actually opened
- suppress reporting on quiche event errors for "other" transfers
  than the current one to not fail a transfer due to faults in
  another one.
- revert recent return value handling for quiche_h3_recv_body()
  to not indicate an error but an EAGAIN situation. We wish quiche
  would document what functions return.

Fixes #11449
Closes #11469
Reported-by: ウさん
2 years agohostip: return IPv6 first for localhost resolves
Daniel Stenberg [Wed, 19 Jul 2023 07:17:15 +0000 (09:17 +0200)] 
hostip: return IPv6 first for localhost resolves

Fixes #11465
Reported-by: Chilledheart on github
Closes #11466

2 years agotool: fix tool_seek_cb build when SIZEOF_CURL_OFF_T > SIZEOF_OFF_T
Harry Sintonen [Wed, 19 Jul 2023 08:22:15 +0000 (11:22 +0300)] 
tool: fix tool_seek_cb build when SIZEOF_CURL_OFF_T > SIZEOF_OFF_T

- a variable was renamed, and some use of it wasn't. this fixes the
  build.

Closes #11468

2 years agoquiche: fix lookup of transfer at multi
Stefan Eissing [Tue, 18 Jul 2023 15:37:58 +0000 (17:37 +0200)] 
quiche: fix lookup of transfer at multi

- refs #11449 where weirdness in quiche multi connection tranfers was
  observed
- fixes lookup of transfer for a quiche event to take the connection
  into account
- formerly, a transfer with the same stream_id, but on another connection
  could be found

Closes #11462