]> git.ipfire.org Git - thirdparty/curl.git/log
thirdparty/curl.git
5 years agoHTTP: increase EXPECT_100_THRESHOLD to 1Mb
加藤郁之 [Tue, 14 Jan 2020 14:34:56 +0000 (23:34 +0900)] 
HTTP: increase EXPECT_100_THRESHOLD to 1Mb

Mentioned: https://curl.haxx.se/mail/lib-2020-01/0050.html

Closes #4814

5 years agoROADMAP: thread-safe `curl_global_init()`
Daniel Stenberg [Fri, 17 Jan 2020 11:58:35 +0000 (12:58 +0100)] 
ROADMAP: thread-safe `curl_global_init()`

I'd like to see this happen.

5 years agoRELEASE-NOTES: synced
Daniel Stenberg [Fri, 17 Jan 2020 07:08:36 +0000 (08:08 +0100)] 
RELEASE-NOTES: synced

5 years agowolfssl: use the wc-prefixed symbol alternatives
Daniel Stenberg [Thu, 16 Jan 2020 14:59:56 +0000 (15:59 +0100)] 
wolfssl: use the wc-prefixed symbol alternatives

The symbols without wc_ prefix are not always provided.

Ref: https://github.com/wolfSSL/wolfssl/issues/2744

Closes #4827

5 years agopolarssl: removed
Daniel Stenberg [Thu, 16 Jan 2020 07:17:04 +0000 (08:17 +0100)] 
polarssl: removed

As detailed in DEPRECATE.md, the polarssl support is now removed after
having been disabled for 6 months and nobody has missed it.

The threadlock files used by mbedtls are renamed to an 'mbedtls' prefix
instead of the former 'polarssl' and the common functions that
previously were shared between mbedtls and polarssl and contained the
name 'polarssl' have now all been renamed to instead say 'mbedtls'.

Closes #4825

5 years agolibssh2: fix variable type
Marcel Raad [Wed, 15 Jan 2020 19:28:01 +0000 (20:28 +0100)] 
libssh2: fix variable type

This led to a conversion warning on 64-bit MinGW, which has 32-bit
`long` but 64-bit `size_t`.

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

5 years agocurl:progressbarinit: ignore column width from terminals < 20
Daniel Stenberg [Tue, 14 Jan 2020 21:18:12 +0000 (22:18 +0100)] 
curl:progressbarinit: ignore column width from terminals < 20

To avoid division by zero - or other issues.

Reported-by: Daniel Marjamäki
Closes #4818

5 years agowolfssh: set the password correctly for PASSWORD auth
Daniel Stenberg [Wed, 15 Jan 2020 13:23:03 +0000 (14:23 +0100)] 
wolfssh: set the password correctly for PASSWORD auth

5 years agowolfssh: remove fprintf() calls (and uses of __func__)
Daniel Stenberg [Wed, 15 Jan 2020 13:00:37 +0000 (14:00 +0100)] 
wolfssh: remove fprintf() calls (and uses of __func__)

5 years agoCMake: use check_symbol_exists also for inet_pton
Marcel Raad [Sat, 11 Jan 2020 10:20:38 +0000 (11:20 +0100)] 
CMake: use check_symbol_exists also for inet_pton

It doesn't make much sense to only check if the function can be linked
when it's not declared in any header and that is treated as an error.
With the correct target Windows version set, the function is declared
in ws2tcpip.h and the comment above the modified block is invalid.

Also, move the definition of `_WIN32_WINNT` up to before all symbol
availability checks so that we don't have to care which ones must be
done after it.

Tested with Visual Studio 2019 and current MinGW-w64.

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

5 years agoschannel_verify: Fix alt names manual verify for UNICODE builds
Jay Satiro [Mon, 13 Jan 2020 23:25:12 +0000 (18:25 -0500)] 
schannel_verify: Fix alt names manual verify for UNICODE builds

Follow-up to 29e40a6 from two days ago, which added that feature for
Windows 7 and earlier. The bug only occurred in same.

Ref: https://github.com/curl/curl/pull/4761

5 years agoHTTP-COOKIES.md: describe the cookie file format
Daniel Stenberg [Fri, 10 Jan 2020 21:53:05 +0000 (22:53 +0100)] 
HTTP-COOKIES.md: describe the cookie file format

... and refer to that file from from CURLOPT_COOKIEFILE.3 and
CURLOPT_COOKIELIST.3

Assisted-by: Jay Satiro
Reported-by: bsammon on github
Fixes #4805
Closes #4806

5 years agoCMake: Add support for CMAKE_LTO option.
Tobias Hieta [Thu, 9 Jan 2020 11:10:55 +0000 (12:10 +0100)] 
CMake: Add support for CMAKE_LTO option.

This enables Link Time Optimization. LTO is a proven technique for
optimizing across compilation units.

Closes #4799

5 years agoRELEASE-NOTES: synced
Daniel Stenberg [Mon, 13 Jan 2020 15:02:01 +0000 (16:02 +0100)] 
RELEASE-NOTES: synced

5 years agoConnectionExists: respect the max_concurrent_streams limits
Daniel Stenberg [Sun, 5 Jan 2020 09:34:19 +0000 (10:34 +0100)] 
ConnectionExists: respect the max_concurrent_streams limits

A regression made the code use 'multiplexed' as a boolean instead of the
counter it is intended to be. This made curl try to "over-populate"
connections with new streams.

This regression came with 41fcdf71a1, shipped in curl 7.65.0.

Also, respect the CURLMOPT_MAX_CONCURRENT_STREAMS value in the same
check.

Reported-by: Kunal Ekawde
Fixes #4779
Closes #4784

5 years agocurl: make #0 not output the full URL
Daniel Stenberg [Mon, 13 Jan 2020 11:30:37 +0000 (12:30 +0100)] 
curl: make #0 not output the full URL

It was not intended nor documented!

Added test 1176 to verify.

Reported-by: vshmuk on hackerone
Closes #4812

5 years agowolfSSH: new SSH backend
Daniel Stenberg [Sun, 5 Jan 2020 09:51:39 +0000 (10:51 +0100)] 
wolfSSH: new SSH backend

Adds support for SFTP (not SCP) using WolfSSH.

Closes #4231

5 years agocurl: remove 'config' field from OutStruct
Daniel Stenberg [Sat, 11 Jan 2020 21:53:34 +0000 (22:53 +0100)] 
curl: remove 'config' field from OutStruct

As it was just unnecessary duplicated information already stored in the
'per_transfer' struct and that's around mostly anyway.

The duplicated pointer caused problems when the code flow was aborted
before the dupe was filled in and could cause a NULL pointer access.

Reported-by: Brian Carpenter
Fixes #4807
Closes #4810

5 years agomisc: Copyright year out of date, should be 2020
Daniel Stenberg [Sun, 12 Jan 2020 15:55:34 +0000 (16:55 +0100)] 
misc: Copyright year out of date, should be 2020

Follow-up to recent commits

[skip ci]

5 years agolibssh2: add support for forcing a hostkey type
Santino Keupp [Fri, 20 Dec 2019 12:37:20 +0000 (13:37 +0100)] 
libssh2: add support for forcing a hostkey type

- Allow forcing the host's key type found in the known_hosts file.

Currently, curl (with libssh2) does not take keys from your known_hosts
file into account when talking to a server. With this patch the
known_hosts file will be searched for an entry matching the hostname
and, if found, libssh2 will be told to claim this key type from the
server.

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

5 years agocmake: Improve libssh2 check on Windows
nicoguillier [Fri, 10 Jan 2020 08:57:38 +0000 (09:57 +0100)] 
cmake: Improve libssh2 check on Windows

- Add "libssh2" name to FindLibSSH2 library search.

On Windows systems, libSSH2 CMake installation may name the library
"LibSSH2".

Prior to this change cmake only checked for name "ssh2". On Linux that
works fine because it will prepend the "lib", but it doesn't do that on
Windows.

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

5 years agoschannel: Make CURLOPT_CAINFO work better on Windows 7
Faizur Rahman [Wed, 25 Dec 2019 23:49:48 +0000 (18:49 -0500)] 
schannel: Make CURLOPT_CAINFO work better on Windows 7

- Support hostname verification via alternative names (SAN) in the
  peer certificate when CURLOPT_CAINFO is used in Windows 7 and earlier.

CERT_NAME_SEARCH_ALL_NAMES_FLAG doesn't exist before Windows 8. As a
result CertGetNameString doesn't quite work on those versions of
Windows. This change provides an alternative solution for
CertGetNameString by iterating through CERT_ALT_NAME_INFO for earlier
versions of Windows.

Prior to this change many certificates failed the hostname validation
when CURLOPT_CAINFO was used in Windows 7 and earlier. Most certificates
now represent multiple hostnames and rely on the alternative names field
exclusively to represent their hostnames.

Reported-by: Jeroen Ooms
Fixes https://github.com/curl/curl/issues/3711
Closes https://github.com/curl/curl/pull/4761

5 years agongtcp2: Add an error code for QUIC connection errors
Emil Engler [Tue, 24 Dec 2019 10:17:16 +0000 (11:17 +0100)] 
ngtcp2: Add an error code for QUIC connection errors

- Add new error code CURLE_QUIC_CONNECT_ERROR for QUIC connection
  errors.

Prior to this change CURLE_FAILED_INIT was used, but that was not
correct.

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

5 years agomulti: Change curl_multi_wait/poll to error on negative timeout
Jay Satiro [Sat, 28 Dec 2019 04:39:24 +0000 (23:39 -0500)] 
multi: Change curl_multi_wait/poll to error on negative timeout

- Add new error CURLM_BAD_FUNCTION_ARGUMENT and return that error when
  curl_multi_wait/poll is passed timeout param < 0.

Prior to this change passing a negative value to curl_multi_wait/poll
such as -1 could cause the function to wait forever.

Reported-by: hamstergene@users.noreply.github.com
Fixes https://github.com/curl/curl/issues/4763

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

5 years agocmake: Enable SMB for Windows builds
Marc Aldorasi [Fri, 13 Dec 2019 22:23:11 +0000 (17:23 -0500)] 
cmake: Enable SMB for Windows builds

- Define USE_WIN32_CRYPTO by default. This enables SMB.

- Show whether SMB is enabled in the "Enabled features" output.

- Fix mingw compiler warning for call to CryptHashData by casting away
  const param. mingw CryptHashData prototype is wrong.

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

5 years agovtls: Refactor Curl_multissl_version to make the code clearer
Jay Satiro [Fri, 10 Jan 2020 06:34:00 +0000 (01:34 -0500)] 
vtls: Refactor Curl_multissl_version to make the code clearer

Reported-by: Johannes Schindelin
Ref: https://github.com/curl/curl/pull/3863#pullrequestreview-241395121

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

5 years agofix: Copyright year out of date, should be 2020
Daniel Stenberg [Fri, 10 Jan 2020 21:38:44 +0000 (22:38 +0100)] 
fix: Copyright year out of date, should be 2020

Follow-up to 875314ed0bf3b

5 years agohostip: move code to resolve IP address literals to `Curl_resolv`
Marcel Raad [Mon, 6 Jan 2020 11:56:44 +0000 (12:56 +0100)] 
hostip: move code to resolve IP address literals to `Curl_resolv`

The code was duplicated in the various resolver backends.

Also, it was called after the call to `Curl_ipvalid`, which matters in
case of `CURLRES_IPV4` when called from `connect.c:bindlocal`. This
caused test 1048 to fail on classic MinGW.

The code ignores `conn->ip_version` as done previously in the
individual resolver backends.

Move the call to the `resolver_start` callback up to appease test 655,
which wants it to be called also for literal addresses.

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

5 years agoscripts/delta: adapt to new public header layout
Daniel Stenberg [Tue, 7 Jan 2020 07:30:59 +0000 (08:30 +0100)] 
scripts/delta: adapt to new public header layout

5 years agotest1167: verify global symbols in public headers are curl prefixed
Daniel Stenberg [Tue, 7 Jan 2020 07:06:33 +0000 (08:06 +0100)] 
test1167: verify global symbols in public headers are curl prefixed

... using the new badsymbols.pl perl script

Fixes #4793
Closes #4794

5 years agolibtest/mk-lib1521: adapt to new public header layout
Daniel Stenberg [Tue, 7 Jan 2020 07:30:33 +0000 (08:30 +0100)] 
libtest/mk-lib1521: adapt to new public header layout

5 years agoinclude: remove non-curl prefixed defines
Daniel Stenberg [Tue, 7 Jan 2020 07:28:47 +0000 (08:28 +0100)] 
include: remove non-curl prefixed defines

...requires some rearranging of the setup of CURLOPT_ and CURLMOPT_
enums.

5 years agocurl.h: remove WIN32 define
Daniel Stenberg [Mon, 6 Jan 2020 22:31:42 +0000 (23:31 +0100)] 
curl.h: remove WIN32 define

It isn't our job to define this in a public header - and it defines a
name outside of our naming scope.

5 years agotool_dirhie.c: fix the copyright year range
Daniel Stenberg [Thu, 9 Jan 2020 21:49:02 +0000 (22:49 +0100)] 
tool_dirhie.c: fix the copyright year range

Follow-up to: 4027bd72d9

5 years agobump: work towards 7.69.0 is started
Daniel Stenberg [Thu, 9 Jan 2020 21:37:59 +0000 (22:37 +0100)] 
bump: work towards 7.69.0 is started

5 years agotool_dirhie: Allow directory traversal during creation
Jay Satiro [Wed, 8 Jan 2020 00:44:51 +0000 (19:44 -0500)] 
tool_dirhie: Allow directory traversal during creation

- When creating a directory hierarchy do not error when mkdir fails due
  to error EACCESS (13) "access denied".

Some file systems allow for directory traversal; in this case that it
should be possible to create child directories when permission to the
parent directory is restricted.

This is a regression caused by me in f16bed0 (precedes curl-7_61_1).
Basically I had assumed that if a directory already existed it would
fail only with error EEXIST, and not error EACCES. The latter may
happen if the directory exists but has certain restricted permissions.

Reported-by: mbeifuss@users.noreply.github.com
Fixes https://github.com/curl/curl/issues/4796
Closes https://github.com/curl/curl/pull/4797

5 years agoKNOWN_BUGS: AUTH PLAIN for SMTP is not working on all servers
Daniel Stenberg [Thu, 9 Jan 2020 15:19:34 +0000 (16:19 +0100)] 
KNOWN_BUGS: AUTH PLAIN for SMTP is not working on all servers

Closes #4080

5 years agodocs/RELEASE-PROCEDURE.md: pushed some release dates
Daniel Stenberg [Thu, 9 Jan 2020 08:25:56 +0000 (09:25 +0100)] 
docs/RELEASE-PROCEDURE.md: pushed some release dates

Ref: https://curl.haxx.se/mail/lib-2020-01/0031.html

5 years agoruntests: make random seed fixed for a month
Daniel Stenberg [Wed, 18 Dec 2019 14:37:20 +0000 (15:37 +0100)] 
runtests: make random seed fixed for a month

When using randomized features of runtests (-R and --shallow) it is
useful to have a fixed random seed to make sure for example extra
commits in a branch or a rebase won't change the seed that would make
repeated runs work differently.

As it is also useful to change seed sometimes, the default seed is now
determined based on the current month (and first line curl -V
output). When the month changes, so will the random seed.

The specific seed is also shown in the standard test suite top header
and it can be set explictly with the new --seed=[num] option so that the
exact order of a previous run can be achieved.

Closes #4734

5 years agoRELEASE-PROCEDURE.md: fix next release date (Feb 26)
Daniel Stenberg [Wed, 8 Jan 2020 08:47:37 +0000 (09:47 +0100)] 
RELEASE-PROCEDURE.md: fix next release date (Feb 26)

[skip ci]

5 years agoRELEASE-NOTES: 7.68.0 curl-7_68_0
Daniel Stenberg [Sat, 4 Jan 2020 21:48:15 +0000 (22:48 +0100)] 
RELEASE-NOTES: 7.68.0

5 years agoTHANKS: updated with names from the 7.68.0 release
Daniel Stenberg [Sat, 4 Jan 2020 21:49:37 +0000 (22:49 +0100)] 
THANKS: updated with names from the 7.68.0 release

5 years agoRELEASE-PROCEDURE: add four future release dates
Daniel Stenberg [Tue, 7 Jan 2020 14:16:46 +0000 (15:16 +0100)] 
RELEASE-PROCEDURE: add four future release dates

and remove four past release dates

[skip ci]

5 years agoTrackMemory tests: always remove CR before LF
Marcel Raad [Mon, 6 Jan 2020 10:11:50 +0000 (11:11 +0100)] 
TrackMemory tests: always remove CR before LF

It was removed for output containing ' =' via `s/ =.*//`. With classic
MinGW, this made lines with `free()` end with CRLF, but lines with e.g.
`malloc()` end with only LF. The tests expect LF only.

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

5 years agomulti.h: move INITIAL_MAX_CONCURRENT_STREAMS from public header
Daniel Stenberg [Mon, 6 Jan 2020 12:13:33 +0000 (13:13 +0100)] 
multi.h: move INITIAL_MAX_CONCURRENT_STREAMS from public header

... to the private multihhandle.h. It is not for public use and it
wasn't prefixed correctly anyway!

Closes #4790

5 years agofile: fix copyright year range
Daniel Stenberg [Mon, 6 Jan 2020 09:12:02 +0000 (10:12 +0100)] 
file: fix copyright year range

Follow-up to 1b71bc532bd

5 years agocurl -w: handle a blank input file correctly
Daniel Stenberg [Sat, 4 Jan 2020 10:41:35 +0000 (11:41 +0100)] 
curl -w: handle a blank input file correctly

Previously it would end up with an uninitialized memory buffer that
would lead to a crash or junk getting output.

Added test 1271 to verify.

Reported-by: Brian Carpenter
Closes #4786

5 years agofile: on Windows, refuse paths that start with \\
Daniel Stenberg [Thu, 7 Nov 2019 09:13:01 +0000 (10:13 +0100)] 
file: on Windows, refuse paths that start with \\

... as that might cause an unexpected SMB connection to a given host
name.

Reported-by: Fernando Muñoz
CVE-2019-15601
Bug: https://curl.haxx.se/docs/CVE-2019-15601.html

5 years agoCURLOPT_READFUNCTION.3: fix fopen params in example
Jay Satiro [Mon, 6 Jan 2020 08:09:53 +0000 (03:09 -0500)] 
CURLOPT_READFUNCTION.3: fix fopen params in example

5 years agoCURLOPT_READFUNCTION.3: fix variable name in example
Jay Satiro [Mon, 6 Jan 2020 08:01:33 +0000 (03:01 -0500)] 
CURLOPT_READFUNCTION.3: fix variable name in example

Reported-by: Paul Joyce
Fixes https://github.com/curl/curl/issues/4787

5 years agocurl:getparameter return error for --http3 if libcurl doesn't support
Daniel Stenberg [Sun, 5 Jan 2020 16:12:03 +0000 (17:12 +0100)] 
curl:getparameter return error for --http3 if libcurl doesn't support

Closes #4785

5 years agodocs: mention CURL_MAX_INPUT_LENGTH restrictions
Daniel Stenberg [Sun, 5 Jan 2020 09:23:11 +0000 (10:23 +0100)] 
docs: mention CURL_MAX_INPUT_LENGTH restrictions

... for curl_easy_setopt() and curl_url_set().

[skip ci]

Closes #4783

5 years agocurl: properly free mimepost data
Daniel Stenberg [Sat, 4 Jan 2020 20:40:49 +0000 (21:40 +0100)] 
curl: properly free mimepost data

... as it could otherwise leak memory when a transfer failed.

Added test 1293 to verify.

Reported-by: Brian Carpenter
Fixes #4781
Closes #4782

5 years agocurl: cleanup multi handle on failure
Daniel Stenberg [Sat, 4 Jan 2020 15:27:56 +0000 (16:27 +0100)] 
curl: cleanup multi handle on failure

... to fix memory leak in error path.

Fixes #4772
Closes #4780
Reported-by: Brian Carpenter
5 years agolib: fix compiler warnings with `CURL_DISABLE_VERBOSE_STRINGS`
Marcel Raad [Fri, 3 Jan 2020 12:30:34 +0000 (13:30 +0100)] 
lib: fix compiler warnings with `CURL_DISABLE_VERBOSE_STRINGS`

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

5 years agoCOPYING: it's 2020!
Daniel Stenberg [Fri, 3 Jan 2020 14:12:10 +0000 (15:12 +0100)] 
COPYING: it's 2020!

[skip ci]

5 years agotests: Fix bounce requests with truncated writes
Marc Aldorasi [Thu, 2 Jan 2020 17:05:11 +0000 (12:05 -0500)] 
tests: Fix bounce requests with truncated writes

Prior to this change the swsbounce check in service_connection could
fail because prevtestno and prevpartno were not set, which would cause
the wrong response data to be sent to some tests and cause them to fail.

Ref: https://github.com/curl/curl/pull/4717#issuecomment-570240785

5 years agotool: make a few char pointers point to const char instead
Marcel Raad [Sat, 13 Apr 2019 21:00:45 +0000 (23:00 +0200)] 
tool: make a few char pointers point to const char instead

These are read-only.

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

5 years agotests: Change NTLM tests to require SSL
Jay Satiro [Sun, 29 Dec 2019 20:23:25 +0000 (15:23 -0500)] 
tests: Change NTLM tests to require SSL

Prior to this change tests that required NTLM feature did not require
SSL feature.

There are pending changes to cmake builds that will allow enabling NTLM
in non-SSL builds in Windows. In that case the NTLM auth strings created
are different from what is expected by the NTLM tests and they fail:

"The issue with NTLM is that previous non-SSL builds would not enable
NTLM and so the NTLM tests would be skipped."

Assisted-by: marc-groundctl@users.noreply.github.com
Ref: https://github.com/curl/curl/pull/4717#issuecomment-566218729

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

5 years agobearssl: Improve I/O handling
Michael Forney [Sat, 21 Dec 2019 03:20:18 +0000 (19:20 -0800)] 
bearssl: Improve I/O handling

Factor out common I/O loop as bearssl_run_until, which reads/writes TLS
records until the desired engine state is reached. This is now used for
the handshake, read, write, and close.

Match OpenSSL SSL_write behavior, and don't return the number of bytes
written until the corresponding records have been completely flushed
across the socket. This involves keeping track of the length of data
buffered into the TLS engine, and assumes that when CURLE_AGAIN is
returned, the write function will be called again with the same data
and length arguments. This is the same requirement of SSL_write.

Handle TLS close notify as EOF when reading by returning 0.

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

5 years agotravis: Fix error detection
Jay Satiro [Sat, 28 Dec 2019 06:56:05 +0000 (01:56 -0500)] 
travis: Fix error detection

- Stop using inline shell scripts for before_script and script sections.

Prior to this change Travis could ignore errors from commands in inline
scripts. I don't understand how or why it happens. This is a workaround.

Assisted-by: Simon Warta
Ref: https://github.com/travis-ci/travis-ci/issues/1066

Fixes https://github.com/curl/curl/issues/3730
Closes https://github.com/curl/curl/pull/3755

5 years agotool_operate: fix mem leak when failed config parse
Jay Satiro [Sun, 29 Dec 2019 19:18:48 +0000 (14:18 -0500)] 
tool_operate: fix mem leak when failed config parse

Found by fuzzing the config file.

Reported-by: Geeknik Labs
Fixes https://github.com/curl/curl/issues/4767

5 years agolib: remove erroneous +x file permission on some c files
Xiang Xiao [Tue, 24 Dec 2019 13:47:37 +0000 (21:47 +0800)] 
lib: remove erroneous +x file permission on some c files

Modified by commit eb9a604 accidentally.

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

5 years agolib: fix warnings found when porting to NuttX
Xiang Xiao [Tue, 24 Dec 2019 13:28:32 +0000 (21:28 +0800)] 
lib: fix warnings found when porting to NuttX

- Undefine DEBUGASSERT in curl_setup_once.h in case it was already
  defined as a system macro.

- Don't compile write32_le in curl_endian unless
  CURL_SIZEOF_CURL_OFF_T > 4, since it's only used by Curl_write64_le.

- Include <arpa/inet.h> in socketpair.c.

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

5 years agoos400: Add missing CURLE error constants
Jay Satiro [Thu, 26 Dec 2019 21:20:11 +0000 (16:20 -0500)] 
os400: Add missing CURLE error constants

Bug: https://github.com/curl/curl/pull/4754#issuecomment-569126922
Reported-by: Emil Engler
5 years agoCURLOPT_HEADERFUNCTION.3: Document that size is always 1
Jay Satiro [Thu, 26 Dec 2019 07:26:08 +0000 (02:26 -0500)] 
CURLOPT_HEADERFUNCTION.3: Document that size is always 1

For compatibility with `fwrite`, the `CURLOPT_HEADERFUNCTION` callback
is passed two `size_t` parameters which, when multiplied, designate the
number of bytes of data passed in. In practice, CURL always sets the
first parameter (`size`) to 1.

This practice is also enshrined in documentation and cannot be changed
in future. The documentation states that the default callback is
`fwrite`, which means `fwrite` must be a suitable function for this
purpose. However, the documentation also states that the callback must
return the number of *bytes* it successfully handled, whereas ISO C
`fwrite` returns the number of items (each of size `size`) which it
wrote. The only way these numbers can be equal is if `size` is 1.

Since `size` is 1 and can never be changed in future anyway, document
that fact explicitly and let users rely on it.

Reported-by: Frank Gevaerts
Commit-message-by: Christopher Head
Ref: https://github.com/curl/curl/pull/2787

Fixes https://github.com/curl/curl/issues/4758

5 years agoexamples/postinmemory.c: Call curl_global_cleanup always
Jay Satiro [Tue, 24 Dec 2019 06:06:47 +0000 (01:06 -0500)] 
examples/postinmemory.c: Call curl_global_cleanup always

Prior to this change curl_global_cleanup was not called if
curl_easy_init failed.

Reported-by: kouzhudong@users.noreply.github.com
Fixes https://github.com/curl/curl/issues/4751

5 years agourl2file.c: fix copyright year
Daniel Stenberg [Sat, 21 Dec 2019 17:17:55 +0000 (18:17 +0100)] 
url2file.c: fix copyright year

Follow-up to 525787269599b5

5 years agoexamples/url2file.c: corrected a comment
Rickard Hallerbäck [Fri, 20 Dec 2019 08:40:38 +0000 (09:40 +0100)] 
examples/url2file.c: corrected a comment

The comment was confusing and suggested that setting CURLOPT_NOPROGRESS
to 0L would both enable and disable debug output at the same time, like
a Schrödinger's cat of CURLOPTs.

Closes #4745

5 years agoHISTORY: OSS-Fuzz started fuzzing libcurl in 2017
Daniel Stenberg [Fri, 20 Dec 2019 10:03:57 +0000 (11:03 +0100)] 
HISTORY: OSS-Fuzz started fuzzing libcurl in 2017

5 years agoRELEASE-NOTES: synced
Daniel Stenberg [Fri, 20 Dec 2019 07:48:57 +0000 (08:48 +0100)] 
RELEASE-NOTES: synced

5 years agongtcp2: Support the latest update key callback type 4735/head
Jay Satiro [Wed, 18 Dec 2019 18:56:16 +0000 (13:56 -0500)] 
ngtcp2: Support the latest update key callback type

- Remove our cb_update_key in favor of ngtcp2's new
  ngtcp2_crypto_update_key_cb which does the same thing.

Several days ago the ngtcp2_update_key callback function prototype was
changed in ngtcp2/ngtcp2@42ce09c. Though it would be possible to
fix up our cb_update_key for that change they also added
ngtcp2_crypto_update_key_cb which does the same thing so we'll use that
instead.

Ref: https://github.com/ngtcp2/ngtcp2/commit/42ce09c

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

5 years agosws: search for "Testno:" header uncondtionally if no testno
Daniel Stenberg [Thu, 19 Dec 2019 15:45:53 +0000 (16:45 +0100)] 
sws: search for "Testno:" header uncondtionally if no testno

Even if the initial request line wasn't found. With the fix to 1455, the
test number is now detected correctly.

(Problem found when running tests in random order.)

Closes #4744

5 years agotests: set LC_ALL in more tests
Daniel Stenberg [Thu, 19 Dec 2019 15:44:07 +0000 (16:44 +0100)] 
tests: set LC_ALL in more tests

Follow-up to 23208e330ac0c21

Closes #4743

5 years agotest165: set LC_ALL=en_US.UTF-8 too
Daniel Stenberg [Thu, 19 Dec 2019 09:10:54 +0000 (10:10 +0100)] 
test165: set LC_ALL=en_US.UTF-8 too

On my current Debian Unstable with libidn2 2.2.0, I get an error if
LC_ALL is set to blank. Then curl errors out with:

curl: (3) Failed to convert www.åäö.se to ACE; could not convert string to UTF-8

Closes #4738

5 years agocurl.h: add two defines for the "pre ISO C" case
Daniel Stenberg [Thu, 19 Dec 2019 10:00:58 +0000 (11:00 +0100)] 
curl.h: add two defines for the "pre ISO C" case

Without this fix, this caused a compilation failure on AIX with IBM xlc
13.1.3 compiler.

Reported-by: Ram Krushna Mishra
Fixes #4739
Closes #4740

5 years agocreate_conn: prefer multiplexing to using new connections
Daniel Stenberg [Wed, 18 Dec 2019 13:03:36 +0000 (14:03 +0100)] 
create_conn: prefer multiplexing to using new connections

... as it would previously prefer new connections rather than
multiplexing in most conditions! The (now removed) code was a leftover
from the Pipelining code that was translated wrongly into a
multiplex-only world.

Reported-by: Kunal Ekawde
Bug: https://curl.haxx.se/mail/lib-2019-12/0060.html
Closes #4732

5 years agotest1456: remove the use of a fixed local port
Daniel Stenberg [Wed, 18 Dec 2019 13:38:35 +0000 (14:38 +0100)] 
test1456: remove the use of a fixed local port

Fixup the test to instead not compare the port number. It sometimes
caused problems like this:

"curl: (45) bind failed with errno 98: Address already in use"

Closes #4733

5 years agoCURLOPT_QUOTE.3: fix typos
Jay Satiro [Wed, 18 Dec 2019 20:21:36 +0000 (15:21 -0500)] 
CURLOPT_QUOTE.3: fix typos

Prior to this change the EXAMPLE in the QUOTE/PREQUOTE/POSTQUOTE man
pages would not compile because a variable name was incorrect.

Reported-by: Bylon2@users.noreply.github.com
Fixes https://github.com/curl/curl/issues/4736

5 years agostrerror: Fix compiler warning "empty expression"
Gisle Vanem [Wed, 18 Dec 2019 19:09:29 +0000 (14:09 -0500)] 
strerror: Fix compiler warning "empty expression"

- Remove the final semi-colon in the SEC2TXT() macro definition.

Before:  #define SEC2TXT(sec) case sec: txt = #sec; break;

After:   #define SEC2TXT(sec) case sec: txt = #sec; break

Prior to this change SEC2TXT(foo); would generate break;; which caused
the empty expression warning.

Ref: https://github.com/curl/curl/commit/5b22e1a#r36458547

5 years agocurl/parseconfig: use curl_free() to free memory allocated by libcurl
Daniel Stenberg [Wed, 18 Dec 2019 12:43:50 +0000 (13:43 +0100)] 
curl/parseconfig: use curl_free() to free memory allocated by libcurl

Reported-by: bxac on github
Fixes #4730
Closes #4731

5 years agocurl/parseconfig: fix mem-leak
Daniel Stenberg [Wed, 18 Dec 2019 12:30:39 +0000 (13:30 +0100)] 
curl/parseconfig: fix mem-leak

When looping, first trying '.curlrc' and then '_curlrc', the function
would not free the first string.

Closes #4731

5 years agoCURLOPT_URL.3: "curl supports SMB version 1 (only)"
Daniel Stenberg [Wed, 18 Dec 2019 09:14:18 +0000 (10:14 +0100)] 
CURLOPT_URL.3: "curl supports SMB version 1 (only)"

[skip ci]

5 years agotest1270: a basic -w redirect_url test
Daniel Stenberg [Tue, 17 Dec 2019 13:43:19 +0000 (14:43 +0100)] 
test1270: a basic -w redirect_url test

Closes #4728

5 years agoHISTORY: the SMB(S) support landed in 2014
Daniel Stenberg [Wed, 18 Dec 2019 07:24:51 +0000 (08:24 +0100)] 
HISTORY: the SMB(S) support landed in 2014

5 years agodefine: remove HAVE_ENGINE_LOAD_BUILTIN_ENGINES, not used anymore
Daniel Stenberg [Mon, 16 Dec 2019 21:53:10 +0000 (22:53 +0100)] 
define: remove HAVE_ENGINE_LOAD_BUILTIN_ENGINES, not used anymore

It is covered by USE_OPENSSL_ENGINE now.

Reported-by: Gisle Vanem
Bug: https://github.com/curl/curl/commit/87b9337c8f76c21c57b204e88b68c6ecf3bd1ac0#commitcomment-36447951

Closes #4725

5 years agolib: remove ASSIGNWITHINCONDITION exceptions, use our code style
Daniel Stenberg [Mon, 16 Dec 2019 07:50:46 +0000 (08:50 +0100)] 
lib: remove ASSIGNWITHINCONDITION exceptions, use our code style

... even for macros

Reviewed-by: Daniel Gustafsson
Reviewed-by: Jay Satiro
Reported-by: Jay Satiro
Fixes #4683
Closes #4722

5 years agotests: make sure checksrc runs on header files too
Daniel Stenberg [Mon, 16 Dec 2019 07:52:16 +0000 (08:52 +0100)] 
tests: make sure checksrc runs on header files too

5 years agoRevert "checksrc: fix regexp for ASSIGNWITHINCONDITION"
Daniel Stenberg [Mon, 16 Dec 2019 07:34:14 +0000 (08:34 +0100)] 
Revert "checksrc: fix regexp for ASSIGNWITHINCONDITION"

This reverts commit ba82673dac3e8d00a76aa5e3779a0cb80e7442af.

Bug: #4683

5 years agoKNOWN_BUGS: TLS session cache doesn't work with TFO
Daniel Stenberg [Mon, 16 Dec 2019 15:20:16 +0000 (16:20 +0100)] 
KNOWN_BUGS: TLS session cache doesn't work with TFO

[skip ci]
Closes #4301

5 years agoKNOWN_BUGS: Connection information when using TCP Fast Open
Daniel Stenberg [Mon, 16 Dec 2019 15:17:16 +0000 (16:17 +0100)] 
KNOWN_BUGS: Connection information when using TCP Fast Open

Also point to #4296 for more details
Closes #4296

5 years agoKNOWN_BUGS: LDAP on Windows doesn't work
Daniel Stenberg [Mon, 16 Dec 2019 15:15:39 +0000 (16:15 +0100)] 
KNOWN_BUGS: LDAP on Windows doesn't work

Closes #4261

5 years agodocs: TLS SRP doesn't work with TLS 1.3
Daniel Stenberg [Mon, 16 Dec 2019 15:03:22 +0000 (16:03 +0100)] 
docs: TLS SRP doesn't work with TLS 1.3

Reported-by: sayrer on github
Closes #4262
[skip ci]

5 years agocirrus: Switch to the FreeBSD 12.1 point release & enable more tests.
Dan Fandrich [Mon, 16 Dec 2019 10:25:53 +0000 (11:25 +0100)] 
cirrus: Switch to the FreeBSD 12.1 point release & enable more tests.

A few tests are now passing on FreeBSD, so no longer skip them.
[skip ci]

5 years agoazure: the macos cmake doesn't need to install cmake
Daniel Stenberg [Mon, 16 Dec 2019 08:59:53 +0000 (09:59 +0100)] 
azure: the macos cmake doesn't need to install cmake

 Error: cmake 3.15.5 is already installed
 To upgrade to 3.16.1, run `brew upgrade cmake`.

Closes #4723

5 years agowinbuild: Document CURL_STATICLIB requirement for static libcurl
Jay Satiro [Sun, 15 Dec 2019 22:31:23 +0000 (17:31 -0500)] 
winbuild: Document CURL_STATICLIB requirement for static libcurl

A static libcurl (ie winbuild mode=static) requires that the user define
CURL_STATICLIB when using it in their application. This is already
covered in the FAQ and INSTALL.md, but is a pretty important point so
now it's noted in the BUILD.WINDOWS.txt as well.

Assisted-by: Michael Vittiglio
Closes https://github.com/curl/curl/pull/4721

5 years agolibssh2: add support for ECDSA and ed25519 knownhost keys
Santino Keupp [Fri, 13 Dec 2019 21:55:18 +0000 (22:55 +0100)] 
libssh2: add support for ECDSA and ed25519 knownhost keys

... if a new enough libssh2 version is present.

Source: https://curl.haxx.se/mail/archive-2019-12/0023.html
Co-Authored-by: Daniel Stenberg
Closes #4714

5 years agolib1591: free memory properly on OOM, in the trailers callback
Daniel Stenberg [Sun, 15 Dec 2019 11:33:24 +0000 (12:33 +0100)] 
lib1591: free memory properly on OOM, in the trailers callback

Detected by torture tests.

Closes #4720

5 years agoruntests: --repeat=[num] to repeat tests
Daniel Stenberg [Fri, 13 Dec 2019 16:27:12 +0000 (17:27 +0100)] 
runtests: --repeat=[num] to repeat tests

Closes #4715

5 years agoRELEASE-NOTES: synced
Daniel Stenberg [Sat, 14 Dec 2019 23:37:52 +0000 (00:37 +0100)] 
RELEASE-NOTES: synced