]> git.ipfire.org Git - thirdparty/curl.git/log
thirdparty/curl.git
4 years agotravis: remove the arm job 7239/head
Daniel Stenberg [Fri, 11 Jun 2021 11:59:37 +0000 (13:59 +0200)] 
travis: remove the arm job

We do it on circle CI instead

4 years agoCI: add .circleci/config.yml
Daniel Stenberg [Fri, 11 Jun 2021 05:50:28 +0000 (07:50 +0200)] 
CI: add .circleci/config.yml

Assisted-by: Gabriel Simmer
Closes #7239

4 years agoRELEASE-NOTES: synced
Daniel Stenberg [Fri, 11 Jun 2021 12:31:16 +0000 (14:31 +0200)] 
RELEASE-NOTES: synced

4 years agoruntests: init $VERSION to avoid warnings when using -l
Daniel Stenberg [Fri, 11 Jun 2021 12:26:32 +0000 (14:26 +0200)] 
runtests: init $VERSION to avoid warnings when using -l

4 years agoopenssl: don't remove session id entry in disassociate
Daniel Stenberg [Thu, 10 Jun 2021 11:50:40 +0000 (13:50 +0200)] 
openssl: don't remove session id entry in disassociate

When a connection is disassociated from a transfer, the Session ID entry
should remain.

Regression since 7f4a9a9 (shipped in libcurl 7.77.0)
Reported-by: Gergely Nagy
Reported-by: Paul Groke
Fixes #7222
Closes #7230

4 years agosingle_transfer: ignore blank --output-dir
Daniel Stenberg [Thu, 10 Jun 2021 14:18:22 +0000 (16:18 +0200)] 
single_transfer: ignore blank --output-dir

... as otherwise it creates a rather unexpected target directory with a
leading slash.

Reported-by: Harry Sintonen
Fixes #7218
Closes #7233

4 years agotests: update README about servers and port numbers
Daniel Stenberg [Fri, 11 Jun 2021 09:22:46 +0000 (11:22 +0200)] 
tests: update README about servers and port numbers

Closes #7242

4 years agoconn_shutdown: if closed during CONNECT cleanup properly
Daniel Stenberg [Wed, 9 Jun 2021 06:38:07 +0000 (08:38 +0200)] 
conn_shutdown: if closed during CONNECT cleanup properly

Reported-by: Alex Xu
Reported-by: Phil E. Taylor
Fixes #7236
Closes #7237

4 years agosws: malloc request struct instead of using stack
Christian Weisgerber [Thu, 10 Jun 2021 15:11:34 +0000 (17:11 +0200)] 
sws: malloc request struct instead of using stack

... 2MB requests is otherwise just too big for some systems.

(The allocations are not freed properly.)

Bug: https://curl.se/mail/lib-2021-06/0018.html

Closes #7235

4 years agolib: don't compare fd to FD_SETSIZE when using poll
Mark Swaanenburg [Fri, 11 Jun 2021 06:27:00 +0000 (06:27 +0000)] 
lib: don't compare fd to FD_SETSIZE when using poll

FD_SETSIZE is irrelevant when using poll. So ensuring that the file
descriptor is smaller than FD_SETSIZE in VALID_SOCK, can cause
multi_wait to ignore perfectly valid file descriptors and simply wait
for 1s to avoid hammering the CPU in a busy loop.

Fixes #7240
Closes #7241

4 years agodoh: fix wrong DEBUGASSERT for doh private_data
zhangxiuhua [Thu, 10 Jun 2021 08:17:31 +0000 (16:17 +0800)] 
doh: fix wrong DEBUGASSERT for doh private_data

Closes #7227

4 years agotests: update README.md with a missing single quote
yb999 [Thu, 10 Jun 2021 14:05:28 +0000 (22:05 +0800)] 
tests: update README.md with a missing single quote

Closes #7231

4 years agoGHA: run all tests for hyper too
Daniel Stenberg [Wed, 9 Jun 2021 11:52:45 +0000 (13:52 +0200)] 
GHA: run all tests for hyper too

As it lists disabled ones in DISABLED now

Closes #7209

4 years agotests/data/DISABLED: add tests not working with hyper
Daniel Stenberg [Tue, 8 Jun 2021 21:31:46 +0000 (23:31 +0200)] 
tests/data/DISABLED: add tests not working with hyper

The goal is to remove them all from here over time.

Closes #7209

4 years agoruntests: also find the last test in Makefile.inc
Daniel Stenberg [Wed, 9 Jun 2021 11:52:29 +0000 (13:52 +0200)] 
runtests: also find the last test in Makefile.inc

Closes #7209

4 years agotest3010: work with hyper mode
Daniel Stenberg [Wed, 9 Jun 2021 11:40:55 +0000 (13:40 +0200)] 
test3010: work with hyper mode

Closes #7209

4 years agoconfigure: disable RTSP when hyper is selected
Daniel Stenberg [Wed, 9 Jun 2021 09:43:41 +0000 (11:43 +0200)] 
configure: disable RTSP when hyper is selected

Makes test 1013 work

Closes #7209

4 years agotest1594/1595/1596: fix to work in hyper mode
Daniel Stenberg [Tue, 8 Jun 2021 22:08:47 +0000 (00:08 +0200)] 
test1594/1595/1596: fix to work in hyper mode

Closes #7209

4 years agotest1438/1457: add HTTP keyword to make hyper mode work
Daniel Stenberg [Tue, 8 Jun 2021 22:04:44 +0000 (00:04 +0200)] 
test1438/1457: add HTTP keyword to make hyper mode work

Closes #7209

4 years agotest1340/1341: adjusted for hyper mode
Daniel Stenberg [Tue, 8 Jun 2021 22:00:17 +0000 (00:00 +0200)] 
test1340/1341: adjusted for hyper mode

Closes #7209

4 years agotest1218: adjusted for hyper mode
Daniel Stenberg [Tue, 8 Jun 2021 21:58:30 +0000 (23:58 +0200)] 
test1218: adjusted for hyper mode

Closes #7209

4 years agotest1216: adjusted for hyper mode
Daniel Stenberg [Tue, 8 Jun 2021 21:57:53 +0000 (23:57 +0200)] 
test1216: adjusted for hyper mode

Closes #7209

4 years agotest1230: adjust to work in hyper mode
Daniel Stenberg [Tue, 8 Jun 2021 21:56:50 +0000 (23:56 +0200)] 
test1230: adjust to work in hyper mode

Closes #7209

4 years agoc-hyper: abort CONNECT response reading early on non 2xx responses
Daniel Stenberg [Tue, 8 Jun 2021 21:30:57 +0000 (23:30 +0200)] 
c-hyper: abort CONNECT response reading early on non 2xx responses

Fixes test 493

Closes #7209

4 years agotest434: add HTTP keyword
Daniel Stenberg [Tue, 8 Jun 2021 15:45:45 +0000 (17:45 +0200)] 
test434: add HTTP keyword

Closes #7209

4 years agotest599: adjusted to work in hyper mode
Daniel Stenberg [Tue, 8 Jun 2021 09:37:31 +0000 (11:37 +0200)] 
test599: adjusted to work in hyper mode

Closes #7209

4 years agoc-hyper: fix the uploaded field in progress callbacks
Daniel Stenberg [Tue, 8 Jun 2021 08:11:28 +0000 (10:11 +0200)] 
c-hyper: fix the uploaded field in progress callbacks

Makes test 578 work

Closes #7209

4 years agotest566: adjust to work with hyper mode
Daniel Stenberg [Tue, 8 Jun 2021 07:41:28 +0000 (09:41 +0200)] 
test566: adjust to work with hyper mode

Closes #7209

4 years agoCURLOPT_WRITEFUNCTION.3: minor update of the example
Fawad Mirza [Wed, 9 Jun 2021 11:17:38 +0000 (16:47 +0530)] 
CURLOPT_WRITEFUNCTION.3: minor update of the example

Safely avoid chunk.size garbage value if declared non globally.

Closes #7219

4 years agoconfigure: rename get-easy-option configure option to get-easy-options
Bastian Krause [Tue, 8 Jun 2021 15:30:17 +0000 (17:30 +0200)] 
configure: rename get-easy-option configure option to get-easy-options

"get-easy-options" is the configure option advertised by the help text
anyway, so use that.

Fixes #7211
Closes #7213

Follow-up to ad691b191 ("configure: added --disable-get-easy-options")
Suggested-by: Daniel Stenberg <daniel@haxx.se>
Signed-off-by: Bastian Krause <bst@pengutronix.de>
4 years agoruntests: skip disabled tests unless -f is used
Daniel Stenberg [Tue, 8 Jun 2021 15:28:59 +0000 (17:28 +0200)] 
runtests: skip disabled tests unless -f is used

To make it easier to write ranges like '115 to 229' without that
explicitly enabling tests that are listed in DISABLED, this makes
runtests always skip disabled tests unless the -f command line option is
used.

Previously the code attempted to not run such tests, but didn't do it
correctly.

Closes #7212

4 years agongtcp2: disable TLSv1.3 compatible mode when using GnuTLS
Jun-ya Kato [Mon, 7 Jun 2021 00:52:14 +0000 (00:52 +0000)] 
ngtcp2: disable TLSv1.3 compatible mode when using GnuTLS

The latest GnuTLS-3.7.2 implements disable switch for TLSv1.3 compatible
mode for middle box but it is enabled by default, which is unnecessary
for QUIC.

Fixes #6896
Closes #7202

4 years agotest644: remove as duplicate of test 587
Daniel Stenberg [Tue, 8 Jun 2021 12:01:04 +0000 (14:01 +0200)] 
test644: remove as duplicate of test 587

Closes #7208

4 years agoRELEASE-NOTES: synced
Daniel Gustafsson [Tue, 8 Jun 2021 08:01:01 +0000 (10:01 +0200)] 
RELEASE-NOTES: synced

4 years agocookies: track expiration in jar to optimize removals
Daniel Gustafsson [Tue, 8 Jun 2021 07:16:58 +0000 (09:16 +0200)] 
cookies: track expiration in jar to optimize removals

Removing expired cookies needs to be a fast operation since we want to
be able to perform it often and speculatively. By tracking the timestamp
of the next known expiration we can exit early in case the timestamp is
in the future.

Closes: #7172
Reviewed-by: Daniel Stenberg <daniel@haxx.se>
4 years agoGHA: add several libcurl tests to the hyper job
Daniel Stenberg [Mon, 7 Jun 2021 21:18:45 +0000 (23:18 +0200)] 
GHA: add several libcurl tests to the hyper job

500 to 512

4 years agotest500: adjust to work with hyper mode
Daniel Stenberg [Mon, 7 Jun 2021 11:16:38 +0000 (13:16 +0200)] 
test500: adjust to work with hyper mode

4 years agoc-hyper: support CURLINFO_STARTTRANSFER_TIME
Daniel Stenberg [Mon, 7 Jun 2021 11:16:07 +0000 (13:16 +0200)] 
c-hyper: support CURLINFO_STARTTRANSFER_TIME

Closes #7204

4 years agoc-hyper: support CURLOPT_HEADER
Daniel Stenberg [Mon, 7 Jun 2021 11:07:37 +0000 (13:07 +0200)] 
c-hyper: support CURLOPT_HEADER

When enabled, the headers are passed to the body write callback as well.

Like in test 500

Closes #7204

4 years agoGHA: run the newly fixed tests with hyper
Daniel Stenberg [Mon, 7 Jun 2021 15:34:45 +0000 (17:34 +0200)] 
GHA: run the newly fixed tests with hyper

Closes #7205

4 years agotest433: adjust for hyper mode
Daniel Stenberg [Mon, 7 Jun 2021 09:57:25 +0000 (11:57 +0200)] 
test433: adjust for hyper mode

Closes #7205

4 years agotest395: hyper cannot work around > 64 bit content-lengths like built-in
Daniel Stenberg [Mon, 7 Jun 2021 09:55:52 +0000 (11:55 +0200)] 
test395: hyper cannot work around > 64 bit content-lengths like built-in

Closes #7205

4 years agotest394: hyper returns a different error
Daniel Stenberg [Mon, 7 Jun 2021 09:50:09 +0000 (11:50 +0200)] 
test394: hyper returns a different error

Closes #7205

4 years agotest393: make Content-Length fit within 64 bit for hyper
Daniel Stenberg [Mon, 7 Jun 2021 09:34:52 +0000 (11:34 +0200)] 
test393: make Content-Length fit within 64 bit for hyper

Closes #7205

4 years agotest347: CRLFify to work in hyper mode
Daniel Stenberg [Mon, 7 Jun 2021 09:27:41 +0000 (11:27 +0200)] 
test347: CRLFify to work in hyper mode

Closes #7205

4 years agotest339: CRLFify better to work in hyper mode
Daniel Stenberg [Mon, 7 Jun 2021 09:26:32 +0000 (11:26 +0200)] 
test339: CRLFify better to work in hyper mode

Closes #7205

4 years agotravis: remove the hyper build
Daniel Stenberg [Mon, 7 Jun 2021 15:22:55 +0000 (17:22 +0200)] 
travis: remove the hyper build

4 years agoGHA: add a linux-hyper job
Daniel Stenberg [Mon, 7 Jun 2021 12:57:14 +0000 (14:57 +0200)] 
GHA: add a linux-hyper job

Closes #7206

4 years agotest328: avoid a header-looking body to make hyper mode work
Daniel Stenberg [Mon, 7 Jun 2021 09:15:21 +0000 (11:15 +0200)] 
test328: avoid a header-looking body to make hyper mode work

The test still works the same, just modified two bytes in the content.

Closes #7203

4 years agorelease-notes.pl: also spot common 'closes' typo
Daniel Stenberg [Mon, 7 Jun 2021 09:16:58 +0000 (11:16 +0200)] 
release-notes.pl: also spot common 'closes' typo

4 years agometalink: remove
Daniel Stenberg [Tue, 1 Jun 2021 14:24:00 +0000 (16:24 +0200)] 
metalink: remove

Warning: this will make existing curl command lines that use metalink to
stop working.

Reasons for removal:

1. We've found several security problems and issues involving the
   metalink support in curl. The issues are not detailed here. When
   working on those, it become apparent to the team that several of the
   problems are due to the system design, metalink library API and what
   the metalink RFC says. They are very hard to fix on the curl side
   only.

2. The metalink usage with curl was only very briefly documented and was
   not following the "normal" curl usage pattern in several ways, making
   it surprising and non-intuitive which could lead to further security
   issues.

3. The metalink library was last updated 6 years ago and wasn't so
   active the years before that either. An unmaintained library means
   there's a security problem waiting to happen. This is probably reason
   enough.

4. Metalink requires an XML parsing library, which is complex code (even
   the smaller alternatives) and to this day often gets security
   updates.

5. Metalink is not a widely used curl feature. In the 2020 curl user
   survey, only 1.4% of the responders said that they'd are using it. In
   2021 that number was 1.2%. Searching the web also show very few
   traces of it being used, even with other tools.

6. The torrent format and associated technology clearly won for
   downloading large files from multiple sources in parallel.

Cloes #7176

4 years agodocs/INSTALL: remove mentions of configure --with-darwin-ssl
Daniel Stenberg [Sun, 6 Jun 2021 10:12:01 +0000 (12:12 +0200)] 
docs/INSTALL: remove mentions of configure --with-darwin-ssl

... as it isn't supported since a while back.

Make configure fail with a warning if used.

Reported-by: Vadim Grinshpun
Bug: https://curl.se/mail/lib-2021-06/0008.html
Closes #7200

4 years agoRELEASE-NOTES: synced
Daniel Stenberg [Sun, 6 Jun 2021 15:10:47 +0000 (17:10 +0200)] 
RELEASE-NOTES: synced

4 years agocmake: Avoid leaking absolute paths into exported config
Gregor Jasny [Mon, 31 May 2021 15:10:45 +0000 (17:10 +0200)] 
cmake: Avoid leaking absolute paths into exported config

The `find_libarary` command resolves the library or framework
into an absolute path. In case of system frameworks which are
located within an Xcode-provided SDK this results in the Xcode
path and SDK version being part of the library path.

Because those library paths end up in the exported CMake config
importing curl will fail once the Xcode location or SDK version
changes:

```cmake
set_target_properties(CURL::libcurl PROPERTIES
  INTERFACE_INCLUDE_DIRECTORIES "${_IMPORT_PREFIX}/include"
  INTERFACE_LINK_LIBRARIES "lber;ldap;/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.3.sdk/System/Library/Frameworks/SystemConfiguration.framework;OpenSSL::SSL;OpenSSL::Crypto;ZLIB::ZLIB"
)
```

A work-around is to link against system-level frameworks with
`-framework XYZ`. In case of `SystemConfiguration` we might be able
to omit the lookup-check because we could assume the framework is
always present.

Closes #7152

4 years agohttp2_connisdead: handle trailing GOAWAY better
Shikha Sharma [Fri, 4 Jun 2021 11:28:16 +0000 (13:28 +0200)] 
http2_connisdead: handle trailing GOAWAY better

When checking the connection the input processing returns error
immediately, we now consider that a dead connnection.

Bug: https://curl.se/mail/lib-2021-06/0001.html
Closes #7192

4 years agoares: always store IPv6 addresses first
Dmitry Karpov [Thu, 3 Jun 2021 21:56:37 +0000 (23:56 +0200)] 
ares: always store IPv6 addresses first

Trying dual-stack on some embedded platform, I noticed that quite
frequently (20%) libCurl starts from IPv4 regardless the Happy Eyeballs
timeout value.  After debugging this issue, I noticed that this happens
if c-ares resolver response for IPv6 family comes before IPv4 (which was
randomly happening in my tests).

In such cases, because libCurl puts the last resolver response on top of
the address list, when IPv4 resolver response comes after IPv6 one - the
IPv4 family starts the connection phase instead of IPv6 family.

The solution for this issue is to always put IPv6 addresses on top of
the address list, regardless the order of resolver responses.

Bug: https://curl.se/mail/lib-2021-06/0003.html

Closes #7188

4 years agoRevert "Revert "socketpair: fix potential hangs""
Daniel Stenberg [Sat, 5 Jun 2021 10:57:28 +0000 (12:57 +0200)] 
Revert "Revert "socketpair: fix potential hangs""

This reverts commit 3e70c3430a370a31eff2c1d8fea29edaca8f1127.

Thus brings back the change from #7144 as was originally landed in
c769d1eab4de8b

Closes #7144 (again)

4 years agoschannel: move code out of SChannel_connect_step1
Ebe Janchivdorj [Tue, 1 Jun 2021 20:37:08 +0000 (13:37 -0700)] 
schannel: move code out of SChannel_connect_step1

Reviewed-by: Marc Hoersken
Closes #7168

4 years agotests/data/Makefile.inc: error: trailing backslash on last line
Daniel Stenberg [Fri, 4 Jun 2021 14:50:54 +0000 (16:50 +0200)] 
tests/data/Makefile.inc: error: trailing backslash on last line

Follow-up to d8dcb399b8009d

4 years agoTODO: Support rate-limiting for MQTT
Daniel Stenberg [Fri, 4 Jun 2021 13:57:02 +0000 (15:57 +0200)] 
TODO: Support rate-limiting for MQTT

4 years agowarnless: simplify type size handling
dmitrykos [Wed, 2 Jun 2021 20:06:00 +0000 (23:06 +0300)] 
warnless: simplify type size handling

By using sizeof(T), existing defines and relying on the compiler to
define the required signed/unsigned mask.

Closes #7181

4 years ago[Win32] Fix for USE_WATT32
Gisle Vanem [Fri, 4 Jun 2021 10:16:57 +0000 (12:16 +0200)] 
[Win32] Fix for USE_WATT32

My Watt-32 tcp/ip stack works on Windows but it does not have `WSAIoctl()`

4 years agourl: bad CURLOPT_CONNECT_TO syntax now returns error
Alexis Vachette [Thu, 3 Jun 2021 12:49:49 +0000 (14:49 +0200)] 
url: bad CURLOPT_CONNECT_TO syntax now returns error

Added test 3020 to verify

Closes #7183

4 years agogithub: remove the cmake macOS gcc-8 jobs
Daniel Stenberg [Thu, 3 Jun 2021 21:03:35 +0000 (23:03 +0200)] 
github: remove the cmake macOS gcc-8 jobs

They're too similar to the gcc-9 ones to be useful (and seems to not
work anymore).

Closes #7187

4 years agotest269: disable for hyper 7186/head
Daniel Stenberg [Thu, 3 Jun 2021 15:56:36 +0000 (17:56 +0200)] 
test269: disable for hyper

--ignore-content-length / CURLOPT_IGNORE_CONTENT_LENGTH doesn't work
with hyper.

Closes #7184

4 years agoruntests: enable 'hyper mode' only for HTTP tests
Daniel Stenberg [Thu, 3 Jun 2021 16:10:44 +0000 (18:10 +0200)] 
runtests: enable 'hyper mode' only for HTTP tests

The 'hyper mode' makes line-ending checks work in the test suite for
when hyper is used. Now it also requires that HTTP or HTTPS are
mentioned as keywords to be enabled so that it doesn't wrongly adjusts
tests for other protocols.

This makes test 271 (TFTP) work again in hyper enabled builds.

Closes #7185

4 years agohostip: bad CURLOPT_RESOLVE syntax now returns error
Alexis Vachette [Wed, 2 Jun 2021 12:12:10 +0000 (14:12 +0200)] 
hostip: bad CURLOPT_RESOLVE syntax now returns error

Added test 3019
Fixes #7170
Closes #7174

4 years agocookies: fix typo and expand comment
Daniel Gustafsson [Thu, 3 Jun 2021 11:02:09 +0000 (13:02 +0200)] 
cookies: fix typo and expand comment

Fix a typo in the sorting comment, and while in there elaborate slightly
on why creationtime can be used as a tiebreaker.

4 years agocookies: remove unused header
Daniel Gustafsson [Thu, 3 Jun 2021 11:02:07 +0000 (13:02 +0200)] 
cookies: remove unused header

Commit 1c1d9f1affbd3367bcb24062e261d0ea5d185e3a removed the last use
for the inet_pton.h headerfile, this removes the inclusion of the
header.

Closes: #7182
Reviewed-by: Daniel Stenberg <daniel@haxx.se>
4 years agoRevert "socketpair: fix potential hangs"
Daniel Stenberg [Thu, 3 Jun 2021 10:12:13 +0000 (12:12 +0200)] 
Revert "socketpair: fix potential hangs"

This reverts commit c769d1eab4de8b9f1bd84d992c63692fdc43c5be.

See #7144 for details

4 years agosocketpair: fix potential hangs
Paul Groke [Fri, 28 May 2021 11:42:56 +0000 (13:42 +0200)] 
socketpair: fix potential hangs

Fixes potential hang in accept by using select + non-blocking accept.

Fixes potential hang in peer check by replacing the send/recv check with
a getsockname/getpeername check.

Adds length check for returned sockaddr data.

Closes #7144

4 years agoruntests: parse data/Makefile.inc instead of using make 7177/head
Daniel Stenberg [Wed, 2 Jun 2021 14:38:57 +0000 (16:38 +0200)] 
runtests: parse data/Makefile.inc instead of using make

The warning about missing entries in that file then doesn't require that
the Makefile has been regenerated which was confusing.

The scan for the test num is a little more error prone than before
(since now it doesn't actually verify that it is legitimate Makefile
syntax), but I think it is good enough.

Closes #7177

4 years agofilecheck: quietly remove test-place/*~
Harry Sintonen [Wed, 2 Jun 2021 17:27:57 +0000 (20:27 +0300)] 
filecheck: quietly remove test-place/*~

Closes #7179

4 years agoCURLE_SETOPT_OPTION_SYNTAX: new error name for wrong setopt syntax
Daniel Stenberg [Wed, 2 Jun 2021 12:56:07 +0000 (14:56 +0200)] 
CURLE_SETOPT_OPTION_SYNTAX: new error name for wrong setopt syntax

For options that pass in lists or strings that are subsequently parsed
and must be correct. This broadens the scope for the option previously
known as CURLE_TELNET_OPTION_SYNTAX but the old name is of course still
provided as a #define for existing applications.

Closes #7175

4 years agotests: fix Accept-Encoding strips to work with Hyper builds
Daniel Stenberg [Wed, 2 Jun 2021 07:45:40 +0000 (09:45 +0200)] 
tests: fix Accept-Encoding strips to work with Hyper builds

The previous strip also removed the CR which turned problematic.

valgrind.supp: add zstd suppression using hyper

Reported-and-analyzed-by: Kevin Burke
Fixes #7169
Closes #7171

4 years agogithub: timeout jobs on macOS after 90 minutes
Daniel Stenberg [Wed, 2 Jun 2021 11:19:36 +0000 (13:19 +0200)] 
github: timeout jobs on macOS after 90 minutes

Assisted-by: Marc Hoersken
Closes #7173

4 years agomqtt: detect illegal and too large file size
Harry Sintonen [Tue, 1 Jun 2021 15:22:31 +0000 (18:22 +0300)] 
mqtt: detect illegal and too large file size

Add test 3017 and 3018 to verify.
Closes #7166

4 years agocmake: add CURL_DISABLE_NTLM option
theawless [Fri, 7 May 2021 09:44:40 +0000 (15:14 +0530)] 
cmake: add CURL_DISABLE_NTLM option

Closes #7028

4 years agoconfigure: add --disable-ntlm option
theawless [Fri, 7 May 2021 09:45:35 +0000 (15:15 +0530)] 
configure: add --disable-ntlm option

Closes #7028

4 years agodefine: re-add CURL_DISABLE_NTLM and corresponding ifdefs
theawless [Fri, 7 May 2021 07:28:50 +0000 (12:58 +0530)] 
define: re-add CURL_DISABLE_NTLM and corresponding ifdefs

This flag will be further exposed by adding build options.

Reverts #6809
Closes #7028

4 years agoRELEASE-NOTES: synced
Daniel Stenberg [Wed, 2 Jun 2021 06:18:08 +0000 (08:18 +0200)] 
RELEASE-NOTES: synced

4 years agotravis: delete --enable-hsts option (it is the default now) [ci skip]
Viktor Szakats [Tue, 1 Jun 2021 22:30:11 +0000 (22:30 +0000)] 
travis: delete --enable-hsts option (it is the default now) [ci skip]

Reviewed-by: Daniel Stenberg
Closes #7167

4 years agohostip: fix 3 coverity complaints
Daniel Stenberg [Tue, 1 Jun 2021 08:16:19 +0000 (10:16 +0200)] 
hostip: fix 3 coverity complaints

Follow-up to 1a0ebf6632f889eed

- Check the return code to Curl_inet_pton() in two instances, even
  though we know the input is valid so the functions won't fail.

- Clear the 'struct sockaddr_in' struct before use so that the
  'sin_zero' field isn't left uninitialized.

Detected by Coverity.
Assisted-by: Harry Sintonen
Closes #7163

4 years agoc-hyper: fix NTLM on closed connection tested with test159
Daniel Stenberg [Mon, 31 May 2021 13:11:27 +0000 (15:11 +0200)] 
c-hyper: fix NTLM on closed connection tested with test159

Closes #7154

4 years agoconncache: lowercase the hash key for better match
Daniel Stenberg [Tue, 1 Jun 2021 06:28:29 +0000 (08:28 +0200)] 
conncache: lowercase the hash key for better match

As host names are case insensitive, the use of case sensitive hashing
caused unnecesary cache misses and therefore lost performance. This
lowercases the hash key.

Reported-by: Harry Sintonen
Fixes #7159
Closes #7161

4 years agombedtls: make mbedtls_strerror always work
Daniel Stenberg [Tue, 1 Jun 2021 07:38:42 +0000 (09:38 +0200)] 
mbedtls: make mbedtls_strerror always work

If the function doesn't exist, provide a macro that just clears the
error message. Removes #ifdef uses from the code.

Closes #7162

4 years agovtls: exit addsessionid if no cache is inited
Daniel Stenberg [Tue, 1 Jun 2021 09:17:27 +0000 (11:17 +0200)] 
vtls: exit addsessionid if no cache is inited

Follow-up to b249592d29ae0

Avoids NULL pointer derefs.

Closes #7165

4 years agoCurl_ntlm_core_mk_nt_hash: fix OOM in error path
Harry Sintonen [Tue, 1 Jun 2021 09:31:15 +0000 (11:31 +0200)] 
Curl_ntlm_core_mk_nt_hash: fix OOM in error path

Closes #7164

4 years agossl: read pending close notify alert before closing the connection
Michael Kaufmann [Tue, 18 May 2021 09:34:02 +0000 (11:34 +0200)] 
ssl: read pending close notify alert before closing the connection

This avoids a TCP reset (RST) if the server initiates a connection
shutdown by sending an SSL close notify alert and then closes the TCP
connection.

For SSL connections, usually the server announces that it will close the
connection with an SSL close notify alert. curl should read this alert.
If curl does not read this alert and just closes the connection, some
operating systems close the TCP connection with an RST flag.

See RFC 1122, section 4.2.2.13

If curl reads the close notify alert, the TCP connection is closed
normally with a FIN flag.

The new code is similar to existing code in the "SSL shutdown" function:
try to read an alert (non-blocking), and ignore any read errors.

Closes #7095

4 years agosetopt: fix incorrect comments
Laurent Dufresne [Mon, 31 May 2021 18:55:14 +0000 (20:55 +0200)] 
setopt: fix incorrect comments

Closes #7157

4 years agombedtls: add support for cert and key blob options
Laurent Dufresne [Mon, 31 May 2021 18:52:05 +0000 (20:52 +0200)] 
mbedtls: add support for cert and key blob options

CURLOPT_SSLCERT_BLOB and CURLOPT_SSLKEY_BLOB weren't usable with
mbedtls backend, so the support was added.

Closes #7157

4 years agocmake: try well-known send/recv signature for Apple
Gregor Jasny [Mon, 31 May 2021 19:36:37 +0000 (21:36 +0200)] 
cmake: try well-known send/recv signature for Apple

The CMake `try_compile` command is especially slow for
the Xcode generator. With this patch applied it first tests
for the currently used (and Open Group specified) send/recv
signature. In case this fails testing falls-back to the
permutations.

speed-up:

```
time cmake .. -GNinja -DCMAKE_USE_SECTRANSP=ON -DHTTP_ONLY=ON -DCMAKE_USE_LIBSSH2=OFF
before: 11.64s user 11.09s system 55% cpu 40.754 total
after:   7.84s user 6.57s  system 51% cpu 28.074 total
```

```
time cmake .. -GXcode -DCMAKE_USE_SECTRANSP=ON -DHTTP_ONLY=ON -DCMAKE_USE_LIBSSH2=OFF
before: 217.07s user 104.15s system 60% cpu 8:51.79 total
after:  108.76s user  51.80s system 58% cpu 4:32.58 total
```

Closes #7158

4 years agohttp2: init recvbuf struct for pushed streams
Daniel Stenberg [Mon, 31 May 2021 13:30:31 +0000 (15:30 +0200)] 
http2: init recvbuf struct for pushed streams

Debug builds would warn that these structs were not initialized properly
for pushed streams.

Ref: #7148
Closes #7153

4 years agoCurl_ssl_getsessionid: fail if no session cache exists
Daniel Stenberg [Mon, 31 May 2021 13:29:03 +0000 (15:29 +0200)] 
Curl_ssl_getsessionid: fail if no session cache exists

This function might get called for an easy handle for which the session
cache hasn't been setup. It now just returns a "miss" in that case.

Reported-by: Christoph M. Becker
Fixes #7148
Closes #7153

4 years agoGOVERNANCE: add 'user', 'committer' and 'contributor'
Daniel Stenberg [Mon, 31 May 2021 07:38:12 +0000 (09:38 +0200)] 
GOVERNANCE: add 'user', 'committer' and 'contributor'

As those are commonly used terms in the project.

Closes #7151

4 years agoURL-SYNTAX.md: document the new 'localhost' treatment
Daniel Stenberg [Mon, 31 May 2021 06:33:44 +0000 (08:33 +0200)] 
URL-SYNTAX.md: document the new 'localhost' treatment

4 years agohostip: make 'localhost' return fixed values
Daniel Stenberg [Mon, 31 May 2021 06:33:44 +0000 (08:33 +0200)] 
hostip: make 'localhost' return fixed values

Resolving the case insensitive host name 'localhost' now returns the
addresses 127.0.0.1 and (if IPv6 is enabled) ::1 without using any
resolver.

This removes the risk that users accidentally resolves 'localhost' to
something else. By making sure 'localhost' is always local, we can
assume a "secure context" for such transfers (for cookies etc).

Closes #7039

4 years agodocs: fix typos
Daniel Gustafsson [Mon, 31 May 2021 10:47:15 +0000 (12:47 +0200)] 
docs: fix typos

4 years agohsts: ignore numberical IP address hosts
Daniel Stenberg [Sat, 29 May 2021 21:57:58 +0000 (23:57 +0200)] 
hsts: ignore numberical IP address hosts

Also, use a single function library-wide for detecting if a given hostname is
a numerical IP address.

Reported-by: Harry Sintonen
Fixes #7146
Closes #7149

4 years agotest178: adjust for hyper
Daniel Stenberg [Fri, 28 May 2021 21:46:03 +0000 (23:46 +0200)] 
test178: adjust for hyper

Hyper returns the same error for wrong HTTP version as for negative
content-length. Test 178 verifies that negative content-length is
rejected but the hyper backend will return a different error for it (and
without any helpful message telling why the message was bad). It will
also not return any headers at all for the response, not even the ones
that arrived before the error.

Closes #7147