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

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>