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

2 years agoCI: Change FreeBSD image from 12.3 to 12.4
Philip H [Wed, 7 Dec 2022 11:06:31 +0000 (12:06 +0100)] 
CI: Change FreeBSD image from 12.3 to 12.4

Ref: https://www.phoronix.com/news/FreeBSD-12.4-Released

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

2 years agotest1421: fix typo
Ryan Schmidt [Wed, 7 Dec 2022 16:37:33 +0000 (10:37 -0600)] 
test1421: fix typo

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

2 years agobuild: assume errno.h is always available
Jay Satiro [Sun, 27 Nov 2022 21:12:12 +0000 (16:12 -0500)] 
build: assume errno.h is always available

- Remove errno.h detection from all build configurations.

errno.h is a standard header according to C89.

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

2 years agobuild: assume assert.h is always available
Jay Satiro [Sun, 27 Nov 2022 21:03:39 +0000 (16:03 -0500)] 
build: assume assert.h is always available

- Remove assert.h detection from all build configurations.

assert.h is a standard header according to C89.

I had proposed this several years ago as part of a larger change that
was abandoned.

Ref: https://github.com/curl/curl/issues/1237#issuecomment-277500720

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

2 years agoCI: LGTM.com will be shut down in December 2022
Philip H [Wed, 7 Dec 2022 11:07:13 +0000 (12:07 +0100)] 
CI: LGTM.com will be shut down in December 2022

Closes #10052

2 years agomailmap: Andy Alt
Daniel Stenberg [Tue, 6 Dec 2022 22:23:13 +0000 (23:23 +0100)] 
mailmap: Andy Alt

2 years agomisc: Fix incorrect spelling
andy5995 [Tue, 6 Dec 2022 19:34:12 +0000 (13:34 -0600)] 
misc: Fix incorrect spelling

Fix various uses of connnect by replacing them with connect.

Closes: #10045
Reviewed-by: Daniel Stenberg <daniel@haxx.se>
Reviewed-by: Daniel Gustafsson <daniel@yesql.se>
2 years agowolfssl: remove special BIO return code handling
Stefan Eissing [Tue, 6 Dec 2022 07:47:32 +0000 (08:47 +0100)] 
wolfssl: remove special BIO return code handling

- rely solely on the retry flag in BIO, similar to OpenSSL vtls
  implementation.

Ref: https://github.com/curl/curl/pull/10021#issuecomment-1336147053

Closes #10033

2 years agoopenssl: return -1 on error in the BIO callbacks
Daniel Stenberg [Mon, 5 Dec 2022 10:29:38 +0000 (11:29 +0100)] 
openssl: return -1 on error in the BIO callbacks

BIO_read and BIO_write return negative numbers on error, including
retryable ones. A regression from 55807e6. Both branches should be
returning -1.

The APIs are patterned after POSIX read and write which, similarly,
return -1 on errors, not zero, with EAGAIN treated as an error.

Bug: https://github.com/curl/curl/issues/10013#issuecomment-1335308146
Reported-by: David Benjamin
Closes #10021

2 years agoconfig-mac: remove HAVE_SYS_SELECT_H
Ryan Schmidt [Mon, 5 Dec 2022 19:09:49 +0000 (13:09 -0600)] 
config-mac: remove HAVE_SYS_SELECT_H

When compiling for classic Mac OS with GUSI, there is no sys/select.h.
GUSI provides the "select" function prototype in sys/time.h.

Closes #10039

2 years agosetup: do not require __MRC__ defined for Mac OS 9 builds
Ryan Schmidt [Sat, 27 Aug 2022 00:31:31 +0000 (19:31 -0500)] 
setup: do not require __MRC__ defined for Mac OS 9 builds

Partially reverts "somewhat protect Mac OS X users from using Mac OS 9
config file", commit 62519bfe059251af2914199f284c736553ff0489.

Do things that are specific to classic Mac OS (i.e. include config-mac.h
in curl_setup.h and rename "main" to "curl_main" in tool_setup.h) when
only "macintosh" is defined. Remove the additional condition that
"__MRC__" should be defined since that would only be true with the MPW
MrC compiler which prevents the use of other reasonable compilers like
the MPW SC compiler and especially the Metrowerks CodeWarrior compilers.
"macintosh" is only defined by classic Mac OS compilers so this change
should not affect users of Mac OS X / OS X / macOS / any other OS.

Closes #10037

2 years agocurl.h: name all public function parameters
Ryan Schmidt [Mon, 5 Dec 2022 18:25:57 +0000 (12:25 -0600)] 
curl.h: name all public function parameters

Most public function parameters already have names; this adds those
that were missing.

Closes #10036

2 years agodocs/examples: spell correction ('Retrieve')
Andy Alt [Tue, 6 Dec 2022 03:24:28 +0000 (21:24 -0600)] 
docs/examples: spell correction ('Retrieve')

Closes #10040

2 years agounit1302: slightly extended
Daniel Stenberg [Mon, 5 Dec 2022 09:08:53 +0000 (10:08 +0100)] 
unit1302: slightly extended

To test more base64 decoding

2 years agobase64: faster base64 decoding
Daniel Stenberg [Mon, 5 Dec 2022 08:40:10 +0000 (09:40 +0100)] 
base64: faster base64 decoding

- by using a lookup table instead of strchr()
- by doing full quantums first, then padding

Closes #10032

2 years agolibssh2: return error when ssh_hostkeyfunc returns error
mickae1 [Mon, 5 Dec 2022 13:24:02 +0000 (14:24 +0100)] 
libssh2: return error when ssh_hostkeyfunc returns error

return CURLE_PEER_FAILED_VERIFICATION if verification with the callback
return a result different than CURLKHMATCH_OK

Closes #10034

2 years agoMakefile.mk: improve a GNU Make hack [ci skip]
Viktor Szakats [Mon, 5 Dec 2022 14:31:32 +0000 (14:31 +0000)] 
Makefile.mk: improve a GNU Make hack [ci skip]

Replace the hack of using `$() ` to represent a single space. The new
method silences the `--warn-undefined-variables` debug warning and it's
also a better-known form of solving this problem.

Reviewed-by: Jay Satiro
Closes #10031

2 years agotests/unit/.gitignore: ignore all unit + 4 digits files
Daniel Stenberg [Mon, 5 Dec 2022 13:58:06 +0000 (14:58 +0100)] 
tests/unit/.gitignore: ignore all unit + 4 digits files

2 years agobase64: encode without using snprintf
Daniel Stenberg [Sat, 3 Dec 2022 23:34:09 +0000 (00:34 +0100)] 
base64: encode without using snprintf

For speed. In some tests, this approch is 29 times faster!

Closes #10026

2 years agobase64: better alloc size
Daniel Stenberg [Sat, 3 Dec 2022 23:07:52 +0000 (00:07 +0100)] 
base64: better alloc size

The previous algorithm allocated more bytes than necessary.

Suggested-by: xtonik on github
Fixes #10024
Closes #10025

2 years agoconfig-mac: fix typo: size_T -> size_t
Ryan Schmidt [Sat, 27 Aug 2022 00:03:37 +0000 (19:03 -0500)] 
config-mac: fix typo: size_T -> size_t

Both MPW and CodeWarrior compilers complained about this.

Closes #10029

2 years agoRELEASE-NOTES: synced
Daniel Stenberg [Sat, 3 Dec 2022 10:47:27 +0000 (11:47 +0100)] 
RELEASE-NOTES: synced

2 years agoCMake: fix build with `CURL_USE_GSSAPI`
Jakub Zakrzewski [Fri, 2 Dec 2022 15:22:32 +0000 (16:22 +0100)] 
CMake: fix build with `CURL_USE_GSSAPI`

CMAKE_*_LINKER_FLAGS must be a string but GSS_LINKER_FLAGS is a list, so
we need to replace semicolons with spaces when setting those.

Fixes #9017
Closes #1022

2 years agoci: Reuse fuzzing snippet from curl-fuzzer project
Max Dymond [Fri, 2 Dec 2022 14:02:13 +0000 (14:02 +0000)] 
ci: Reuse fuzzing snippet from curl-fuzzer project

2 years agoGHA: clarify workflows permissions, set least possible privilege
Diogo Teles Sant'Anna [Wed, 16 Nov 2022 14:55:33 +0000 (11:55 -0300)] 
GHA: clarify workflows permissions, set least possible privilege

Set top-level permissions to None on all workflows, setting per-job
permissions. This avoids that new jobs inherit unwanted permissions.

Discussion: https://curl.se/mail/lib-2022-11/0028.html

Signed-off-by: Diogo Teles Sant'Anna <diogoteles@google.com>
Closes #9928

2 years agoMakefile.mk: address minor issues
Viktor Szakats [Fri, 2 Dec 2022 15:20:41 +0000 (15:20 +0000)] 
Makefile.mk: address minor issues

- Fix `NROFF` auto-detection with certain shell/make-build combinations:

  When a non-MSYS2 GNU Make runs inside an MSYS2 shell, Make executes
  the detection command as-is via `CreateProcess()`. It fails because
  `command` is an `sh` built-in. Ensure to explicitly invoke the shell.

- Initialize user-customizable variables:

  Silences a list of warnings when running GNU Make with the option
  `--warn-undefined-variables`. Another benefit is that it's now easy
  to look up all user-customizable `Makefile.mk` variables by grepping
  for ` ?=` in the curl source tree.

Suggested-by: Gisle Vanem
  Ref: https://github.com/curl/curl/pull/9764#issuecomment-1330674433

- Fix `MKDIR` invocation:

  Avoid a warning and potential issue in envs without forward-slash
  support.

Closes #10000

2 years agocurl_get_line: allow last line without newline char
Rob de Wit [Wed, 23 Nov 2022 13:56:39 +0000 (14:56 +0100)] 
curl_get_line: allow last line without newline char

improve backwards compatibility

Test 3200 verifies

Closes #9973

2 years agocookie: open cookie jar as a binary file
Daniel Stenberg [Fri, 2 Dec 2022 07:30:30 +0000 (08:30 +0100)] 
cookie: open cookie jar as a binary file

On Windows there is a difference and for text files, ^Z means end of
file which is not desirable.

Ref: #9973
Closes #10017

2 years agoruntests: only do CRLF replacements for hyper if it is HTTP
Daniel Stenberg [Thu, 1 Dec 2022 16:25:25 +0000 (17:25 +0100)] 
runtests: only do CRLF replacements for hyper if it is HTTP

Closes #10016

2 years agoopenssl: fix for BoringSSL BIO result interpretation mixups
Stefan Eissing [Thu, 1 Dec 2022 15:19:39 +0000 (16:19 +0100)] 
openssl: fix for BoringSSL BIO result interpretation mixups

Reported-by: Robin Marx
Fixes #10013
Closes #10015

2 years agoci: Remove zuul fuzzing job as it's superseded by CIFuzz
Max Dymond [Thu, 1 Dec 2022 13:54:13 +0000 (13:54 +0000)] 
ci: Remove zuul fuzzing job as it's superseded by CIFuzz

2 years agoruntests: do CRLF replacements per section only
Daniel Stenberg [Thu, 1 Dec 2022 08:21:04 +0000 (09:21 +0100)] 
runtests: do CRLF replacements per section only

The `crlf="yes"` attribute and "hyper mode" are now only applied on a
subset of dedicated sections: data, datacheck, stdout and protocol.

Updated test 2500 accordingly.

Also made test1 use crlf="yes" for <protocol>, mostly because it is
often used as a template test case. Going forward, using this attribute
we should be able to write test cases using linefeeds only and avoid
mixed line ending encodings.

Follow-up to ca15b7512e8d11

Fixes #10009
Closes #10010

2 years agognutls: use common gnutls init and verify code for ngtcp2
Stefan Eissing [Wed, 30 Nov 2022 13:42:37 +0000 (14:42 +0100)] 
gnutls: use common gnutls init and verify code for ngtcp2

Closes #10007

2 years agoaws_sigv4: fix typos in aws_sigv4.c
Baitinq on github [Wed, 30 Nov 2022 14:59:52 +0000 (15:59 +0100)] 
aws_sigv4: fix typos in aws_sigv4.c

Closes #10008

2 years agocurl.h: include <sys/select.h> on SerenityOS
Kenneth Myhra [Wed, 30 Nov 2022 09:33:57 +0000 (10:33 +0100)] 
curl.h: include <sys/select.h> on SerenityOS

Closes #10006

2 years agoopenssl: prefix errors with '[lib]/[version]: '
Daniel Stenberg [Wed, 30 Nov 2022 09:20:06 +0000 (10:20 +0100)] 
openssl: prefix errors with '[lib]/[version]: '

To help users understand where this (cryptic) error message comes from.

Suggested-by: Philip Sanetra
Ref: #10002
Closes #10004

2 years agotests: add HTTP/3 test case, custom location for proper nghttpx
Stefan Eissing [Tue, 29 Nov 2022 15:41:15 +0000 (16:41 +0100)] 
tests: add HTTP/3 test case, custom location for proper nghttpx

- adding support for HTTP/3 test cases via a nghttpx server that is
  build with ngtcp2 and nghttp3.
- test2500 is the first test case, performing a simple GET.
- nghttpx is checked for support and the 'feature' nghttpx-h3
  is set accordingly. test2500 will only run, when supported.
- a specific nghttpx location can be given in the environment
  variable NGHTTPX or via the configure option
    --with-test-nghttpx=<path>

Extend NGHTTPX config to H2 tests as well

* use $ENV{NGHTTPX} and the configured default also in http2 server starts
* always provide the empty test/nghttpx.conf to nghttpx. as it defaults to
  reading /etc/nghttpx/nghttpx.conf otherwise.

Added nghttpx to CI ngtcp2 jobs to run h3 tests.

Closes #9031

2 years agoRELEASE-NOTES: synced
Daniel Stenberg [Wed, 30 Nov 2022 08:11:08 +0000 (09:11 +0100)] 
RELEASE-NOTES: synced

Removed duplicate after contributors.sh fix: 9967c10b6daa1

2 years agoscripts/contributors.sh: strip one OR MORE leading spaces
Daniel Stenberg [Wed, 30 Nov 2022 08:09:47 +0000 (09:09 +0100)] 
scripts/contributors.sh: strip one OR MORE leading spaces

From names found credited in commit logs

2 years agoRELEASE-NOTES: synced
Daniel Stenberg [Wed, 30 Nov 2022 07:59:43 +0000 (08:59 +0100)] 
RELEASE-NOTES: synced

2 years agoopenssl/mbedtls: use %d for outputing port with failf (int)
Daniel Stenberg [Tue, 29 Nov 2022 15:45:39 +0000 (16:45 +0100)] 
openssl/mbedtls: use %d for outputing port with failf (int)

Coverity CID 1517100

Also, remove some int typecasts in vtls.c for the port number

Closes #10001

2 years agoKNOWN_BUGS: remove "Multi perform hangs waiting for threaded resolver"
Daniel Stenberg [Tue, 29 Nov 2022 13:50:23 +0000 (14:50 +0100)] 
KNOWN_BUGS: remove "Multi perform hangs waiting for threaded resolver"

We now offer a way to avoid that hang, using CURLOPT_QUICK_EXIT.

Follow-up to 49798cac832ab1 fixed via #9147

Closes #9999

2 years agoKNOWN_BUGS: remove "--interface for ipv6 binds to unusable IP address"
Daniel Stenberg [Tue, 29 Nov 2022 13:39:10 +0000 (14:39 +0100)] 
KNOWN_BUGS: remove "--interface for ipv6 binds to unusable IP address"

Since years back the "if2ip" function verifies that it binds to a local IPv6
address that uses the same scope as the remote address.

This is not a bug.

Fixes #686
Closes #9998

2 years agotest1276: verify lib/optiontable.pl
Daniel Stenberg [Mon, 28 Nov 2022 15:34:01 +0000 (16:34 +0100)] 
test1276: verify lib/optiontable.pl

Checks that it generates an output identical to the file.

2 years agolib/optiontable.pl: adapt to CURLOPTDEPRECATED()
Daniel Stenberg [Mon, 28 Nov 2022 15:32:43 +0000 (16:32 +0100)] 
lib/optiontable.pl: adapt to CURLOPTDEPRECATED()

Follow-up from 6967571bf20624bc

Reported-by: Gisle Vanem
Fixes #9992
Closes #9993

2 years agodocs/INSTALL.md: list OSes and CPUs quoted
Daniel Stenberg [Tue, 29 Nov 2022 09:02:47 +0000 (10:02 +0100)] 
docs/INSTALL.md: list OSes and CPUs quoted

to make them skip spellcheck. Also added a new CPU.

Follow-up to 4506cbf7f24a2a

Closes #9997

2 years agovtls: fix typo in vtls_int.h
Ikko Ashimine [Mon, 28 Nov 2022 17:54:13 +0000 (02:54 +0900)] 
vtls: fix typo in vtls_int.h

paramter -> parameter

Closes: #9996
Reviewed-by: Daniel Gustafsson <daniel@yesql.se>
2 years agocurl-openssl.m4: do not add $prefix/include/openssl to CPPFLAGS
Daniel Stenberg [Mon, 28 Nov 2022 09:27:28 +0000 (10:27 +0100)] 
curl-openssl.m4: do not add $prefix/include/openssl to CPPFLAGS

As OpenSSL's include files are all included using <openssl/*.h> in curl
source code, we just risk that existing openssl files will "shadow"
include files without path if that path is provided.

Fixes #9989
Closes #9988

2 years agoINSTALL: update operating systems and CPU archs
Daniel Stenberg [Mon, 28 Nov 2022 16:16:37 +0000 (17:16 +0100)] 
INSTALL: update operating systems and CPU archs

Update after recent runs on Twitter/Mastodon and my blog

Closes #9994

2 years agotls: backends use connection filters for IO, enabling HTTPS-proxy
Stefan Eissing [Fri, 25 Nov 2022 13:06:43 +0000 (14:06 +0100)] 
tls: backends use connection filters for IO, enabling HTTPS-proxy

 - OpenSSL (and compatible)
 - BearSSL
 - gnutls
 - mbedtls
 - rustls
 - schannel
 - secure-transport
 - wolfSSL (v5.0.0 and newer)

 This leaves only the following without HTTPS-proxy support:
 - gskit
 - nss
 - wolfSSL (versions earlier than v5.0.0)

Closes #9962

2 years agoinclude/curl/curl.h: bump the deprecated requirements to gcc 6.1
Daniel Stenberg [Mon, 28 Nov 2022 07:22:02 +0000 (08:22 +0100)] 
include/curl/curl.h: bump the deprecated requirements to gcc 6.1

Reported-by: Michael Kaufmann
Fixes #9917
Closes #9987

2 years agomime: relax easy/mime structures binding
Patrick Monnerat [Wed, 16 Nov 2022 16:40:11 +0000 (17:40 +0100)] 
mime: relax easy/mime structures binding

Deprecation and removal of codeset conversion support from the library
have released the strict need for an early binding of mime structures to
an easy handle (https://github.com/curl/curl/commit/2610142).

This constraint currently forces to create the handle before the mime
structure and the latter cannot be attached to another handle once
created (see https://curl.se/mail/lib-2022-08/0027.html).

This commit removes the handle pointers from the mime structures
allowing more flexibility on their use.

When an easy handle is duplicated, bound mime structures must however
still be duplicated too as their components hold send-time dynamic
information.

Closes #9927

2 years agotest416: verify growing FTP file support
fractal-access [Thu, 10 Nov 2022 15:20:28 +0000 (16:20 +0100)] 
test416: verify growing FTP file support

Added setting: RETRSIZE [size] in the <servercmd> section. When set this
will cause the test FTP server to return the size set (rather than the
actual size) in the acknowledgement from a RETR request.

Closes #9772

2 years agoftp: support growing files with CURLOPT_IGNORE_CONTENT_LENGTH
fractal-access [Wed, 19 Oct 2022 13:37:44 +0000 (14:37 +0100)] 
ftp: support growing files with CURLOPT_IGNORE_CONTENT_LENGTH

When using the option CURLOPT_IGNORE_CONTENT_LENGTH (set.ignorecl in
code) to support growing files in FTP, the code should ignore the
initial size it gets from the server as this will not be the final size
of the file. This is done in ftp_state_quote() to prevent a size request
being issued in the initial sequence. However, in a later call to
ftp_state_get_resp() the code attempts to get the size of the content
again if it doesn't already have it, by parsing the response from the
RETR request. This fix prevents this parsing of the response to get the
size when the set.ignorecl option is set. This should maintain the size
value as -1, unknown, in this situation.

Closes #9772

2 years agocfilter: re-add `conn` as parameter to cfilter setup methods
Stefan Eissing [Sat, 26 Nov 2022 11:43:56 +0000 (12:43 +0100)] 
cfilter: re-add `conn` as parameter to cfilter setup methods

- `Curl_ssl_get_config()` now returns the first config if no SSL proxy
  filter is active

- socket filter starts connection only on first invocation of its
  connect method

Fixes #9982
Closes #9983

2 years agoKNOWN_BUGS: remove five FTP related issues
Daniel Stenberg [Tue, 22 Nov 2022 08:28:20 +0000 (09:28 +0100)] 
KNOWN_BUGS: remove five FTP related issues

- "FTP with CONNECT and slow server"

I believe this is not a problem these days.

- "FTP with NULs in URL parts"

The FTP protocol does not support them properly anyway.

- remove "FTP and empty path parts in the URL"

I don't think this has ever been reported as a real problem but was only
a hypothetical one.

- "Premature transfer end but healthy control channel"

This is not a bug, this is an optimization that *could* be performed but is
not an actual problem.

- "FTP without or slow 220 response"

Instead add to the documentation of the connect timeout that the
connection is considered complete at TCP/TLS/QUIC layer.

Closes #9979

2 years agotests: add authorityInfoAccess to generated certs
Stefan Eissing [Fri, 25 Nov 2022 13:00:48 +0000 (14:00 +0100)] 
tests: add authorityInfoAccess to generated certs

Generate stunnel.pem as well

Closes #9980

2 years agoruntests: --no-debuginfod now disables DEBUGINFOD_URLS
Daniel Stenberg [Sat, 19 Nov 2022 14:58:35 +0000 (15:58 +0100)] 
runtests: --no-debuginfod now disables DEBUGINFOD_URLS

Prior to this change, DEBUGINFOD_URLS was always disabled by runtests
due to a report of it slowing down tests. However, some setups need it
to fetch debug symbols, and if it is disabled on those systems then curl
tests with valgrind will fail.

Reported-by: Mark Gaiser
Ref: #8805
Closes #9950

2 years agotest/aws_sigv4: test cases for content-sha256
Casey Bodley [Mon, 21 Nov 2022 19:56:13 +0000 (14:56 -0500)] 
test/aws_sigv4: test cases for content-sha256

1956 adds the sha256 value corresponding to an empty buffer
1957 adds an arbitrary value and confirms that the signature differs from 1956
1958 adds whitespace to 1957 and confirms that the signature matches 1957
1959 adds a value longer than 'char sha_hex[65]' in Curl_output_aws_sigv4()

Signed-off-by: Casey Bodley <cbodley@redhat.com>
Closes #9804

2 years agoaws_sigv4: consult x-%s-content-sha256 for payload hash
Casey Bodley [Tue, 25 Oct 2022 22:46:58 +0000 (18:46 -0400)] 
aws_sigv4: consult x-%s-content-sha256 for payload hash

`Curl_output_aws_sigv4()` doesn't always have the whole payload in
memory to generate a real payload hash. this commit allows the user to
pass in a header like `x-amz-content-sha256` to provide their desired
payload hash

some services like s3 require this header, and may support other values
like s3's `UNSIGNED-PAYLOAD` and `STREAMING-AWS4-HMAC-SHA256-PAYLOAD`
with special semantics. servers use this header's value as the payload
hash during signature validation, so it must match what the client uses
to generate the signature

CURLOPT_AWS_SIGV4.3 now describes the content-sha256 interaction

Signed-off-by: Casey Bodley <cbodley@redhat.com>
Closes #9804

2 years agoGHA: NSS use clang instead of clang-9
Philip H [Thu, 24 Nov 2022 09:32:34 +0000 (10:32 +0100)] 
GHA: NSS use clang instead of clang-9

Closes #9978

2 years agoRELEASE-NOTES: synced
Daniel Stenberg [Fri, 25 Nov 2022 07:40:19 +0000 (08:40 +0100)] 
RELEASE-NOTES: synced

2 years agotool_operate: override the numeric locale and set "C" by force
Daniel Stenberg [Wed, 23 Nov 2022 10:24:26 +0000 (11:24 +0100)] 
tool_operate: override the numeric locale and set "C" by force

Makes curl always use dot as decimal separator for options,
independently of what the locale says. Makes scripts and command lines
portable.

Updated docs accordingly.

Reported-by: Daniel Faust
Fixes #9969
Closes #9972

2 years agotest1662: verify formpost, 301 redirect, no rewind possible
Daniel Stenberg [Tue, 22 Nov 2022 07:25:50 +0000 (08:25 +0100)] 
test1662: verify formpost, 301 redirect, no rewind possible

Reproduces #9735 and verifies the subsequent fix. The original issue
uses a pipe that cannot be rewound, but this test case instead sets a
callback without rewind ability to get roughly the same properties but
being a much more portable test.

2 years agolib: rewind BEFORE request instead of AFTER previous
Daniel Stenberg [Tue, 22 Nov 2022 07:25:50 +0000 (08:25 +0100)] 
lib: rewind BEFORE request instead of AFTER previous

This makes a big difference for cases when the rewind is not actually
necessary to perofm (for example HTTP response code 301 converts to GET)
and therefore the rewind can be avoided. In particular for situations
when that rewind fails, for example when reading from a pipe or similar.

Reported-by: Ali Utku Selen
Fixes #9735
Closes #9958

2 years agovtls: repair build with disabled proxy
Daniel Stenberg [Wed, 23 Nov 2022 15:11:25 +0000 (16:11 +0100)] 
vtls: repair build with disabled proxy

Closes #9974

2 years agopackaging: remove traces of deleted files
Daniel Gustafsson [Wed, 23 Nov 2022 11:12:59 +0000 (12:12 +0100)] 
packaging: remove traces of deleted files

Commit a8861b6cc removed packages/DOS but left a few traces of it
which broke the distcheck CI. Remove all traces.

Closes: #9971
Reviewed-by: Daniel Stenberg <daniel@haxx.se>
2 years agoopenssl: silence compiler warning when not using IPv6
Daniel Gustafsson [Wed, 23 Nov 2022 11:10:30 +0000 (12:10 +0100)] 
openssl: silence compiler warning when not using IPv6

In non-IPv6 builds the conn parameter is unused, and compilers which
run with "-Werror=unused-parameter" (or similar) warnings turned on
fails to build. Below is an excerpt from a CI job:

  vtls/openssl.c: In function ‘Curl_ossl_verifyhost’:
  vtls/openssl.c:2016:75: error: unused parameter ‘conn’ [-Werror=unused-parameter]
   2016 | CURLcode Curl_ossl_verifyhost(struct Curl_easy *data, struct connectdata *conn,
        |                                                       ~~~~~~~~~~~~~~~~~~~~^~~~

Closes: #9970
Reviewed-by: Daniel Stenberg <daniel@haxx.se>
2 years agonetware: remove leftover traces
Daniel Gustafsson [Wed, 23 Nov 2022 10:56:52 +0000 (11:56 +0100)] 
netware: remove leftover traces

Commit 3b16575ae938dec2a29454631a12aa52b6ab9c67 removed support for
building on Novell Netware, but a few leftover traces remained. This
removes the last bits.

Closes: #9966
Reviewed-by: Daniel Stenberg <daniel@haxx.se>
2 years agocurl_endian: remove Curl_write64_le from header
Ryan Schmidt [Tue, 22 Nov 2022 23:59:14 +0000 (17:59 -0600)] 
curl_endian: remove Curl_write64_le from header

The actual function was already removed in 4331c6dc.

See #7280
Closes #9968

2 years agodocs: add more "SEE ALSO" links to CA related pages
Daniel Stenberg [Tue, 22 Nov 2022 09:38:16 +0000 (10:38 +0100)] 
docs: add more "SEE ALSO" links to CA related pages

Closes #9959

2 years agoexamples: update descriptions
Daniel Stenberg [Tue, 22 Nov 2022 09:57:55 +0000 (10:57 +0100)] 
examples: update descriptions

Make them not say "this is an example showing..." and instead just say
what the example shows.

Closes #9960

2 years agovtls: localization of state data in filters
Stefan Eissing [Tue, 22 Nov 2022 08:55:41 +0000 (09:55 +0100)] 
vtls: localization of state data in filters

 - almost all backend calls pass the Curl_cfilter intance instead of
   connectdata+sockindex
 - ssl_connect_data is remove from struct connectdata and made internal
   to vtls
 - ssl_connect_data is allocated in the added filter, kept at cf->ctx

 - added function to let a ssl filter access its ssl_primary_config and
   ssl_config_data this selects the propert subfields in conn and data,
   for filters added as plain or proxy
 - adjusted all backends to use the changed api
 - adjusted all backends to access config data via the exposed
   functions, no longer using conn or data directly

cfilter renames for clear purpose:

 - methods `Curl_conn_*(data, conn, sockindex)` work on the complete
   filter chain at `sockindex` and connection `conn`.
 - methods `Curl_cf_*(cf, ...)` work on a specific Curl_cfilter
   instance.
 - methods `Curl_conn_cf()` work on/with filter instances at a
   connection.
 - rebased and resolved some naming conflicts
 - hostname validation (und session lookup) on SECONDARY use the same
   name as on FIRST (again).

new debug macros and removing connectdata from function signatures where not
needed.

adapting schannel for new Curl_read_plain paramter.

Closes #9919

2 years agoexamples/10-at-a-time: fix possible skipped final transfers
Daniel Stenberg [Tue, 22 Nov 2022 08:32:42 +0000 (03:32 -0500)] 
examples/10-at-a-time: fix possible skipped final transfers

Prior to this change if curl_multi_perform returned 0 running handles
and then all remaining transfers were added, then the perform loop would
end immediately without performing those transfers.

Reported-by: Mikhail Kuznetsov
Fixes https://github.com/curl/curl/issues/9953
Closes https://github.com/curl/curl/pull/9954

2 years agoMakefile.mk: portable Makefile.m32
Viktor Szakats [Tue, 22 Nov 2022 08:25:05 +0000 (08:25 +0000)] 
Makefile.mk: portable Makefile.m32

Update bare GNU Make `Makefile.m32` to:

- Move objects into a subdirectory.
- Add support for MS-DOS. Tested with DJGPP.
- Add support for Watt-32 (on MS-DOS).
- Add support for AmigaOS.
- Rename `Makefile.m32` to `Makefile.mk`
- Replace `ARCH` with `TRIPLET`.
- Build `tool_hugehelp.c` proper (when tools are available).
- Drop MS-DOS compatibility macro `USE_ZLIB` (replaced by `HAVE_LIBZ`)
- Add support for `ZLIB_LIBS` to override `-lz`.
- Omit object files when building examples.
- Default `CC` to `gcc` once again, for convenience. (Caveat: compiler
  name `cc` cannot be set now.)
- Set `-DCURL_NO_OLDIES` for examples, like autotools does.
- Delete `makefile.dj` files. Notice the configuration details and
  defaults are not retained with the new method.
- Delete `makefile.amiga` files. A successful build needs a few custom
  options. We're also not retaining all build details from the existing
  Amiga make files.
- Rename `Makefile.m32` to `Makefile.mk` to reflect that they are not
  Windows/MinGW32-specific anymore.
- Add support for new `CFG` options: `-map`, `-debug`, `-trackmem`
- Set `-DNDEBUG` by default.
- Allow using `-DOS=...` in all `lib/config-*.h` headers, syncing this
  with `config-win32.h`.
- Look for zlib parts in `ZLIB_PATH/include` and `ZLIB_PATH/lib`
  instead of bare `ZLIB_PATH`.

Note that existing build configurations for MS-DOS and AmigaOS likely
become incompatible with this change.

Example AmigaOS configuration:
```
export CROSSPREFIX=/opt/amiga/bin/m68k-amigaos-
export CC=gcc
export CPPFLAGS='-DHAVE_PROTO_BSDSOCKET_H'
export CFLAGS='-mcrt=clib2'
export LDFLAGS="${CFLAGS}"
export LIBS='-lnet -lm'
make -C lib -f Makefile.mk
make -C src -f Makefile.mk
```

Example MS-DOS configuration:
```
export CROSSPREFIX=/opt/djgpp/bin/i586-pc-msdosdjgpp-
export WATT_PATH=/opt/djgpp/net/watt
export ZLIB_PATH=/opt/djgpp
export OPENSSL_PATH=/opt/djgpp
export OPENSSL_LIBS='-lssl -lcrypt'
export CFG=-zlib-ssl
make -C lib -f Makefile.mk
make -C src -f Makefile.mk
```

Closes #9764

2 years agocfiler: filter types have flags indicating what they do
Stefan Eissing [Mon, 21 Nov 2022 14:40:26 +0000 (15:40 +0100)] 
cfiler: filter types have flags indicating what they do

- Adding Curl_conn_is_ip_connected() to check if network connectivity
  has been reached

- having ftp wait for network connectivity before proceeding with
  transfers.

Fixes test failures 1631 and 1632 with hyper.

Closes #9952

2 years agoRELEASE-NOTES: synced
Daniel Stenberg [Mon, 21 Nov 2022 12:39:01 +0000 (13:39 +0100)] 
RELEASE-NOTES: synced

2 years agosendf: change Curl_read_plain to wrap Curl_recv_plain (take 2)
Jay Satiro [Mon, 14 Nov 2022 08:30:30 +0000 (03:30 -0500)] 
sendf: change Curl_read_plain to wrap Curl_recv_plain (take 2)

Prior to this change Curl_read_plain would attempt to read the
socket directly. On Windows that's a problem because recv data may be
cached by libcurl and that data is only drained using Curl_recv_plain.

Rather than rewrite Curl_read_plain to handle cached recv data, I
changed it to wrap Curl_recv_plain, in much the same way that
Curl_write_plain already wraps Curl_send_plain.

Curl_read_plain -> Curl_recv_plain
Curl_write_plain -> Curl_send_plain

This fixes a bug in the schannel backend where decryption of arbitrary
TLS records fails because cached recv data is never drained. We send
data (TLS records formed by Schannel) using Curl_write_plain, which
calls Curl_send_plain, and that may do a recv-before-send
("pre-receive") to cache received data. The code calls Curl_read_plain
to read data (TLS records from the server), which prior to this change
did not call Curl_recv_plain and therefore cached recv data wasn't
retrieved, resulting in malformed TLS records and decryption failure
(SEC_E_DECRYPT_FAILURE).

The bug has only been observed during Schannel TLS 1.3 handshakes. Refer
to the issue and PR for more information.

--

This is take 2 of the original fix. It preserves the original behavior
of Curl_read_plain to write 0 to the bytes read parameter on error,
since apparently some callers expect that (SOCKS tests were hanging).
The original fix which landed in 12e1def5 and was later reverted in
18383fbf failed to work properly because it did not do that.

Also, it changes Curl_write_plain the same way to complement
Curl_read_plain, and it changes Curl_send_plain to return -1 instead of
0 on CURLE_AGAIN to complement Curl_recv_plain.

Behavior on error with these changes:

Curl_recv_plain returns -1 and *code receives error code.
Curl_send_plain returns -1 and *code receives error code.
Curl_read_plain returns error code and *n (bytes read) receives 0.
Curl_write_plain returns error code and *written receives 0.

--

Ref: https://github.com/curl/curl/issues/9431#issuecomment-1312420361

Assisted-by: Joel Depooter
Reported-by: Egor Pugin
Fixes https://github.com/curl/curl/issues/9431
Closes https://github.com/curl/curl/pull/9949

2 years agohyper: classify headers as CONNECT and 1XX
Sean McArthur [Fri, 18 Nov 2022 20:29:44 +0000 (12:29 -0800)] 
hyper: classify headers as CONNECT and 1XX

Closes #9947

2 years agoftp: fix "AUTH TLS" on primary conn and for SSL in PASV second conn
Stefan Eissing [Fri, 18 Nov 2022 20:33:37 +0000 (21:33 +0100)] 
ftp: fix "AUTH TLS" on primary conn and for SSL in PASV second conn

Follow-up to dafdb20a26d0c89

Reported-by: Anthony Hu
Closes #9948