]> git.ipfire.org Git - thirdparty/curl.git/log
thirdparty/curl.git
2 years agogen: escape more minus
Daniel Stenberg [Fri, 11 Aug 2023 15:01:34 +0000 (17:01 +0200)] 
gen: escape more minus

Detected since it was still hard to search for option names using dashes
in the middle in the man page.

Closes #11660

2 years agocookie-jar.d: enphasize that this option is ONLY writing cookies
Daniel Stenberg [Fri, 11 Aug 2023 15:04:37 +0000 (17:04 +0200)] 
cookie-jar.d: enphasize that this option is ONLY writing cookies

Reported-by: Dan Jacobson
Tweaked-by: Jay Satiro
Ref: #11642
Closes #11661

2 years agodocs/HYPER.md: document a workaround for a link error
Nicholas Nethercote [Fri, 11 Aug 2023 06:47:21 +0000 (16:47 +1000)] 
docs/HYPER.md: document a workaround for a link error

Closes #11653

2 years agoschannel: verify hostname independent of verify cert
Jay Satiro [Thu, 8 Dec 2022 06:26:13 +0000 (01:26 -0500)] 
schannel: verify hostname independent of verify cert

Prior to this change when CURLOPT_SSL_VERIFYPEER (verifypeer) was off
and CURLOPT_SSL_VERIFYHOST (verifyhost) was on we did not verify the
hostname in schannel code.

This fixes KNOWN_BUG 2.8 "Schannel disable CURLOPT_SSL_VERIFYPEER and
verify hostname". We discussed a fix several years ago in #3285 but it
went stale.

Assisted-by: Daniel Stenberg
Bug: https://curl.haxx.se/mail/lib-2018-10/0113.html
Reported-by: Martin Galvan
Ref: https://github.com/curl/curl/pull/3285

Fixes https://github.com/curl/curl/issues/3284
Closes https://github.com/curl/curl/pull/10056

2 years agocurl_quiche: remove superfluous NULL check
Daniel Stenberg [Fri, 11 Aug 2023 09:12:45 +0000 (11:12 +0200)] 
curl_quiche: remove superfluous NULL check

'stream' is always non-NULL at this point

Pointed out by Coverity

Closes #11656

2 years agocurl/urlapi.h: tiny typo
Daniel Stenberg [Fri, 11 Aug 2023 07:17:11 +0000 (09:17 +0200)] 
curl/urlapi.h: tiny typo

2 years agogithub/labeler: make HYPER.md set Hyper and not TLS
Daniel Stenberg [Fri, 11 Aug 2023 06:59:26 +0000 (08:59 +0200)] 
github/labeler: make HYPER.md set Hyper and not TLS

2 years agodocs/cmdline-opts/gen.pl: hide "added in" before 7.50.0
Daniel Stenberg [Thu, 10 Aug 2023 11:38:49 +0000 (13:38 +0200)] 
docs/cmdline-opts/gen.pl: hide "added in" before 7.50.0

7.50.0 shipped on Jul 21 2016, over seven years ago. We no longer need
to specify version changes for earlier releases in the generated output.

This ups the limit from the previous 7.30.0 (Apr 12 2013)

This hides roughly 35 "added in" mentions.

Closes #11651

2 years agobug_report: require reporters to specify curl and os versions
Jay Satiro [Wed, 9 Aug 2023 06:48:11 +0000 (02:48 -0400)] 
bug_report: require reporters to specify curl and os versions

- Change curl version and os sections from single-line input to
  multi-line textarea.

- Require curl version and os sections to be filled out before report
  can be submitted.

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

2 years agogen.pl: replace all single quotes with aq
Daniel Stenberg [Wed, 9 Aug 2023 15:58:34 +0000 (17:58 +0200)] 
gen.pl: replace all single quotes with aq

- this prevents man from using a unicode sequence for them
- which then allows search to work properly

Closes #11645

2 years agocmake: fix to use variable for the curl namespace
Viktor Szakats [Tue, 8 Aug 2023 13:03:58 +0000 (13:03 +0000)] 
cmake: fix to use variable for the curl namespace

Replace (wrong) literal with a variable to specify the curl
namespace.

Follow-up to 1199308dbc902c52be67fc805c72dd2582520d30 #11505

Reported-by: balikalina on Github
Fixes https://github.com/curl/curl/commit/1199308dbc902c52be67fc805c72dd2582520d30#r123923098
Closes #11629

2 years agocmake: allow `SHARE_LIB_OBJECT=ON` on all platforms
Viktor Szakats [Tue, 8 Aug 2023 11:45:26 +0000 (11:45 +0000)] 
cmake: allow `SHARE_LIB_OBJECT=ON` on all platforms

2ebc74c36a19a1700af394c16855ce144d9878e3 #11546 introduced sharing
libcurl objects for shared and static targets.

The above automatically enabled for Windows builds, with an option to
disable with `SHARE_LIB_OBJECT=OFF`.

This patch extend this feature to all platforms as a manual option.
You can enable it by setting `SHARE_LIB_OBJECT=ON`. Then shared objects
are built in PIC mode, meaning the static lib will also have PIC code.

[EXPERIMENTAL]

Closes #11627

2 years agocmake: assume `wldap32` availability on Windows
Viktor Szakats [Tue, 8 Aug 2023 09:41:20 +0000 (09:41 +0000)] 
cmake: assume `wldap32` availability on Windows

This system library first shipped with Windows ME, available as an extra
install for some older releases (according to [1]). The import library
was present already in old MinGW 3.4.2 (year 2007).

Drop the feature check and its associated `HAVE_WLDAP32` variable.

To manually disable `wldap32`, you can use the `USE_WIN32_LDAP=OFF`
CMake option, like before.

[1]: https://dlcdn.apache.org/httpd/binaries/win32/LEGACY.html

Reviewed-by: Jay Satiro
Closes #11624

2 years agopage-header: move up a URL paragraph from GLOBBING to URL
Daniel Stenberg [Wed, 9 Aug 2023 08:49:36 +0000 (10:49 +0200)] 
page-header: move up a URL paragraph from GLOBBING to URL

2 years agovariable.d: output the function names table style
Daniel Stenberg [Wed, 9 Aug 2023 08:37:18 +0000 (10:37 +0200)] 
variable.d: output the function names table style

Also correct the url function name in the header

Closes #11641

2 years agohaproxy-clientip.d: remove backticks
Daniel Stenberg [Wed, 9 Aug 2023 08:17:53 +0000 (10:17 +0200)] 
haproxy-clientip.d: remove backticks

This is not markdown

Follow-up to 0a75964d0d94a4

Closes #11639

2 years agoRELEASE-NOTES: synced
Daniel Stenberg [Wed, 9 Aug 2023 07:58:43 +0000 (09:58 +0200)] 
RELEASE-NOTES: synced

2 years agogen.pl: escape all dashes (ascii minus) to avoid unicode hyphens
Daniel Stenberg [Wed, 9 Aug 2023 07:00:23 +0000 (09:00 +0200)] 
gen.pl: escape all dashes (ascii minus) to avoid unicode hyphens

Reported-by: FC Stegerman
Fixes #11635
Closes #11637

2 years agocmdline-opts/page-header: reorder, clean up
Daniel Stenberg [Wed, 9 Aug 2023 07:26:18 +0000 (09:26 +0200)] 
cmdline-opts/page-header: reorder, clean up

- removed some unnecessary blurb to focus
- moved up the more important URL details
- put "globbing" into its own subtitle and moved down a little
- mention the online man page in the version section

Closes #11638

2 years agoc-hyper: adjust the hyper to curlcode conversion
Daniel Stenberg [Tue, 8 Aug 2023 11:19:37 +0000 (13:19 +0200)] 
c-hyper: adjust the hyper to curlcode conversion

Closes #11621

2 years agotest2306: make it use a persistent connection
Daniel Stenberg [Tue, 8 Aug 2023 09:30:17 +0000 (11:30 +0200)] 
test2306: make it use a persistent connection

+ enable verbose already from the start

Closes #11621

2 years agolist-only.d: mention SFTP as supported protocol
eppesuig [Tue, 8 Aug 2023 12:55:43 +0000 (14:55 +0200)] 
list-only.d: mention SFTP as supported protocol

Closes #11628

2 years agorequest.d: use .TP for protocol "labels"
Daniel Stenberg [Tue, 8 Aug 2023 13:44:14 +0000 (15:44 +0200)] 
request.d: use .TP for protocol "labels"

To render the section nicer in man page.

Closes #11630

2 years agocf-haproxy: make CURLOPT_HAPROXY_CLIENT_IP set the *source* IP
Daniel Stenberg [Tue, 8 Aug 2023 11:49:21 +0000 (13:49 +0200)] 
cf-haproxy: make CURLOPT_HAPROXY_CLIENT_IP set the *source* IP

... as documented.

Update test 3201 and 3202 accordingly.

Reported-by: Markus Sommer
Fixes #11619
Closes #11626

2 years agopage-footer: QLOGDIR works with ngtcp2 and quiche
Daniel Stenberg [Tue, 8 Aug 2023 14:12:57 +0000 (16:12 +0200)] 
page-footer: QLOGDIR works with ngtcp2 and quiche

It previously said "both" backends which is confusing as we currently
have three...

Closes #11631

2 years agohttp3: quiche, handshake optimization, trace cleanup
Stefan Eissing [Mon, 7 Aug 2023 11:50:14 +0000 (13:50 +0200)] 
http3: quiche, handshake optimization, trace cleanup

- load x509 store after clienthello
- cleanup of tracing

Closes #11618

2 years agongtcp2: remove dead code
Daniel Stenberg [Tue, 8 Aug 2023 09:36:21 +0000 (11:36 +0200)] 
ngtcp2: remove dead code

'result' is always zero (CURLE_OK) at this point

Detected by Coverity

Closes #11622

2 years agoopenssl: auto-detect `SSL_R_TLSV13_ALERT_CERTIFICATE_REQUIRED`
Viktor Szakats [Mon, 7 Aug 2023 23:06:50 +0000 (23:06 +0000)] 
openssl: auto-detect `SSL_R_TLSV13_ALERT_CERTIFICATE_REQUIRED`

OpenSSL 1.1.1 defines this macro, but no ealier version, or any of the
popular forks (yet). Use the macro itself to detect its presence,
replacing the hard-wired fork-specific conditions.

This way the feature will enable automatically when forks implement it,
while also shorter and possibly requiring less future maintenance.

Follow-up to 94241a9e78397a2aaf89a213e6ada61e7de7ee02 #6721

Reviewed-by: Jay Satiro
Closes #11617

2 years agoopenssl: use `SSL_CTX_set_ciphersuites` with LibreSSL 3.4.1
Viktor Szakats [Mon, 7 Aug 2023 23:02:46 +0000 (23:02 +0000)] 
openssl: use `SSL_CTX_set_ciphersuites` with LibreSSL 3.4.1

LibreSSL 3.4.1 (2021-10-14) added support for
`SSL_CTX_set_ciphersuites`.

Ref: https://ftp.openbsd.org/pub/OpenBSD/LibreSSL/libressl-3.4.1-relnotes.txt

Reviewed-by: Jay Satiro
Closes #11616

2 years agoopenssl: use `SSL_CTX_set_keylog_callback` with LibreSSL 3.5.0
Viktor Szakats [Mon, 7 Aug 2023 22:34:26 +0000 (22:34 +0000)] 
openssl: use `SSL_CTX_set_keylog_callback` with LibreSSL 3.5.0

LibreSSL 3.5.0 (2022-02-24) added support for
`SSL_CTX_set_keylog_callback`.

Ref: https://ftp.openbsd.org/pub/OpenBSD/LibreSSL/libressl-3.5.0-relnotes.txt

Reviewed-by: Jay Satiro
Closes #11615

2 years agocmake: drop `HAVE_LIBWINMM` and `HAVE_LIBWS2_32` feature checks
Viktor Szakats [Mon, 7 Aug 2023 19:50:11 +0000 (19:50 +0000)] 
cmake: drop `HAVE_LIBWINMM` and `HAVE_LIBWS2_32` feature checks

- `HAVE_LIBWINMM` was detected but unused. The `winmm` system library is
  also not used by curl, but it is by its optional dependency `librtmp`.
  Change the logic to always add `winmm` when `USE_LIBRTMP` is set. This
  library has been available since the early days of Windows.

- `HAVE_LIBWS2_32` detected `ws2_32` lib on Windows. This lib is present
  since Windows 95 OSR2 (AFAIR). Winsock1 already wasn't supported and
  other existing logic already assumed this lib being present, so delete
  the check and replace the detection variable with `WIN32` and always
  add `ws2_32` on Windows.

Closes #11612

2 years agocrypto: ensure crypto initialization works
Daniel Gustafsson [Fri, 10 Mar 2023 09:01:44 +0000 (10:01 +0100)] 
crypto: ensure crypto initialization works

Make sure that context initialization during hash setup works to avoid
going forward with the risk of a null pointer dereference.

Reported-by: Philippe Antoine on HackerOne
Assisted-by: Jay Satiro
Assisted-by: Daniel Stenberg
Closes #11614

2 years agoopenssl: switch to modern init for LibreSSL 2.7.0+
Viktor Szakats [Mon, 7 Aug 2023 16:32:46 +0000 (16:32 +0000)] 
openssl: switch to modern init for LibreSSL 2.7.0+

LibreSSL 2.7.0 (2018-03-21) introduced automatic initialization,
`OPENSSL_init_ssl()` function and deprecated the old, manual init
method, as seen in OpenSSL 1.1.0. Switch to the modern method when
available.

Ref: https://ftp.openbsd.org/pub/OpenBSD/LibreSSL/libressl-2.7.0-relnotes.txt

Reviewed-by: Daniel Stenberg
Closes #11611

2 years agogskit: remove
Daniel Stenberg [Mon, 7 Aug 2023 11:02:32 +0000 (13:02 +0200)] 
gskit: remove

We remove support for building curl with gskit.

 - This is a niche TLS library, only running on some IBM systems
 - no regular curl contributors use this backend
 - no CI builds use or verify this backend
 - gskit, or the curl adaption for it, lacks many modern TLS features
   making it an inferior solution
 - build breakages in this code take weeks or more to get detected
 - fixing gskit code is mostly done "flying blind"

This removal has been advertized in DEPRECATED in Jan 2, 2023 and it has
been mentioned on the curl-library mailing list.

It could be brought back, this is not a ban. Given proper effort and
will, gskit support is welcome back into the curl TLS backend family.

Closes #11460

2 years agoRELEASE-NOTES: synced
Daniel Stenberg [Mon, 7 Aug 2023 18:39:32 +0000 (20:39 +0200)] 
RELEASE-NOTES: synced

2 years agoTHANKS-filter: add a name typo
Dan Fandrich [Mon, 7 Aug 2023 16:12:42 +0000 (09:12 -0700)] 
THANKS-filter: add a name typo

2 years agohttp3/ngtcp2: shorten handshake, trace cleanup
Stefan Eissing [Mon, 7 Aug 2023 09:42:23 +0000 (11:42 +0200)] 
http3/ngtcp2: shorten handshake, trace cleanup

- shorten handshake timing by delayed x509 store load (OpenSSL)
  as we do for HTTP/2
- cleanup of trace output, align with HTTP/2 output

Closes #11609

2 years agoheaders: accept leading whitespaces on first response header
Daniel Stenberg [Mon, 7 Aug 2023 10:45:45 +0000 (12:45 +0200)] 
headers: accept leading whitespaces on first response header

This is a bad header fold but since the popular browsers accept this
violation, so does curl now. Unless built with hyper.

Add test 1473 to verify and adjust test 2306.

Reported-by: junsik on github
Fixes #11605
Closes #11607

2 years agoinclude/curl/mprintf.h: add __attribute__ for the prototypes
Daniel Stenberg [Sun, 6 Aug 2023 20:28:01 +0000 (22:28 +0200)] 
include/curl/mprintf.h: add __attribute__ for the prototypes

- if gcc or clang is used
- if __STDC_VERSION__ >= 199901L, which means greater than C90
- if not using mingw
- if CURL_NO_FMT_CHECKS is not defined

Closes #11589

2 years agotests: fix bad printf format flags in test code
Daniel Stenberg [Sun, 6 Aug 2023 20:29:40 +0000 (22:29 +0200)] 
tests: fix bad printf format flags in test code

2 years agotests: fix header scan tools for attribute edits in mprintf.h
Daniel Stenberg [Sun, 6 Aug 2023 20:29:11 +0000 (22:29 +0200)] 
tests: fix header scan tools for attribute edits in mprintf.h

2 years agocf-socket: log successful interface bind
Daniel Stenberg [Mon, 7 Aug 2023 07:58:47 +0000 (09:58 +0200)] 
cf-socket: log successful interface bind

When the setsockopt SO_BINDTODEVICE operation succeeds, output that in
the verbose output.

Ref: #11599
Closes #11608

2 years agoCURLOPT_SSL_VERIFYPEER.3: mention it does not load CA certs when disabled
Daniel Stenberg [Mon, 7 Aug 2023 06:30:19 +0000 (08:30 +0200)] 
CURLOPT_SSL_VERIFYPEER.3: mention it does not load CA certs when disabled

Ref: #11457
Closes #11606

2 years agoCURLOPT_SSL_VERIFYPEER.3: add two more see also options
Daniel Stenberg [Sun, 6 Aug 2023 21:24:32 +0000 (23:24 +0200)] 
CURLOPT_SSL_VERIFYPEER.3: add two more see also options

CURLINFO_CAINFO and CURLINFO_CAPATH

Closes #11603

2 years agoKNOWN_BUGS: aws-sigv4 does not behave well with AWS VPC Lattice
Daniel Stenberg [Sun, 6 Aug 2023 21:38:28 +0000 (23:38 +0200)] 
KNOWN_BUGS: aws-sigv4 does not behave well with AWS VPC Lattice

Closes #11007

2 years agoCI: use openssl 3.0.10+quic, nghttp3 0.14.0, ngtcp2 0.18.0
Graham Campbell [Fri, 4 Aug 2023 09:51:06 +0000 (10:51 +0100)] 
CI: use openssl 3.0.10+quic, nghttp3 0.14.0, ngtcp2 0.18.0

Closes #11585

2 years agoTODO: add *5* entries for aws-sigv4
Daniel Stenberg [Sun, 6 Aug 2023 21:04:57 +0000 (23:04 +0200)] 
TODO: add *5* entries for aws-sigv4

Closes #7559
Closes #8107
Closes #8810
Closes #9717
Closes #10129

2 years agoTODO: LDAP Certificate-Based Authentication
Daniel Stenberg [Sun, 6 Aug 2023 20:58:42 +0000 (22:58 +0200)] 
TODO: LDAP Certificate-Based Authentication

Closes #9641

2 years agohttp2: cleanup trace messages
Stefan Eissing [Fri, 4 Aug 2023 09:35:03 +0000 (11:35 +0200)] 
http2: cleanup trace messages

- more compact format with bracketed stream id
- all frames traced in and out

Closes #11592

2 years agotests/tftpd+mqttd: make variables static to silence picky warnings
Daniel Stenberg [Fri, 4 Aug 2023 12:43:16 +0000 (14:43 +0200)] 
tests/tftpd+mqttd: make variables static to silence picky warnings

Closes #11594

2 years agodocs/cmdline: remove repeated working for negotiate + ntlm
Daniel Stenberg [Fri, 4 Aug 2023 14:34:25 +0000 (16:34 +0200)] 
docs/cmdline: remove repeated working for negotiate + ntlm

The extra wording is added automatically by the gen.pl tool

Closes #11597

2 years agodocs/cmdline: add small "warning" to verbose options
Daniel Stenberg [Fri, 4 Aug 2023 14:07:16 +0000 (16:07 +0200)] 
docs/cmdline: add small "warning" to verbose options

"Note that verbose output of curl activities and network traffic might
contain sensitive data, including user names, credentials or secret data
content. Be aware and be careful when sharing trace logs with others."

Closes #11596

2 years agoRELEASE-NOTES: synced
Daniel Stenberg [Fri, 4 Aug 2023 14:00:08 +0000 (16:00 +0200)] 
RELEASE-NOTES: synced

2 years agopingpong: don't use *bump_headersize
Daniel Stenberg [Fri, 4 Aug 2023 07:32:55 +0000 (09:32 +0200)] 
pingpong: don't use *bump_headersize

We use that for HTTP(S) only.

Follow-up to 3ee79c1674fd6

Closes #11590

2 years agourldata: remove spurious parenthesis to unbreak no-proxy build
Daniel Stenberg [Fri, 4 Aug 2023 07:59:18 +0000 (09:59 +0200)] 
urldata: remove spurious parenthesis to unbreak no-proxy build

Follow-up to e12b39e13382

Closes #11591

2 years agoeasy: don't call Curl_trc_opt() in disabled-verbose builds
Daniel Stenberg [Fri, 4 Aug 2023 07:35:40 +0000 (09:35 +0200)] 
easy: don't call Curl_trc_opt() in disabled-verbose builds

Follow-up to e12b39e133822c6a0

Closes #11588

2 years agohttp: use %u for printfing int
Daniel Stenberg [Fri, 4 Aug 2023 06:45:39 +0000 (08:45 +0200)] 
http: use %u for printfing int

Follow-up to 3ee79c1674fd6f99e8efca5

Closes #11587

2 years agovquic: show stringified messages for errno
Goro FUJI [Thu, 3 Aug 2023 08:37:22 +0000 (08:37 +0000)] 
vquic: show stringified messages for errno

Closes #11584

2 years agotrace: make tracing available in non-debug builds
Stefan Eissing [Thu, 3 Aug 2023 15:32:25 +0000 (17:32 +0200)] 
trace: make tracing available in non-debug builds

Add --trace-config to curl

Add curl_global_trace() to libcurl

Closes #11421

2 years agoTODO: remove "Support intermediate & root pinning for PINNEDPUBLICKEY"
Daniel Stenberg [Thu, 3 Aug 2023 15:27:44 +0000 (17:27 +0200)] 
TODO: remove "Support intermediate & root pinning for PINNEDPUBLICKEY"

See also https://github.com/curl/curl/pull/7507

2 years agoTODO: add "WebSocket read callback"
Daniel Stenberg [Thu, 3 Aug 2023 15:20:33 +0000 (17:20 +0200)] 
TODO: add "WebSocket read callback"

remove "Upgrade to websockets" as we already have this

Closes #11402

2 years agotest497: verify rejecting too large incoming headers
Daniel Stenberg [Wed, 2 Aug 2023 21:51:51 +0000 (23:51 +0200)] 
test497: verify rejecting too large incoming headers

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