]> git.ipfire.org Git - thirdparty/curl.git/log
thirdparty/curl.git
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

2 years agoRELEASE_NOTES: synced
Daniel Stenberg [Wed, 21 Dec 2022 14:35:59 +0000 (15:35 +0100)] 
RELEASE_NOTES: synced

bumped version for new cycle

2 years agotool_operate: fix `CURLOPT_SOCKS5_GSSAPI_NEC` type
Marcel Raad [Wed, 21 Dec 2022 11:31:31 +0000 (12:31 +0100)] 
tool_operate: fix `CURLOPT_SOCKS5_GSSAPI_NEC` type

`CURLOPT_SOCKS5_GSSAPI_NEC` is a long, while `socks5_gssapi_nec` was
made a bool in commit 4ac64eadf60.

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

2 years agoRELEASE-NOTES: synced curl-7_87_0
Daniel Stenberg [Wed, 21 Dec 2022 07:00:59 +0000 (08:00 +0100)] 
RELEASE-NOTES: synced

The curl 7.87.0 release

2 years agoTHANKS: 40 new contributors from 7.87.0
Daniel Stenberg [Wed, 21 Dec 2022 07:00:59 +0000 (08:00 +0100)] 
THANKS: 40 new contributors from 7.87.0

2 years agohttp: fix the ::1 comparison for IPv6 localhost for cookies
Daniel Stenberg [Tue, 20 Dec 2022 09:07:36 +0000 (10:07 +0100)] 
http: fix the ::1 comparison for IPv6 localhost for cookies

When checking if there is a "secure context", which it is if the
connection is to localhost even if the protocol is HTTP, the comparison
for ::1 was done incorrectly and included brackets.

Reported-by: BratSinot on github
Fixes #10120
Closes #10121

2 years agoCI/spell: actions/checkout@v2 > actions/checkout@v3
Philip H [Mon, 19 Dec 2022 21:58:28 +0000 (22:58 +0100)] 
CI/spell: actions/checkout@v2 > actions/checkout@v3

2 years agosmb/telnet: do not free the protocol struct in *_done()
Daniel Stenberg [Mon, 19 Dec 2022 07:38:37 +0000 (08:38 +0100)] 
smb/telnet: do not free the protocol struct in *_done()

It is managed by the generic layer.

Reported-by: Trail of Bits
Closes #10112

2 years agohttp: use the IDN decoded name in HSTS checks
Daniel Stenberg [Mon, 19 Dec 2022 07:36:55 +0000 (08:36 +0100)] 
http: use the IDN decoded name in HSTS checks

Otherwise it stores the info HSTS into the persistent cache for the IDN
name which will not match when the HSTS status is later checked for
using the decoded name.

Reported-by: Hiroki Kurosawa
Closes #10111

2 years agoCURLOPT_DEBUGFUNCTION.3: emphasize that incoming data is "raw"
Daniel Stenberg [Fri, 16 Dec 2022 11:45:20 +0000 (12:45 +0100)] 
CURLOPT_DEBUGFUNCTION.3: emphasize that incoming data is "raw"

Closes #10106

2 years agosocks: fix username max size is 255 (0xFF)
Xì Gà [Fri, 16 Dec 2022 10:58:38 +0000 (17:58 +0700)] 
socks: fix username max size is 255 (0xFF)

Closes #10105

Reviewed-by: Daniel Gustafsson
2 years agolimit-rate.d: see also --rate
Daniel Stenberg [Fri, 16 Dec 2022 09:31:13 +0000 (10:31 +0100)] 
limit-rate.d: see also --rate

2 years agolib1560: add some basic IDN host name tests
Daniel Stenberg [Thu, 15 Dec 2022 09:25:13 +0000 (10:25 +0100)] 
lib1560: add some basic IDN host name tests

Closes #10094

2 years agoidn: rename the files to idn.[ch] and hold all IDN functions
Daniel Stenberg [Wed, 14 Dec 2022 13:49:59 +0000 (14:49 +0100)] 
idn: rename the files to idn.[ch] and hold all IDN functions

Closes #10094

2 years agoidn: remove Curl_win32_ascii_to_idn
Daniel Stenberg [Wed, 14 Dec 2022 13:41:02 +0000 (14:41 +0100)] 
idn: remove Curl_win32_ascii_to_idn

It was not used. Introduce a new IDN header for the prototype(s).

Closes #10094

2 years agoRELEASE-NOTES: synced
Daniel Stenberg [Thu, 15 Dec 2022 15:35:18 +0000 (16:35 +0100)] 
RELEASE-NOTES: synced

2 years agocurl_url_get.3: remove spurious backtick
Daniel Stenberg [Thu, 15 Dec 2022 11:57:48 +0000 (12:57 +0100)] 
curl_url_get.3: remove spurious backtick

Put there by mistake.

Follow-up from 9a8564a92

Closes #10101

2 years agosocks: fix infof() flag for outputing a char
Daniel Stenberg [Thu, 15 Dec 2022 11:29:59 +0000 (12:29 +0100)] 
socks: fix infof() flag for outputing a char

It used to be a 'long', %lu is no longer correct.

Follow-up to 57d2d9b6bed33d
Detected by Coverity CID 1517663

Closes #10100

2 years agossl-reqd.d: clarify that this is for upgrading connections only
Daniel Stenberg [Wed, 14 Dec 2022 12:56:42 +0000 (13:56 +0100)] 
ssl-reqd.d: clarify that this is for upgrading connections only

Closes #10093

2 years agocurl_url_set.3: document CURLU_DISALLOW_USER
Daniel Stenberg [Thu, 15 Dec 2022 09:30:51 +0000 (10:30 +0100)] 
curl_url_set.3: document CURLU_DISALLOW_USER

Closes #10099

2 years agocmake: set the soname on the shared library
Daniel Stenberg [Sat, 3 Dec 2022 12:20:14 +0000 (13:20 +0100)] 
cmake: set the soname on the shared library

Set SONAME and VERSION for platforms we think this works on. Remove
issue from KNOWN_BUGS.

Assisted-by: Jakub Zakrzewski
Closes #10023

2 years agotool_paramhlp: free the proto strings on exit
Daniel Stenberg [Wed, 14 Dec 2022 22:55:37 +0000 (23:55 +0100)] 
tool_paramhlp: free the proto strings on exit

And also make sure that repeated use of the options free the previous
string before it stores a new.

Follow-up from e6f8445edef8e7996d

Closes #10098

2 years agotool_cfgable: free the ssl_ec_curves on exit
Daniel Stenberg [Wed, 14 Dec 2022 22:46:12 +0000 (23:46 +0100)] 
tool_cfgable: free the ssl_ec_curves on exit

Follow-up to ede125b7b

Closes #10097

2 years agourlapi: reject more bad letters from the host name: &+()
Daniel Stenberg [Wed, 14 Dec 2022 22:41:08 +0000 (23:41 +0100)] 
urlapi: reject more bad letters from the host name: &+()

Follow-up from eb0167ff7d31d3a5

Extend test 1560 to verify

Closes #10096

2 years agoaltsvc: fix rejection of negative port numbers
Daniel Stenberg [Wed, 14 Dec 2022 22:16:16 +0000 (23:16 +0100)] 
altsvc: fix rejection of negative port numbers

Follow-up to ac612dfeee95

strtoul() accepts a leading minus so better make sure there is none

Extended test 356 somewhat to use a huge negative 64 bit number that
otherwise becomes a low positive number.

Closes #10095

2 years agolib: use size_t or int etc instead of longs
Daniel Stenberg [Tue, 13 Dec 2022 14:02:00 +0000 (15:02 +0100)] 
lib: use size_t or int etc instead of longs

Since long is not using a consistent data size in curl builds, making it
often "waste" 32 bits.

Closes #10088

2 years agoazure: use "unversioned" clang and clang-tools for scanbuild job
Daniel Stenberg [Wed, 14 Dec 2022 09:26:09 +0000 (10:26 +0100)] 
azure: use "unversioned" clang and clang-tools for scanbuild job

To make it less fragile

Closes #10092

2 years agox509asn1: avoid freeing unallocated pointers
Daniel Gustafsson [Wed, 14 Dec 2022 09:14:27 +0000 (10:14 +0100)] 
x509asn1: avoid freeing unallocated pointers

When utf8asn1str fails there is no allocation returned, so freeing
the return pointer in **to is at best a no-op and at worst a double-
free bug waiting to happen. The current coding isn't hiding any such
bugs but to future proof, avoid freeing the return value pointer iff
the function failed.

Closes: #10087
Reviewed-by: Daniel Stenberg <daniel@haxx.se>
2 years agocurl_url_set.3: fix typo
Emil Engler [Tue, 13 Dec 2022 18:04:55 +0000 (19:04 +0100)] 
curl_url_set.3: fix typo

Closes: #10089
Reviewed-by: Daniel Gustafsson <daniel@yesql.se>
2 years agotest2304: verify websocket handling when connection is closed
Daniel Stenberg [Mon, 12 Dec 2022 15:50:39 +0000 (16:50 +0100)] 
test2304: verify websocket handling when connection is closed

2 years agoserver/sws: if asked to close connection, skip the websocket handling
Daniel Stenberg [Mon, 12 Dec 2022 15:45:53 +0000 (16:45 +0100)] 
server/sws: if asked to close connection, skip the websocket handling

2 years agows: if no connection is around, return error
Daniel Stenberg [Mon, 12 Dec 2022 12:37:55 +0000 (13:37 +0100)] 
ws: if no connection is around, return error

- curl_ws_send returns CURLE_SEND_ERROR if data->conn is gone

- curl_ws_recv returns CURLE_GOT_NOTHING on connection close

- curl_ws_recv.3: mention new return code for connection close + example
  embryo

Closes #10084

2 years agodocs: extend the dump-header documentation
Emil Engler [Mon, 12 Dec 2022 18:44:35 +0000 (19:44 +0100)] 
docs: extend the dump-header documentation

This commit extends the documentation of the --dump-header command-line
option to reflect the behavior introduced in 8b1e5df7.

See #10079
Closes #10085

2 years agoRELEASE-NOTES: synced
Daniel Stenberg [Mon, 12 Dec 2022 08:15:50 +0000 (09:15 +0100)] 
RELEASE-NOTES: synced

2 years agostyled-output.d: this option does not work on Windows
Daniel Stenberg [Mon, 12 Dec 2022 07:11:15 +0000 (08:11 +0100)] 
styled-output.d: this option does not work on Windows

Reported-by: u20221022 on github
Fixes #10082
Closes #10083

2 years agotool: determine the correct fopen option for -D
Emil Engler [Sun, 11 Dec 2022 17:08:17 +0000 (18:08 +0100)] 
tool: determine the correct fopen option for -D

This commit fixes a bug in the dump-header feature regarding the
determination of the second fopen(3) option.

Reported-by: u20221022 on github
See #4753
See #4762
Fixes #10074
Closes #10079

2 years agodocs/curl_ws_send: Fixed typo in websocket docs
MonkeybreadSoftware [Sun, 11 Dec 2022 19:23:54 +0000 (20:23 +0100)] 
docs/curl_ws_send: Fixed typo in websocket docs

Replace as with is in relevant sentences.

Closes: #10081
Reviewed-by: Daniel Gustafsson <daniel@yesql.se>
2 years agoc-hyper: fix multi-request mechanism
Prithvi MK [Sun, 11 Dec 2022 10:13:14 +0000 (15:43 +0530)] 
c-hyper: fix multi-request mechanism

It makes test 565 run fine.

Fixes #8896
Closes #10080
Assisted-by: Daniel Stenberg
2 years agopage-header: grammar improvement (display transfer rate)
andy5995 [Fri, 9 Dec 2022 19:58:13 +0000 (13:58 -0600)] 
page-header: grammar improvement (display transfer rate)

Closes #10068

2 years agodocs/DEPRECATE.md: grammar improvement and sp correction
andy5995 [Fri, 9 Dec 2022 19:10:42 +0000 (13:10 -0600)] 
docs/DEPRECATE.md: grammar improvement and sp correction

The main thing I wanted to do was fix the spelling of "spent", but I
think this rewording improves the flow of the paragraph.

Closes #10067

2 years agotool_cfgable: make socks5_gssapi_nec a boolean
Boris Verkhovskiy [Sat, 10 Dec 2022 22:26:37 +0000 (15:26 -0700)] 
tool_cfgable: make socks5_gssapi_nec a boolean

Closes #10078

2 years agocontributors.sh: actually use $CURLWWW instead of just setting it.
Frank Gevaerts [Fri, 9 Dec 2022 15:42:21 +0000 (16:42 +0100)] 
contributors.sh: actually use $CURLWWW instead of just setting it.

The script was all set up for flexibility where curl-www is elsewhere in
the filesystem, but then hard-coded ../curl-www anyway...

Closes #10064

2 years agoKNOWN_BUGS: remove items not considered bugs any more
Daniel Stenberg [Tue, 6 Dec 2022 12:00:35 +0000 (13:00 +0100)] 
KNOWN_BUGS: remove items not considered bugs any more

- CURL_GLOBAL_SSL

This option was changed in libcurl 7.57.0 and clearly it has not caused
too many issues and a lot of time has passed.

- Store TLS context per transfer instead of per connection

This is a possible future optimization. One that is much less important
and interesting since the added support for CA caching.

- Microsoft telnet server

This bug was filed in May 2007 against curl 7.16.1 and we have not
received further reports.

- active FTP over a SOCKS

Actually, proxies in general is not working with active FTP mode. This
is now added in proxy documentation.

- DICT responses show the underlying protocol

curl still does this, but since this is now an established behavior
since forever we cannot change it easily and adding an option for it
seems crazy as this protocol is not so little its not worth it. Let's
just live with it.

- Secure Transport disabling hostname validation also disables SNI

This is an already documented restriction in Secure Transport.

- CURLOPT_SEEKFUNCTION not called with CURLFORM_STREAM

The curl_formadd() function is marked and documented as deprecated. No
point in collecting bugs for it. It should not be used further.

- STARTTRANSFER time is wrong for HTTP POSTs

After close source code inspection I cannot see how this is true or that
there is any special treatment for different HTTP methods. We also have
not received many further reports on this, making me strongly suspect
that this is no (longer an) issue.

- multipart formposts file name encoding

The once proposed RFC 5987-encoding is since RFC 7578 documented as MUST
NOT be used. The since then implemented MIME API allows the user to set
the name on their own and can thus provide it encoded as it wants.

- DoH is not used for all name resolves when enabled

It is questionable if users actually want to use DoH for interface and
FTP port name resolving. This restriction is now documented and we
advice users against using name resolving at all for these functions.

Closes #10043

2 years agoCURLOPT_COOKIEFILE.3: advice => advise
Daniel Stenberg [Fri, 9 Dec 2022 09:16:08 +0000 (10:16 +0100)] 
CURLOPT_COOKIEFILE.3: advice => advise

Closes #10063

Reviewed-by: Daniel Gustafsson
2 years agocurl.h: reword comment to not use deprecated option
Daniel Gustafsson [Fri, 9 Dec 2022 08:41:24 +0000 (09:41 +0100)] 
curl.h: reword comment to not use deprecated option

CURLOPT_INFILE was replaced by CURLOPT_READDATA in 7.9.7,  reword the
comment mentioning it to make code grepping easier as well as improve
the documentation.

Closes: #10062
Reviewed-by: Daniel Stenberg <daniel@haxx.se>
2 years agosystem.h: fix socklen_t, curl_off_t, long long for Classic Mac OS
Ryan Schmidt [Wed, 7 Dec 2022 17:00:41 +0000 (11:00 -0600)] 
system.h: fix socklen_t, curl_off_t, long long for Classic Mac OS

Change "__MWERKS__" to "macintosh". When this block was originally added
in 3ac6929 it was probably intended to handle classic Mac OS since the
previous classic Mac OS build procedure for curl (which was removed in
bf327a9) used Metrowerks CodeWarrior.

But there are other classic Mac OS compilers, such as the MPW compilers,
that were not handled by this case. For classic Mac OS,
CURL_TYPEOF_CURL_SOCKLEN_T needs to match what's provided by the
third-party GUSI library, which does not vary by compiler.

Meanwhile CodeWarrior works on platforms other than classic Mac OS, and
they may need different definitions. Separate blocks could be added
later for any of those platforms that curl doesn't already support.

Closes #10049

2 years agovms: remove SIZEOF_SHORT
Ryan Schmidt [Thu, 8 Dec 2022 19:45:44 +0000 (13:45 -0600)] 
vms: remove SIZEOF_SHORT

The rest of SIZEOF_SHORT was removed in d48dd15.

See #9291
Closes #10061

2 years agotool_formparse: avoid clobbering on function params
Daniel Gustafsson [Thu, 8 Dec 2022 22:45:18 +0000 (23:45 +0100)] 
tool_formparse: avoid clobbering on function params

While perfectly legal to do, clobbering function parameters and using
them as local variables is confusing at best and rarely improves code
readability.  Fix by using a local variable instead, no functionality
is changed.

This also renames the parameter from data to mime_data since the term
data is (soft) reserved for the easy handle struct.

Closes: #10046
Reviewed-by: Daniel Stenberg <daniel@haxx.se>
2 years agonoproxy: guard against empty hostnames in noproxy check
Daniel Gustafsson [Thu, 8 Dec 2022 22:37:32 +0000 (23:37 +0100)] 
noproxy: guard against empty hostnames in noproxy check

When checking for a noproxy setting we need to ensure that we get
a hostname passed in. If there is no hostname then there cannot be
a matching noproxy rule for it by definition.

Closes: #10057
Reported-by: Geeknik Labs
Reviewed-by: Daniel Stenberg <daniel@haxx.se>
2 years agoc-hyper: CONNECT respones are not server responses
Daniel Stenberg [Thu, 8 Dec 2022 16:47:54 +0000 (17:47 +0100)] 
c-hyper: CONNECT respones are not server responses

Together with d31915a8dbbd it makes test 265 run fine.

Fixes #8853
Assisted-by: Prithvi MK
Assisted-by: Sean McArthur
Closes #10060

2 years agotest265: Use "connection: keep-alive" response header
Daniel Stenberg [Thu, 8 Dec 2022 15:47:43 +0000 (16:47 +0100)] 
test265: Use "connection: keep-alive" response header

When it answers as HTTP/1.0, so that clients (hyper) knows properly that
the connection remains intact.

2 years agoRELEASE-NOTES: synced
Daniel Stenberg [Thu, 8 Dec 2022 13:55:39 +0000 (14:55 +0100)] 
RELEASE-NOTES: synced

2 years agocfilter: improve SSL connection checks
Stefan Eissing [Wed, 7 Dec 2022 13:58:46 +0000 (14:58 +0100)] 
cfilter: improve SSL connection checks

- fixes `Curl_ssl_cf_get_ssl()` to detect also the first filter instance
  as ssl (refs #10053)

- replaces `Curl_ssl_use()` with the correct `Curl_conn_is_ssl()`

Closes #10054
Fixes #10053

Reported-by: Patrick Monnerat
2 years agoruntests: silence nghttpx errors
Daniel Stenberg [Tue, 6 Dec 2022 16:26:13 +0000 (17:26 +0100)] 
runtests: silence nghttpx errors

Also, move the output of the nghttpx_h3 info to the general "Env:" line
in the test output header.

Reported-by: Marcel Raad
Ref: https://github.com/curl/curl/commit/ca15b7512e8d1199e55fbaa206ef01e64b8f147d#commitcomment-92015094
Closes #10044

2 years agoconfig-mac: define HAVE_SYS_IOCTL_H
Ryan Schmidt [Mon, 5 Dec 2022 19:25:05 +0000 (13:25 -0600)] 
config-mac: define HAVE_SYS_IOCTL_H

This is needed to compile nonblock.c on classic Mac OS with Grand
Unified Socket Interface (GUSI) because nonblock.c uses FIONBIO which is
defined in <sys/filio.h> which is included by <sys/ioctl.h>.

Ref: https://sourceforge.net/projects/gusi/

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