]> git.ipfire.org Git - thirdparty/curl.git/log
thirdparty/curl.git
3 years agodigest: unquote realm and nonce before processing
Evgeny Grin [Wed, 25 May 2022 07:20:18 +0000 (10:20 +0300)] 
digest: unquote realm and nonce before processing

RFC 7616 (and 2617) requires values to be "unquoted" before used for
digest calculations. The only place where unquoting can be done
correctly is header parsing function (realm="DOMAIN\\host" and
realm=DOMAN\\host are different realms).

This commit adds unquoting (de-escaping) of all values during header
parsing and quoting of the values during header forming. This approach
should be most straightforward and easy to read/maintain as all values
are processed in the same way as required by RFC.

Closes #8912

3 years agoheaders: handle unfold of space-cleansed headers
Daniel Stenberg [Wed, 1 Jun 2022 12:04:17 +0000 (14:04 +0200)] 
headers: handle unfold of space-cleansed headers

Detected by OSS-fuzz

Bug: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=47767

Updated test 1274

Closes #8947

3 years agolib: make more protocol specific struct fields #ifdefed
Daniel Stenberg [Wed, 1 Jun 2022 12:30:55 +0000 (14:30 +0200)] 
lib: make more protocol specific struct fields #ifdefed

... so that they don't take up space if the protocols are disabled in
the build.

Closes #8944

3 years agoDISABLED: disable 1021 for hyper again
Daniel Stenberg [Wed, 1 Jun 2022 07:43:48 +0000 (09:43 +0200)] 
DISABLED: disable 1021 for hyper again

due to flakiness in the CI builds

3 years agourldata: store tcp_keepidle and tcp_keepintvl as ints
Daniel Stenberg [Tue, 31 May 2022 11:42:35 +0000 (13:42 +0200)] 
urldata: store tcp_keepidle and tcp_keepintvl as ints

They can't be set larger than INT_MAX in the setsocket API calls.

Also document the max values in their respective man pages.

Closes #8940

3 years agourldata: reduce size of a few struct fields
Daniel Stenberg [Tue, 31 May 2022 11:42:31 +0000 (13:42 +0200)] 
urldata: reduce size of a few struct fields

When the values are never larger than 32 bit, ints are better than longs.

Closes #8940

3 years agourldata: remove three unused booleans from struct UserDefined
Daniel Stenberg [Tue, 31 May 2022 11:42:23 +0000 (13:42 +0200)] 
urldata: remove three unused booleans from struct UserDefined

- is_fwrite_set
- free_referer
- strip_path_slash

Closes #8940

3 years agoremote-name.d: mention --output-dir
Daniel Stenberg [Tue, 31 May 2022 22:33:17 +0000 (00:33 +0200)] 
remote-name.d: mention --output-dir

plus add two see-alsos

Closes #8945

3 years agoconfigure: skip libidn2 detection when winidn is used
Jay Satiro [Sun, 29 May 2022 07:20:39 +0000 (03:20 -0400)] 
configure: skip libidn2 detection when winidn is used

Prior to this change --with-winidn could be overridden by libidn2
detection.

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

3 years agoCURLOPT_FILETIME.3: fix the protocols this works with
Daniel Stenberg [Tue, 31 May 2022 15:40:47 +0000 (17:40 +0200)] 
CURLOPT_FILETIME.3: fix the protocols this works with

3 years agotest681: verify --no-remote-name
Daniel Stenberg [Tue, 31 May 2022 11:24:02 +0000 (13:24 +0200)] 
test681: verify --no-remote-name

Follow-up to 83ee5c428d960 (from #8931)

Closes #8942

3 years agongtcp2: enable Linux GSO
Tatsuhiro Tsujikawa [Mon, 23 May 2022 11:03:05 +0000 (20:03 +0900)] 
ngtcp2: enable Linux GSO

Enable Linux GSO in ngtcp2 QUIC.  In order to recover from the
EAGAIN/EWOULDBLOCK by sendmsg with multiple packets in one GSO write,
packet buffer is now held by struct quicsocket.  GSO write might fail in
runtime depending on NIC.  Disable GSO if sendmsg returns EIO.

Closes #8909

3 years agoCURLOPT_PORT.3: We discourage using this option
Daniel Stenberg [Tue, 31 May 2022 08:56:35 +0000 (10:56 +0200)] 
CURLOPT_PORT.3: We discourage using this option

Closes #8941

3 years agoRELEASE-NOTES: synced
Daniel Stenberg [Tue, 31 May 2022 12:59:23 +0000 (14:59 +0200)] 
RELEASE-NOTES: synced

3 years agoheaders_push: error out if a folded header has no previous header
Daniel Stenberg [Tue, 31 May 2022 12:03:09 +0000 (14:03 +0200)] 
headers_push: error out if a folded header has no previous header

As that would indicate an illegal header. The fuzzer reached the assert
in unfold_value() proving that this case can happen.

Follow-up to c9b60f005358a364

Closes #8939

3 years agocurl: re-enable --no-remote-name
Boris Verkhovskiy [Tue, 31 May 2022 11:22:38 +0000 (13:22 +0200)] 
curl: re-enable --no-remote-name

Closes #8931

3 years agotest680: require 'http' since it uses such a URL
Daniel Stenberg [Tue, 31 May 2022 11:14:02 +0000 (13:14 +0200)] 
test680: require 'http' since it uses such a URL

Follow-up to d1b376c03524

3 years agoCURLOPT_NETRC.3: document the .netrc file format
Daniel Stenberg [Tue, 31 May 2022 07:05:01 +0000 (09:05 +0200)] 
CURLOPT_NETRC.3: document the .netrc file format

3 years agotest680: verify rejection of malformatted .netrc quoted password
Daniel Stenberg [Tue, 31 May 2022 07:05:01 +0000 (09:05 +0200)] 
test680: verify rejection of malformatted .netrc quoted password

3 years agotest679: verify netrc quoted string
Daniel Stenberg [Tue, 31 May 2022 07:05:01 +0000 (09:05 +0200)] 
test679: verify netrc quoted string

3 years agonetrc: support quoted strings
Daniel Stenberg [Tue, 31 May 2022 07:04:56 +0000 (09:04 +0200)] 
netrc: support quoted strings

The .netrc parser now accepts strings within double-quotes in order to
deal with for example passwords containing white space - which
previously was not possible.

A password that starts with a double-quote also ends with one, and
double-quotes themselves are escaped with backslashes, like \". It also
supports \n, \r and \t for newline, carriage return and tabs
respectively.

If the password does not start with a double quote, it will end at first
white space and no escaping is performed.

WARNING: this change is not entirely backwards compatible. If anyone
previously used a double-quote as the first letter of their password,
the parser will now get it differently compared to before. This is
highly unfortunate but hard to avoid.

Reported-by: ImpatientHippo on GitHub
Fixes #8908
Closes #8937

3 years agocurl_getdate.3: document that some illegal dates pass through
Daniel Stenberg [Mon, 30 May 2022 22:29:17 +0000 (00:29 +0200)] 
curl_getdate.3: document that some illegal dates pass through

Closes #8938

3 years agoCI: remove configure --enable-headers-api flags
Daniel Stenberg [Mon, 30 May 2022 12:13:48 +0000 (14:13 +0200)] 
CI: remove configure --enable-headers-api flags

3 years agoheaders api: remove EXPERIMENTAL tag
Daniel Stenberg [Mon, 30 May 2022 12:13:48 +0000 (14:13 +0200)] 
headers api: remove EXPERIMENTAL tag

Closes #8900

3 years agocookies: fix documentation comment
Daniel Gustafsson [Mon, 30 May 2022 11:46:25 +0000 (13:46 +0200)] 
cookies: fix documentation comment

Commit 4073cd83b2 added the noexpire parameter to Curl_cookie_add but
missed updating the documentation comment at the head of the file.

3 years agotests/data/test1940: use binary mode for expected stdout
Marc Hoersken [Sun, 29 May 2022 22:32:23 +0000 (00:32 +0200)] 
tests/data/test1940: use binary mode for expected stdout

The generated stdout data is written in binary mode with [LF]
line endings, therefore we also need to do a binary comparison.

Assisted-by: Jay Satiro
Assisted-by: Daniel Stenberg
Follow up to c9b60f005358a364cbcddbebd8d12593acffdd84
Fixes #8920
Closes #8936

3 years agoCURLINFO_CAINFO/PATH.3: clarify the multiple TLS situation
Daniel Stenberg [Sat, 28 May 2022 23:47:50 +0000 (01:47 +0200)] 
CURLINFO_CAINFO/PATH.3: clarify the multiple TLS situation

Spell out the multi-TLS situation.

Reported-by: Dan Fandrich
Fixes #8926
Closes #8932

3 years agotool_getparam: fix --parallel-max maximum value constraint
JustAnotherArchivist [Sat, 28 May 2022 05:07:02 +0000 (05:07 +0000)] 
tool_getparam: fix --parallel-max maximum value constraint

- Clamp --parallel-max to MAX_PARALLEL (300) instead of resetting to
  default value.

Previously, --parallel-max 300 would use 300 concurrent transfers, but
--parallel-max 301 would unexpectedly use only 50. This change clamps
higher values to the maximum (ie --parallel-max 301 would use 300).

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

3 years agocurl.1: add a few see also --tls-max
Daniel Stenberg [Fri, 27 May 2022 14:51:05 +0000 (16:51 +0200)] 
curl.1: add a few see also --tls-max

Closes #8929

3 years agocmake: do not add libcurl.rc to the static libcurl library
Viktor Szakats [Thu, 26 May 2022 15:54:47 +0000 (15:54 +0000)] 
cmake: do not add libcurl.rc to the static libcurl library

Fixes: https://github.com/curl/curl/pull/8918#issuecomment-1138263855
Reviewed-By: Karlson2k@users.noreply.github.com
Closes #8923

3 years agocmake: support adding a suffix to the OS value
Viktor Szakats [Thu, 26 May 2022 15:54:20 +0000 (15:54 +0000)] 
cmake: support adding a suffix to the OS value

CMake automatically uses the `CMAKE_SYSTEM_NAME` value to fill the OS
string appearing in the --version output after the curl version number,
for example:

  'curl 7.83.1 (Windows)'

This patchs adds the ability to pass a suffix that is appended to this
value. It's useful to add CPU info or other platform details,
for example:

  'curl 7.83.1 (Windows-x64)'

Closes #8919

3 years agocmake: enable curl.rc for all Windows targets
Viktor Szakats [Thu, 26 May 2022 15:53:19 +0000 (15:53 +0000)] 
cmake: enable curl.rc for all Windows targets

Before this patch, it was only enabled for MSVC. This syncs this
configuration with libcurl.rc, which was already included with
every Windows compiler.

Closes #8918

3 years agocmake: fix detecting libidn2
Viktor Szakats [Thu, 26 May 2022 15:52:57 +0000 (15:52 +0000)] 
cmake: fix detecting libidn2

Without this patch, libidn2 detection doesn't even seem to be
attempted. With this patch, cmake can be configured to pick it
up and enable it. Necessary configuration remains manual and
differs from most other dependencies.

If you are aware of a better fix, we're glad hearing about it
in a new Issue.

Closes #8917

3 years agoversion: allow stricmp() for sorting the feature list
Viktor Szakats [Wed, 25 May 2022 15:24:42 +0000 (15:24 +0000)] 
version: allow stricmp() for sorting the feature list

In CMakeLists.txt there is an attempt to detect `stricmp()`, and in
certain cases, this attempt is the only successful one to detect a
case-insensitive comparison function. `HAVE_STRICMP` is defined as
a result, but this macro wasn't used anywhere in the source. This
patch makes use of it as an alternative when alpha-sorting the
`--version` feature list.

Reviewed-by: Daniel Stenberg
Closes #8916

3 years agoDISABLED: add six tests that fail with hyper 8924/head
Daniel Stenberg [Wed, 25 May 2022 11:06:39 +0000 (13:06 +0200)] 
DISABLED: add six tests that fail with hyper

1117 1274 1940 1941 1942 1943

3 years agoc-hyper: mark status line as status for Curl_client_write()
Daniel Stenberg [Wed, 25 May 2022 11:06:29 +0000 (13:06 +0200)] 
c-hyper: mark status line as status for Curl_client_write()

To make sure the headers API can filter it out as not a regular header.

Reported-by: Gisle Vanem
Fixes #8894
Closes #8914

3 years agotests/data/test1501: kill ftp server after slow LIST response
Marc Hoersken [Tue, 24 May 2022 10:25:39 +0000 (12:25 +0200)] 
tests/data/test1501: kill ftp server after slow LIST response

This test is contributing to flakiness on the Windows CI runs.
Killing the ftp server after the test run like other slowness
tests already do may help resolve or reduce the flakiness.

Closes #8907

3 years agoheaders: fix the unfold realloc to use proper new size
Daniel Stenberg [Wed, 25 May 2022 08:32:22 +0000 (10:32 +0200)] 
headers: fix the unfold realloc to use proper new size

Previously it didn't take the old name length into acount

Follow-up to: c9b60f005358a364
Closes #8913

3 years agoGHA: align all install, configure and build steps again
Marc Hoersken [Tue, 17 May 2022 22:03:16 +0000 (00:03 +0200)] 
GHA: align all install, configure and build steps again

First step towards more unified build steps on GitHub Actions.

Closes #8873

3 years agoCI/azure: remove obsolete strategy for single builds
Marc Hoersken [Tue, 24 May 2022 21:50:29 +0000 (23:50 +0200)] 
CI/azure: remove obsolete strategy for single builds

This shortens these CI job names on GitHub even more.
Follow up to #8906 which also increased their timeout.

Closes #8911

3 years agoCI/azure: shorten names of Windows CI jobs
Marc Hoersken [Tue, 24 May 2022 10:19:05 +0000 (12:19 +0200)] 
CI/azure: shorten names of Windows CI jobs

Suggested-by: Daniel Stenberg
Closes #8906

3 years agohttp: restore header folding behavior
Daniel Stenberg [Tue, 24 May 2022 21:33:35 +0000 (23:33 +0200)] 
http: restore header folding behavior

Folded header lines will now get passed through like before. The headers
API is adapted and will provide the content unfolded.

Added test 1274 and extended test 1940 to verify.

Reported-by: Petr Pisar
Fixes #8844
Closes #8899

3 years agoMakefile.m32: delete obsolete options, improve -On [ci skip]
Viktor Szakats [Tue, 24 May 2022 17:04:38 +0000 (17:04 +0000)] 
Makefile.m32: delete obsolete options, improve -On [ci skip]

- `-D_AMD64_` has not been necessary for mingw-w64 builds for a long time now.
- `-fno-strict-aliasing` is mentioned for Intel C compiler in autotools, and
  I used this with VxWorks in another project, but otherwise this isn't
  necessary anymore as a default. If a target still needs it, it can be
  added with `CURL_CFLAG_EXTRAS=-fno-strict-aliasing`
- bump up default optimization level to `-O3` (from `-O2`), and also rearrange
  option order so the default can now be overridden via
  `CURL_CFLAG_EXTRAS`.
- delete `-g` (generate debug info) from `CFLAGS` and `-s` from `LDFLAGS`
  (strip debug info). They were working against each other. Now, if someone
  needs debug info, it can be enabled via `CURL_CFLAG_EXTRAS=-g`

Closes #8904

3 years agontlm: fix one more hostname test fallout
Daniel Gustafsson [Tue, 24 May 2022 10:51:28 +0000 (12:51 +0200)] 
ntlm: fix one more hostname test fallout

This fixup was missed in commit 5a41abef6dca19.

Closes: #8901
Reviewed-by: Daniel Stenberg <daniel@haxx.se>
3 years agodoh: remove UNITTEST macro definition
Daniel Gustafsson [Tue, 24 May 2022 10:46:22 +0000 (12:46 +0200)] 
doh: remove UNITTEST macro definition

The UNITTEST macro is defined by curl_setup.h so there is no use in
carry a local copy of the logic.

Closes: #8902
Reviewed-by: Daniel Stenberg <daniel@haxx.se>
3 years agocookie: fix false positive "potentially uninitialized local variable"
Daniel Stenberg [Tue, 24 May 2022 08:57:32 +0000 (10:57 +0200)] 
cookie: fix false positive "potentially uninitialized local variable"

Reviewed-by: Daniel Gustafsson
Closes #8903

3 years agocurl: add --rate to set max request rate per time unit
Daniel Stenberg [Mon, 23 May 2022 15:59:56 +0000 (17:59 +0200)] 
curl: add --rate to set max request rate per time unit

--rate "12/m" - for 12 per minute or
--rate "5/h" - for 5 per hour

Removed from TODO

Closes #8671

3 years agomax-time.d: clarify max-time sets max transfer time
Jay Satiro [Thu, 19 May 2022 07:40:52 +0000 (03:40 -0400)] 
max-time.d: clarify max-time sets max transfer time

Prior to this change the doc said --max-time set the maximum time of the
'whole operation' which is not accurate. The option maps to
CURLOPT_TIMEOUT_MS which sets maximum transfer time.

For example, the maximum time on a transfer is reset if the transfer is
retried (--retry).

Reported-by: Nuru@users.noreply.github.com
Fixes https://github.com/curl/curl/issues/8877
Closes #8879

3 years agoGHA/hyper: enable debug in the build
Daniel Stenberg [Mon, 23 May 2022 14:47:22 +0000 (16:47 +0200)] 
GHA/hyper: enable debug in the build

3 years agohyper: use 'alt-used'
Daniel Stenberg [Mon, 23 May 2022 14:47:17 +0000 (16:47 +0200)] 
hyper: use 'alt-used'

Makes test 412+413 work

Closes #8898

3 years agoRELEASE-NOTES: synced
Daniel Stenberg [Mon, 23 May 2022 07:11:32 +0000 (09:11 +0200)] 
RELEASE-NOTES: synced

3 years agoCURLINFO_CAPATH/CAINFO: get the default CA paths from libcurl
Daniel Stenberg [Mon, 23 May 2022 06:42:23 +0000 (08:42 +0200)] 
CURLINFO_CAPATH/CAINFO: get the default CA paths from libcurl

Closes #8888

3 years agolinks: update dead links
Daniel Stenberg [Sun, 22 May 2022 22:36:49 +0000 (00:36 +0200)] 
links: update dead links

The wiki pages are gone, remove and link to more long-living docs.

Closes #8897

3 years agontlm: (void) typecast msnprintf() where we ignore return code
Daniel Stenberg [Mon, 23 May 2022 06:13:09 +0000 (08:13 +0200)] 
ntlm: (void) typecast msnprintf() where we ignore return code

Follow-up to 5a41abef6, to please Coverity

3 years agontlm: copy NTLM_HOSTNAME to host buffer
Daniel Gustafsson [Sun, 22 May 2022 21:26:24 +0000 (23:26 +0200)] 
ntlm: copy NTLM_HOSTNAME to host buffer

Commit 709ae2454f43 added a fake hostname to avoid leaking the local
hostname, but omitted copying it to the host buffer.  Fix by copying
and adjust the test fallout.

Closes: #8895
Fixes: #8893
Reported-by: Patrick Monnerat <patrick@monnerat.net>
Reviewed-by: Daniel Stenberg <daniel@haxx.se>
3 years agoconfigure: use the SED value to invoke sed
Daniel Gustafsson [Sat, 21 May 2022 13:34:24 +0000 (15:34 +0200)] 
configure: use the SED value to invoke sed

Rather than assuming sed in PATH, use the resolved $SED variable
like in all other invocations of sed in configure.

Closes: #8891
Reviewed-by: Daniel Stenberg <daniel@haxx.se>
Reviewed-by: Marcel Raad <Marcel.Raad@teamviewer.com>
3 years agongtcp2: Allow curl to send larger UDP datagrams
Tatsuhiro Tsujikawa [Sun, 10 Apr 2022 08:35:23 +0000 (17:35 +0900)] 
ngtcp2: Allow curl to send larger UDP datagrams

Allow curl to send larger UDP datagram if Path MTU Discovery finds the
availability of larger path MTU.  To make it work and not to send
fragmented packet, we need to set DF bit.  That makes send(2) fail with
EMSGSIZE if UDP datagram is too large.  In that case, just let it be
lost.  This patch enables DF bit for Linux only.

Closes #8883

3 years agolibcurl-security.3: add "Secrets in memory"
Daniel Stenberg [Fri, 20 May 2022 15:36:25 +0000 (17:36 +0200)] 
libcurl-security.3: add "Secrets in memory"

Closes #8881

3 years agotests: update NTLM tests to use new host name
Daniel Stenberg [Fri, 20 May 2022 14:24:01 +0000 (16:24 +0200)] 
tests: update NTLM tests to use new host name

Also drop the debug requirement, remove the setenv sections, remove
prechecks and add NTLM to the top keywords.

Closes #8889

3 years agontlm: provide a fixed fake host name
Daniel Stenberg [Fri, 20 May 2022 14:23:21 +0000 (16:23 +0200)] 
ntlm: provide a fixed fake host name

The NTLM protocol includes providing the local host name, but apparently
other implementations already provide a fixed fake name instead to avoid
leaking the real local name.

The exact name used is 'WORKSTATION', because Firefox uses that.

The change is written to allow someone to "back-pedal" fairly easy in
case of need.

Reported-by: Carlo Alberto
Fixes #8859
Closes #8889

3 years agoKNOWN_BUGS: fix typo in problem description
Daniel Gustafsson [Fri, 20 May 2022 11:43:35 +0000 (13:43 +0200)] 
KNOWN_BUGS: fix typo in problem description

s/TSL/TLS/

3 years agoFEATURES: remove yassl as TLS library for NTLM
Daniel Gustafsson [Fri, 20 May 2022 11:43:12 +0000 (13:43 +0200)] 
FEATURES: remove yassl as TLS library for NTLM

yassl was added in commit 9d904ee41b880b but is no longer available
and is thus not a library to use for NTLM. This aligns the FEATURES
doc with the FAQ.

Closes: #8886
Reviewed-by: Daniel Stenberg <daniel@haxx.se>
3 years agoFEATURES: reorder footnotes
Daniel Gustafsson [Fri, 20 May 2022 11:42:45 +0000 (13:42 +0200)] 
FEATURES: reorder footnotes

The empty left-behind footnote confused the website rendering into
creating a nested emoty list, making the resulting page look quite
odd.  Remove and re-order the remaining ones to avoid a gap in the
sequence.

Closes: #8886
Reviewed-by: Daniel Stenberg <daniel@haxx.se>
3 years agoFAQ: remove opinionated sentence on NTLM
Daniel Gustafsson [Fri, 20 May 2022 11:40:12 +0000 (13:40 +0200)] 
FAQ: remove opinionated sentence on NTLM

curl is a tool that support many different things, and it doesn't
really seem like our job to tell other what to use (as they might
not have much say in the matter even).  Also tidy up wording.

Closes: #8886
Reviewed-by: Daniel Stenberg <daniel@haxx.se>
3 years agolog2changes: do not indent empty lines [ci skip]
Viktor Szakats [Fri, 20 May 2022 05:58:05 +0000 (05:58 +0000)] 
log2changes: do not indent empty lines [ci skip]

This will omit two spaces of indentation from lines with no content,
thus avoiding 'spaces @ EOL'.

Reviewed-by: Daniel Stenberg <daniel@haxx.se>
Closes #8887

3 years agowolfssl: correct the failf() message when a handle can't be made
Daniel Stenberg [Thu, 19 May 2022 15:54:30 +0000 (17:54 +0200)] 
wolfssl: correct the failf() message when a handle can't be made

Closes #8885

3 years agoMakefile.m32: delete two obsolete OpenSSL options [ci skip]
Viktor Szakats [Thu, 19 May 2022 16:47:00 +0000 (16:47 +0000)] 
Makefile.m32: delete two obsolete OpenSSL options [ci skip]

- -DOPENSSL_NO_KRB5: No longer used by OpenSSL 1.1.x, 3.x, or
  LibreSSL 3.5.x, yet it collides with the latter, which defines
  it unconditionally, resulting in this warning:
    ../../libressl/include/openssl/opensslfeatures.h:14:9: warning: 'OPENSSL_NO_KRB5' macro redefined [-Wmacro-redefined]
  It was originally added to curl in 2004.

- -DHAVE_OPENSSL_PKCS12_H: No longer used by OpenSSL 1.1.x, 3.x, or
  LibreSSL back to at least 2.5.5. Originally added in the same
  commit as the above, in 2004.

Closes #8884

3 years agoRELEASE-NOTES: synced
Daniel Stenberg [Thu, 19 May 2022 15:59:09 +0000 (17:59 +0200)] 
RELEASE-NOTES: synced

bump to 7.84.0

3 years agoMakefile.am: fix portability issues
Christian Weisgerber via curl-library [Thu, 19 May 2022 13:45:07 +0000 (15:45 +0200)] 
Makefile.am: fix portability issues

Commit a04f0b961333e1a19848d073d8c7db9c20b2a371 made me notice that
there is a portability issue in curl's top-level Makefile.am.

$< can only be used in rules that deal with .SUFFIXES.  Its use
for general prerequisites is a GNU make extension.

$< could be replaced by $?, but I think in an autotools context,
something like this is better:

Bug: https://curl.se/mail/lib-2022-05/0024.html
Closes #8861

3 years agosocks: support unix sockets for socks proxy
Balakrishnan Balasubramanian [Thu, 19 May 2022 13:33:22 +0000 (15:33 +0200)] 
socks: support unix sockets for socks proxy

Usage:
  curl -x "socks5h://localhost/run/tor/socks" "https://example.com"

Updated runtests.pl to run a socksd server listening on unix socket

Added tests test1467 test1468

Added documentation for proxy command line option and socks proxy
options

Closes #8668

3 years agocmake: add libpsl support
Vincent Torri [Thu, 19 May 2022 13:29:54 +0000 (15:29 +0200)] 
cmake: add libpsl support

Fixes #8865
Closes #8867

3 years agongtcp2: extend QUIC transport parameters buffer
Tatsuhiro Tsujikawa [Tue, 17 May 2022 12:12:57 +0000 (21:12 +0900)] 
ngtcp2: extend QUIC transport parameters buffer

Extend QUIC transport parameters buffer because 64 bytes are too
short for the ever increasing parameters.

Closes #8872

3 years agongtcp2: handle error from ngtcp2_conn_submit_crypto_data
Tatsuhiro Tsujikawa [Tue, 17 May 2022 10:53:02 +0000 (19:53 +0900)] 
ngtcp2: handle error from ngtcp2_conn_submit_crypto_data

Closes #8871

3 years agongtcp2: send appropriate connection close error code
Tatsuhiro Tsujikawa [Sun, 15 May 2022 03:30:43 +0000 (12:30 +0900)] 
ngtcp2: send appropriate connection close error code

Closes #8870

3 years agotest1561: adjusted for the cookie fix
Daniel Stenberg [Thu, 19 May 2022 12:48:26 +0000 (14:48 +0200)] 
test1561: adjusted for the cookie fix

3 years agotest414: verify secure cookie domain overlay
Daniel Stenberg [Thu, 19 May 2022 12:48:26 +0000 (14:48 +0200)] 
test414: verify secure cookie domain overlay

3 years agocookie: address secure domain overlay
Harry Sintonen [Thu, 19 May 2022 12:48:26 +0000 (14:48 +0200)] 
cookie: address secure domain overlay

Bug: https://hackerone.com/reports/1560324
Co-authored-by: Daniel Stenberg
Closes #8840

3 years agostrcase: some optimisations
Frank Gevaerts [Wed, 18 May 2022 12:30:51 +0000 (14:30 +0200)] 
strcase: some optimisations

Lookup tables for toupper() and tolower() make Curl_strcasecompare()
about 1.5 times faster. Reorganising Curl_strcasecompare() to fully exit
early then also allows simplifying the check at the end, for another
15%. In total, the changes make Curl_strcasecompare() around 1.6 to 1.7
times faster.

Note that these optimisation assume ASCII. The original
Curl_raw_toupper() and raw_tolower() look like they already made that
assumption.

Closes #8875

3 years agoBUG-BOUNTY.md: mention the audit exception
Daniel Stenberg [Thu, 19 May 2022 08:20:06 +0000 (10:20 +0200)] 
BUG-BOUNTY.md: mention the audit exception

Dedicated - paid for - security audits that are performed in
collaboration with curl developers are not eligible for bounties.

(plus I changed the sub-titles to use ## instead of # in the markdown)

Closes #8880

3 years agolib/vssh/wolfssh.h: removed
Daniel Stenberg [Tue, 17 May 2022 06:43:03 +0000 (08:43 +0200)] 
lib/vssh/wolfssh.h: removed

Unused header file

Reported-by: Illarion Taev
Fixes #8863
Closes #8866

3 years agowolfSSL: explicitly use compatibility layer
Elms [Tue, 17 May 2022 04:55:24 +0000 (21:55 -0700)] 
wolfSSL: explicitly use compatibility layer

This change removes adding an include `$prefix/wolfssl` or similar to
allow for openssl include aliasing. Include paths of `wolfssl/openssl/`
are used to explicitly use wolfSSL includes. This fixes cmake builds as
well as avoiding potentially using openSSL headers since include path
order is not guaranteed.

Closes #8864

3 years agocurl: deprecate --random-file and --egd-file
Daniel Stenberg [Tue, 17 May 2022 09:06:07 +0000 (11:06 +0200)] 
curl: deprecate --random-file and --egd-file

As libcurl no longer has any functionality for them, the tool now does
nothing with them.

Closes #8670

3 years agoopts: deprecate RANDOM_FILE and EGDSOCKET
Daniel Stenberg [Tue, 17 May 2022 09:05:53 +0000 (11:05 +0200)] 
opts: deprecate RANDOM_FILE and EGDSOCKET

These two options were only ever used for the OpenSSL backend for
versions before 1.1.0. They were never used for other backends and they
are not used with recent OpenSSL versions. They were never used much by
applications.

The defines RANDOM_FILE and EGD_SOCKET can still be set at build-time
for ancient EOL OpenSSL versions.

Closes #8670

3 years agobindlocal: don't use a random port if port number would wrap
Harry Sintonen [Mon, 16 May 2022 19:18:04 +0000 (22:18 +0300)] 
bindlocal: don't use a random port if port number would wrap

Earlier if CURLOPT_LOCALPORT + CURLOPT_LOCALPORTRANGE would go past port
65535 the code would fall back to random port rather than giving up.

Closes #8862

3 years agotransfer: Fix potential NULL pointer dereference
Daniel Gustafsson [Mon, 16 May 2022 19:18:46 +0000 (21:18 +0200)] 
transfer: Fix potential NULL pointer dereference

Commit 0ef54abf5208 accidentally used the conn variable before the
assertion for it being NULL. Fix by moving the assignment which use
conn to after the assertion.

Closes: #8857
Reviewed-by: Daniel Stenberg <daniel@haxx.se>
3 years agodocs: clarify data replacement policy for MIME API
Daniel Gustafsson [Mon, 16 May 2022 18:32:38 +0000 (20:32 +0200)] 
docs: clarify data replacement policy for MIME API

The API documentation for the MIME functions specify that the parts
can be set twice, with the last call winning.  While true, the user
can set the parts n times for n > 2, reword to specify multiple API
calls instead.

Closes: #8860
Reviewed-by: Daniel Stenberg <daniel@haxx.se>
3 years agongtcp2: support boringssl crypto backend
vvb2060 on github [Tue, 3 May 2022 21:14:38 +0000 (05:14 +0800)] 
ngtcp2: support boringssl crypto backend

Closes #8789

3 years agoquic: add Curl_quic_idle
Tatsuhiro Tsujikawa [Tue, 12 Apr 2022 10:10:46 +0000 (19:10 +0900)] 
quic: add Curl_quic_idle

Add Curl_quic_idle which is called when no HTTP level read or write is
performed.  It is a good place to handle timer expiry for QUIC transport
(.e.g, retransmission).

Closes #8698

3 years agomprintf: ignore clang non-literal format string
Gregor Jasny [Sun, 24 Apr 2022 11:31:27 +0000 (13:31 +0200)] 
mprintf: ignore clang non-literal format string

Closes #8740

3 years agosectransp: check for a function defined when __BLOCKS__ is undefined
Nick Zitzmann [Sun, 15 May 2022 21:57:20 +0000 (16:57 -0500)] 
sectransp: check for a function defined when __BLOCKS__ is undefined

SecTrustEvaluateAsync() is defined in the macOS 10.7 SDK, but it
requires Grand Central Dispatch to be supported by the compiler, and
some third-party macOS compilers do not support Grand Central Dispatch.
SecTrustCopyPublicKey() is not present in macOS 10.6, so this shouldn't
adversely affect anything.

Fixes #8846
Reported-by: Egor Pugin
Closes #8854

3 years agotest412/413: Use version macro for User-Agent
Daniel Gustafsson [Mon, 16 May 2022 08:45:41 +0000 (10:45 +0200)] 
test412/413: Use version macro for User-Agent

Commit 46d45ea3a incorrectly hardcoded the User-Agent in the test
output file which breaks when curlver is updated. Shift to using
the %VERSION macro instead.

Closes: #8856
3 years agomacos9: remove partial support
Daniel Gustafsson [Mon, 16 May 2022 08:10:16 +0000 (10:10 +0200)] 
macos9: remove partial support

The support for compiling on Mac OS 9 hasn't been modified since 2001
and has no active maintainer or packager, so it's time to remove it as
it's incredibly unlikely to work. If a maintainer re-emerges it can be
resurrected from Git history.

Closes: #8836
Reviewed-by: Daniel Stenberg <daniel@haxx.se>
3 years agotest1635: verify --fail-with-body with --retry
Daniel Stenberg [Mon, 16 May 2022 08:04:18 +0000 (10:04 +0200)] 
test1635: verify --fail-with-body with --retry

Almost a dupe of 1634

Closes #8847

3 years agotool_operate: make sure --fail-with-body works with --retry
Daniel Stenberg [Mon, 16 May 2022 08:04:05 +0000 (10:04 +0200)] 
tool_operate: make sure --fail-with-body works with --retry

... in the same way --fail already does.

Reported-by: Jakub Bochenski
Fixes #8845
Closes #8847

3 years agongtcp2: Correct use of ngtcp2 and nghttp3 signed integer types
Tatsuhiro Tsujikawa [Sun, 15 May 2022 03:38:57 +0000 (12:38 +0900)] 
ngtcp2: Correct use of ngtcp2 and nghttp3 signed integer types

Closes #8851

3 years agongtcp2: Fix alert_read_func return value
Tatsuhiro Tsujikawa [Sun, 15 May 2022 03:49:05 +0000 (12:49 +0900)] 
ngtcp2: Fix alert_read_func return value

Closes #8852

3 years agoCurl_parsenetrc: don't access local pwbuf outside of scope
Harry Sintonen [Sat, 14 May 2022 22:58:05 +0000 (01:58 +0300)] 
Curl_parsenetrc: don't access local pwbuf outside of scope

Accessing local variables outside of the scope is forbidden and
depending on the compiler can result in the value being
overwritten. Fixed by moving the pwbuf to be in scope.

Closes #8850

3 years agoRELEASE-NOTES: synced
Daniel Stenberg [Mon, 16 May 2022 07:23:21 +0000 (09:23 +0200)] 
RELEASE-NOTES: synced

and bump curlver to 7.83.2 for now (but likely to become 7.84.0 soon)

3 years agoci: update github actions
Frazer Smith [Sat, 14 May 2022 21:37:59 +0000 (23:37 +0200)] 
ci: update github actions

- bump actions/checkout from 2 to 3
- bump actions/upload-artifact from 1 to 3
- bump github/codeql-actions from 1 to 2
- use version tag for actions/checkout

Closes #8843

3 years agotest1919: verify CURLOPT_XOAUTH2_BEARER leak fix
Daniel Stenberg [Sat, 14 May 2022 16:04:52 +0000 (18:04 +0200)] 
test1919: verify CURLOPT_XOAUTH2_BEARER leak fix