]> granicus.if.org Git - curl/log
curl
6 years agoCMake: fix MIT/Heimdal Kerberos detection
Konstantin Kushnir [Tue, 27 Nov 2018 15:12:35 +0000 (17:12 +0200)]
CMake: fix MIT/Heimdal Kerberos detection

- fix syntax error in FindGSS.cmake
- correct krb5 include directory. FindGSS exports
  "GSS_INCLUDE_DIR" variable.

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

6 years agotest328: verify Content-Encoding: none
Daniel Stenberg [Tue, 27 Nov 2018 16:30:44 +0000 (17:30 +0100)]
test328: verify Content-Encoding: none

Because of issue #3315

Closes #3317

6 years agoconfigure: include all libraries in ssl-libs fetch
James Knight [Tue, 30 Oct 2018 07:17:44 +0000 (03:17 -0400)]
configure: include all libraries in ssl-libs fetch

When compiling a collection of SSL libraries to link against (SSL_LIBS),
ensure all libraries are included. The call `--libs-only-l` can produce
only a subset of found in a `--libs` call (e.x. pthread may be excluded).
Adding `--libs-only-other` ensures other libraries are also included in
the list. This corrects select build environments compiling against a
static version of OpenSSL. Before the change, the following could be
observed:

    checking for openssl options with pkg-config... found
    configure: pkg-config: SSL_LIBS: "-lssl -lz -ldl -lcrypto -lz -ldl "
    configure: pkg-config: SSL_LDFLAGS: "-L/home/jdknight/<workdir>/staging/usr/lib -L/home/jdknight/<workdir>/staging/usr/lib "
    configure: pkg-config: SSL_CPPFLAGS: "-I/home/jdknight/<workdir>/staging/usr/include "
    checking for HMAC_Update in -lcrypto... no
    checking for HMAC_Init_ex in -lcrypto... no
    checking OpenSSL linking with -ldl... no
    checking OpenSSL linking with -ldl and -lpthread... no
    configure: WARNING: SSL disabled, you will not be able to use HTTPS, FTPS, NTLM and more.
    configure: WARNING: Use --with-ssl, --with-gnutls, --with-polarssl, --with-cyassl, --with-nss, --with-axtls, --with-winssl, or --with-darwinssl to address this.
    ...
    SSL support:      no      (--with-{ssl,gnutls,nss,polarssl,mbedtls,cyassl,axtls,winssl,darwinssl} )
    ...

And include the other libraries when compiling SSL_LIBS succeeds with:

    checking for openssl options with pkg-config... found
    configure: pkg-config: SSL_LIBS: "-lssl -lz -ldl -pthread -lcrypto -lz -ldl -pthread "
    configure: pkg-config: SSL_LDFLAGS: "-L/home/jdknight/<workdir>/staging/usr/lib -L/home/jdknight/<workdir>/staging/usr/lib "
    configure: pkg-config: SSL_CPPFLAGS: "-I/home/jdknight/<workdir>/staging/usr/include "
    checking for HMAC_Update in -lcrypto... yes
    checking for SSL_connect in -lssl... yes
    ...
    SSL support:      enabled (OpenSSL)
    ...

Signed-off-by: James Knight <james.d.knight@live.com>
Closes #3193

6 years agodoh: fix typo in infof call
Daniel Gustafsson [Mon, 26 Nov 2018 10:40:26 +0000 (11:40 +0100)]
doh: fix typo in infof call

Reviewed-by: Daniel Stenberg <daniel@haxx.se>
6 years agocmdline-opts/gen.pl: define the correct varname
Daniel Gustafsson [Mon, 26 Nov 2018 08:56:49 +0000 (09:56 +0100)]
cmdline-opts/gen.pl: define the correct varname

The variable definition had a small typo making it declare another
variable then the intended.

Closes #3304
Reviewed-by: Daniel Stenberg <daniel@haxx.se>
6 years agoRELEASE-NOTES: synced
Daniel Stenberg [Sun, 25 Nov 2018 22:50:39 +0000 (23:50 +0100)]
RELEASE-NOTES: synced

6 years agocurl_easy_perform: fix timeout handling
Daniel Stenberg [Sat, 24 Nov 2018 22:20:19 +0000 (23:20 +0100)]
curl_easy_perform: fix timeout handling

curl_multi_wait() was erroneously used from within
curl_easy_perform(). It could lead to it believing there was no socket
to wait for and then instead sleep for a while instead of monitoring the
socket and then miss acting on that activity as swiftly as it should
(causing an up to 1000 ms delay).

Reported-by: Antoni Villalonga
Fixes #3305
Closes #3306
Closes #3308

6 years agoCURLOPT_WRITEFUNCTION.3: spell out that it gets called many times
Daniel Stenberg [Fri, 23 Nov 2018 15:55:33 +0000 (16:55 +0100)]
CURLOPT_WRITEFUNCTION.3: spell out that it gets called many times

6 years agocookies: create the cookiejar even if no cookies to save
Daniel Stenberg [Thu, 22 Nov 2018 12:24:02 +0000 (13:24 +0100)]
cookies: create the cookiejar even if no cookies to save

Important for when the file is going to be read again and thus must not
contain old contents!

Adds test 327 to verify.

Reported-by: daboul on github
Fixes #3299
Closes #3300

6 years agochecksrc: ban snprintf use, add command line flag to override warns
Daniel Stenberg [Thu, 22 Nov 2018 08:00:57 +0000 (09:00 +0100)]
checksrc: ban snprintf use, add command line flag to override warns

6 years agosnprintf: renamed and we now only use msnprintf()
Daniel Stenberg [Thu, 22 Nov 2018 08:01:24 +0000 (09:01 +0100)]
snprintf: renamed and we now only use msnprintf()

The function does not return the same value as snprintf() normally does,
so readers may be mislead into thinking the code works differently than
it actually does. A different function name makes this easier to detect.

Reported-by: Tomas Hoger
Assisted-by: Daniel Gustafsson
Fixes #3296
Closes #3297

6 years agotest: update test20/1322 for eglibc bug workaround
Tobias Hintze [Tue, 13 Nov 2018 14:49:28 +0000 (15:49 +0100)]
test: update test20/1322 for eglibc bug workaround

The tests 20 and 1322 are using getaddrinfo of libc for resolving. In
eglibc-2.19 there is a memory leakage and invalid free bug which
surfaces in some special circumstances (PF_UNSPEC hint with invalid or
non-existent names). The valgrind runs in testing fail in these
situations.

As the tests 20/1322 are not specific on either protocol (IPv4/IPv6)
this commit changes the hints to IPv4 protocol by passing `--ipv4` flag
on the tests' command line.  This prevents the valgrind failures.

6 years agohost names: allow trailing dot in name resolve, then strip it
Tobias Hintze [Fri, 2 Nov 2018 20:24:14 +0000 (21:24 +0100)]
host names: allow trailing dot in name resolve, then strip it

Delays stripping of trailing dots to after resolving the hostname.

Fixes #3022
Closes #3222

6 years agoCURLOPT_HEADERFUNCTION.3: match 'nitems' name in synopsis and description
UnknownShadow200 [Wed, 21 Nov 2018 14:56:20 +0000 (01:56 +1100)]
CURLOPT_HEADERFUNCTION.3: match 'nitems' name in synopsis and description

Closes #3295

6 years agoconfigure: Fix typo in comment
Daniel Gustafsson [Wed, 21 Nov 2018 11:23:54 +0000 (12:23 +0100)]
configure: Fix typo in comment

6 years agoopenssl: support session resume with TLS 1.3
Michael Kaufmann [Wed, 14 Nov 2018 10:52:45 +0000 (11:52 +0100)]
openssl: support session resume with TLS 1.3

Session resumption information is not available immediately after a TLS 1.3
handshake. The client must wait until the server has sent a session ticket.

Use OpenSSL's "new session" callback to get the session information and put it
into curl's session cache. For TLS 1.3 sessions, this callback will be invoked
after the server has sent a session ticket.

The "new session" callback is invoked only if OpenSSL's session cache is
enabled, so enable it and use the "external storage" mode which lets curl manage
the contents of the session cache.

A pointer to the connection data and the sockindex are now saved as "SSL extra
data" to make them available to the callback.

This approach also works for old SSL/TLS versions and old OpenSSL versions.

Reviewed-by: Daniel Stenberg <daniel@haxx.se>
Fixes #3202
Closes #3271

6 years agossl: fix compilation with OpenSSL 0.9.7
Michael Kaufmann [Tue, 13 Nov 2018 20:41:25 +0000 (21:41 +0100)]
ssl: fix compilation with OpenSSL 0.9.7

- ENGINE_cleanup() was used without including "openssl/engine.h"
- enable engine support for OpenSSL 0.9.7

Closes #3266

6 years agoopenssl: disable TLS renegotiation with BoringSSL
Daniel Stenberg [Tue, 20 Nov 2018 22:48:30 +0000 (23:48 +0100)]
openssl: disable TLS renegotiation with BoringSSL

Since we're close to feature freeze, this change disables this feature
with an #ifdef. Define ALLOW_RENEG at build-time to enable.

This could be converted to a bit for CURLOPT_SSL_OPTIONS to let
applications opt-in this.

Concern-raised-by: David Benjamin
Fixes #3283
Closes #3293

6 years agoares: remove fd from multi fd set when ares is about to close the fd
Romain Fliedel [Mon, 5 Nov 2018 10:01:19 +0000 (11:01 +0100)]
ares: remove fd from multi fd set when ares is about to close the fd

When using c-ares for asyn dns, the dns socket fd was silently closed
by c-ares without curl being aware. curl would then 'realize' the fd
has been removed at next call of Curl_resolver_getsock, and only then
notify the CURLMOPT_SOCKETFUNCTION to remove fd from its poll set with
CURL_POLL_REMOVE. At this point the fd is already closed.

By using ares socket state callback (ARES_OPT_SOCK_STATE_CB), this
patch allows curl to be notified that the fd is not longer needed
for neither for write nor read. At this point by calling
Curl_multi_closed we are able to notify multi with CURL_POLL_REMOVE
before the fd is actually closed by ares.

In asyn-ares.c Curl_resolver_duphandle we can't use ares_dup anymore
since it does not allow passing a different sock_state_cb_data

Closes #3238

6 years agoexamples/ephiperfifo: report error when epoll_ctl fails
Romain Fliedel [Mon, 5 Nov 2018 10:46:56 +0000 (11:46 +0100)]
examples/ephiperfifo: report error when epoll_ctl fails

6 years agontlm: Remove redundant ifdef USE_OPENSSL
pkubaj [Wed, 14 Nov 2018 12:12:34 +0000 (12:12 +0000)]
ntlm: Remove redundant ifdef USE_OPENSSL

lib/curl_ntlm.c had code that read as follows:

  #ifdef USE_OPENSSL
  # ifdef USE_OPENSSL
  # else
  # ..
  # endif
  #endif

Remove the redundant USE_OPENSSL along with #else (it's not possible to
reach it anyway). The removed construction is a leftover from when the
SSLeay support was removed.

Closes #3269
Reviewed-by: Daniel Gustafsson <daniel@yesql.se>
Reviewed-by: Daniel Stenberg <daniel@haxx.se>
6 years agossl: replace all internal uses of CURLE_SSL_CACERT
Han Han [Tue, 20 Nov 2018 01:48:59 +0000 (17:48 -0800)]
ssl: replace all internal uses of CURLE_SSL_CACERT

Closes #3291

6 years agodocs: add more description to unified ssl error codes
Han Han [Mon, 19 Nov 2018 23:57:44 +0000 (15:57 -0800)]
docs: add more description to unified ssl error codes

6 years agocurle: move deprecated error code to ifndef block
Han Han [Mon, 19 Nov 2018 23:16:54 +0000 (15:16 -0800)]
curle: move deprecated error code to ifndef block

6 years agoos400: add CURLOPT_CURLU to ILE/RPG binding.
Patrick Monnerat [Mon, 19 Nov 2018 14:23:00 +0000 (15:23 +0100)]
os400: add CURLOPT_CURLU to ILE/RPG binding.

6 years agoos400: Add curl_easy_conn_upkeep() to ILE/RPG binding.
Patrick Monnerat [Mon, 19 Nov 2018 14:22:00 +0000 (15:22 +0100)]
os400: Add curl_easy_conn_upkeep() to ILE/RPG binding.

6 years agoos400: fix return type of curl_easy_pause() in ILE/RPG binding.
Patrick Monnerat [Mon, 19 Nov 2018 14:19:36 +0000 (15:19 +0100)]
os400: fix return type of curl_easy_pause() in ILE/RPG binding.

6 years agoRELEASE-NOTES: synced
Daniel Stenberg [Mon, 19 Nov 2018 13:39:59 +0000 (14:39 +0100)]
RELEASE-NOTES: synced

6 years agoimpacket: add LICENSE
Daniel Stenberg [Thu, 15 Nov 2018 14:17:58 +0000 (15:17 +0100)]
impacket: add LICENSE

The license for the impacket package was not in our tree.

Imported now from upstream's
https://github.com/SecureAuthCorp/impacket/blob/master/LICENSE

Reported-by: infinnovation-dev on github
Fixes #3276
Closes #3277

6 years agotool_doswin: Fix uninitialized field warning
Daniel Gustafsson [Sun, 18 Nov 2018 20:57:00 +0000 (21:57 +0100)]
tool_doswin: Fix uninitialized field warning

The partial struct initialization in 397664a065abffb7c3445ca9 caused
a warning on uninitialized MODULEENTRY32 struct members:

  /src/tool_doswin.c:681:3: warning: missing initializer for field
  'th32ModuleID' of 'MODULEENTRY32 {aka struct tagMODULEENTRY32}'
  [-Wmissing-field-initializers]

This is sort of a bogus warning as the remaining members will be set
to zero by the compiler, as all omitted members are. Nevertheless,
remove the warning by omitting all members and setting the dwSize
members explicitly.

Closes #3254
Reviewed-by: Marcel Raad <Marcel.Raad@teamviewer.com>
Reviewed-by: Jay Satiro <raysatiro@yahoo.com>
6 years agoopenssl: Remove SSLEAY leftovers
Daniel Gustafsson [Sat, 17 Nov 2018 20:36:10 +0000 (21:36 +0100)]
openssl: Remove SSLEAY leftovers

Commit 709cf76f6bb7dbac deprecated USE_SSLEAY, as curl since long isn't
compatible with the SSLeay library. This removes the few leftovers that
were omitted in the less frequently used platform targets.

Closes #3270
Reviewed-by: Daniel Stenberg <daniel@haxx.se>
6 years agohttp_negotiate: do not close connection until negotiation is completed
Elia Tufarolo [Tue, 13 Nov 2018 17:30:56 +0000 (18:30 +0100)]
http_negotiate: do not close connection until negotiation is completed

Fix HTTP POST using CURLAUTH_NEGOTIATE.

Closes #3275

6 years agopop3: only do APOP with a valid timestamp
Daniel Stenberg [Thu, 15 Nov 2018 16:00:16 +0000 (17:00 +0100)]
pop3: only do APOP with a valid timestamp

Brought-by: bobmitchell1956 on github
Fixes #3278
Closes #3279

6 years agoopenssl: do not log excess "TLS app data" lines for TLS 1.3
Peter Wu [Fri, 16 Nov 2018 16:57:08 +0000 (17:57 +0100)]
openssl: do not log excess "TLS app data" lines for TLS 1.3

The SSL_CTX_set_msg_callback callback is not just called for the
Handshake or Alert protocols, but also for the raw record header
(SSL3_RT_HEADER) and the decrypted inner record type
(SSL3_RT_INNER_CONTENT_TYPE). Be sure to ignore the latter to avoid
excess debug spam when using `curl -v` against a TLSv1.3-enabled server:

    * TLSv1.3 (IN), TLS app data, [no content] (0):

(Following this message, another callback for the decrypted
handshake/alert messages will be be present anyway.)

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

6 years agotests: disable SO_EXCLUSIVEADDRUSE for stunnel on Windows
Marc Hoersken [Thu, 15 Nov 2018 20:10:29 +0000 (21:10 +0100)]
tests: disable SO_EXCLUSIVEADDRUSE for stunnel on Windows

SO_EXCLUSIVEADDRUSE is on by default on Vista or newer,
but does not work together with SO_REUSEADDR being on.

The default changes were made with stunnel 5.34 and 5.35.

6 years agonss: remove version selecting dead code
Kamil Dudka [Tue, 13 Nov 2018 22:54:56 +0000 (23:54 +0100)]
nss: remove version selecting dead code

Closes #3262

6 years agonss: set default max-tls to 1.3/1.2
Daniel Stenberg [Mon, 12 Nov 2018 15:22:23 +0000 (16:22 +0100)]
nss: set default max-tls to 1.3/1.2

Fixes #3261

6 years agotool_cb_wrt: Silence function cast compiler warning
Daniel Gustafsson [Mon, 12 Nov 2018 19:54:07 +0000 (20:54 +0100)]
tool_cb_wrt: Silence function cast compiler warning

Commit 5bfaa86ceb3c2a9ac474a928e748c4a86a703b33 introduced a new
compiler warning on Windows cross compilation with GCC. See below
for an example of the warning from the autobuild logs (whitespace
edited to fit):

/src/tool_cb_wrt.c:175:9: warning: cast from function call of type
    'intptr_t {aka long long int}' to non-matching type 'void *'
    [-Wbad-function-cast]
(HANDLE) _get_osfhandle(fileno(outs->stream)),
^

Store the return value from _get_osfhandle() in an intermediate
variable and cast the variable in WriteConsoleW() rather than the
function call directly to avoid a compiler warning.

In passing, also add inspection of the MultiByteToWideChar() return
value and return failure in case an error is reported.

Closes #3263
Reviewed-by: Marcel Raad <Marcel.Raad@teamviewer.com>
Reviewed-by: Viktor Szakats <commit@vszakats.net>
6 years agonss: fix fallthrough comment to fix picky compiler warning
Daniel Stenberg [Mon, 12 Nov 2018 14:23:17 +0000 (15:23 +0100)]
nss: fix fallthrough comment to fix picky compiler warning

6 years agodocs: expanded on some CURLU details
Daniel Stenberg [Sat, 10 Nov 2018 23:10:56 +0000 (00:10 +0100)]
docs: expanded on some CURLU details

6 years agoftp: avoid two unsigned int overflows in FTP listing parser
Tim Rühsen [Sat, 3 Nov 2018 17:49:00 +0000 (18:49 +0100)]
ftp: avoid two unsigned int overflows in FTP listing parser

Curl_ftp_parselist: avoid unsigned integer overflows

The overflow has no real world impact, just avoid it for "best
practice".

Closes #3225

6 years agocurl: --local-port range was not "including"
Daniel Stenberg [Fri, 9 Nov 2018 09:49:14 +0000 (10:49 +0100)]
curl: --local-port range was not "including"

The end port number in a given range was not included in the range used,
as it is documented to be.

Reported-by: infinnovation-dev on github
Fixes #3251
Closes #3255

6 years agoopenssl: support BoringSSL TLS renegotiation
Jérémy Rocher [Fri, 9 Nov 2018 13:05:26 +0000 (14:05 +0100)]
openssl: support BoringSSL TLS renegotiation

As per BoringSSL porting documentation [1], BoringSSL rejects peer
renegotiations by default.

curl fails when trying to authenticate to server through client
certificate if it is requested by server after the initial TLS
handshake.

Enable renegotiation by default with BoringSSL to get same behavior as
with OpenSSL. This is done by calling SSL_set_renegotiate_mode [2]
which was introduced in commit 1d5ef3bb1eb9 [3].

1 - https://boringssl.googlesource.com/boringssl/+/HEAD/PORTING.md#tls-renegotiation
2 - https://boringssl.googlesource.com/boringssl/+/master/include/openssl/ssl.h#3482
3 - https://boringssl.googlesource.com/boringssl/+/1d5ef3bb1eb97848617db5e7d633d735a401df86

Signed-off-by: Jérémy Rocher <rocher.jeremy@gmail.com>
Fixes #3258
Closes #3259

6 years agoHISTORY: add some milestones
Daniel Stenberg [Fri, 9 Nov 2018 12:05:26 +0000 (13:05 +0100)]
HISTORY: add some milestones

Added a few of the more notable milestones in curl history that were
missing. Primarily more recent ones but I also noted some older that
could be worth mentioning.

[ci skip]
Closes #3257

6 years agoKNOWN_BUGS: add --proxy-any connection issue
Daniel Gustafsson [Fri, 9 Nov 2018 15:50:39 +0000 (16:50 +0100)]
KNOWN_BUGS: add --proxy-any connection issue

Add the identified issue with --proxy-any and proxy servers which
advertise authentication schemes other than the supported one.

Closes #876
Closes #3250
Reported-by: NTMan on Github
Reviewed-by: Daniel Stenberg <daniel@haxx.se>
6 years agosetopt: add CURLOPT_CURLU
Jim Fuller [Thu, 1 Nov 2018 18:16:15 +0000 (19:16 +0100)]
setopt: add CURLOPT_CURLU

Allows an application to pass in a pre-parsed URL via a URL handle.

Closes #3227

6 years agodocs: ESCape "\n" codes
Gisle Vanem [Wed, 7 Nov 2018 12:26:55 +0000 (13:26 +0100)]
docs: ESCape "\n" codes

Groff / Troff will display a:
 printaf("Errno: %ld\n", error);
as:
  printf("Errno: %ld0, error);

when a "\n" is not escaped. Use "\\n" instead.

Closes #3246

6 years agocurl: --local-port fix followup
Daniel Stenberg [Wed, 7 Nov 2018 22:26:55 +0000 (23:26 +0100)]
curl: --local-port fix followup

Regression by 52db54869e6.

Reported-by: infinnovation-dev on github
Fixes #3248
Closes #3249

6 years agoMore "\n" ESCaping
Gisle Vanem [Wed, 7 Nov 2018 12:32:17 +0000 (13:32 +0100)]
More "\n" ESCaping

6 years agoRELEASE-NOTES: synced
Daniel Stenberg [Wed, 7 Nov 2018 11:00:14 +0000 (12:00 +0100)]
RELEASE-NOTES: synced

6 years agocurl: fix --local-port integer overflow
Daniel Stenberg [Mon, 5 Nov 2018 10:57:29 +0000 (11:57 +0100)]
curl: fix --local-port integer overflow

The tool's local port command line range parser didn't check for integer
overflows and could pass "weird" data to libcurl for this option.
libcurl however, has a strict range check for the values so it rejects
anything outside of the accepted range.

Reported-by: Brian Carpenter
Closes #3242

6 years agocurl: correct the switch() logic in ourWriteOut
Daniel Stenberg [Wed, 7 Nov 2018 10:14:20 +0000 (11:14 +0100)]
curl: correct the switch() logic in ourWriteOut

Follow-up to e431daf013, as I did the wrong correction for a compiler
warning. It should be a break and not a fall-through.

Pointed-out-by: Frank Gevaerts
6 years agocurl: add %{stderr} and %{stdout} for --write-out
Frank Gevaerts [Mon, 8 Oct 2018 21:54:01 +0000 (23:54 +0200)]
curl: add %{stderr} and %{stdout} for --write-out

Closes #3115

6 years agowinssl: be consistent in Schannel capitalization
Daniel Gustafsson [Wed, 7 Nov 2018 09:11:13 +0000 (10:11 +0100)]
winssl: be consistent in Schannel capitalization

The productname from Microsoft is "Schannel", but in infof/failf
reporting we use "schannel". This removes different versions.

Closes #3243
Reviewed-by: Daniel Stenberg <daniel@haxx.se>
6 years agoTODO: Have the URL API offer IDN decoding
Daniel Stenberg [Wed, 7 Nov 2018 07:46:34 +0000 (08:46 +0100)]
TODO: Have the URL API offer IDN decoding

Similar to how URL decoding/encoding is done, we could have URL
functions to convert IDN host names to punycode.

Suggested-by: Alexey Melnichuk
Closes #3232

6 years agourlapi: only skip encoding the first '=' with APPENDQUERY set
Daniel Stenberg [Tue, 6 Nov 2018 22:48:35 +0000 (23:48 +0100)]
urlapi: only skip encoding the first '=' with APPENDQUERY set

APPENDQUERY + URLENCODE would skip all equals signs but now it only skip
encoding the first to better allow "name=content" for any content.

Reported-by: Alexey Melnichuk
Fixes #3231
Closes #3231

6 years agourl: a short host name + port is not a scheme
Daniel Stenberg [Sun, 4 Nov 2018 22:30:48 +0000 (23:30 +0100)]
url: a short host name + port is not a scheme

The function identifying a leading "scheme" part of the URL considered a
few letters ending with a colon to be a scheme, making something like
"short:80" to become an unknown scheme instead of a short host name and
a port number.

Extended test 1560 to verify.

Also fixed test203 to use file_pwd to make it get the correct path on
windows. Removed test 2070 since it was a duplicate of 203.

Assisted-by: Marcel Raad
Reported-by: Hagai Auro
Fixes #3220
Fixes #3233
Closes #3223
Closes #3235

6 years agolibcurl: stop reading from paused transfers
Sangamkar [Mon, 5 Nov 2018 23:29:55 +0000 (15:29 -0800)]
libcurl: stop reading from paused transfers

In the transfer loop it would previously not acknwledge the pause bit
and continue until drained or loop ended.

Closes #3240

6 years agotool: add undocumented option --dump-module-paths for win32
Jay Satiro [Thu, 1 Nov 2018 06:50:40 +0000 (02:50 -0400)]
tool: add undocumented option --dump-module-paths for win32

- Add an undocumented diagnostic option for Windows to show the full
  paths of all loaded modules regardless of whether or not libcurl
  initialization succeeds.

This is needed so that in the CI we can get a list of all DLL
dependencies after initialization (when they're most likely to have
finished loading) and then package them as artifacts so that a
functioning build can be downloaded. Also I imagine it may have some use
as a diagnostic for help requests.

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

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

6 years agocurl_multibyte: fix a malloc overcalculation
Jay Satiro [Thu, 1 Nov 2018 06:53:22 +0000 (02:53 -0400)]
curl_multibyte: fix a malloc overcalculation

Prior to this change twice as many bytes as necessary were malloc'd when
converting wchar to UTF8. To allay confusion in the future I also
changed the variable name for the amount of bytes from len to bytes.

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

6 years agonetrc: don't ignore the login name specified with "--user"
Michael Kaufmann [Sat, 3 Nov 2018 15:58:18 +0000 (16:58 +0100)]
netrc: don't ignore the login name specified with "--user"

- for "--netrc", don't ignore the login/password specified with "--user",
  only ignore the login/password in the URL.
  This restores the netrc behaviour of curl 7.61.1 and earlier.
- fix the documentation of CURL_NETRC_REQUIRED
- improve the detection of login/password changes when reading .netrc
- don't read .netrc if both login and password are already set

Fixes #3213
Closes #3224

6 years agoOS400: add URL API ccsid wrappers and sync ILE/RPG bindings
Patrick Monnerat [Mon, 5 Nov 2018 14:37:23 +0000 (15:37 +0100)]
OS400: add URL API ccsid wrappers and sync ILE/RPG bindings

6 years agocurl: fixed UTF-8 in current console code page (Windows)
Yasuhiro Matsumoto [Thu, 1 Nov 2018 16:04:39 +0000 (01:04 +0900)]
curl: fixed UTF-8 in current console code page (Windows)

Fixes #3211
Fixes #3175
Closes #3212

6 years agoTODO: 2.6 multi upkeep
Daniel Stenberg [Mon, 5 Nov 2018 08:53:49 +0000 (09:53 +0100)]
TODO: 2.6 multi upkeep

Closes #3199

6 years agounittest: make 1652 stable across collations
Daniel Gustafsson [Mon, 5 Nov 2018 08:51:33 +0000 (09:51 +0100)]
unittest: make 1652 stable across collations

The previous coding used a format string whose output depended on the
current locale of the environment running the test. Since the gist of
the test is to have a format string, with the actual formatting being
less important, switch to a more stable formatstring with decimals.

Reported-by: Marcel Raad
Closes #3234
Reviewed-by: Daniel Stenberg <daniel@haxx.se>
Reviewed-by: Marcel Raad <Marcel.Raad@teamviewer.com>
6 years agoRevert "url: a short host name + port is not a scheme"
Daniel Stenberg [Mon, 5 Nov 2018 08:24:53 +0000 (09:24 +0100)]
Revert "url: a short host name + port is not a scheme"

This reverts commit 226cfa8264cd979eff3fd52c0f3585ef095e7cf2.

This commit caused test failures on appveyor/windows. Work on fixing them is
in #3235.

6 years agosymbols-in-versions: add missing CURLU_ symbols
Daniel Stenberg [Sat, 3 Nov 2018 21:45:08 +0000 (22:45 +0100)]
symbols-in-versions: add missing CURLU_ symbols

...and fix symbol-scan.pl to also scan urlapi.h

Reported-by: Alexey Melnichuk
Fixes #3226
Closes #3230

6 years agoinfof: clearly indicate truncation
Daniel Gustafsson [Sat, 3 Nov 2018 19:54:18 +0000 (20:54 +0100)]
infof: clearly indicate truncation

The internal buffer in infof() is limited to 2048 bytes of payload plus
an additional byte for NULL termination. Servers with very long error
messages can however cause truncation of the string, which currently
isn't very clear, and leads to badly formatted output.

This appends a "...\n" (or just "..." in case the format didn't with a
newline char) marker to the end of the string to clearly show
that it has been truncated.

Also include a unittest covering infof() to try and catch any bugs
introduced in this quite important function.

Closes #3216
Reviewed-by: Daniel Stenberg <daniel@haxx.se>
Reviewed-by: Marcel Raad <Marcel.Raad@teamviewer.com>
6 years agotool_getparam: fix some comments
Michael Kaufmann [Sat, 3 Nov 2018 16:24:31 +0000 (17:24 +0100)]
tool_getparam: fix some comments

6 years agourl: a short host name + port is not a scheme
Daniel Stenberg [Fri, 2 Nov 2018 22:46:01 +0000 (23:46 +0100)]
url: a short host name + port is not a scheme

The function identifying a leading "scheme" part of the URL considered a few
letters ending with a colon to be a scheme, making something like "short:80"
to become an unknown scheme instead of a short host name and a port number.

Extended test 1560 to verify.

Reported-by: Hagai Auro
Fixes #3220
Closes #3223

6 years agoURL: fix IPv6 numeral address parser
Daniel Stenberg [Fri, 2 Nov 2018 14:11:16 +0000 (15:11 +0100)]
URL: fix IPv6 numeral address parser

Regression from 46e164069d1a52. Extended test 1560 to verify.

Reported-by: tpaukrt on github
Fixes #3218
Closes #3219

6 years agotravis: remove curl before a normal build
Daniel Stenberg [Wed, 31 Oct 2018 11:57:36 +0000 (12:57 +0100)]
travis: remove curl before a normal build

on Linux. To make sure the test suite runs with its newly build tool and
doesn't require an external one present.

Bug: #3198
Closes #3200

6 years agomprintf: avoid unsigned integer overflow warning
Tim Rühsen [Sun, 28 Oct 2018 10:33:27 +0000 (11:33 +0100)]
mprintf: avoid unsigned integer overflow warning

The overflow has no real world impact.
Just avoid it for "best practice".

Code change suggested by "The Infinnovation Team" and Daniel Stenberg.
Closes #3184

6 years agoCurl_follow: accept non-supported schemes for "fake" redirects
Daniel Stenberg [Thu, 1 Nov 2018 22:45:57 +0000 (23:45 +0100)]
Curl_follow: accept non-supported schemes for "fake" redirects

When not actually following the redirect and the target URL is only
stored for later retrieval, curl always accepted "non-supported"
schemes. This was a regression from 46e164069d1a5230.

Reported-by: Brad King
Fixes #3210
Closes #3215

6 years agoopenvms: fix example name
Daniel Gustafsson [Fri, 2 Nov 2018 07:59:01 +0000 (08:59 +0100)]
openvms: fix example name

Commit efc696a2e09225bfeab4 renamed persistant.c to persistent.c to
fix the typo in the name, but missed to update the OpenVMS package
files which still looked for the old name.

Closes #3217
Reviewed-by: Daniel Stenberg <daniel@haxx.se>
Reviewed-by: Viktor Szakats <commit@vszakats.net>
6 years agoconfigure: show CFLAGS, LDFLAGS etc in summary
Daniel Stenberg [Thu, 1 Nov 2018 07:17:28 +0000 (08:17 +0100)]
configure: show CFLAGS, LDFLAGS etc in summary

To make it easier to understand other people's and remote builds etc.

Closes #3207

6 years agoversion: bump for next cycle
Daniel Stenberg [Thu, 1 Nov 2018 10:02:49 +0000 (11:02 +0100)]
version: bump for next cycle

6 years agoaxtls: removed
Daniel Stenberg [Tue, 30 Oct 2018 09:00:00 +0000 (10:00 +0100)]
axtls: removed

As has been outlined in the DEPRECATE.md document, the axTLS code has
been disabled for 6 months and is hereby removed.

Use a better supported TLS library!

Assisted-by: Daniel Gustafsson
Closes #3194

6 years agoschannel: make CURLOPT_CERTINFO support using Issuer chain
marcosdiazr [Tue, 30 Oct 2018 21:06:30 +0000 (18:06 -0300)]
schannel: make CURLOPT_CERTINFO support using Issuer chain

Closes #3197

6 years agotravis: build with sanitize=address,undefined,signed-integer-overflow
Daniel Stenberg [Mon, 29 Oct 2018 15:18:34 +0000 (16:18 +0100)]
travis: build with sanitize=address,undefined,signed-integer-overflow

... using clang

Closes #3190

6 years agoschannel: use Curl_ prefix for global private symbols
Daniel Stenberg [Wed, 31 Oct 2018 12:36:30 +0000 (13:36 +0100)]
schannel: use Curl_ prefix for global private symbols

Curl_verify_certificate() must use the Curl_ prefix since it is globally
available in the lib and otherwise steps outside of our namespace!

Closes #3201

6 years agotests: drop http_pipe.py script no longer used
Kamil Dudka [Wed, 31 Oct 2018 12:07:48 +0000 (13:07 +0100)]
tests: drop http_pipe.py script no longer used

It is unused since commit f7208df7d9d5cd5e15e2d89237e828f32b63f135.

Closes #3204

6 years agoruntests: use the local curl for verifying
Daniel Stenberg [Wed, 31 Oct 2018 10:08:49 +0000 (11:08 +0100)]
runtests: use the local curl for verifying

... revert the mistaken change brought in commit 8440616f53.

Reported-by: Alessandro Ghedini
Bug: https://curl.haxx.se/mail/lib-2018-10/0118.html

Closes #3198

6 years agoRELEASE-NOTES: 7.62.0 curl-7_62_0
Daniel Stenberg [Mon, 29 Oct 2018 07:35:51 +0000 (08:35 +0100)]
RELEASE-NOTES: 7.62.0

6 years agoTHANKS: 7.62.0 status
Daniel Stenberg [Sat, 27 Oct 2018 10:06:15 +0000 (12:06 +0200)]
THANKS: 7.62.0 status

6 years agovtls: add MesaLink to curl_sslbackend enum
Daniel Gustafsson [Tue, 30 Oct 2018 15:56:51 +0000 (16:56 +0100)]
vtls: add MesaLink to curl_sslbackend enum

MesaLink support was added in commit 57348eb97d1b8fc3742e02c but the
backend was never added to the curl_sslbackend enum in curl/curl.h.
This adds the new backend to the enum and updates the relevant docs.

Closes #3195
Reviewed-by: Daniel Stenberg <daniel@haxx.se>
6 years agocmake: Remove unused CURL_CONFIG_HAS_BEEN_RUN_BEFORE variable
Ruslan Baratov [Mon, 29 Oct 2018 16:19:48 +0000 (19:19 +0300)]
cmake: Remove unused CURL_CONFIG_HAS_BEEN_RUN_BEFORE variable

Closes #3191

6 years agotest2080: verify the fix for CVE-2018-16842
Daniel Stenberg [Sun, 28 Oct 2018 09:43:57 +0000 (10:43 +0100)]
test2080: verify the fix for CVE-2018-16842

6 years agovoutf: fix bad arethmetic when outputting warnings to stderr
Daniel Stenberg [Sat, 27 Oct 2018 23:33:23 +0000 (01:33 +0200)]
voutf: fix bad arethmetic when outputting warnings to stderr

CVE-2018-16842
Reported-by: Brian Carpenter
Bug: https://curl.haxx.se/docs/CVE-2018-16842.html

6 years agocmake: uniform ZLIB to use USE_ variable and clean curl-config.cmake.in
Tuomo Rinne [Sat, 27 Oct 2018 10:23:19 +0000 (11:23 +0100)]
cmake: uniform ZLIB to use USE_ variable and clean curl-config.cmake.in

Closes #3123

6 years agocmake: add find_dependency call for ZLIB to CMake config file
Tuomo Rinne [Thu, 11 Oct 2018 18:55:53 +0000 (19:55 +0100)]
cmake: add find_dependency call for ZLIB to CMake config file

6 years agocmake: add support for transitive ZLIB target
Tuomo Rinne [Wed, 10 Oct 2018 20:45:44 +0000 (21:45 +0100)]
cmake: add support for transitive ZLIB target

6 years agounit1650: fix "null pointer passed as argument 1 to memcmp"
Daniel Stenberg [Mon, 29 Oct 2018 09:27:04 +0000 (10:27 +0100)]
unit1650: fix "null pointer passed as argument 1 to memcmp"

Detected by UndefinedBehaviorSanitizer

Closes #3187

6 years agotravis: add a "make tidy" build that runs clang-tidy
Daniel Stenberg [Sat, 27 Oct 2018 14:02:48 +0000 (16:02 +0200)]
travis: add a "make tidy" build that runs clang-tidy

Closes #3182

6 years agounit1300: fix stack-use-after-scope AddressSanitizer warning
Daniel Stenberg [Sun, 28 Oct 2018 23:06:01 +0000 (00:06 +0100)]
unit1300: fix stack-use-after-scope AddressSanitizer warning

Closes #3186

6 years agoCurl_auth_create_plain_message: fix too-large-input-check
Daniel Stenberg [Fri, 28 Sep 2018 14:08:16 +0000 (16:08 +0200)]
Curl_auth_create_plain_message: fix too-large-input-check

CVE-2018-16839
Reported-by: Harry Sintonen
Bug: https://curl.haxx.se/docs/CVE-2018-16839.html

6 years agoCurl_close: clear data->multi_easy on free to avoid use-after-free
Daniel Stenberg [Thu, 18 Oct 2018 13:07:15 +0000 (15:07 +0200)]
Curl_close: clear data->multi_easy on free to avoid use-after-free

Regression from b46cfbc068 (7.59.0)
CVE-2018-16840
Reported-by: Brian Carpenter (Geeknik Labs)
Bug: https://curl.haxx.se/docs/CVE-2018-16840.html

6 years agosystem.h: use proper setting with Sun C++ as well
randomswdev [Sat, 27 Oct 2018 13:28:59 +0000 (15:28 +0200)]
system.h: use proper setting with Sun C++ as well

system.h selects the proper Sun settings when __SUNPRO_C is defined. The
Sun compiler does not define it when compiling C++ files.  I'm adding a
check also on __SUNPRO_CC to allow curl to work properly also when used
in a C++ project on Sun Solaris.

Closes #3181

6 years agorand: add comment to skip a clang-tidy false positive
Daniel Stenberg [Sat, 27 Oct 2018 13:57:31 +0000 (15:57 +0200)]
rand: add comment to skip a clang-tidy false positive

6 years agotest1651: unit test Curl_extract_certinfo()
Daniel Stenberg [Fri, 26 Oct 2018 21:07:07 +0000 (23:07 +0200)]
test1651: unit test Curl_extract_certinfo()

The version used for Gskit, NSS, GnuTLS, WolfSSL and schannel.