]> git.ipfire.org Git - thirdparty/curl.git/log
thirdparty/curl.git
2 years agoquic: improve connect error message, debugging info, fix false connect report
Stefan Eissing [Fri, 6 Jan 2023 11:33:34 +0000 (12:33 +0100)] 
quic: improve connect error message, debugging info, fix false connect report

- ECONNECTREFUSED has not its own fail message in quic filters
- Debug logging in connect eyballing improved
- Fix bug in ngtcp2/quiche that could lead to false success reporting.

Reported-by: Divy Le Ray
Fixes #10245
Closes #10248

2 years agoquiche: fix build without any HTTP/2 implementation
Stefan Eissing [Mon, 9 Jan 2023 08:23:03 +0000 (09:23 +0100)] 
quiche: fix build without any HTTP/2 implementation

Fixes #10260
Closes #10263

2 years ago.github/workflows/linux.yml: add a quiche CI job
Daniel Stenberg [Thu, 5 Jan 2023 17:47:38 +0000 (18:47 +0100)] 
.github/workflows/linux.yml: add a quiche CI job

Move over from zuul

Closes #10241

2 years agocurl.h: allow up to 10M buffer size
Daniel Stenberg [Sat, 7 Jan 2023 15:03:40 +0000 (16:03 +0100)] 
curl.h: allow up to 10M buffer size

Bump the limit from 512K. There might be reasons for applications using
h3 to set larger buffers and there is no strong reason for curl to have
a very small maximum.

Ref: https://curl.se/mail/lib-2023-01/0026.html

Closes #10256

2 years agoGHA: use designated ngtcp2 and its dependencies versions
Tatsuhiro Tsujikawa [Sun, 8 Jan 2023 06:58:54 +0000 (15:58 +0900)] 
GHA: use designated ngtcp2 and its dependencies versions

Designate ngtcp2 and its dependency versions so that the CI build does
not fail without our control.

Closes #10257

2 years agodocs/cmdline-opts/hsts.d: explain hsts more
Daniel Stenberg [Sun, 8 Jan 2023 09:29:18 +0000 (10:29 +0100)] 
docs/cmdline-opts/hsts.d: explain hsts more

Closes #10258

2 years agomsh3: run again in its cfilter
Stefan Eissing [Mon, 2 Jan 2023 13:08:16 +0000 (14:08 +0100)] 
msh3: run again in its cfilter

- test 2500, single GET works
- test 2501, single POST stalls
- test 2502, multiple, sequential GETs each use a new connection since
  MsH3ConnectionGetState(qconn) no longer reports CONNECTED after one
  GET.

Closes #10204

2 years agosendf: fix build for Linux TCP fastopen
Jay Satiro [Fri, 6 Jan 2023 19:00:59 +0000 (14:00 -0500)] 
sendf: fix build for Linux TCP fastopen

- Fix the remote addr struct dereference.

- Include cf-socket.h in urldata.h.

Follow-up to 6a8d7ef9 which changed conn->ipaddr (Curl_addrinfo* )
member to conn->remote_addr (Curl_sockaddr_ex *) several days ago.

Reported-by: Stephan Guilloux
Fixes https://github.com/curl/curl/issues/10249
Closes https://github.com/curl/curl/pull/10250

2 years agoRELEASE-NOTES: synced
Daniel Stenberg [Sat, 7 Jan 2023 22:09:28 +0000 (23:09 +0100)] 
RELEASE-NOTES: synced

2 years agosetopt: move the SHA256 opt within #ifdef libssh2
Daniel Stenberg [Sat, 7 Jan 2023 14:49:03 +0000 (15:49 +0100)] 
setopt: move the SHA256 opt within #ifdef libssh2

Because only the libssh2 backend not supports it and thus this should
return error if this option is used other backends.

Reported-by: Harry Sintonen
Closes #10255

2 years agonss: implement data_pending method
Patrick Monnerat [Thu, 5 Jan 2023 03:22:14 +0000 (04:22 +0100)] 
nss: implement data_pending method

NSS currently uses the default Curl_none_data_pending() method which
always returns false, causing TLS buffered input data to be missed.

The current commit implements the nss_data_pending() method that properly
monitors the presence of available TLS data.

Ref:#10077

Closes #10225

2 years agoCURLOPT_HEADERDATA.3: warn DLL users must set write function
Jay Satiro [Thu, 5 Jan 2023 07:14:53 +0000 (02:14 -0500)] 
CURLOPT_HEADERDATA.3: warn DLL users must set write function

- Warn that in Windows if libcurl is running from a DLL and if
  CURLOPT_HEADERDATA is set then CURLOPT_WRITEFUNCTION or
  CURLOPT_HEADERFUNCTION must be set as well, otherwise the user may
  experience crashes.

We already have a similar warning in CURLOPT_WRITEDATA. Basically, in
Windows libcurl could crash writing a FILE pointer that was created by
a different C runtime. In Windows each DLL that is part of a program may
or may not have its own C runtime.

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

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

2 years agox509asn1: fix compile errors and warnings
jonrumsey [Thu, 5 Jan 2023 15:26:50 +0000 (15:26 +0000)] 
x509asn1: fix compile errors and warnings

Various small issues when built for GSKit

Closes #10238

2 years agoruntests: fix detection of TLS backends
Patrick Monnerat [Thu, 5 Jan 2023 16:26:50 +0000 (17:26 +0100)] 
runtests: fix detection of TLS backends

Built-in TLS backends are detected at test time by scanning for their
names in the version string line returned by the cli tool: as this line
may also list the libssh configuration that mentions its own backend,
the curl backend may be wrongly determined.

In example, if the version line contains "libssh/0.10.4/openssl/zlib",
OpenSSL is detected as a curl-configured backend even if not.

This fix requires the backend names to appear as full words preceded by
spacing in the version line to be recognized as curl TLS backends.

Closes #10236

2 years agoGHA: add job on Slackware 15.0
andy5995 [Wed, 4 Jan 2023 23:33:52 +0000 (17:33 -0600)] 
GHA: add job on Slackware 15.0

Closes #10230

2 years agotest363: make even smaller writes to loop more
Daniel Stenberg [Thu, 5 Jan 2023 12:35:53 +0000 (13:35 +0100)] 
test363: make even smaller writes to loop more

2 years agohttp_proxy: do not assign data->req.p.http use local copy
Daniel Stenberg [Thu, 5 Jan 2023 08:38:11 +0000 (09:38 +0100)] 
http_proxy: do not assign data->req.p.http use local copy

Avoid the tricky reusing of the data->req.p.http pointer for http proxy
tunneling.

Fixes #10194
Closes #10234

2 years agoquic: rename vquic implementations, fix for quiche build.
Stefan Eissing [Thu, 5 Jan 2023 18:23:21 +0000 (19:23 +0100)] 
quic: rename vquic implementations, fix for quiche build.

- quiche in debug mode did not build, fixed.
- moved all vquic implementation files to prefix curl_* to avoid
  the potential mixups between provided .h files and our own.
- quich passes test 2500 and 2502. 2501, the POST, fail with
  the body being rejected. Quich bug?

Closes #10242

2 years agosectransp: fix for incomplete read/writes
Stefan Eissing [Thu, 5 Jan 2023 10:13:17 +0000 (11:13 +0100)] 
sectransp: fix for incomplete read/writes

SecureTransport expects result code errSSLWouldBlock when the requested
length could not be sent/recieved in full. The previous code returned
noErr, which let SecureTransport to believe that the IO had terminated
prematurely.

Fixes #10227
Closes #10235

2 years agoGHA: Hacktoberfest CI: Update deprecated 'set-output' command
andy5995 [Wed, 4 Jan 2023 06:32:02 +0000 (00:32 -0600)] 
GHA: Hacktoberfest CI: Update deprecated 'set-output' command

Closes #10221

2 years agoscripts: set file mode +x on all perl and shell scripts
Jay Satiro [Tue, 3 Jan 2023 22:35:24 +0000 (17:35 -0500)] 
scripts: set file mode +x on all perl and shell scripts

- Set all scripts +x, ie 644 => 755.

Prior to this change some scripts were not executable and therefore
could not be called directly.

~~~
git ls-files -s \*.{sh,pl,py} | grep -v 100755
~~~

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

2 years agotool_operate: fix headerfile writing
Stefan Eissing [Wed, 4 Jan 2023 13:37:52 +0000 (14:37 +0100)] 
tool_operate: fix headerfile writing

Do not rely on the first transfer started to be the first to get a
response (remember -Z). All transfers now write the headefile (-D) in
append mode, making sure that the order of transfer responses does not
lead to overwrites of previous data.

Closes #10224

2 years agomisc: reduce struct and struct field sizes
Daniel Stenberg [Sun, 1 Jan 2023 10:26:22 +0000 (11:26 +0100)] 
misc: reduce struct and struct field sizes

- by using BIT() instead of bool
- imap: shrink struct
- ftp: make state 'unsigned char'
- ftp: sort ftp_conn struct entries on size
- urldata: use smaller fields for SSL version info storage
- pop3: reduce the pop3_conn struct size
- smtp: reduce the size of the smtp structs

Closes #10186

2 years agonoproxy: support for space-separated names is deprecated
Daniel Stenberg [Tue, 3 Jan 2023 13:58:37 +0000 (14:58 +0100)] 
noproxy: support for space-separated names is deprecated

To be removed in July 2024.

Assisted-by: Michael Osipov
Fixes #10209
Closes #10215

2 years agolib: fix typos in comments which repeat a word
Andrei Rybak [Wed, 4 Jan 2023 00:13:52 +0000 (01:13 +0100)] 
lib: fix typos in comments which repeat a word

Remove erroneously duplicated words in code comments of files
`lib.connect.c` and `lib/url.c`.

Closes #10220

2 years agocmake: set SOVERSION also for macOS 10406/head
Radek Brich [Tue, 3 Jan 2023 13:31:57 +0000 (14:31 +0100)] 
cmake: set SOVERSION also for macOS

Closes #10214

2 years agohttp2: fix compiler warning due to uninitialized variable
Jay Satiro [Tue, 3 Jan 2023 22:15:26 +0000 (17:15 -0500)] 
http2: fix compiler warning due to uninitialized variable

Prior to this change http2_cfilter_add could return an uninitialized
cfilter pointer in an OOM condition. In this case though, the pointer
is discarded and not dereferenced so there was no risk of a crash.

2 years agocf-socket: keep sockaddr local in the socket filters
Stefan Eissing [Tue, 3 Jan 2023 12:13:37 +0000 (13:13 +0100)] 
cf-socket: keep sockaddr local in the socket filters

- copy `struct Curl_addrinfo` on filter setup into context
- remove `struct Curl_addrinfoi *` with `struct Curl_sockaddr_ex *` in
  connectdata that is set and NULLed by the socket filter
- this means we have no reference to the resolver info in connectdata or
  its filters
- trigger the CF_CTRL_CONN_INFO_UPDATE event when the complete filter
  chain reaches connected status
- update easy handle connection information on CF_CTRL_DATA_SETUP event.

Closes #10213

2 years agoRELEASE-NOTES: synced
Daniel Stenberg [Tue, 3 Jan 2023 08:34:54 +0000 (09:34 +0100)] 
RELEASE-NOTES: synced

2 years agoruntests: consider warnings fatal and error on them
Daniel Stenberg [Mon, 2 Jan 2023 16:47:30 +0000 (17:47 +0100)] 
runtests: consider warnings fatal and error on them

To help us detect and fix warnings in this script easier and faster.

Assisted-by: Jakob Hirsch
Ref: #10206
Closes #10208

2 years agocopyright: update all copyright lines and remove year ranges
Daniel Stenberg [Mon, 2 Jan 2023 12:51:48 +0000 (13:51 +0100)] 
copyright: update all copyright lines and remove year ranges

- they are mostly pointless in all major jurisdictions
- many big corporations and projects already don't use them
- saves us from pointless churn
- git keeps history for us
- the year range is kept in COPYING

checksrc is updated to allow non-year using copyright statements

Closes #10205

2 years agodocs/DEPRECATE.md: deprecate gskit
Daniel Stenberg [Mon, 2 Jan 2023 10:43:51 +0000 (11:43 +0100)] 
docs/DEPRECATE.md: deprecate gskit

Ref: #10163

- 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"

Closes #10201

2 years agoRevert "x509asn1: avoid freeing unallocated pointers"
Daniel Stenberg [Mon, 2 Jan 2023 15:42:55 +0000 (16:42 +0100)] 
Revert "x509asn1: avoid freeing unallocated pointers"

This reverts commit 6b19247e794cfdf4ec63c5880d8f4f5485f653ab.

Fixes #10163
Closes #10207

2 years agongtcp2: fix the build without 'sendmsg'
Daniel Stenberg [Mon, 2 Jan 2023 22:22:27 +0000 (23:22 +0100)] 
ngtcp2: fix the build without 'sendmsg'

Follow-up from 71b7e0161032

Closes #10210

2 years agocmake: check for sendmsg
Daniel Stenberg [Mon, 2 Jan 2023 22:25:15 +0000 (23:25 +0100)] 
cmake: check for sendmsg

Used by ngtcp2

Closes #10211

2 years agoruntest.pl: add expected fourth return value
Timmy Schierling [Mon, 2 Jan 2023 13:06:28 +0000 (14:06 +0100)] 
runtest.pl: add expected fourth return value

Fixes warning in autobild log: "Use of uninitialized value $HTTP2TLSPORT
in substitution iterator at /tests/runtests.pl line 3516"

Closes #10206

2 years agohttp2: when using printf %.*s, the length arg must be 'int'
Daniel Stenberg [Mon, 2 Jan 2023 11:53:45 +0000 (12:53 +0100)] 
http2: when using printf %.*s, the length arg must be 'int'

Detected by Coverity CID 1518341

Closes #10203

2 years agocfilters: check for NULL before using pointer
Daniel Stenberg [Mon, 2 Jan 2023 11:48:56 +0000 (12:48 +0100)] 
cfilters: check for NULL before using pointer

Detected by Coverity CID 1518343

Closes #10202

2 years agohttp2: in connisdead check, attach the connection before reading
Daniel Stenberg [Mon, 2 Jan 2023 09:10:29 +0000 (10:10 +0100)] 
http2: in connisdead check, attach the connection before reading

Otherwise data->conn is NULL and things go wrong.

This problem caused occastional failures in test 359, 1700 and more
depending on timing and the alignment of various planets.

Assisted-by: Stefan Eissing
Closes #10199

2 years agoLinux CI: update some dependecies to latest tag
Philip H [Sun, 1 Jan 2023 22:33:18 +0000 (23:33 +0100)] 
Linux CI: update some dependecies to latest tag

Closes #10195

2 years agoc-hyper: move down the Accept-Encoding header generation
Daniel Stenberg [Mon, 2 Jan 2023 10:02:07 +0000 (11:02 +0100)] 
c-hyper: move down the Accept-Encoding header generation

To match the internal HTTP request header order so that test 1277 works
again.

Closes #10200

2 years agorelease-notes.pl: check fixes/closes lines better
Daniel Stenberg [Mon, 2 Jan 2023 10:31:29 +0000 (11:31 +0100)] 
release-notes.pl: check fixes/closes lines better

To better skip lines that just happen to mention those words at the
start of a line without being instructions.

2 years agotest1560: use a UTF8-using locale when run
Daniel Stenberg [Sun, 1 Jan 2023 22:37:10 +0000 (23:37 +0100)] 
test1560: use a UTF8-using locale when run

There are odd cases that don't use UTF8 and then the IDN handling goes
wrong.

Reported-by: Marcel Raad
Fixes #10193
Closes #10196

2 years agocf-socket: fix build regression
Daniel Stenberg [Sun, 1 Jan 2023 15:32:13 +0000 (16:32 +0100)] 
cf-socket: fix build regression

Reported-by: Stephan Guilloux
Fixes #10190
Closes #10191

2 years agoexamples: remove the curlgtk.c example
Daniel Stenberg [Sun, 1 Jan 2023 23:28:18 +0000 (00:28 +0100)] 
examples: remove the curlgtk.c example

- it does not add a lot of value
- we do not test-build it to verify because of its dependencies
- unclear for what GTK versions it works or not

Reported-by: odek86 on github
Fixes #10197
Closes #10198

2 years agodocs: add link to GitHub Discussions
andy5995 [Wed, 28 Dec 2022 00:18:15 +0000 (18:18 -0600)] 
docs: add link to GitHub Discussions

Closes #10171

2 years agoGHA: ignore changes to md files for most workflows
andy5995 [Wed, 28 Dec 2022 14:57:36 +0000 (08:57 -0600)] 
GHA: ignore changes to md files for most workflows

Closes #10176

2 years agohttp: decode transfer encoding first
Josh Brobst [Sat, 31 Dec 2022 19:41:44 +0000 (14:41 -0500)] 
http: decode transfer encoding first

The unencoding stack is added to as Transfer-Encoding and
Content-Encoding fields are encountered with no distinction between the
two, meaning the stack will be incorrect if, e.g., the message has both
fields and a non-chunked Transfer-Encoding comes first. This commit
fixes this by ordering the stack with transfer encodings first.

Reviewed-by: Patrick Monnerat
Closes #10187

2 years agocurl.h: mark CURLSSLBACKEND_MESALINK as deprecated
Daniel Stenberg [Sun, 1 Jan 2023 11:05:08 +0000 (12:05 +0100)] 
curl.h: mark CURLSSLBACKEND_MESALINK as deprecated

Follow-up since 223f26c28a340b36

Deprecated since 7.82.0

Closes #10189

2 years agocurl_global_sslset.3: clarify the openssl situation
Daniel Stenberg [Sun, 1 Jan 2023 10:51:20 +0000 (11:51 +0100)] 
curl_global_sslset.3: clarify the openssl situation

and add rustls

Closes #10188

2 years agohttp: add additional condition for including stdint.h
Cameron Blomquist [Sat, 31 Dec 2022 14:40:51 +0000 (09:40 -0500)] 
http: add additional condition for including stdint.h

stdint.h was only included in http.h when ENABLE_QUIC was defined, but
symbols from stdint.h are also used when USE_NGHTTP2 is defined. This
causes build errors when USE_NGHTTP2 is defined but ENABLE_QUIC is not.

Closes #10185

2 years agourldata: cease storing TLS auth type
Daniel Stenberg [Fri, 30 Dec 2022 14:04:57 +0000 (15:04 +0100)] 
urldata: cease storing TLS auth type

The only TLS auth type libcurl ever supported is SRP and that is the
default type. Since nobody ever sets any other type, there is no point
in wasting space to store the set type and code to check the type.

If TLS auth is used, SRP is now implied.

Closes #10181

2 years agovtls: use ALPN HTTP/1.0 when HTTP/1.0 is used
Daniel Stenberg [Fri, 30 Dec 2022 16:37:11 +0000 (17:37 +0100)] 
vtls: use ALPN HTTP/1.0 when HTTP/1.0 is used

Previously libcurl would use the HTTP/1.1 ALPN id even when the
application specified HTTP/1.0.

Reported-by: William Tang
Ref: #10183

2 years agolib670: make test.h the first include
Marcel Raad [Fri, 30 Dec 2022 13:50:15 +0000 (14:50 +0100)] 
lib670: make test.h the first include

As in all other lib tests. This avoids a macro redefinition warning for
`_FILE_OFFSET_BITS` visible in the autobuilds.

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

2 years agolib: connect/h2/h3 refactor
Stefan Eissing [Fri, 30 Dec 2022 08:14:55 +0000 (09:14 +0100)] 
lib: connect/h2/h3 refactor

Refactoring of connection setup and happy eyeballing. Move
nghttp2. ngtcp2, quiche and msh3 into connection filters.

 - eyeballing cfilter that uses sub-filters for performing parallel connects
 - socket cfilter for all transport types, including QUIC
 - QUIC implementations in cfilter, can now participate in eyeballing
 - connection setup is more dynamic in order to adapt to what filter did
   really connect.  Relevant to see if a SSL filter needs to be added or
   if SSL has already been provided
 - HTTP/3 test cases similar to HTTP/2
 - multiuse of parallel transfers for HTTP/3, tested for ngtcp2 and quiche

 - Fix for data attach/detach in VTLS filters that could lead to crashes
   during parallel transfers.
 - Eliminating setup() methods in cfilters, no longer needed.
 - Improving Curl_conn_is_alive() to replace Curl_connalive() and
   integrated ssl alive checks into cfilter.
 - Adding CF_CNTRL_CONN_INFO_UPDATE to tell filters to update
   connection into and persist it at the easy handle.

 - Several more cfilter related cleanups and moves:
   - stream_weigth and dependency info is now wrapped in struct
     Curl_data_priority
   - Curl_data_priority members depend is available in HTTP2|HTTP3
   - Curl_data_priority members depend on NGHTTP2 support
   - handling init/reset/cleanup of priority part of url.c
   - data->state.priority same struct, but shallow copy for compares only

 - PROTOPT_STREAM has been removed
   - Curl_conn_is_mulitplex() now available to check on capability

 - Adding query method to connection filters.
   - ngtcp2+quiche: implementing query for max concurrent transfers.

 - Adding is_alive and keep_alive cfilter methods. Adding DATA_SETUP event.
   - setting keepalive timestamp on connect
   - DATA_SETUP is called after the connection has been completely
     setup (but may not connected yet) to allow filters to initialize
     data members they use.

 - there is no socket to be had with msh3, it is unclear how select
   shall work

 - manual test via "curl --http3 https://curl.se" fail with "empty
   reply from server".

 - Various socket/conn related cleanups:
   - Curl_socket is now Curl_socket_open and in cf-socket.c
   - Curl_closesocket is now Curl_socket_close and in cf-socket.c
   - Curl_ssl_use has been replaced with Cur_conn_is_ssl
   - Curl_conn_tcp_accepted_set has been split into
     Curl_conn_tcp_listen_set and Curl_conn_tcp_accepted_set
     with a clearer purpose

Closes #10141

2 years agoRELEASE-NOTES: synced
Daniel Stenberg [Fri, 30 Dec 2022 15:06:03 +0000 (16:06 +0100)] 
RELEASE-NOTES: synced

2 years agodocs/libcurl/curl_getdate.3: minor whitespace edit
Daniel Stenberg [Fri, 30 Dec 2022 11:58:14 +0000 (12:58 +0100)] 
docs/libcurl/curl_getdate.3: minor whitespace edit

To avoid a fccp quirk that made it render wrongly on the website

2 years agotransfer: break the read loop when RECV is cleared
Daniel Stenberg [Wed, 28 Dec 2022 10:08:44 +0000 (11:08 +0100)] 
transfer: break the read loop when RECV is cleared

When the RECV bit is cleared because the response reading for this
transfer is complete, the read loop should be stopped. data_pending()
can otherwise still return TRUE and another read would be attempted.

Reported-by: Hide Ishikawa
Fixes #10172
Closes #10174

2 years agomultihandle: turn bool struct fields into bits
Daniel Stenberg [Thu, 29 Dec 2022 16:43:36 +0000 (17:43 +0100)] 
multihandle: turn bool struct fields into bits

Closes #10179

2 years agoftpserver: lower the normal DATA connect timeout to speed up torture tests
Stefan Eissing [Thu, 29 Dec 2022 14:22:17 +0000 (15:22 +0100)] 
ftpserver: lower the normal DATA connect timeout to speed up torture tests

- tests/ftpserver.pl blocks when expecting a DATA connection from the
  client.

- the previous 10 seconds were encountered repeatedly in torture tests
  and let to long waits.

- 2 seconds should still be sufficient for current hw, but CI will show.

Closes #10178

2 years agomsh3: add support for request payload
Nick Banks [Tue, 27 Dec 2022 16:02:56 +0000 (16:02 +0000)] 
msh3: add support for request payload

Closes #10136

2 years agoopenssl: remove attached easy handles from SSL instances
Stefan Eissing [Wed, 28 Dec 2022 08:58:09 +0000 (09:58 +0100)] 
openssl: remove attached easy handles from SSL instances

 - keeping the "current" easy handle registered at SSL* is no longer
   necessary, since the "calling" data object is already stored in the
   cfilter's context (and used by other SSL backends from there).
 - The "detach" of an easy handle that goes out of scope is then avoided.
 - using SSL_set0_wbio for clear reference counting where available.

Closes #10151

2 years agosocketpair: allow localhost MITM sniffers
Daniel Stenberg [Tue, 27 Dec 2022 16:19:51 +0000 (17:19 +0100)] 
socketpair: allow localhost MITM sniffers

Windows allow programs to MITM connections to localhost. The previous
check here would detect that and error out. This new method writes data
to verify the pipe thus allowing MITM.

Reported-by: SerusDev on github
Fixes #10144
Closes #10169

2 years agoHTTP3: mention what needs to be in place to remove EXPERIMENTAL label
Daniel Stenberg [Tue, 27 Dec 2022 14:57:00 +0000 (15:57 +0100)] 
HTTP3: mention what needs to be in place to remove EXPERIMENTAL label

Closes #10168

2 years agoMANUAL.md: add pipe to apt-key example
andy5995 [Tue, 27 Dec 2022 23:47:10 +0000 (17:47 -0600)] 
MANUAL.md: add pipe to apt-key example

Closes #10170

2 years agotest417: verify %{certs} output
Daniel Stenberg [Tue, 27 Dec 2022 11:00:12 +0000 (12:00 +0100)] 
test417: verify %{certs} output

2 years agoruntests: make 'mbedtls' a testable feature
Daniel Stenberg [Tue, 27 Dec 2022 11:00:13 +0000 (12:00 +0100)] 
runtests: make 'mbedtls' a testable feature

Also add to FILEFORMAT.md

2 years agowriteout: add %{certs} and %{num_certs}
Daniel Stenberg [Tue, 27 Dec 2022 11:00:12 +0000 (12:00 +0100)] 
writeout: add %{certs} and %{num_certs}

Let users get the server certificate chain using the command line

Closes #10019

2 years agohaxproxy: send before TLS handhshake
Stefan Eissing [Tue, 27 Dec 2022 11:10:45 +0000 (12:10 +0100)] 
haxproxy: send before TLS handhshake

- reverse order of haproxy and final ssl cfilter

- make haproxy avaiable on PROXY builds, independent of HTTP support as
  it can be used with any protocol.

Reported-by: Sergio-IME on github
Fixes #10165
Closes #10167

2 years agoRELEASE-NOTES: synced
Daniel Stenberg [Tue, 27 Dec 2022 14:38:47 +0000 (15:38 +0100)] 
RELEASE-NOTES: synced

2 years agotest446: verify hsts with two URLs
Daniel Stenberg [Tue, 27 Dec 2022 10:50:23 +0000 (11:50 +0100)] 
test446: verify hsts with two URLs

2 years agoruntests: support crlf="yes" for verify/proxy
Daniel Stenberg [Tue, 27 Dec 2022 10:50:23 +0000 (11:50 +0100)] 
runtests: support crlf="yes" for verify/proxy

2 years agohsts: handle adding the same host name again
Daniel Stenberg [Tue, 27 Dec 2022 10:50:23 +0000 (11:50 +0100)] 
hsts: handle adding the same host name again

It will then use the largest expire time of the two entries.

2 years agotool_operate: share HSTS between handles
Daniel Stenberg [Tue, 27 Dec 2022 10:50:23 +0000 (11:50 +0100)] 
tool_operate: share HSTS between handles

2 years agoshare: add sharing of HSTS cache among handles
Daniel Stenberg [Tue, 27 Dec 2022 10:50:20 +0000 (11:50 +0100)] 
share: add sharing of HSTS cache among handles

Closes #10138

2 years agoMakefile.mk: fix wolfssl and mbedtls default paths
Viktor Szakats [Tue, 27 Dec 2022 11:36:03 +0000 (11:36 +0000)] 
Makefile.mk: fix wolfssl and mbedtls default paths

Fix the defaults for `WOLFSSL_PATH` and `MBEDTLS_PATH` to have
meaningful values instead of the copy-pasted wrong ones.

Ref: https://github.com/curl/curl/commit/66e68ca47f7fd00dff2cb7c45ba6725d40099585#r94275172

Reported-by: Ryan Schmidt
Closes #10164

2 years agoINTERNALS: cleanup
Daniel Stenberg [Mon, 26 Dec 2022 10:23:17 +0000 (11:23 +0100)] 
INTERNALS: cleanup

- remove "operating systems" (mostly outdated)

- upodate the "build tools"

Closes #10162

2 years agocmake: bump requirement to 3.7
Daniel Stenberg [Mon, 26 Dec 2022 09:25:23 +0000 (10:25 +0100)] 
cmake: bump requirement to 3.7

Because this is the cmake version (released in November 2016) that
introduced GREATER_EQUAL, which is used already.

Reported-by: nick-telia on github
Fixes #10128
Closes #10161

2 years agocfilters:Curl_conn_get_select_socks: use the first non-connected filter
Daniel Stenberg [Mon, 26 Dec 2022 08:59:20 +0000 (09:59 +0100)] 
cfilters:Curl_conn_get_select_socks: use the first non-connected filter

When there are filters addded for both socket and SSL, the code
previously checked the SSL sockets during connect when it *should* first
check the socket layer until that has connected.

Fixes #10157
Fixes #10146
Closes #10160

Reviewed-by: Stefan Eissing
2 years agourlapi: add CURLU_PUNYCODE
Daniel Stenberg [Mon, 26 Dec 2022 09:58:37 +0000 (10:58 +0100)] 
urlapi: add CURLU_PUNYCODE

Allows curl_url_get() get the punycode version of host names for the
host name and URL parts.

Extend test 1560 to verify.

Closes #10109

2 years agoRELEASE-NOTES: synced
Daniel Stenberg [Mon, 26 Dec 2022 09:56:49 +0000 (10:56 +0100)] 
RELEASE-NOTES: synced

2 years agolibssh2: try sha2 algos for hostkey methods
Daniel Stenberg [Thu, 22 Dec 2022 18:57:16 +0000 (19:57 +0100)] 
libssh2: try sha2 algos for hostkey methods

As is supported by recent libssh2, but should just be ignored by older
versions.

Reported-by: norbertmm on github
Assisted-by: norbertmm on github
Fixes #10143
Closes #10145

2 years agotypecheck: accept expressions for option/info parameters
Patrick Monnerat [Fri, 23 Dec 2022 14:35:27 +0000 (15:35 +0100)] 
typecheck: accept expressions for option/info parameters

As expressions can have side effects, evaluate only once.

To enable deprecation reporting only once, get rid of the __typeof__
use to define the local temporary variable and use the target type
(CURLoption/CURLINFO). This also avoids multiple reports on type
conflicts (if some) by the curlcheck_* macros.

Note that CURLOPT_* and CURLINFO_* symbols may be deprecated, but not
their values: a curl_easy_setopt call with an integer constant as option
will never report a deprecation.

Reported-by: Thomas Klausner
Fixes #10148
Closes #10149

2 years agotests: avoid use of sha1 in certificates
Paul Howarth [Fri, 23 Dec 2022 12:34:49 +0000 (12:34 +0000)] 
tests: avoid use of sha1 in certificates

The SHA-1 algorithm is deprecated (particularly for security-sensitive
applications) in a variety of OS environments. This already affects
RHEL-9 and derivatives, which are not willing to use certificates using
that algorithm. The fix is to use sha256 instead, which is already used
for most of the other certificates in the test suite.

Fixes #10135

This gets rid of issues related to sha1 signatures.

Manual steps after "make clean-certs" and "make build-certs":

- Copy tests/certs/stunnel-sv.pem to tests/stunnel.pem
  (make clean-certs does not remove the original tests/stunnel.pem)

- Copy tests/certs/Server-localhost-sv.pubkey-pinned into --pinnedpubkey
  options of tests/data/test2041 and tests/data/test2087

Closes #10153

2 years agocmake: fix the snprintf detection
Yurii Rashkovskii [Sat, 24 Dec 2022 01:45:30 +0000 (17:45 -0800)] 
cmake: fix the snprintf detection

I haven't had the time to check other configurations, but on my macOS
Ventura 13.1 with XCode 14.2 cmake does not find `snprintf`.

Solution: ensure stdio.h is checked for definitions

Closes #10155

2 years agohttp: remove the trace message "Mark bundle... multiuse"
Radu Hociung [Mon, 26 Dec 2022 05:39:52 +0000 (00:39 -0500)] 
http: remove the trace message "Mark bundle... multiuse"

The message "Mark bundle as not supporting multiuse" was added at commit
29364d93 when an http/2-related bug was fixed, and it appears to be a
leftover trace message.

This message should be removed because:
 * it conveys no information to the user
 * it is enabled in the default build (--enable-verbose)
 * it reads like a warning/unexpected condition
 * it is equivalent to "Detected http proto < 2", which is
   not a useful message.
 * it is a time-wasting red-herring for anyone who encounters
   it for the first time while investigating some other, real
   problem.

This commit removes the trace message "Mark bundle as not
supporting multiuse"

Closes #10159

2 years agourl: fix build with `--disable-cookies`
Hannah Schierling [Sun, 25 Dec 2022 22:45:01 +0000 (23:45 +0100)] 
url: fix build with `--disable-cookies`

Struct `UserDefined` has no member `cookielist` if
`CURL_DISABLE_COOKIES` is defined.

Follow-up to af5999a

Closes #10158

2 years agoruntests: also tear down http2/http3 servers when https server is stopped
Stefan Eissing [Mon, 19 Dec 2022 16:17:54 +0000 (17:17 +0100)] 
runtests: also tear down http2/http3 servers when https server is stopped

Closes #10114

2 years agotests: add 3 new HTTP/2 test cases, plus https: support for nghttpx
Stefan Eissing [Mon, 19 Dec 2022 11:31:06 +0000 (12:31 +0100)] 
tests: add 3 new HTTP/2 test cases, plus https: support for nghttpx

- a simple https get
- a simple https post
- a multi get of 4 requests and check that same connection was used

Closes #10114

2 years agourldata: remove unused struct fields, made more conditional
Daniel Stenberg [Thu, 22 Dec 2022 22:25:34 +0000 (23:25 +0100)] 
urldata: remove unused struct fields, made more conditional

- source_quote, source_prequote and source_postquote have not been used since
  5e0d9aea3; September 2006

- make several fields conditional on proxy support

- make three quote struct fields conditional on FTP || SSH

- make 'mime_options' depend on MIME

- make trailer_* fields depend on HTTP

- change 'gssapi_delegation' from long to unsigned char

- make 'localportrange' unsigned short instead of int

- conn->trailer now depends on HTTP

Closes #10147

2 years agourldata: make set.http200aliases conditional on HTTP being present
Daniel Stenberg [Thu, 22 Dec 2022 16:08:38 +0000 (17:08 +0100)] 
urldata: make set.http200aliases conditional on HTTP being present

And make a few SSH-only fields depend on SSH

Closes #10140

2 years agomd4: fix build with GnuTLS + OpenSSL v1
Daniel Stenberg [Thu, 22 Dec 2022 16:40:26 +0000 (17:40 +0100)] 
md4: fix build with GnuTLS + OpenSSL v1

Reported-by: Esdras de Morais da Silva
Fixes #10110
Closes #10142

2 years agourldata: make 'ftp_create_missing_dirs' depend on FTP || SFTP
Daniel Stenberg [Thu, 22 Dec 2022 15:52:42 +0000 (16:52 +0100)] 
urldata: make 'ftp_create_missing_dirs' depend on FTP || SFTP

Closes #10139

2 years agomisc: fix grammar and spelling
John Bampton [Thu, 22 Dec 2022 14:22:11 +0000 (00:22 +1000)] 
misc: fix grammar and spelling

Closes #10137

2 years agourldata: move the cookefilelist to the 'set' struct
Daniel Stenberg [Thu, 22 Dec 2022 12:09:16 +0000 (13:09 +0100)] 
urldata: move the cookefilelist to the 'set' struct

The cookiefile entries are set into the handle and should remain set for
the lifetime of the handle so that duplicating it also duplicates the
list. Therefore, the struct field is moved from 'state' to 'set'.

Fixes #10133
Closes #10134

2 years agostrdup: name it Curl_strdup
Daniel Stenberg [Thu, 22 Dec 2022 09:15:38 +0000 (10:15 +0100)] 
strdup: name it Curl_strdup

It does not belong in the curlx_ name space as it is never used
externally.

Closes #10132

2 years agomsh3: update to v0.5 Release
Nick Banks [Wed, 21 Dec 2022 14:13:40 +0000 (14:13 +0000)] 
msh3: update to v0.5 Release

Closes #10125

2 years agoworkflows/linux.yml: merge 3 common packages
andy5995 [Fri, 9 Dec 2022 20:53:47 +0000 (14:53 -0600)] 
workflows/linux.yml: merge 3 common packages

Closes #10071

2 years agodocs: mention indirect effects of --insecure
Daniel Stenberg [Wed, 21 Dec 2022 22:36:57 +0000 (23:36 +0100)] 
docs: mention indirect effects of --insecure

Warn users that disabling certficate verification allows servers to
"pollute" curl with data it trusts.

Reported-by: Harry Sintonen
Closes #10126

2 years agoSECURITY-PROCESS.md: document severity levels
Daniel Stenberg [Mon, 19 Dec 2022 17:04:11 +0000 (18:04 +0100)] 
SECURITY-PROCESS.md: document severity levels

Closes #10118