]> granicus.if.org Git - curl/log
curl
6 years agoexamples/sftpuploadresume: typecast fseek argument to long
Daniel Stenberg [Tue, 24 Apr 2018 12:11:53 +0000 (14:11 +0200)]
examples/sftpuploadresume: typecast fseek argument to long

/docs/examples/sftpuploadresume.c:102:12: warning: conversion to 'long
int' from 'curl_off_t {aka long long int}' may alter its value

6 years agoRevert "ftplistparser: keep state between invokes"
Daniel Stenberg [Tue, 24 Apr 2018 06:19:54 +0000 (08:19 +0200)]
Revert "ftplistparser: keep state between invokes"

This reverts commit abbc8457d85aca74b7cfda1d394b0844932b2934.

Caused fuzzer problems on travis not seen when this was a PR!

6 years agoCurl_memchr: zero length input can't match
Daniel Stenberg [Tue, 24 Apr 2018 06:03:23 +0000 (08:03 +0200)]
Curl_memchr: zero length input can't match

Avoids undefined behavior.

Reported-by: Geeknik Labs
6 years agoftplistparser: keep state between invokes
Daniel Stenberg [Thu, 19 Apr 2018 13:47:05 +0000 (15:47 +0200)]
ftplistparser: keep state between invokes

Fixes FTP wildcard parsing when doing over a number of read buffers.

Regression from f786d1f14

Reported-by: wncboy on github
Fixes #2445
Closes #2519

6 years agoftplistparser: renamed some members and variables
Daniel Stenberg [Fri, 20 Apr 2018 08:29:44 +0000 (10:29 +0200)]
ftplistparser: renamed some members and variables

... to make them better spell out what they're for.

6 years agoRELEASE-NOTES: synced
Daniel Stenberg [Mon, 23 Apr 2018 12:43:02 +0000 (14:43 +0200)]
RELEASE-NOTES: synced

6 years agocurl_global_sslset: always provide available backends
Christian Schmitz [Sun, 15 Apr 2018 08:35:06 +0000 (10:35 +0200)]
curl_global_sslset: always provide available backends

Closes #2499

6 years agohttp2: convert an assert to run-time check
Daniel Stenberg [Sat, 21 Apr 2018 10:33:52 +0000 (12:33 +0200)]
http2: convert an assert to run-time check

Fuzzing has proven we can reach code in on_frame_recv with status_code
not having been set, so let's detect that in run-time (instead of with
assert) and error error accordingly.

(This should no longer happen with the latest nghttp2)

Detected by OSS-Fuzz
Bug: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=7903
Closes #2514

6 years agocurl.1: clarify that options and URLs can be mixed
Daniel Stenberg [Mon, 23 Apr 2018 06:33:08 +0000 (08:33 +0200)]
curl.1: clarify that options and URLs can be mixed

Fixes #2515
Closes #2517

6 years agoCURLOPT_SSLCERT.3: improve WinSSL-specific usage info
Archangel_SDY [Wed, 18 Apr 2018 13:01:14 +0000 (21:01 +0800)]
CURLOPT_SSLCERT.3: improve WinSSL-specific usage info

Ref: https://github.com/curl/curl/pull/2376#issuecomment-381858780

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

6 years agoschannel: fix build error on targets <= XP
Archangel_SDY [Wed, 18 Apr 2018 11:13:54 +0000 (19:13 +0800)]
schannel: fix build error on targets <= XP

- Use CRYPT_STRING_HEX instead of CRYPT_STRING_HEXRAW since XP doesn't
  support the latter.

Ref: https://github.com/curl/curl/pull/2376#issuecomment-382153668

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

6 years agoRevert "ftplistparser: keep state between invokes"
Daniel Stenberg [Mon, 23 Apr 2018 05:50:01 +0000 (07:50 +0200)]
Revert "ftplistparser: keep state between invokes"

This reverts commit 8fb78f9ddc6d858d630600059b8ad84a80892fd9.

Unfortunately this fix introduces memory leaks I've not been able to fix
in several days. Reverting this for now to get the leaks fixed.

6 years agotool_help: clarify --max-time unit of time is seconds
Jay Satiro [Sat, 21 Apr 2018 18:19:37 +0000 (14:19 -0400)]
tool_help: clarify --max-time unit of time is seconds

Before:
 -m, --max-time <time> Maximum time allowed for the transfer

After:
 -m, --max-time <seconds> Maximum time allowed for the transfer

6 years agohttp2: handle GOAWAY properly
Daniel Stenberg [Thu, 19 Apr 2018 18:03:30 +0000 (20:03 +0200)]
http2: handle GOAWAY properly

When receiving REFUSED_STREAM, mark the connection for close and retry
streams accordingly on another/fresh connection.

Reported-by: Terry Wu
Fixes #2416
Fixes #1618
Closes #2510

6 years agohttp2: clear the "drain counter" when a stream is closed
Daniel Stenberg [Thu, 19 Apr 2018 18:01:52 +0000 (20:01 +0200)]
http2: clear the "drain counter" when a stream is closed

This fixes the notorious "httpc->drain_total >= data->state.drain"
assert.

Reported-by: Anders Bakken
Fixes #1680
Closes #2509

6 years agohttp2: avoid strstr() on data not zero terminated
Daniel Stenberg [Fri, 20 Apr 2018 14:32:46 +0000 (16:32 +0200)]
http2: avoid strstr() on data not zero terminated

It's not strictly clear if the API contract allows us to call strstr()
on a string that isn't zero terminated even when we know it will find
the substring, and clang's ASAN check dislikes us for it.

Also added a check of the return code in case it fails, even if I can't
think of a situation how that can trigger.

Detected by OSS-Fuzz
Closes #2513
Bug: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=7760

6 years agoopenssl: fix subjectAltName check on non-ASCII platforms
Stephan Mühlstrasser [Fri, 13 Apr 2018 12:04:11 +0000 (14:04 +0200)]
openssl: fix subjectAltName check on non-ASCII platforms

Curl_cert_hostcheck operates with the host character set, therefore the
ASCII subjectAltName string retrieved with OpenSSL must be converted to
the host encoding before comparison.

Closes #2493

6 years agoopenssl: Add support for OpenSSL 1.1.1 verbose-mode trace messages
Jay Satiro [Tue, 20 Mar 2018 06:57:50 +0000 (02:57 -0400)]
openssl: Add support for OpenSSL 1.1.1 verbose-mode trace messages

- Support handling verbose-mode trace messages of type
  SSL3_RT_INNER_CONTENT_TYPE, SSL3_MT_ENCRYPTED_EXTENSIONS,
  SSL3_MT_END_OF_EARLY_DATA, SSL3_MT_KEY_UPDATE, SSL3_MT_NEXT_PROTO,
  SSL3_MT_MESSAGE_HASH

Reported-by: iz8mbw@users.noreply.github.com
Fixes https://github.com/curl/curl/issues/2403

6 years agoftplistparser: keep state between invokes
Daniel Stenberg [Thu, 19 Apr 2018 13:47:05 +0000 (15:47 +0200)]
ftplistparser: keep state between invokes

Regression from f786d1f14

Reported-by: wncboy on github
Fixes #2445
Closes #2508

6 years agodetect_proxy: only show proxy use if it had contents
Daniel Stenberg [Thu, 19 Apr 2018 12:59:06 +0000 (14:59 +0200)]
detect_proxy: only show proxy use if it had contents

6 years agohttp2: handle on_begin_headers() called more than once
Daniel Stenberg [Wed, 18 Apr 2018 21:51:01 +0000 (23:51 +0200)]
http2: handle on_begin_headers() called more than once

This triggered an assert if called more than once in debug mode (and a
memory leak if not debug build). With the right sequence of HTTP/2
headers incoming it can happen.

Detected by OSS-Fuzz

Closes #2507
Bug: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=7764

6 years agoschannel: add support for CURLOPT_CAINFO
Dan McNulty [Fri, 10 Mar 2017 20:27:30 +0000 (14:27 -0600)]
schannel: add support for CURLOPT_CAINFO

- Move verify_certificate functionality in schannel.c into a new
  file called schannel_verify.c. Additionally, some structure defintions
  from schannel.c have been moved to schannel.h to allow them to be
  used in schannel_verify.c.

- Make verify_certificate functionality for Schannel available on
  all versions of Windows instead of just Windows CE. verify_certificate
  will be invoked on Windows CE or when the user specifies
  CURLOPT_CAINFO and CURLOPT_SSL_VERIFYPEER.

- In verify_certificate, create a custom certificate chain engine that
  exclusively trusts the certificate store backed by the CURLOPT_CAINFO
  file.

- doc updates of --cacert/CAINFO support for schannel

- Use CERT_NAME_SEARCH_ALL_NAMES_FLAG when invoking CertGetNameString
  when available. This implements a TODO in schannel.c to improve
  handling of multiple SANs in a certificate. In particular, all SANs
  will now be searched instead of just the first name.

- Update tool_operate.c to not search for the curl-ca-bundle.crt file
  when using Schannel to maintain backward compatibility. Previously,
  any curl-ca-bundle.crt file found in that search would have been
  ignored by Schannel. But, with CAINFO support, the file found by
  that search would have been used as the certificate store and
  could cause issues for any users that have curl-ca-bundle.crt in
  the search path.

- Update url.c to not set the build time CURL_CA_BUNDLE if the selected
  SSL backend is Schannel. We allow setting CA location for schannel
  only when explicitly specified by the user via CURLOPT_CAINFO /
  --cacert.

- Add new test cases 3000 and 3001. These test cases check that the first
  and last SAN, respectively, matches the connection hostname. New test
  certificates have been added for these cases. For 3000, the certificate
  prefix is Server-localhost-firstSAN and for 3001, the certificate
  prefix is Server-localhost-secondSAN.

- Remove TODO 15.2 (Add support for custom server certificate
  validation), this commit addresses it.

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

6 years agoschannel: fix warning
Jay Satiro [Tue, 17 Apr 2018 17:47:01 +0000 (13:47 -0400)]
schannel: fix warning

- Fix warning 'integer from pointer without a cast' on 3rd arg in
  CertOpenStore. The arg type HCRYPTPROV may be a pointer or integer
  type of the same size.

Follow-up to e35b025.

Caught by Marc's CI builds.

6 years agodocs: fix typos
Jakub Wilk [Tue, 17 Apr 2018 19:17:57 +0000 (21:17 +0200)]
docs: fix typos

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

6 years agoRELEASE-NOTES: synced
Daniel Stenberg [Tue, 17 Apr 2018 11:46:06 +0000 (13:46 +0200)]
RELEASE-NOTES: synced

6 years agowinbuild: Support custom devel paths for each dependency
kdekker [Mon, 9 Apr 2018 09:19:51 +0000 (11:19 +0200)]
winbuild: Support custom devel paths for each dependency

- Support custom devel paths for c-ares, mbedTLS, nghttp2, libSSH2,
  OpenSSL and zlib. Respectively: CARES_PATH, MBEDTLS_PATH,
  NGHTTP2_PATH, SSH2_PATH, SSL_PATH and ZLIB_PATH.

- Use lib.exe for making the static library instead of link.exe /lib.
  The latter is undocumented and could cause problems as noted in the
  comments.

- Remove a dangling URL that no longer worked. (I was not able to find
  the IDN download at MSDN/microsoft.com, so it seems to be removed.)

- Remove custom override for release-ssh2-ssl-dll-zlib configuration.
  Nobody knows why it was there and as far as we can see is unnecessary.

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

6 years agoREADME.md: add backers and sponsors
Jess [Thu, 12 Apr 2018 05:40:17 +0000 (14:40 +0900)]
README.md: add backers and sponsors

Closes #2484

6 years agoschannel: add client certificate authentication
Archangel_SDY [Sat, 10 Mar 2018 15:40:00 +0000 (23:40 +0800)]
schannel: add client certificate authentication

Users can now specify a client certificate in system certificates store
explicitly using expression like `--cert "CurrentUser\MY\<thumbprint>"`

Closes #2376

6 years agontlm_sspi: fix authentication using Credential Manager
toughengineer [Sat, 8 Jul 2017 00:10:08 +0000 (02:10 +0200)]
ntlm_sspi: fix authentication using Credential Manager

If you pass empty user/pass asking curl to use Windows Credential
Storage (as stated in the docs) and it has valid credentials for the
domain, e.g.
curl -v -u : --ntlm example.com
currently authentication fails.
This change fixes it by providing proper SPN string to the SSPI API
calls.

Fixes https://github.com/curl/curl/issues/1622
Closes https://github.com/curl/curl/pull/1660

6 years agoconfigure: keep LD_LIBRARY_PATH changes local
Daniel Stenberg [Fri, 13 Apr 2018 12:07:39 +0000 (14:07 +0200)]
configure: keep LD_LIBRARY_PATH changes local

... only set it when we actually have to run tests to reduce its impact
on for example build commands etc.

Fixes #2490
Closes #2492

Reported-by: Dmitry Mikhirev
6 years agourldata: make service names unconditional
Marcel Raad [Tue, 10 Apr 2018 06:50:29 +0000 (08:50 +0200)]
urldata: make service names unconditional

The ifdefs have become quite long. Also, the condition for the
definition of CURLOPT_SERVICE_NAME and for setting it from
CURLOPT_SERVICE_NAME have diverged. We will soon also need the two
options for NTLM, at least when using SSPI, for
https://github.com/curl/curl/pull/1660.
Just make the definitions unconditional to make that easier.

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

6 years agotest1148: tolerate progress updates better
Daniel Stenberg [Thu, 12 Apr 2018 15:56:13 +0000 (17:56 +0200)]
test1148: tolerate progress updates better

Fixes #2446
Closes #2488

6 years agossh: show libSSH2 error code when closing fails
Christian Schmitz [Sun, 15 Apr 2018 08:49:30 +0000 (10:49 +0200)]
ssh: show libSSH2 error code when closing fails

Closes #2500

6 years agovauth: Fix typo
Daniel Gustafsson [Sat, 14 Apr 2018 19:52:00 +0000 (21:52 +0200)]
vauth: Fix typo

Address various spellings of "credentials".

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

6 years agosystem.h: Add sparcv8plus to oracle/sunpro 32-bit detection
Dagobert Michelsen [Fri, 13 Apr 2018 09:57:48 +0000 (11:57 +0200)]
system.h: Add sparcv8plus to oracle/sunpro 32-bit detection

With specific compiler options selecting the arch like -xarch=sparc on
newer compilers like Oracle Studio 12.4 there is no definition of
__sparcv8 but __sparcv8plus which means the V9 ISA, but limited to the
32ÎíÎñbit subset defined by the V8plus ISA specification, without the
Visual Instruction Set (VIS), and without other implementation-specific
ISA extensions. So it should be the same as __sparcv8.

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

6 years agochecksrc: Fix typo
Daniel Gustafsson [Sat, 14 Apr 2018 22:47:36 +0000 (00:47 +0200)]
checksrc: Fix typo

Fix typo in "semicolon" spelling and remove stray tab character.

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

6 years agoall: Refactor malloc+memset to use calloc
Daniel Gustafsson [Sat, 14 Apr 2018 20:42:04 +0000 (22:42 +0200)]
all: Refactor malloc+memset to use calloc

When a zeroed out allocation is required, use calloc() rather than
malloc() followed by an explicit memset(). The result will be the
same, but using calloc() everywhere increases consistency in the
codebase and avoids the risk of subtle bugs when code is injected
between malloc and memset by accident.

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

6 years agoduphandle: make sure CURLOPT_RESOLVE is duplicated fine too
Daniel Stenberg [Thu, 12 Apr 2018 11:09:04 +0000 (13:09 +0200)]
duphandle: make sure CURLOPT_RESOLVE is duplicated fine too

Verified in test 1502 now

Fixes #2485
Closes #2486
Reported-by: Ernst Sjöstrand
6 years agomailmap: add a monnerat fixup [ci skip]
Daniel Stenberg [Thu, 12 Apr 2018 06:02:40 +0000 (08:02 +0200)]
mailmap: add a monnerat fixup [ci skip]

6 years agoproxy: show getenv proxy use in verbose output
Daniel Stenberg [Tue, 10 Apr 2018 19:30:28 +0000 (21:30 +0200)]
proxy: show getenv proxy use in verbose output

... to aid debugging etc as it sometimes isn't immediately obvious why
curl uses or doesn't use a proxy.

Inspired by #2477

Closes #2480

6 years agotravis: build libpsl and make builds use it
Daniel Stenberg [Sun, 8 Apr 2018 22:11:04 +0000 (00:11 +0200)]
travis: build libpsl and make builds use it

closes #2471

6 years agotravis: bump to clang 6 and gcc 7
Daniel Stenberg [Mon, 9 Apr 2018 18:30:57 +0000 (20:30 +0200)]
travis: bump to clang 6 and gcc 7

Extra-eye-on-this-by: Marcel Raad
Closes #2478

6 years agotravis: use trusty for coverage build
Marcel Raad [Thu, 20 Jul 2017 13:22:29 +0000 (15:22 +0200)]
travis: use trusty for coverage build

This works now and precise is in the process of being decommissioned.

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

6 years agolib: silence null-dereference warnings
Marcel Raad [Mon, 9 Apr 2018 13:53:12 +0000 (15:53 +0200)]
lib: silence null-dereference warnings

In debug mode, MingGW-w64's GCC 7.3 issues null-dereference warnings
when dereferencing pointers after DEBUGASSERT-ing that they are not
NULL.
Fix this by removing the DEBUGASSERTs.

Suggested-by: Daniel Stenberg
Ref: https://github.com/curl/curl/pull/2463

6 years agowinbuild: fix URL
kdekker [Mon, 9 Apr 2018 10:10:43 +0000 (12:10 +0200)]
winbuild: fix URL

Follow up on https://github.com/curl/curl/pull/2472.
Now using en-us instead of nl-nl as language code in the URL.

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

6 years agowinbuild: updated the documentation
kdekker [Mon, 9 Apr 2018 08:42:14 +0000 (10:42 +0200)]
winbuild: updated the documentation

The setenv command no longer exists and visual studio build prompts got
changed. Used Visual Studio 2015/2017 as reference.

Closes #2472

6 years agotest1136: fix cookie order after commit c990eadd1277
Daniel Stenberg [Sun, 8 Apr 2018 22:10:20 +0000 (00:10 +0200)]
test1136: fix cookie order after commit c990eadd1277

6 years agobuild: cleanup to fix clang warnings/errors
Daniel Stenberg [Sat, 7 Apr 2018 09:03:18 +0000 (11:03 +0200)]
build: cleanup to fix clang warnings/errors

unit1309 and vtls/gtls: error: arithmetic on a null pointer treated as a
cast from integer to pointer is a GNU extension

Reported-by: Rikard Falkeborn
Fixes #2466
Closes #2468

6 years agoexamples/sftpuploadresmue: Fix Windows large file seek
Jay Satiro [Sat, 7 Apr 2018 20:03:55 +0000 (16:03 -0400)]
examples/sftpuploadresmue: Fix Windows large file seek

- Use _fseeki64 instead of fseek (long) to seek curl_off_t in Windows.

- Use CURL_FORMAT_CURL_OFF_T specifier instead of %ld to print
  curl_off_t.

Caught by Marc's CI builds.

6 years agocurl_setup: provide a CURL_SA_FAMILY_T type if none exists
Daniel Stenberg [Fri, 6 Apr 2018 13:26:04 +0000 (15:26 +0200)]
curl_setup: provide a CURL_SA_FAMILY_T type if none exists

... and use this type instead of 'sa_family_t' in the code since several
platforms don't have it.

Closes #2463

6 years agobuild: add picky compiler warning flags for gcc 6 and 7
Eric Gallager [Mon, 12 Feb 2018 06:42:47 +0000 (01:42 -0500)]
build: add picky compiler warning flags for gcc 6 and 7

6 years agoconfigure: detect sa_family_t
Daniel Stenberg [Mon, 26 Mar 2018 14:01:07 +0000 (16:01 +0200)]
configure: detect sa_family_t

6 years agotool_operate: Fix retry on FTP 4xx to ignore other protocols
Stefan Agner [Fri, 6 Apr 2018 19:00:02 +0000 (21:00 +0200)]
tool_operate: Fix retry on FTP 4xx to ignore other protocols

Only treat response code as FTP response codes in case the
protocol type is FTP.

This fixes an issue where an HTTP download was treated as FTP
in case libcurl returned with 33. This happens when the
download has already finished and the server responses 416:
  HTTP/1.1 416 Requested Range Not Satisfiable

This should not be treated as an FTP error.

Fixes #2464
Closes #2465

6 years agohash: calculate sizes with size_t instead of longs
Daniel Stenberg [Fri, 6 Apr 2018 12:19:39 +0000 (14:19 +0200)]
hash: calculate sizes with size_t instead of longs

... since they return size_t anyway!

closes #2462

6 years agoRELEASE-NOTES: synced
Daniel Stenberg [Fri, 6 Apr 2018 13:52:10 +0000 (15:52 +0200)]
RELEASE-NOTES: synced

6 years agobuild-openssl.bat: Refer to VS2017 as VC14.1 instead of VC15
Jay Satiro [Fri, 22 Dec 2017 22:00:32 +0000 (17:00 -0500)]
build-openssl.bat: Refer to VS2017 as VC14.1 instead of VC15

.. and do the same for build-wolfssl.bat.

Because MS calls it VC14.1.

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

6 years agowinbuild: make the clean target work without build-type
kdekker [Wed, 4 Apr 2018 09:32:19 +0000 (11:32 +0200)]
winbuild: make the clean target work without build-type

Due to the check in Makefile.vc and MakefileBuild.vc, no make call can
be invoked unless a build-type was specified. However, a clean target
only existed when a build type was specified. As a result, the clean
target was unreachable. Made clean target unconditional.

Closes #2455

6 years agobuild-openssl.bat: allow custom paths for VS and perl
patelvivekv1993 [Thu, 5 Apr 2018 11:06:05 +0000 (16:36 +0530)]
build-openssl.bat: allow custom paths for VS and perl

Fixes #2430
Closes #2457

6 years agoFTP: allow PASV on IPv6 connections when a proxy is being used
Laurie Clark-Michalek [Wed, 28 Mar 2018 14:42:33 +0000 (15:42 +0100)]
FTP: allow PASV on IPv6 connections when a proxy is being used

In the situation of a client connecting to an FTP server using an IPv6
tunnel proxy, the connection info will indicate that the connection is
IPv6. However, because the server behing the proxy is IPv4, it is
permissable to attempt PSV mode. In the case of the FTP server being
IPv4 only, EPSV will always fail, and with the current logic curl will
be unable to connect to the server, as the IPv6 fwdproxy causes curl to
think that EPSV is impossible.

Closes #2432

6 years agofile: restore old behavior for file:////foo/bar URLs
Jon DeVree [Thu, 29 Mar 2018 22:39:56 +0000 (18:39 -0400)]
file: restore old behavior for file:////foo/bar URLs

curl 7.57.0 and up interpret this according to Appendix E.3.2 of RFC
8089 but then returns an error saying this is unimplemented. This is
actually a regression in behavior on both Windows and Unix.

Before curl 7.57.0 this URL was treated as a path of "//foo/bar" and
then passed to the relevant OS API. This means that the behavior of this
case is actually OS dependent.

The Unix path resolution rules say that the OS must handle swallowing
the extra "/" and so this path is the same as "/foo/bar"

The Windows path resolution rules say that this is a UNC path and
automatically handles the SMB access for the program. So curl on Windows
was already doing Appendix E.3.2 without any special code in curl.

Regression

Closes #2438

6 years agoRevert "openssl: Don't add verify locations when verifypeer==0"
Gaurav Malhotra [Tue, 3 Apr 2018 12:41:27 +0000 (18:11 +0530)]
Revert "openssl: Don't add verify locations when verifypeer==0"

This reverts commit dc85437736e1fc90e689bb1f6c51c8f1aa9430eb.

libcurl (with the OpenSSL backend) performs server certificate verification
even if verifypeer == 0 and the verification result is available using
CURLINFO_SSL_VERIFYRESULT. The commit that is being reverted caused the
CURLINFO_SSL_VERIFYRESULT to not have useful information for the
verifypeer == 0 use case (it would always have
X509_V_ERR_UNABLE_TO_GET_ISSUER_CERT_LOCALLY).

Closes #2451

6 years agotls: fix mbedTLS 2.7.0 build + handle sha256 failures
Wyatt O'Day [Mon, 2 Apr 2018 17:33:00 +0000 (13:33 -0400)]
tls: fix mbedTLS 2.7.0 build + handle sha256 failures

(mbedtls 2.70 compiled with MBEDTLS_DEPRECATED_REMOVED)

Closes #2453

6 years agocookie: case-insensitive hashing for the domains
Lauri Kasanen [Thu, 5 Apr 2018 12:55:59 +0000 (15:55 +0300)]
cookie: case-insensitive hashing for the domains

closes #2458

6 years agocookie: fix and optimize 2nd top level domain name extraction
Patrick Monnerat [Wed, 4 Apr 2018 13:28:28 +0000 (15:28 +0200)]
cookie: fix and optimize 2nd top level domain name extraction

This fixes a segfault occurring when a name of the (invalid) form "domain..tld"
is processed.

test46 updated to cover this case.

Follow-up to commit c990ead.

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

6 years agoopenssl: provide defines for argument typecasts to build warning-free
Daniel Stenberg [Wed, 4 Apr 2018 08:55:56 +0000 (10:55 +0200)]
openssl: provide defines for argument typecasts to build warning-free

... as OpenSSL >= 1.1.0 and libressl >= 2.7.0 use different argument types.

6 years agoopenssl: fix build with LibreSSL 2.7
Bernard Spil [Mon, 2 Apr 2018 17:04:06 +0000 (19:04 +0200)]
openssl: fix build with LibreSSL 2.7

 - LibreSSL 2.7 implements (most of) OpenSSL 1.1 API

Fixes #2319
Closes #2447
Closes #2448

Signed-off-by: Bernard Spil <brnrd@FreeBSD.org>
6 years agocookie: store cookies per top-level-domain-specific hash table
Lauri Kasanen [Fri, 30 Mar 2018 14:35:46 +0000 (17:35 +0300)]
cookie: store cookies per top-level-domain-specific hash table

This makes libcurl handle thousands of cookies much better and speedier.

Closes #2440

6 years agocookies: when reading from a file, only remove_expired once
Lauri Kasanen [Fri, 30 Mar 2018 15:33:52 +0000 (18:33 +0300)]
cookies: when reading from a file, only remove_expired once

This drops the cookie load time for 8k cookies from 178ms to 15ms.

Closes #2441

6 years agotest1148: set a fixed locale for the test
Daniel Stenberg [Mon, 2 Apr 2018 08:30:16 +0000 (10:30 +0200)]
test1148: set a fixed locale for the test

...as otherwise it might use a different decimal sign.

Bug: #2436
Reported-by: Oumph on github
6 years agodocs: fix CURLINFO_*_T examples use of CURL_FORMAT_CURL_OFF_T
Jay Satiro [Sat, 31 Mar 2018 18:51:55 +0000 (14:51 -0400)]
docs: fix CURLINFO_*_T examples use of CURL_FORMAT_CURL_OFF_T

- Put a percent sign before each CURL_FORMAT_CURL_OFF_T in printf.

For example "%" CURL_FORMAT_CURL_OFF_T becomes %lld or similar.

Bug: https://curl.haxx.se/mail/lib-2018-03/0140.html
Reported-by: David L.
6 years agocmake: Add advapi32 as explicit link library for win32
Michał Janiszewski [Tue, 27 Mar 2018 13:22:37 +0000 (15:22 +0200)]
cmake: Add advapi32 as explicit link library for win32

ARM targets need advapi32 explicitly.

Closes #2363

6 years agoTODO: connection cache sharing is now supporte
Daniel Stenberg [Sun, 25 Mar 2018 21:55:48 +0000 (23:55 +0200)]
TODO: connection cache sharing is now supporte

6 years agotravis: enable apt retry on fail
Jay Satiro [Mon, 26 Mar 2018 22:29:30 +0000 (18:29 -0400)]
travis: enable apt retry on fail

This is a workaround for an unsolved travis issue that is causing CI
instances to sporadically fail due to 'unable to connect' issues during
apt stage.

Ref: https://github.com/travis-ci/travis-ci/issues/8507
Ref: https://github.com/travis-ci/travis-ci/issues/9112#issuecomment-376305909

6 years agoruntests.pl: fix warning 'use of uninitialized value'
Michael Kaufmann [Sun, 25 Mar 2018 17:56:01 +0000 (19:56 +0200)]
runtests.pl: fix warning 'use of uninitialized value'

follow-up to a9a7b60

Closes #2428

6 years agogitignore: ignore more generated files
Daniel Stenberg [Fri, 23 Mar 2018 23:24:24 +0000 (00:24 +0100)]
gitignore: ignore more generated files

6 years agothreaded resolver: track resolver time and set suitable timeout values
Daniel Stenberg [Thu, 22 Mar 2018 16:59:58 +0000 (17:59 +0100)]
threaded resolver: track resolver time and set suitable timeout values

In order to make curl_multi_timeout() return suitable "sleep" times even
when there's no socket to wait for while the name is being resolved in a
helper thread.

It will increases the timeouts as time passes.

Closes #2419

6 years agoopenldap: fix for NULL return from ldap_get_attribute_ber()
Howard Chu [Sun, 18 Mar 2018 18:13:27 +0000 (18:13 +0000)]
openldap: fix for NULL return from ldap_get_attribute_ber()

Closes #2399

6 years agotravis-ci: enable -Werror for CMake builds (#2418)
Sergei Nikulov [Thu, 22 Mar 2018 13:35:33 +0000 (16:35 +0300)]
travis-ci: enable -Werror for CMake builds (#2418)

6 years agocmake: avoid warn-as-error during config checks (#2411)
Sergei Nikulov [Thu, 22 Mar 2018 13:34:49 +0000 (16:34 +0300)]
cmake: avoid warn-as-error during config checks (#2411)

- Move the CURL_WERROR option processing after the configuration checks
  to avoid failures in case of warnings during the configuration checks.

This is a partial fix for #2358

6 years agotimeval: remove compilation warning by casting (#2417)
Sergei Nikulov [Thu, 22 Mar 2018 13:34:11 +0000 (16:34 +0300)]
timeval: remove compilation warning by casting (#2417)

This is fixes #2358

6 years agohttp2: read pending frames (including GOAWAY) in connection-check
Daniel Stenberg [Mon, 19 Mar 2018 15:28:05 +0000 (16:28 +0100)]
http2: read pending frames (including GOAWAY) in connection-check

If a connection has received a GOAWAY frame while not being used, the
function now reads frames off the connection before trying to reuse it
to avoid reusing connections the server has told us not to use.

Reported-by: Alex Baines
Fixes #1967
Closes #2402

6 years agoCI: add lgtm.yml for tweaking lgtm.com analysis
Bas van Schaik [Wed, 21 Mar 2018 12:27:28 +0000 (12:27 +0000)]
CI: add lgtm.yml for tweaking lgtm.com analysis

Closes #2414

6 years agoCURLINFO_SSL_VERIFYRESULT.3: fix the example, add some text
Daniel Stenberg [Wed, 21 Mar 2018 00:03:07 +0000 (01:03 +0100)]
CURLINFO_SSL_VERIFYRESULT.3: fix the example, add some text

Reported-by: Michal Trybus
Fixes #2400

6 years agoTODO: expand ~/ in config files
Daniel Stenberg [Tue, 20 Mar 2018 23:49:49 +0000 (00:49 +0100)]
TODO: expand ~/ in config files

Closes #2317

6 years agocookie.d: mention that "-" as filename means stdin
Daniel Stenberg [Tue, 20 Mar 2018 22:25:12 +0000 (23:25 +0100)]
cookie.d: mention that "-" as filename means stdin

Reported-by: Dongliang Mu
Fixes #2410

6 years agoCURLINFO_COOKIELIST.3: made the example not leak memory
Daniel Stenberg [Tue, 20 Mar 2018 22:18:23 +0000 (23:18 +0100)]
CURLINFO_COOKIELIST.3: made the example not leak memory

Reported-by: Muz Dima
6 years agovauth/cleartext: fix integer overflow check
Daniel Stenberg [Tue, 20 Mar 2018 14:15:14 +0000 (15:15 +0100)]
vauth/cleartext: fix integer overflow check

Make the integer overflow check not rely on the undefined behavior that
a size_t wraps around on overflow.

Detected by lgtm.com
Closes #2408

6 years agolib/curl_path.h: add #ifdef header guard
Daniel Stenberg [Tue, 20 Mar 2018 13:37:29 +0000 (14:37 +0100)]
lib/curl_path.h: add #ifdef header guard

Detected by lgtm.com

6 years agovauth/ntlm.h: fix the #ifdef header guard
Daniel Stenberg [Tue, 20 Mar 2018 13:28:38 +0000 (14:28 +0100)]
vauth/ntlm.h: fix the #ifdef header guard

Detected by lgtm.com

6 years agoexamples/hiperfifo: checksrc compliance
Jay Satiro [Tue, 20 Mar 2018 07:12:35 +0000 (03:12 -0400)]
examples/hiperfifo: checksrc compliance

6 years agoparsedate: support UT timezone
Nikos Tsipinakis [Mon, 19 Mar 2018 13:42:36 +0000 (15:42 +0200)]
parsedate: support UT timezone

RFC822 section 5.2 mentions Universal Time, 'UT', to be synonymous with
GMT.

Closes #2401

6 years agoRELEASE-NOTES: synced
Daniel Stenberg [Mon, 19 Mar 2018 08:21:18 +0000 (09:21 +0100)]
RELEASE-NOTES: synced

6 years agocmake: add support for brotli
Don [Fri, 16 Mar 2018 19:49:13 +0000 (12:49 -0700)]
cmake: add support for brotli

Currently CMake cannot detect Brotli support. This adds detection of the
libraries and associated header files. It also adds this to the
generated config.

Closes #2392

6 years agodarwinssl: fix iOS build
Chris Araman [Sat, 17 Mar 2018 20:49:27 +0000 (13:49 -0700)]
darwinssl: fix iOS build

6 years agoILE/RPG binding: Add CURLOPT_HAPROXYPROTOCOL/Fix CURLOPT_DNS_SHUFFLE_ADDRESSES
Patrick Monnerat [Sun, 18 Mar 2018 00:47:05 +0000 (01:47 +0100)]
ILE/RPG binding: Add CURLOPT_HAPROXYPROTOCOL/Fix CURLOPT_DNS_SHUFFLE_ADDRESSES

6 years agoresolve: add CURLOPT_DNS_SHUFFLE_ADDRESSES
Rick Deist [Sat, 17 Mar 2018 19:10:04 +0000 (20:10 +0100)]
resolve: add CURLOPT_DNS_SHUFFLE_ADDRESSES

This patch adds CURLOPT_DNS_SHUFFLE_ADDRESSES to explicitly request
shuffling of IP addresses returned for a hostname when there is more
than one. This is useful when the application knows that a round robin
approach is appropriate and is willing to accept the consequences of
potentially discarding some preference order returned by the system's
implementation.

Closes #1694

6 years agoadd_handle/easy_perform: clear errorbuffer on start if set
Daniel Stenberg [Mon, 12 Mar 2018 23:51:39 +0000 (00:51 +0100)]
add_handle/easy_perform: clear errorbuffer on start if set

To offer applications a more defined behavior, we clear the buffer as
early as possible.

Assisted-by: Jay Satiro
Fixes #2190
Closes #2377

6 years agoCURLOPT_HAPROXYPROTOCOL: support the HAProxy PROXY protocol
Lawrence Matthews [Thu, 1 Dec 2016 12:05:04 +0000 (04:05 -0800)]
CURLOPT_HAPROXYPROTOCOL: support the HAProxy PROXY protocol

Add --haproxy-protocol for the command line tool

Closes #2162

6 years agocurl_version_info.3: fix ssl_version description
Daniel Stenberg [Sat, 17 Mar 2018 10:18:00 +0000 (11:18 +0100)]
curl_version_info.3: fix ssl_version description

Reported-by: Vincas Razma
Fixes #2364

6 years agomulti: improved pending transfers handling => improved performance
Daniel Stenberg [Tue, 13 Mar 2018 15:13:56 +0000 (16:13 +0100)]
multi: improved pending transfers handling => improved performance

When a transfer is requested to get done and it is put in the pending
queue when limited by number of connections, total or per-host, libcurl
would previously very aggressively retry *ALL* pending transfers to get
them transferring. That was very time consuming.

By reducing the aggressiveness in how pending are being retried, we
waste MUCH less time on putting transfers back into pending again.

Some test cases got a factor 30(!) speed improvement with this change.

Reported-by: Cyril B
Fixes #2369
Closes #2383