]> granicus.if.org Git - curl/log
curl
7 years agomime: be tolerant about setting twice the same header list in a part.
Patrick Monnerat [Sun, 8 Oct 2017 15:20:13 +0000 (16:20 +0100)]
mime: be tolerant about setting twice the same header list in a part.

7 years agodocs: clarify form/mime usage of non-regular data files.
Patrick Monnerat [Sun, 8 Oct 2017 15:15:23 +0000 (16:15 +0100)]
docs: clarify form/mime usage of non-regular data files.

7 years agoRevert "multi_done: wait for name resolve to finish if still ongoing"
Daniel Stenberg [Sat, 7 Oct 2017 22:50:33 +0000 (00:50 +0200)]
Revert "multi_done: wait for name resolve to finish if still ongoing"

This reverts commit f3e03f6c0ac52a1bf396e03f7d7e9b5b3b7165fe.

Caused memory leaks in the fuzzer, needs to be done differently.

Disable test 1553 for now too, as it causes memory leaks without this
commit!

7 years agoremove_handle: call multi_done() first, then clear dns cache pointer
Daniel Stenberg [Sat, 7 Oct 2017 20:00:48 +0000 (22:00 +0200)]
remove_handle: call multi_done() first, then clear dns cache pointer

Closes #1960

7 years agomulti_done: wait for name resolve to finish if still ongoing
Daniel Stenberg [Sat, 7 Oct 2017 15:54:41 +0000 (17:54 +0200)]
multi_done: wait for name resolve to finish if still ongoing

... as we must clean up memory.

7 years agopingpong: return error when trying to send without connection
Daniel Stenberg [Fri, 6 Oct 2017 15:20:54 +0000 (17:20 +0200)]
pingpong: return error when trying to send without connection

When imap_done() got called before a connection is setup, it would try
to "finish up" and dereffed a NULL pointer.

Test case 1553 managed to reproduce. I had to actually use a host name
to try to resolve to slow it down, as using the normal local server IP
will make libcurl get a connection in the first curl_multi_perform()
loop and then the bug doesn't trigger.

Fixes #1953
Assisted-by: Max Dymond
7 years agotests: added flaky keyword to tests 587 and 644
Dan Fandrich [Fri, 6 Oct 2017 21:04:40 +0000 (23:04 +0200)]
tests: added flaky keyword to tests 587 and 644

These are around 5% flaky in my Linux x86 autobuilds.

7 years agovtls: fix warnings with --disable-crypto-auth
Marcel Raad [Fri, 6 Oct 2017 17:01:19 +0000 (19:01 +0200)]
vtls: fix warnings with --disable-crypto-auth

When CURL_DISABLE_CRYPTO_AUTH is defined, Curl_none_md5sum's parameters
are not used.

7 years agomulti_cleanup: call DONE on handles that never got that
Daniel Stenberg [Thu, 5 Oct 2017 23:11:17 +0000 (01:11 +0200)]
multi_cleanup: call DONE on handles that never got that

... fixes a memory leak with at least IMAP when remove_handle is never
called and the transfer is abruptly just abandoned early.

Test 1552 added to verify

Detected by OSS-fuzz
Assisted-by: Max Dymond
Closes #1954

7 years agostrtoofft: Remove extraneous null check
Benbuck Nason [Thu, 5 Oct 2017 19:45:51 +0000 (12:45 -0700)]
strtoofft: Remove extraneous null check

Fixes #1950: curlx_strtoofft() doesn't fully protect against null 'str'
argument.

Closes #1952

7 years agoopenssl: fix build without HAVE_OPAQUE_EVP_PKEY
Daniel Stenberg [Fri, 6 Oct 2017 08:29:51 +0000 (10:29 +0200)]
openssl: fix build without HAVE_OPAQUE_EVP_PKEY

Reported-by: Javier Sixto
Fixes #1955
Closes #1956

7 years agolib/config-win32.h: let SMB/SMBS be enabled with OpenSSL/NSS
Viktor Szakats [Fri, 6 Oct 2017 07:37:42 +0000 (07:37 +0000)]
lib/config-win32.h: let SMB/SMBS be enabled with OpenSSL/NSS

The source code is now prepared to handle the case when both
Win32 Crypto and OpenSSL/NSS crypto backends are enabled
at the same time, making it now possible to enable `USE_WIN32_CRYPTO`
whenever the targeted Windows version supports it. Since this
matches the minimum Windows version supported by curl
(Windows 2000), enable it unconditionally for the Win32 platform.

This in turn enables SMB (and SMBS) protocol support whenever
Win32 Crypto is available, regardless of what other crypto backends
are enabled.

Ref: https://github.com/curl/curl/pull/1840#issuecomment-325682052

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

7 years agobuild: fix --disable-crypto-auth
Daniel Stenberg [Wed, 4 Oct 2017 22:20:34 +0000 (00:20 +0200)]
build: fix --disable-crypto-auth

Reported-by: Wyatt O'Day
Fixes #1945
Closes #1947

7 years agodarwinssl: add support for TLSv1.3
Nick Zitzmann [Wed, 16 Aug 2017 18:05:09 +0000 (13:05 -0500)]
darwinssl: add support for TLSv1.3

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

7 years agodocs: fix typo in curl_mime_data_cb man page
Felix Kaiser [Wed, 4 Oct 2017 20:03:49 +0000 (22:03 +0200)]
docs: fix typo in curl_mime_data_cb man page

Closes #1946

7 years agolib/Makefile.m32: allow customizing dll suffixes
Viktor Szakats [Wed, 4 Oct 2017 15:57:19 +0000 (15:57 +0000)]
lib/Makefile.m32: allow customizing dll suffixes

- New `CURL_DLL_SUFFIX` envvar will add a suffix to the generated
  libcurl dll name. Useful to add `-x64` to 64-bit builds so that
  it can live in the same directory as the 32-bit one. By default
  this is empty.

- New `CURL_DLL_A_SUFFIX` envvar to customize the suffix of the
  generated import library (implib) for libcurl .dll. It defaults
  to `dll`, and it's useful to modify that to `.dll` to have the
  standard naming scheme for mingw-built .dlls, i.e. `libcurl.dll.a`.

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

7 years agofuzzer: move to using external curl-fuzzer
Max Dymond [Mon, 25 Sep 2017 09:59:18 +0000 (10:59 +0100)]
fuzzer: move to using external curl-fuzzer

Use the external curl-fuzzer repository for fuzzing.

Closes #1923

7 years agofailf: skip the sprintf() if there are no consumers
Daniel Stenberg [Tue, 3 Oct 2017 12:26:36 +0000 (14:26 +0200)]
failf: skip the sprintf() if there are no consumers

Closes #1936

7 years agoftp: UBsan fixup 'pointer index expression overflowed'
Daniel Stenberg [Tue, 3 Oct 2017 15:20:06 +0000 (17:20 +0200)]
ftp: UBsan fixup 'pointer index expression overflowed'

Closes #1939

7 years agoRELEASE-PROCEDURE: update the release schedule
Daniel Stenberg [Wed, 4 Oct 2017 07:03:04 +0000 (09:03 +0200)]
RELEASE-PROCEDURE: update the release schedule

7 years agoRELEASE-NOTES: curl 7.56.0 curl-7_56_0
Daniel Stenberg [Sat, 30 Sep 2017 21:51:01 +0000 (23:51 +0200)]
RELEASE-NOTES: curl 7.56.0

7 years agoTHANKS: added new 7.56.0 contributors
Daniel Stenberg [Sun, 1 Oct 2017 21:19:52 +0000 (23:19 +0200)]
THANKS: added new 7.56.0 contributors

7 years agobuild-openssl.bat: Warn OpenSSL 1.1.0 not yet supported
Jay Satiro [Wed, 4 Oct 2017 04:56:31 +0000 (00:56 -0400)]
build-openssl.bat: Warn OpenSSL 1.1.0 not yet supported

Ref: https://github.com/curl/curl/issues/1002

7 years agoidn: fix source code comment
Michael Kaufmann [Tue, 3 Oct 2017 16:46:50 +0000 (18:46 +0200)]
idn: fix source code comment

7 years agovtls: compare and clone ssl configs properly
Michael Kaufmann [Sun, 24 Sep 2017 12:08:29 +0000 (14:08 +0200)]
vtls: compare and clone ssl configs properly

Compare these settings in Curl_ssl_config_matches():
- verifystatus (CURLOPT_SSL_VERIFYSTATUS)
- random_file (CURLOPT_RANDOM_FILE)
- egdsocket (CURLOPT_EGDSOCKET)

Also copy the setting "verifystatus" in Curl_clone_primary_ssl_config(),
and copy the setting "sessionid" unconditionally.

This means that reusing connections that are secured with a client
certificate is now possible, and the statement "TLS session resumption
is disabled when a client certificate is used" in the old advisory at
https://curl.haxx.se/docs/adv_20170419.html is obsolete.

Reviewed-by: Daniel Stenberg
Closes #1917

7 years agoproxy: read the "no_proxy" variable only if necessary
Michael Kaufmann [Sun, 24 Sep 2017 13:21:44 +0000 (15:21 +0200)]
proxy: read the "no_proxy" variable only if necessary

Reviewed-by: Daniel Stenberg
Closes #1919

7 years agolibcurl-tutorial: add casts in example to avoid compilation warnings.
Patrick Monnerat [Tue, 3 Oct 2017 10:03:46 +0000 (11:03 +0100)]
libcurl-tutorial: add casts in example to avoid compilation warnings.

7 years agoexamples: bring back curl_formadd-using examples
Daniel Stenberg [Tue, 3 Oct 2017 05:59:55 +0000 (07:59 +0200)]
examples: bring back curl_formadd-using examples

... now with a -formadd suffix. While the new mime API is introduced in
7.56.0 we must acknowledge that lots of users can't upgrade their curl
versions immediately.

7 years agotest1153: verify quoted double-qoutes in PWD response
Daniel Stenberg [Mon, 25 Sep 2017 09:16:15 +0000 (11:16 +0200)]
test1153: verify quoted double-qoutes in PWD response

7 years agoFTP: zero terminate the entry path even on bad input
Daniel Stenberg [Sun, 24 Sep 2017 22:35:22 +0000 (00:35 +0200)]
FTP: zero terminate the entry path even on bad input

... a single double quote could leave the entry path buffer without a zero
terminating byte. CVE-2017-1000254

Test 1152 added to verify.

Reported-by: Max Dymond
Bug: https://curl.haxx.se/docs/adv_20171004.html

7 years agocmake: disable tests and man generation if perl/nroff not found
Sergei Nikulov [Tue, 26 Sep 2017 07:42:12 +0000 (10:42 +0300)]
cmake: disable tests and man generation if perl/nroff not found

Fixes https://github.com/curl/curl/issues/1500
Reported-by: Jay Satiro
Fixes https://github.com/curl/curl/pull/1662
Assisted-by: Tom Seddon
Assisted-by: dpull@users.noreply.github.com
Assisted-by: elelel@users.noreply.github.com
Closes https://github.com/curl/curl/pull/1924

7 years agolibcurl-tutorial: fix two typos.
Patrick Monnerat [Sun, 1 Oct 2017 23:12:55 +0000 (00:12 +0100)]
libcurl-tutorial: fix two typos.

7 years agoTODO: remove deprecated form API items.
Patrick Monnerat [Sun, 1 Oct 2017 17:42:52 +0000 (18:42 +0100)]
TODO: remove deprecated form API items.

7 years agolibcurl-tutorial: describe MIME API and deprecate form API.
Patrick Monnerat [Sun, 1 Oct 2017 17:31:52 +0000 (18:31 +0100)]
libcurl-tutorial: describe MIME API and deprecate form API.

Include a guide to form/mime API conversion.

7 years agocookie: fix memory leak if path was set twice in header
Daniel Stenberg [Sat, 30 Sep 2017 12:10:12 +0000 (14:10 +0200)]
cookie: fix memory leak if path was set twice in header

... this will let the second occurance override the first.

Added test 1161 to verify.

Reported-by: Max Dymond
Fixes #1932
Closes #1933

7 years agotest650: Use variable replacement to set the host address and port
Dan Fandrich [Fri, 29 Sep 2017 23:37:55 +0000 (01:37 +0200)]
test650: Use variable replacement to set the host address and port

Otherwise, the test fails when the -b test option is used to set a
different test port range.

7 years agoSet and use more necessary options when some protocols are disabled
Dan Fandrich [Fri, 29 Sep 2017 23:20:56 +0000 (01:20 +0200)]
Set and use more necessary options when some protocols are disabled

When curl and libcurl are built with some protocols disabled, they stop
setting and receiving some options that don't make sense with those
protocols.  In particular, when HTTP is disabled many options aren't set
that are used only by HTTP.  However, some options that appear to be
HTTP-only are actually used by other protocols as well (some despite
having HTTP in the name) and should be set, but weren't. This change now
causes some of these options to be set and used for more (or for all)
protocols. In particular, this fixes tests 646 through 649 in an
HTTP-disabled build, which use the MIME API in the mail protocols.

7 years agotest1160: verifies cookie leak for large cookies
Daniel Stenberg [Fri, 29 Sep 2017 07:19:09 +0000 (09:19 +0200)]
test1160: verifies cookie leak for large cookies

The fix done in 20ea22ff735

7 years agocookie: fix memory leak on oversized rejection
Daniel Stenberg [Fri, 29 Sep 2017 06:50:15 +0000 (08:50 +0200)]
cookie: fix memory leak on oversized rejection

Regression brought by 2bc230de63b

Detected by OSS-fuzz: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=3513
Assisted-by: Max Dymond
Closes #1930

7 years agoconnect: fix race condition with happy eyeballs timeout
Anders Bakken [Thu, 28 Sep 2017 15:20:04 +0000 (08:20 -0700)]
connect: fix race condition with happy eyeballs timeout

The timer should be started after conn->connecttime is set. Otherwise
the timer could expire without this condition being true:

    /* should we try another protocol family? */
    if(i == 0 && conn->tempaddr[1] == NULL &&
      curlx_tvdiff(now, conn->connecttime) >= HAPPY_EYEBALLS_TIMEOUT) {

Ref: #1928

7 years agodocs: link CURLOPT_CONNECTTIMEOUT and CURLOPT_CONNECTTIMEOUT_MS
Michael Kaufmann [Sun, 24 Sep 2017 19:33:46 +0000 (21:33 +0200)]
docs: link CURLOPT_CONNECTTIMEOUT and CURLOPT_CONNECTTIMEOUT_MS

Closes #1922

7 years agodocs: clarify the use of environment variables for proxy
Michael Kaufmann [Sun, 24 Sep 2017 17:58:37 +0000 (19:58 +0200)]
docs: clarify the use of environment variables for proxy

Closes #1921

7 years agohttp: add custom empty headers to repeated requests
Michael Kaufmann [Sun, 24 Sep 2017 17:31:43 +0000 (19:31 +0200)]
http: add custom empty headers to repeated requests

Closes #1920

7 years agoreuse_conn: don't copy flags that are known to be equal
Michael Kaufmann [Sun, 24 Sep 2017 13:02:12 +0000 (15:02 +0200)]
reuse_conn: don't copy flags that are known to be equal

A connection can only be reused if the flags "conn_to_host" and
"conn_to_port" match. Therefore it is not necessary to copy these flags
in reuse_conn().

Closes #1918

7 years agocurl.h: include <sys/select.h> on cygwin too
Daniel Stenberg [Wed, 27 Sep 2017 08:22:55 +0000 (10:22 +0200)]
curl.h: include <sys/select.h> on cygwin too

When building with -std=c++14 on cygwin, this header won't be
automatically included as it otherwise is.

The <sys/select.h> include decision should ideally be reversed and be
avoided where that header file doesn't exist.

Reported-by: Ian Fette
Fixes #1925

7 years agoRELEASE-NOTES: synced with d8ab5dc50
Daniel Stenberg [Mon, 25 Sep 2017 08:48:33 +0000 (10:48 +0200)]
RELEASE-NOTES: synced with d8ab5dc50

7 years agotests: adjust .gitignore for new tests
Michael Kaufmann [Sun, 24 Sep 2017 11:30:30 +0000 (13:30 +0200)]
tests: adjust .gitignore for new tests

7 years agontlm: move NTLM_NEEDS_NSS_INIT define into core NTLM header
Jay Satiro [Fri, 22 Sep 2017 19:47:14 +0000 (15:47 -0400)]
ntlm: move NTLM_NEEDS_NSS_INIT define into core NTLM header

.. and include the core NTLM header in all NTLM-related source files.

Follow up to 6f86022. Since then http_ntlm checks NTLM_NEEDS_NSS_INIT
but did not include vtls.h where it was defined.

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

7 years agofile_range: avoid integer overflow when figuring out byte range
Daniel Stenberg [Fri, 22 Sep 2017 12:24:39 +0000 (14:24 +0200)]
file_range: avoid integer overflow when figuring out byte range

When trying to bump the value with one and the value is already at max,
it causes an integer overflow.

Closes #1908
Detected by oss-fuzz:
https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=3465

Assisted-by: Max Dymond
7 years agotests: fix a compiler warning in test 643
Michael Kaufmann [Sat, 23 Sep 2017 12:43:55 +0000 (14:43 +0200)]
tests: fix a compiler warning in test 643

7 years agosymbols-in-versions: fix CURLSSLSET_NO_BACKENDS entry
Jay Satiro [Sat, 23 Sep 2017 07:19:47 +0000 (03:19 -0400)]
symbols-in-versions: fix CURLSSLSET_NO_BACKENDS entry

- Use spaces instead of tabs as the delimiter.

Follow up to 7c52b12 which added the entry. The entry had used tabs but
the symbol-scan parser doesn't recognize tabs and would fail the symbol.

7 years agometalink: fix NSS issue in MultiSSL builds
Viktor Szakats [Tue, 12 Sep 2017 18:14:00 +0000 (18:14 +0000)]
metalink: fix NSS issue in MultiSSL builds

In MultiSSL mode (i.e. when more than one SSL backend is compiled
in), we cannot use the compile time flag `USE_NSS` as indicator that
the NSS backend is in use. As far as Metalink is concerned, the SSL
backend is only used for MD5, SHA-1 and SHA-256 calculations,
therefore one of the available SSL backends is selected at compile
time, in a strict order of preference.

Let's introduce a new `HAVE_NSS_CONTEXT` constant that can be used
to determine whether the SSL backend used for Metalink is the NSS
backend, and use that to guard the code that wants to de-initialize
the NSS-specific data structure.

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

7 years agontlm: use strict order for SSL backend #if branches
Viktor Szakats [Wed, 30 Aug 2017 21:10:38 +0000 (21:10 +0000)]
ntlm: use strict order for SSL backend #if branches

With the recently introduced MultiSSL support multiple SSL backends
can be compiled into cURL That means that now the order of the SSL

One option would be to use the same SSL backend as was configured
via `curl_global_sslset()`, however, NTLMv2 support would appear
to be available only with some SSL backends. For example, when
eb88d778e (ntlm: Use Windows Crypt API, 2014-12-02) introduced
support for NTLMv1 using Windows' Crypt API, it specifically did
*not* introduce NTLMv2 support using Crypt API at the same time.

So let's select one specific SSL backend for NTLM support when
compiled with multiple SSL backends, using a priority order such
that we support NTLMv2 even if only one compiled-in SSL backend can
be used for that.

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

7 years agosymbols-in-versions: add CURLSSLSET_NO_BACKENDS
Daniel Stenberg [Fri, 22 Sep 2017 14:22:57 +0000 (16:22 +0200)]
symbols-in-versions: add CURLSSLSET_NO_BACKENDS

...fixup from b8e0fe19ec

7 years agoimap: quote atoms properly when escaping characters
Daniel Stenberg [Thu, 21 Sep 2017 07:17:06 +0000 (09:17 +0200)]
imap: quote atoms properly when escaping characters

Updates test 800 to verify

Fixes #1902
Closes #1903

7 years agotests: make the imap server not verify user+password
Daniel Stenberg [Thu, 21 Sep 2017 06:21:43 +0000 (08:21 +0200)]
tests: make the imap server not verify user+password

... as the test cases themselves do that and it makes it easier to add
crazy test cases.

Test 800 updated to use user name + password that need quoting.

Test 856 updated to trigger an auth fail differently.

Ref: #1902

7 years agovtls: provide curl_global_sslset() even in non-SSL builds
Daniel Stenberg [Thu, 21 Sep 2017 21:30:48 +0000 (23:30 +0200)]
vtls: provide curl_global_sslset() even in non-SSL builds

... it just returns error:

Bug: https://github.com/curl/curl/commit/1328f69d53f2f2e937696ea954c480412b018451#commitcomment-24470367
Reported-by: Marcel Raad
Closes #1906

7 years agoform/mime: field names are not allowed to contain zero-valued bytes.
Patrick Monnerat [Fri, 22 Sep 2017 00:08:29 +0000 (01:08 +0100)]
form/mime: field names are not allowed to contain zero-valued bytes.

Also suppress length argument of curl_mime_name() (names are always
zero-terminated).

7 years agoopenssl: only verify RSA private key if supported
Dirk Feytons [Thu, 21 Sep 2017 07:57:32 +0000 (09:57 +0200)]
openssl: only verify RSA private key if supported

In some cases the RSA key does not support verifying it because it's
located on a smart card, an engine wants to hide it, ...
Check the flags on the key before trying to verify it.
OpenSSL does the same thing internally; see ssl/ssl_rsa.c

Closes #1904

7 years agoexamples/post-callback: use long for CURLOPT_POSTFIELDSIZE
Marcel Raad [Thu, 21 Sep 2017 18:07:24 +0000 (20:07 +0200)]
examples/post-callback: use long for CURLOPT_POSTFIELDSIZE

Otherwise, typecheck-gcc.h warns on MinGW-w64.

7 years agomime: rephrase the multipart output state machine (#1898) ...
Patrick Monnerat [Wed, 20 Sep 2017 13:06:47 +0000 (14:06 +0100)]
mime: rephrase the multipart output state machine (#1898) ...

... in hope coverity will like it much.

7 years agomime: fix an explicit null dereference (#1899)
Patrick Monnerat [Wed, 20 Sep 2017 11:01:11 +0000 (12:01 +0100)]
mime: fix an explicit null dereference (#1899)

7 years agocurl: check fseek() return code and bail on error
Daniel Stenberg [Wed, 20 Sep 2017 10:03:44 +0000 (12:03 +0200)]
curl: check fseek() return code and bail on error

Detected by coverity. CID 1418137.

7 years agosmtp: fix memory leak in OOM
Daniel Stenberg [Wed, 20 Sep 2017 09:33:46 +0000 (11:33 +0200)]
smtp: fix memory leak in OOM

Regression since ce0881edee

Coverity CID 1418139 and CID 1418136 found it, but it was also seen in
torture testing.

7 years agoRELEASE-NOTES: synced with 5fe85587c
Daniel Stenberg [Wed, 20 Sep 2017 06:31:04 +0000 (08:31 +0200)]
RELEASE-NOTES: synced with 5fe85587c

7 years agocookies: use lock when using CURLINFO_COOKIELIST
Pavel P [Mon, 18 Sep 2017 22:50:16 +0000 (15:50 -0700)]
cookies: use lock when using CURLINFO_COOKIELIST

Closes #1896

7 years agoossfuzz: changes before merging the generated corpora
Max Dymond [Mon, 11 Sep 2017 19:51:58 +0000 (20:51 +0100)]
ossfuzz: changes before merging the generated corpora

Before merging in the oss-fuzz corpora from Google, there are some changes
to the fuzzer.
- Add a read corpus script, to display corpus files nicely.
- Change the behaviour of the fuzzer so that TLV parse failures all now
  go down the same execution paths, which should reduce the size of the
  corpora.
- Make unknown TLVs a failure to parse, which should decrease the size
  of the corpora as well.

Closes #1881

7 years agomime:escape_string minor clarification change
Daniel Stenberg [Sun, 17 Sep 2017 21:31:49 +0000 (23:31 +0200)]
mime:escape_string minor clarification change

... as it also removes a warning with old gcc versions.

Bug: https://curl.haxx.se/mail/lib-2017-09/0049.html
Reported-by: Ben Greear
7 years agoossfuzz: don't write out to stdout
Max Dymond [Mon, 11 Sep 2017 19:00:27 +0000 (20:00 +0100)]
ossfuzz: don't write out to stdout

Don't make the fuzzer write out to stdout - instead write some of the
contents to a memory block so we exercise the data output code but
quietly.

Closes #1885

7 years agocookies: reject oversized cookies
Daniel Stenberg [Sun, 17 Sep 2017 22:55:07 +0000 (00:55 +0200)]
cookies: reject oversized cookies

... instead of truncating them.

There's no fixed limit for acceptable cookie names in RFC 6265, but the
entire cookie is said to be less than 4096 bytes (section 6.1). This is
also what browsers seem to implement.

We now allow max 5000 bytes cookie header. Max 4095 bytes length per
cookie name and value. Name + value together may not exceed 4096 bytes.

Added test 1151 to verify

Bug: https://curl.haxx.se/mail/lib-2017-09/0062.html
Reported-by: Kevin Smith
Closes #1894

7 years agotravis: on mac, don't install openssl or libidn
Daniel Stenberg [Mon, 18 Sep 2017 08:49:38 +0000 (10:49 +0200)]
travis: on mac, don't install openssl or libidn

- openssl is already installed and causes warnings when trying to
  install again

- libidn isn't used these days, and homebrew doesn't seem to have a
  libidn2 package to replace with easily

Closes #1895

7 years agocurl: make str2udouble not return values on error
Daniel Stenberg [Fri, 15 Sep 2017 14:38:48 +0000 (16:38 +0200)]
curl: make str2udouble not return values on error

... previously it would store a return value even when it returned
error, which could make the value get used anyway!

Reported-by: Brian Carpenter
Closes #1893

7 years agosocks: fix incorrect port number in SOCKS4 error message
Jay Satiro [Mon, 18 Sep 2017 07:07:57 +0000 (03:07 -0400)]
socks: fix incorrect port number in SOCKS4 error message

Prior to this change it appears the SOCKS5 port parsing was erroneously
used for the SOCKS4 error message, and as a result an incorrect port
would be shown in the error message.

Bug: https://github.com/curl/curl/issues/1892
Reported-by: Jackarain@users.noreply.github.com
7 years agoschannel: Support partial send for when data is too large
Marc Aldorasi [Fri, 15 Sep 2017 17:00:05 +0000 (13:00 -0400)]
schannel: Support partial send for when data is too large

Schannel can only encrypt a certain amount of data at once.  Instead of
failing when too much data is to be sent at once, send as much data as
we can and let the caller send the remaining data by calling send again.

Bug: https://curl.haxx.se/mail/lib-2014-07/0033.html

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

7 years agoopenssl: add missing includes
David Benjamin [Fri, 15 Sep 2017 22:36:40 +0000 (18:36 -0400)]
openssl: add missing includes

lib/vtls/openssl.c uses OpenSSL APIs from BUF_MEM and BIO APIs. Include
their headers directly rather than relying on other OpenSSL headers
including things.

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

7 years agoconversions: fix several compiler warnings
Daniel Stenberg [Sun, 10 Sep 2017 22:31:12 +0000 (00:31 +0200)]
conversions: fix several compiler warnings

7 years agoserver/getpart: provide dummy function to build conversion enabled
Daniel Stenberg [Fri, 8 Sep 2017 07:33:22 +0000 (09:33 +0200)]
server/getpart: provide dummy function to build conversion enabled

7 years agonon-ascii: use iconv() with 'char **' argument
Daniel Stenberg [Fri, 8 Sep 2017 07:22:01 +0000 (09:22 +0200)]
non-ascii: use iconv() with 'char **' argument

Bug: https://curl.haxx.se/mail/lib-2017-09/0031.html

7 years agoescape.c: error: pointer targets differ in signedness
Daniel Stenberg [Fri, 8 Sep 2017 06:58:12 +0000 (08:58 +0200)]
escape.c: error: pointer targets differ in signedness

7 years agodocs: clarify the CURLOPT_INTERLEAVE* options behavior
Daniel Stenberg [Fri, 15 Sep 2017 13:47:56 +0000 (15:47 +0200)]
docs: clarify the CURLOPT_INTERLEAVE* options behavior

7 years agortsp: Segfault in rtsp.c when using WRITEDATA
Max Dymond [Tue, 12 Sep 2017 18:45:19 +0000 (19:45 +0100)]
rtsp: Segfault in rtsp.c when using WRITEDATA

If the INTERLEAVEFUNCTION is defined, then use that plus the
INTERLEAVEDATA information when writing RTP. Otherwise, use
WRITEFUNCTION and WRITEDATA.

Fixes #1880
Closes #1884

7 years agotests: enable gssapi in travis-ci linux build
Isaac Boukris [Wed, 19 Jul 2017 17:41:26 +0000 (20:41 +0300)]
tests: enable gssapi in travis-ci linux build

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

7 years agotests: add initial gssapi test using stub implementation
Isaac Boukris [Tue, 18 Jul 2017 18:46:21 +0000 (21:46 +0300)]
tests: add initial gssapi test using stub implementation

The stub implementation is pre-loaded using LD_PRELOAD
and emulates common gssapi uses (only builds if curl is
initially built with gssapi support).

The initial tests are currently disabled for debug builds
as LD_PRELOAD is not used then.

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

7 years agotest1150: verify same host fetch using different ports over proxy
Daniel Stenberg [Thu, 14 Sep 2017 20:50:32 +0000 (22:50 +0200)]
test1150: verify same host fetch using different ports over proxy

Closes #1889

7 years agoURL: on connection re-use, still pick the new remote port
Daniel Stenberg [Thu, 14 Sep 2017 14:49:40 +0000 (16:49 +0200)]
URL: on connection re-use, still pick the new remote port

... as when a proxy connection is being re-used, it can still get a
different remote port.

Fixes #1887
Reported-by: Oli Kingshott
7 years agoRELEASE-NOTES: synced with 87501e57f
Daniel Stenberg [Tue, 12 Sep 2017 12:20:04 +0000 (14:20 +0200)]
RELEASE-NOTES: synced with 87501e57f

7 years agocode style: remove wrong uses of multiple spaces
Daniel Stenberg [Tue, 12 Sep 2017 07:29:01 +0000 (09:29 +0200)]
code style: remove wrong uses of multiple spaces

Closes #1878

7 years agochecksrc: detect and warn for multiple spaces
Daniel Stenberg [Tue, 12 Sep 2017 07:28:37 +0000 (09:28 +0200)]
checksrc: detect and warn for multiple spaces

7 years agocode style: use space after semicolon
Daniel Stenberg [Mon, 11 Sep 2017 07:27:06 +0000 (09:27 +0200)]
code style: use space after semicolon

7 years agochecksrc: verify space after semicolons
Daniel Stenberg [Mon, 11 Sep 2017 07:25:31 +0000 (09:25 +0200)]
checksrc: verify space after semicolons

7 years agocode style: use spaces around pluses
Daniel Stenberg [Sat, 9 Sep 2017 21:55:08 +0000 (23:55 +0200)]
code style: use spaces around pluses

7 years agochecksrc: detect and warn for lack of spaces next to plus signs
Daniel Stenberg [Sat, 9 Sep 2017 21:54:47 +0000 (23:54 +0200)]
checksrc: detect and warn for lack of spaces next to plus signs

7 years agocode style: use spaces around equals signs
Daniel Stenberg [Sat, 9 Sep 2017 21:09:06 +0000 (23:09 +0200)]
code style: use spaces around equals signs

7 years agochecksrc: verify spaces around equals signs
Daniel Stenberg [Sat, 9 Sep 2017 09:57:17 +0000 (11:57 +0200)]
checksrc: verify spaces around equals signs

... as the code style mandates.

7 years agoCurl_checkheaders: make it available for IMAP and SMTP too
Daniel Stenberg [Fri, 8 Sep 2017 13:13:42 +0000 (15:13 +0200)]
Curl_checkheaders: make it available for IMAP and SMTP too

... not only HTTP uses this now.

Closes #1875

7 years agotravis: add build without HTTP/SMTP/IMAP
Daniel Stenberg [Fri, 8 Sep 2017 13:13:22 +0000 (15:13 +0200)]
travis: add build without HTTP/SMTP/IMAP

7 years agombedtls: enable CA path processing
Jay Satiro [Sun, 10 Sep 2017 07:22:05 +0000 (03:22 -0400)]
mbedtls: enable CA path processing

CA path processing was implemented when mbedtls.c was added to libcurl
in fe7590f, but it was never enabled.

Bug: https://github.com/curl/curl/issues/1877
Reported-by: SBKarr@users.noreply.github.com
7 years agortsp: do not call fwrite() with NULL pointer FILE *
Daniel Stenberg [Fri, 8 Sep 2017 08:20:36 +0000 (10:20 +0200)]
rtsp: do not call fwrite() with NULL pointer FILE *

If the default write callback is used and no destination has been set, a
NULL pointer would be passed to fwrite()'s 4th argument.

OSS-fuzz bug https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=3327
(not publicly open yet)

Detected by OSS-fuzz
Closes #1874

7 years agoconfigure: use -Wno-varargs on clang 3.9[.X] debug builds
Daniel Stenberg [Fri, 8 Sep 2017 12:48:45 +0000 (14:48 +0200)]
configure: use -Wno-varargs on clang 3.9[.X] debug builds

... to avoid a clang bug

7 years agoossfuzz: add some more handled CURL options
Max Dymond [Sat, 2 Sep 2017 21:40:01 +0000 (22:40 +0100)]
ossfuzz: add some more handled CURL options

Add support for HEADER, COOKIE, RANGE, CUSTOMREQUEST, MAIL_RECIPIENT,
MAIL_FROM and uploading data.