]> granicus.if.org Git - curl/log
curl
5 years agoRELEASE-NOTES: synced
Daniel Stenberg [Thu, 2 May 2019 09:13:57 +0000 (11:13 +0200)]
RELEASE-NOTES: synced

5 years agomultiif.h: remove unused protos
Daniel Stenberg [Wed, 1 May 2019 20:56:14 +0000 (22:56 +0200)]
multiif.h: remove unused protos

... for functions related to pipelining. Those functions were removed in
2f44e94efb3df.

Closes #3828

5 years agotravis: mesalink: temporarily disable test 3001
Yiming Jing [Wed, 1 May 2019 01:23:37 +0000 (18:23 -0700)]
travis: mesalink: temporarily disable test 3001

... due to SHA-1 signatures in test certs

5 years agotravis: upgrade the MesaLink TLS backend to v1.0.0
Yiming Jing [Tue, 30 Apr 2019 22:46:46 +0000 (15:46 -0700)]
travis: upgrade the MesaLink TLS backend to v1.0.0

Closes #3823
Closes #3776

5 years agoConnectionExists: improve non-multiplexing use case
Daniel Stenberg [Tue, 30 Apr 2019 09:16:53 +0000 (11:16 +0200)]
ConnectionExists: improve non-multiplexing use case

- better log output

- make sure multiplex is enabled for it to be used

5 years agomulti: provide Curl_multiuse_state to update information
Daniel Stenberg [Tue, 30 Apr 2019 09:14:38 +0000 (11:14 +0200)]
multi: provide Curl_multiuse_state to update information

As soon as a TLS backend gets ALPN conformation about the specific HTTP
version it can now set the multiplex situation for the "bundle" and
trigger moving potentially queued up transfers to the CONNECT state.

5 years agoprocess_pending_handles: mark queued transfers as previously pending
Daniel Stenberg [Tue, 30 Apr 2019 09:12:12 +0000 (11:12 +0200)]
process_pending_handles: mark queued transfers as previously pending

With transfers being queued up, we only move one at a a time back to the
CONNECT state but now we mark moved transfers so that when a moved
transfer is confirmed "successful" (it connected) it will trigger the
move of another pending transfer. Previously, it would otherwise wait
until the transfer was done before doing this. This makes queued up
pending transfers get processed (much) faster.

5 years agohttp: mark bundle as not for multiuse on < HTTP/2 response
Daniel Stenberg [Tue, 30 Apr 2019 09:09:10 +0000 (11:09 +0200)]
http: mark bundle as not for multiuse on < HTTP/2 response

Fixes #3813
Closes #3815

5 years agocookie: Guard against possible NULL ptr deref
Daniel Gustafsson [Wed, 1 May 2019 11:14:15 +0000 (13:14 +0200)]
cookie: Guard against possible NULL ptr deref

In case the name pointer isn't set (due to memory pressure most likely)
we need to skip the prefix matching and reject with a badcookie to avoid
a possible NULL pointer dereference.

Closes #3820 #3821
Reported-by: Jonathan Moerman
Reviewed-by: Daniel Stenberg <daniel@haxx.se>
5 years agoos400: Add CURLOPT_MAXAGE_CONN to ILE/RPG bindings
Patrick Monnerat [Tue, 30 Apr 2019 12:29:16 +0000 (14:29 +0200)]
os400: Add CURLOPT_MAXAGE_CONN to ILE/RPG bindings

5 years agonss: provide more specific error messages on failed init
Kamil Dudka [Fri, 26 Apr 2019 10:20:21 +0000 (12:20 +0200)]
nss: provide more specific error messages on failed init

Closes #3808

5 years agodocs: minor polish to the bug bounty / security docs
Reed Loden [Sun, 28 Apr 2019 21:14:23 +0000 (14:14 -0700)]
docs: minor polish to the bug bounty / security docs

Closes #3811

5 years agoCURL_MAX_INPUT_LENGTH: largest acceptable string input size
Daniel Stenberg [Mon, 29 Apr 2019 06:00:49 +0000 (08:00 +0200)]
CURL_MAX_INPUT_LENGTH: largest acceptable string input size

This limits all accepted input strings passed to libcurl to be less than
CURL_MAX_INPUT_LENGTH (8000000) bytes, for these API calls:
curl_easy_setopt() and curl_url_set().

The 8000000 number is arbitrary picked and is meant to detect mistakes
or abuse, not to limit actual practical use cases. By limiting the
acceptable string lengths we also reduce the risk of integer overflows
all over.

NOTE: This does not apply to `CURLOPT_POSTFIELDS`.

Test 1559 verifies.

Closes #3805

5 years agocurlver.h: use parenthesis in CURL_VERSION_BITS macro
Tseng Jun [Sun, 28 Apr 2019 07:25:15 +0000 (15:25 +0800)]
curlver.h: use parenthesis in CURL_VERSION_BITS macro

Closes #3809

5 years agocmake: rename CMAKE_USE_DARWINSSL to CMAKE_USE_SECTRANSP
Simon Warta [Fri, 12 Apr 2019 12:44:59 +0000 (14:44 +0200)]
cmake: rename CMAKE_USE_DARWINSSL to CMAKE_USE_SECTRANSP

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

5 years agontlm: Missed pre-processor || (or) during rebase for cd15acd0
Steve Holme [Tue, 23 Apr 2019 19:26:02 +0000 (20:26 +0100)]
ntlm: Missed pre-processor || (or) during rebase for cd15acd0

5 years agontlm: Support the NT response in the type-3 when OpenSSL doesn't include MD4
Steve Holme [Sat, 13 Apr 2019 20:47:56 +0000 (21:47 +0100)]
ntlm: Support the NT response in the type-3 when OpenSSL doesn't include MD4

Just like we do for mbed TLS, use our local implementation of MD4 when
OpenSSL doesn't support it. This allows a type-3 message to include the
NT response.

5 years agoINTERNALS: fix misindentation of ToC item
Daniel Gustafsson [Tue, 23 Apr 2019 10:38:31 +0000 (12:38 +0200)]
INTERNALS: fix misindentation of ToC item

Kerberos was incorrectly indented as a subsection under FTP, which is
incorrect as they are both top level sections. A fix for this was first
attempted in commit fef38a0898322f285401c5ff2f5e7c90dbf3be63 but that
was a few paddles short of being complete.

5 years agoINTERNALS: Add structs to ToC
Aron Bergman [Tue, 23 Apr 2019 09:36:22 +0000 (11:36 +0200)]
INTERNALS: Add structs to ToC

Add the subsections under "Structs in libcurl" to the table of contents.

Reviewed-by: Daniel Stenberg <daniel@haxx.se>
Reviewed-by: Daniel Gustafsson <daniel@yesql.se>
5 years agoINTERNALS: Add code highlighting
Aron Bergman [Tue, 23 Apr 2019 09:29:47 +0000 (11:29 +0200)]
INTERNALS: Add code highlighting

Make all struct members under the Curl_handler section
print in monospace font.

Closes #3801
Reviewed-by: Daniel Stenberg <daniel@haxx.se>
Reviewed-by: Daniel Gustafsson <daniel@yesql.se>
5 years agodocs/BUG-BOUNTY: bug bounty time [skip ci]
Daniel Stenberg [Sat, 20 Apr 2019 10:19:47 +0000 (12:19 +0200)]
docs/BUG-BOUNTY: bug bounty time [skip ci]

Introducing the curl bug bounty program on hackerone. We now recommend
filing security issues directly in the hackerone ticket system which
only is readable to curl security team members.

Assisted-by: Daniel Gustafsson
Closes #3488

5 years agosasl: Don't send authcid as authzid for the PLAIN mechanism as per RFC 4616
Steve Holme [Thu, 18 Apr 2019 20:54:35 +0000 (21:54 +0100)]
sasl: Don't send authcid as authzid for the PLAIN mechanism as per RFC 4616

RFC 4616 specifies the authzid is optional in the client authentication
message and that the server will derive the authorisation identity
(authzid) from the authentication identity (authcid) when not specified
by the client.

5 years agomemdebug: fix variable name
Gisle Vanem [Mon, 22 Apr 2019 07:04:26 +0000 (03:04 -0400)]
memdebug: fix variable name

Follow-up to 76b6348 which renamed logfile as curl_dbg_logfile.

Ref: https://github.com/curl/curl/commit/76b6348#r33259088

5 years agovauth/cleartext: Don't send the authzid if it is empty
Steve Holme [Wed, 17 Apr 2019 22:06:05 +0000 (23:06 +0100)]
vauth/cleartext: Don't send the authzid if it is empty

Follow up to 762a292f.

5 years agotest 196,197,198: add 'retry' keyword [skip ci]
Daniel Stenberg [Sat, 20 Apr 2019 10:59:05 +0000 (12:59 +0200)]
test 196,197,198: add 'retry' keyword [skip ci]

5 years agoRELEASE-NOTES: synced
Daniel Stenberg [Sun, 21 Apr 2019 21:24:55 +0000 (23:24 +0200)]
RELEASE-NOTES: synced

5 years agoCURLOPT_MAXAGE_CONN: set the maximum allowed age for conn reuse
Daniel Stenberg [Sun, 14 Apr 2019 21:20:01 +0000 (23:20 +0200)]
CURLOPT_MAXAGE_CONN: set the maximum allowed age for conn reuse

... and disconnect too old ones instead of trying to reuse.

Default max age is set to 118 seconds.

Ref: #3722
Closes #3782

5 years agoaltsvc: Fix building with cookies disables
Po-Chuan Hsieh [Sat, 30 Mar 2019 19:11:57 +0000 (19:11 +0000)]
altsvc: Fix building with cookies disables

ALTSVC requires Curl_get_line which is defined in lib/cookie.c inside a #if
check of HTTP and COOKIES. That makes Curl_get_line undefined if COOKIES is
disabled. Fix by splitting out the function into a separate file which can
be included where needed.

Closes #3717
Reviewed-by: Daniel Gustafsson <daniel@yesql.se>
Reviewed-by: Marcel Raad <Marcel.Raad@teamviewer.com>
5 years agotest1002: correct the name [skip ci]
Daniel Stenberg [Fri, 19 Apr 2019 16:25:18 +0000 (18:25 +0200)]
test1002: correct the name [skip ci]

5 years agotest660: verify CONNECT_ONLY with IMAP
Daniel Stenberg [Fri, 19 Apr 2019 21:33:02 +0000 (23:33 +0200)]
test660: verify CONNECT_ONLY with IMAP

which basically just makes sure LOGOUT is *not* issued on disconnect

5 years agoCurl_disconnect: treat all CONNECT_ONLY connections as "dead"
Daniel Stenberg [Fri, 19 Apr 2019 14:58:27 +0000 (16:58 +0200)]
Curl_disconnect: treat all CONNECT_ONLY connections as "dead"

Since the connection has been used by the "outside" we don't know the
state of it anymore and curl should not use it anymore.

Bug: https://curl.haxx.se/mail/lib-2019-04/0052.html

Closes #3795

5 years agomulti: fix the statenames (follow-up fix from 2f44e94efb3df8e)
Daniel Stenberg [Fri, 19 Apr 2019 14:56:32 +0000 (16:56 +0200)]
multi: fix the statenames (follow-up fix from 2f44e94efb3df8e)

The list of names must be in sync with the defined states in the header
file!

5 years agoopenvms: Remove pre-processors for Windows as VMS cannot support them
Steve Holme [Tue, 16 Apr 2019 19:56:30 +0000 (20:56 +0100)]
openvms: Remove pre-processors for Windows as VMS cannot support them

5 years agoopenvms: Remove pre-processor for SecureTransport as VMS cannot support it
Steve Holme [Mon, 15 Apr 2019 22:12:00 +0000 (23:12 +0100)]
openvms: Remove pre-processor for SecureTransport as VMS cannot support it

Fixes #3768
Closes #3785

5 years agoTODO: Add issue link to an existing entry
Jay Satiro [Tue, 16 Apr 2019 19:45:41 +0000 (15:45 -0400)]
TODO: Add issue link to an existing entry

5 years agoRELEASE-NOTES: synced
Daniel Stenberg [Tue, 16 Apr 2019 07:34:48 +0000 (09:34 +0200)]
RELEASE-NOTES: synced

5 years agotool_help: Warn if curl and libcurl versions do not match
Jay Satiro [Sat, 13 Apr 2019 05:12:18 +0000 (01:12 -0400)]
tool_help: Warn if curl and libcurl versions do not match

.. because functionality may be affected if the versions differ.

This commit implements TODO 18.7 "warning if curl version is not in sync
with libcurl version".

Ref: https://github.com/curl/curl/blob/curl-7_64_1/docs/TODO#L1028-L1033

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

5 years agomd5: Update the function signature following d84da52d
Steve Holme [Mon, 15 Apr 2019 23:08:42 +0000 (00:08 +0100)]
md5: Update the function signature following d84da52d

5 years agomd5: Forgot to update the code alignment in d84da52d
Steve Holme [Mon, 15 Apr 2019 21:40:43 +0000 (22:40 +0100)]
md5: Forgot to update the code alignment in d84da52d

5 years agomd5: Return CURLcode from the internally accessible functions
Steve Holme [Mon, 15 Apr 2019 21:38:20 +0000 (22:38 +0100)]
md5: Return CURLcode from the internally accessible functions

Following 28f826b3 to return CURLE_OK instead of numeric 0.

5 years agotests: Run global cleanup at end of tests
Daniel Gustafsson [Mon, 15 Apr 2019 13:23:58 +0000 (15:23 +0200)]
tests: Run global cleanup at end of tests

Make sure to run curl_global_cleanup() when shutting down the test
suite to release any resources allocated in the SSL setup. This is
clearly visible when running tests with PolarSSL where the thread
lock calloc() memory which isn't released when not running cleanup.
Below is an excerpt from the autobuild logs:

  ==12368== 96 bytes in 1 blocks are possibly lost in loss record 1 of 2
  ==12368== at 0x4837B65: calloc (vg_replace_malloc.c:752)
  ==12368== by 0x11A76E: curl_dbg_calloc (memdebug.c:205)
  ==12368== by 0x145CDF: Curl_polarsslthreadlock_thread_setup
                         (polarssl_threadlock.c:54)
  ==12368== by 0x145B37: Curl_polarssl_init (polarssl.c:865)
  ==12368== by 0x14129D: Curl_ssl_init (vtls.c:171)
  ==12368== by 0x118B4C: global_init (easy.c:158)
  ==12368== by 0x118BF5: curl_global_init (easy.c:221)
  ==12368== by 0x118D0B: curl_easy_init (easy.c:299)
  ==12368== by 0x114E96: test (lib1906.c:32)
  ==12368== by 0x115495: main (first.c:174)

Closes #3783
Reviewed-by: Marcel Raad <Marcel.Raad@teamviewer.com>
Reviewed-by: Daniel Stenberg <daniel@haxx.se>
5 years agotravis: use mbedtls from Xenial
Marcel Raad [Sun, 14 Apr 2019 12:48:37 +0000 (14:48 +0200)]
travis: use mbedtls from Xenial

No need to build it from source anymore.

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

5 years agotravis: use libpsl from Xenial
Marcel Raad [Sun, 14 Apr 2019 12:42:23 +0000 (14:42 +0200)]
travis: use libpsl from Xenial

This makes building libpsl and libidn2 from source unnecessary and
removes the need for the autopoint and libunistring-dev packages.

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

5 years agoruntests: start socksd like other servers
Daniel Stenberg [Mon, 15 Apr 2019 06:14:46 +0000 (08:14 +0200)]
runtests: start socksd like other servers

... without a $srcdir prefix. Triggered by the failures in several
autobuilds.

Closes #3781

5 years agosocksd: Fix typos
Daniel Gustafsson [Sun, 14 Apr 2019 20:06:40 +0000 (22:06 +0200)]
socksd: Fix typos

Reviewed-by: Daniel Stenberg <daniel@haxx.se>
5 years agosocksd: Properly decorate static variables
Daniel Gustafsson [Sun, 14 Apr 2019 20:06:09 +0000 (22:06 +0200)]
socksd: Properly decorate static variables

Mark global variables static to avoid compiler warning in Clang when
using -Wmissing-variable-declarations.

Closes #3778
Reviewed-by: Daniel Stenberg <daniel@haxx.se>
5 years agomd(4|5): Fixed indentation oddities with the importation of replacement code
Steve Holme [Sun, 14 Apr 2019 13:08:15 +0000 (14:08 +0100)]
md(4|5): Fixed indentation oddities with the importation of replacement code

The indentation from 211d5329 and 57d6d253 was a little strange as
parts didn't align correctly, uses 4 spaces rather than 2. Checked
the indentation of the original source so it aligns, albeit, using
curl style.

5 years agomd5: Code style to return CURLE_OK rather than numeric 0
Steve Holme [Sun, 14 Apr 2019 07:42:36 +0000 (08:42 +0100)]
md5: Code style to return CURLE_OK rather than numeric 0

5 years agomd5: Corrected code style for some pointer arguments
Steve Holme [Sun, 14 Apr 2019 07:36:56 +0000 (08:36 +0100)]
md5: Corrected code style for some pointer arguments

5 years agotravis: update some builds to xenial
Marcel Raad [Fri, 8 Mar 2019 19:26:10 +0000 (20:26 +0100)]
travis: update some builds to xenial

Xenial comes with more up-to-date software versions and more available
packages, some of which we currently build from source. Unfortunately,
some builds would fail with Xenial because of assertion failures in
Valgrind when using OpenSSL, so leave these at Trusty.

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

5 years agotest: make tests and test scripts use socksd for SOCKS
Daniel Stenberg [Mon, 8 Apr 2019 17:43:48 +0000 (19:43 +0200)]
test: make tests and test scripts use socksd for SOCKS

Make all SOCKS tests use socksd instead of ssh.

5 years agosocksd: new SOCKS 4+5 server for tests
Daniel Stenberg [Mon, 8 Apr 2019 13:27:56 +0000 (15:27 +0200)]
socksd: new SOCKS 4+5 server for tests

Closes #3752

5 years agosingleipconnect: show port in the verbose "Trying ..." message
Daniel Stenberg [Thu, 11 Apr 2019 06:43:33 +0000 (08:43 +0200)]
singleipconnect: show port in the verbose "Trying ..." message

To aid debugging better.

5 years agoCURLOPT_ADDRESS_SCOPE: fix range check and more
tmilburn [Thu, 7 Mar 2019 20:23:54 +0000 (20:23 +0000)]
CURLOPT_ADDRESS_SCOPE: fix range check and more

Commit 9081014 fixed most of the confusing issues between scope id and
scope however 844896d added bad limits checking assuming that the scope
is being set and not the scope id.

I have fixed the documentation so it all refers to scope ids.

In addition Curl_if2ip refered to the scope id as remote_scope_id which
is incorrect, so I renamed it to local_scope_id.

Adjusted-by: Daniel Stenberg
Closes #3655
Closes #3765
Fixes #3713

5 years agourlapi: stricter CURLUPART_PORT parsing
Daniel Stenberg [Thu, 11 Apr 2019 11:20:15 +0000 (13:20 +0200)]
urlapi: stricter CURLUPART_PORT parsing

Only allow well formed decimal numbers in the input.

Document that the number MUST be between 1 and 65535.

Add tests to test 1560 to verify the above.

Ref: https://github.com/curl/curl/issues/3753
Closes #3762

5 years agowinbuild: Support MultiSSL builds
Jan-E [Fri, 12 Apr 2019 21:41:13 +0000 (23:41 +0200)]
winbuild: Support MultiSSL builds

- Remove the lines in winbuild/Makefile.vc that generate an error with
  multiple SSL backends.

- Add /DCURL_WITH_MULTI_SSL in winbuild/MakefileBuild.vc if multiple SSL
  backends are set.

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

5 years agotravis: remove mesalink builds (temporarily?)
Daniel Stenberg [Fri, 12 Apr 2019 08:07:45 +0000 (10:07 +0200)]
travis: remove mesalink builds (temporarily?)

Since the mesalink build started to fail on travis, even though we build
a fixed release version, we disable it to prevent it from blocking
progress.

Closes #3767

5 years agoopenssl: mark connection for close on TLS close_notify
Daniel Stenberg [Thu, 11 Apr 2019 15:22:52 +0000 (17:22 +0200)]
openssl: mark connection for close on TLS close_notify

Without this, detecting and avoid reusing a closed TLS connection
(without a previous GOAWAY) when doing HTTP/2 is tricky.

Reported-by: Tom van der Woerdt
Fixes #3750
Closes #3763

5 years agoRELEASE-NOTES: synced
Daniel Stenberg [Fri, 12 Apr 2019 08:55:50 +0000 (10:55 +0200)]
RELEASE-NOTES: synced

5 years agovauth/cleartext: Update the PLAIN login function signature to match RFC 4616
Steve Holme [Wed, 10 Apr 2019 21:17:02 +0000 (22:17 +0100)]
vauth/cleartext: Update the PLAIN login function signature to match RFC 4616

Functionally this doesn't change anything as we still use the username
for both the authorisation identity and the authentication identity.

Closes #3757

5 years agotest1906: verify CURLOPT_CURLU + CURLOPT_PORT usage
Daniel Stenberg [Thu, 11 Apr 2019 09:28:11 +0000 (11:28 +0200)]
test1906: verify CURLOPT_CURLU + CURLOPT_PORT usage

Based-on-code-by: Poul T Lomholt
5 years agourl: always clone the CUROPT_CURLU handle
Daniel Stenberg [Thu, 11 Apr 2019 10:49:20 +0000 (12:49 +0200)]
url: always clone the CUROPT_CURLU handle

Since a few code paths actually update that data.

Fixes #3753
Closes #3761

Reported-by: Poul T Lomholt
5 years agoCURLOPT_DNS_USE_GLOBAL_CACHE: remove
Daniel Stenberg [Thu, 7 Mar 2019 14:39:43 +0000 (15:39 +0100)]
CURLOPT_DNS_USE_GLOBAL_CACHE: remove

Remove the code too. The functionality has been disabled in code since
7.62.0. Setting this option will from now on simply be ignored and have
no function.

Closes #3654

5 years agotravis: install libgnutls28-dev only for --with-gnutls build
Marcel Raad [Tue, 2 Apr 2019 13:06:47 +0000 (15:06 +0200)]
travis: install libgnutls28-dev only for --with-gnutls build

Reduces the time needed for the other jobs a little.

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

5 years agotravis: install libnss3-dev only for --with-nss build
Marcel Raad [Tue, 2 Apr 2019 12:58:33 +0000 (14:58 +0200)]
travis: install libnss3-dev only for --with-nss build

Reduces the time needed for the other jobs a little.

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

5 years agotravis: install libssh2-dev only for --with-libssh2 build
Marcel Raad [Tue, 2 Apr 2019 12:56:18 +0000 (14:56 +0200)]
travis: install libssh2-dev only for --with-libssh2 build

Reduces the time needed for the other jobs a little.

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

5 years agotravis: install libssh-dev only for --with-libssh build
Marcel Raad [Tue, 2 Apr 2019 12:51:21 +0000 (14:51 +0200)]
travis: install libssh-dev only for --with-libssh build

Reduces the time needed for the other jobs a little.

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

5 years agotravis: install krb5-user only for --with-gssapi build
Marcel Raad [Tue, 2 Apr 2019 12:46:23 +0000 (14:46 +0200)]
travis: install krb5-user only for --with-gssapi build

Reduces the time needed for the other jobs a little.

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

5 years agotravis: install lcov only for the coverage job
Marcel Raad [Tue, 2 Apr 2019 12:35:19 +0000 (14:35 +0200)]
travis: install lcov only for the coverage job

Reduces the time needed for the other jobs a little.

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

5 years agotravis: install clang only when needed
Marcel Raad [Tue, 2 Apr 2019 12:31:06 +0000 (14:31 +0200)]
travis: install clang only when needed

This reduces the GCC job runtimes a little and it's needed to
selectively update clang builds to xenial.

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

5 years agoAppVeyor: enable testing for WinSSL build
Marcel Raad [Sun, 24 Feb 2019 18:05:28 +0000 (19:05 +0100)]
AppVeyor: enable testing for WinSSL build

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

5 years agobuild: fix Codacy/CppCheck warnings
Marcel Raad [Fri, 5 Apr 2019 17:57:29 +0000 (19:57 +0200)]
build: fix Codacy/CppCheck warnings

- remove unused variables
- declare conditionally used variables conditionally
- suppress unused variable warnings in the CMake tests
- remove dead variable stores
- consistently use WIN32 macro to detect Windows

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

5 years agopolarssl_threadlock: remove conditionally unused code
Marcel Raad [Fri, 5 Apr 2019 17:46:05 +0000 (19:46 +0200)]
polarssl_threadlock: remove conditionally unused code

Make functions no-ops if neither both USE_THREADS_POSIX and
HAVE_PTHREAD_H nor both USE_THREADS_WIN32 and HAVE_PROCESS_H are
defined. Previously, if only one of them was defined, there was either
code compiled that did nothing useful or the wrong header included for
the functions used.

Also, move POLARSSL_MUTEX_T define to implementation file as it's not
used externally.

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

5 years agolib557: initialize variables
Marcel Raad [Fri, 5 Apr 2019 09:18:12 +0000 (11:18 +0200)]
lib557: initialize variables

These variables are only conditionally initialized.

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

5 years agolib509: add missing include for strdup
Marcel Raad [Fri, 5 Apr 2019 09:12:25 +0000 (11:12 +0200)]
lib509: add missing include for strdup

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

5 years agoREADME.md: fix no-consecutive-blank-lines Codacy warning
Marcel Raad [Fri, 5 Apr 2019 07:56:57 +0000 (09:56 +0200)]
README.md: fix no-consecutive-blank-lines Codacy warning

Consistently use one blank line between blocks.

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

5 years agotests/server/util: fix Windows Unicode build
Marcel Raad [Wed, 10 Apr 2019 17:26:35 +0000 (19:26 +0200)]
tests/server/util: fix Windows Unicode build

Always use the ANSI version of FormatMessage as we don't have the
curl_multibyte gear available here.

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

5 years agocurl_easy_getinfo.3: fix minor formatting mistake
Daniel Stenberg [Thu, 11 Apr 2019 14:06:40 +0000 (16:06 +0200)]
curl_easy_getinfo.3: fix minor formatting mistake

5 years agoxattr: skip unittest on unsupported platforms
Daniel Gustafsson [Thu, 11 Apr 2019 07:22:22 +0000 (09:22 +0200)]
xattr: skip unittest on unsupported platforms

The stripcredentials unittest fails to compile on platforms without
xattr support, for example the Solaris member in the buildfarm which
fails with the following:

  CC unit1621-unit1621.o
  CC ../libtest/unit1621-first.o
  CCLD unit1621
  Undefined first referenced
  symbol in file
  stripcredentials unit1621-unit1621.o
  goto problem 2
  ld: fatal: symbol referencing errors. No output written to .libs/unit1621
  collect2: error: ld returned 1 exit status
  gmake[2]: *** [Makefile:996: unit1621] Error 1

Fix by excluding the test on such platforms by using the reverse
logic from where stripcredentials() is defined.

Closes #3759
Reviewed-by: Daniel Stenberg <daniel@haxx.se>
5 years agoemailL Added reference to RFC8314 for implicit TLS
Steve Holme [Thu, 11 Apr 2019 00:19:15 +0000 (01:19 +0100)]
emailL Added reference to RFC8314 for implicit TLS

5 years agoREADME: Schannel, stop calling it "winssl"
Steve Holme [Tue, 9 Apr 2019 19:34:10 +0000 (20:34 +0100)]
README: Schannel, stop calling it "winssl"

Stick to "Schannel" everywhere - follow up to 180501cb.

5 years agocmake: clear CMAKE_REQUIRED_LIBRARIES after each use
Jakub Zakrzewski [Sun, 7 Apr 2019 10:38:09 +0000 (12:38 +0200)]
cmake: clear CMAKE_REQUIRED_LIBRARIES after each use

This fixes GSSAPI builds with the libraries in a non-standard location.
The testing for recv() were failing because it failed to link
the Kerberos libraries, which are not needed for this or subsequent
tests.

fixes #3743
closes #3744

5 years agocmake: avoid linking executable for some tests with cmake 3.6+
Jakub Zakrzewski [Sun, 7 Apr 2019 10:43:38 +0000 (12:43 +0200)]
cmake: avoid linking executable for some tests with cmake 3.6+

With CMAKE_TRY_COMPILE_TARGET_TYPE set to STATIC_LIBRARY, the try_compile()
(which is used by check_c_source_compiles()) will build static library
instead of executable. This avoids linking additional libraries in and thus
speeds up those checks a little.

This commit also avoids #3743 (GSSAPI build errors) on itself with cmake
3.6 or above. That issue was fixed separately for all versions.

Ref: #3744

5 years agocmake: minor cleanup
Jakub Zakrzewski [Sun, 7 Apr 2019 10:05:23 +0000 (12:05 +0200)]
cmake: minor cleanup

- Remove nneeded include_regular_expression.
  It was setting what is already a default.

- Remove duplicated include.

- Don't check for pre-3.0.0 CMake version.
  We already require at least 3.0.0, so it's just clutter.

Ref: #3744

5 years agobuild-openssl.bat: Fixed support for OpenSSL v1.1.0+
Steve Holme [Sat, 10 Feb 2018 15:28:10 +0000 (15:28 +0000)]
build-openssl.bat: Fixed support for OpenSSL v1.1.0+

5 years agobuild-openssl.bat: Perfer the use of if statements rather than goto (where possible)
Steve Holme [Sat, 6 Apr 2019 21:07:58 +0000 (22:07 +0100)]
build-openssl.bat: Perfer the use of if statements rather than goto (where possible)

5 years agobuild-openssl.bat: Perform the install for each build type directly after the build
Steve Holme [Sat, 6 Apr 2019 21:46:30 +0000 (22:46 +0100)]
build-openssl.bat: Perform the install for each build type directly after the build

5 years agobuild-openssl.bat: Split the install of static and shared build types
Steve Holme [Sat, 6 Apr 2019 19:00:21 +0000 (20:00 +0100)]
build-openssl.bat: Split the install of static and shared build types

5 years agobuild-openssl.bat: Split the building of static and shared build types
Steve Holme [Sun, 31 Mar 2019 15:45:03 +0000 (17:45 +0200)]
build-openssl.bat: Split the building of static and shared build types

5 years agobuild-openssl.bat: Move the installation into a separate function
Steve Holme [Sun, 31 Mar 2019 09:55:55 +0000 (11:55 +0200)]
build-openssl.bat: Move the installation into a separate function

5 years agobuild-openssl.bat: Move the build step into a separate function
Steve Holme [Thu, 8 Feb 2018 22:05:31 +0000 (22:05 +0000)]
build-openssl.bat: Move the build step into a separate function

5 years agobuild-openssl.bat: Move the OpenSSL configuration into a separate function
Steve Holme [Sun, 31 Mar 2019 08:00:12 +0000 (10:00 +0200)]
build-openssl.bat: Move the OpenSSL configuration into a separate function

5 years agobuild-openssl.bat: Fixed the BUILD_CONFIG variable not being initialised
Steve Holme [Thu, 8 Feb 2018 21:55:26 +0000 (21:55 +0000)]
build-openssl.bat: Fixed the BUILD_CONFIG variable not being initialised

Should the parent environment set this variable then the build might
not be performed as the user intended.

5 years agosocks: fix error message
Daniel Stenberg [Mon, 8 Apr 2019 16:41:43 +0000 (18:41 +0200)]
socks: fix error message

5 years agoconfig.d: clarify that initial : and = might need quoting [skip ci]
Daniel Stenberg [Sun, 7 Apr 2019 22:16:21 +0000 (00:16 +0200)]
config.d: clarify that initial : and = might need quoting [skip ci]

Fixes #3738
Closes #3749

5 years agoRELEASE-NOTES: synced
Daniel Stenberg [Mon, 8 Apr 2019 19:42:05 +0000 (21:42 +0200)]
RELEASE-NOTES: synced

bumped to 7.65.0 for next release

5 years agosocks5: user name and passwords must be shorter than 256
Daniel Stenberg [Fri, 5 Apr 2019 20:50:22 +0000 (22:50 +0200)]
socks5: user name and passwords must be shorter than 256

bytes... since the protocol needs to store the length in a single byte field.

Reported-by: XmiliaH on github
Fixes #3737
Closes #3740

5 years agotest: urlapi: urlencode characters above 0x7f correctly
Jakub Zakrzewski [Sat, 6 Apr 2019 11:47:43 +0000 (13:47 +0200)]
test: urlapi: urlencode characters above 0x7f correctly

5 years agourlapi: urlencode characters above 0x7f correctly
Jakub Zakrzewski [Sat, 6 Apr 2019 11:48:18 +0000 (13:48 +0200)]
urlapi: urlencode characters above 0x7f correctly

fixes #3741
Closes #3742

5 years agomulti_runsingle(): fix use-after-free
Even Rouault [Sun, 7 Apr 2019 12:07:35 +0000 (14:07 +0200)]
multi_runsingle(): fix use-after-free

Fixes #3745
Closes #3746

The following snippet
```

int main()
{
    CURL* hCurlHandle = curl_easy_init();
    curl_easy_setopt(hCurlHandle, CURLOPT_URL, "http://example.com");
    curl_easy_setopt(hCurlHandle, CURLOPT_PROXY, "1");
    curl_easy_perform(hCurlHandle);
    curl_easy_cleanup(hCurlHandle);
    return 0;
}
```
triggers the following Valgrind warning

```
==4125== Invalid read of size 8
==4125==    at 0x4E7D1EE: Curl_llist_remove (llist.c:97)
==4125==    by 0x4E7EF5C: detach_connnection (multi.c:798)
==4125==    by 0x4E80545: multi_runsingle (multi.c:1451)
==4125==    by 0x4E8197C: curl_multi_perform (multi.c:2072)
==4125==    by 0x4E766A0: easy_transfer (easy.c:625)
==4125==    by 0x4E76915: easy_perform (easy.c:719)
==4125==    by 0x4E7697C: curl_easy_perform (easy.c:738)
==4125==    by 0x4008BE: main (in /home/even/curl/test)
==4125==  Address 0x9b3d1d0 is 1,120 bytes inside a block of size 1,600 free'd
==4125==    at 0x4C2ECF0: free (vg_replace_malloc.c:530)
==4125==    by 0x4E62C36: conn_free (url.c:756)
==4125==    by 0x4E62D34: Curl_disconnect (url.c:818)
==4125==    by 0x4E48DF9: Curl_once_resolved (hostip.c:1097)
==4125==    by 0x4E8052D: multi_runsingle (multi.c:1446)
==4125==    by 0x4E8197C: curl_multi_perform (multi.c:2072)
==4125==    by 0x4E766A0: easy_transfer (easy.c:625)
==4125==    by 0x4E76915: easy_perform (easy.c:719)
==4125==    by 0x4E7697C: curl_easy_perform (easy.c:738)
==4125==    by 0x4008BE: main (in /home/even/curl/test)
==4125==  Block was alloc'd at
==4125==    at 0x4C2F988: calloc (vg_replace_malloc.c:711)
==4125==    by 0x4E6438E: allocate_conn (url.c:1654)
==4125==    by 0x4E685B4: create_conn (url.c:3496)
==4125==    by 0x4E6968F: Curl_connect (url.c:4023)
==4125==    by 0x4E802E7: multi_runsingle (multi.c:1368)
==4125==    by 0x4E8197C: curl_multi_perform (multi.c:2072)
==4125==    by 0x4E766A0: easy_transfer (easy.c:625)
==4125==    by 0x4E76915: easy_perform (easy.c:719)
==4125==    by 0x4E7697C: curl_easy_perform (easy.c:738)
==4125==    by 0x4008BE: main (in /home/even/curl/test)
```

This has been bisected to commit 2f44e94

Fixes https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=14109
Credit to OSS Fuzz