]> granicus.if.org Git - curl/log
curl
6 years agosha256: avoid redefine
Daniel Stenberg [Mon, 12 Feb 2018 13:18:30 +0000 (14:18 +0100)]
sha256: avoid redefine

6 years agosha256: build with OpenSSL < 0.9.8 too
Douglas Mencken [Mon, 12 Feb 2018 11:19:56 +0000 (06:19 -0500)]
sha256: build with OpenSSL < 0.9.8 too

support for SHA-2 was introduced in OpenSSL 0.9.8

Closes #2305

6 years agoREADME: language fix
Bruno Grasselli [Fri, 9 Feb 2018 21:01:42 +0000 (22:01 +0100)]
README: language fix

s/off/from

Closes #2300

6 years agohttp_chunks: don't write chunks twice with CURLOPT_HTTP_TRANSFER_DECODING on
Patrick Monnerat [Mon, 12 Feb 2018 02:38:18 +0000 (03:38 +0100)]
http_chunks: don't write chunks twice with CURLOPT_HTTP_TRANSFER_DECODING on

Bug: #2303
Reported-By: Henry Roeland
6 years agoget_posix_time: only check for overflows if they can happen!
Daniel Stenberg [Fri, 9 Feb 2018 13:29:03 +0000 (14:29 +0100)]
get_posix_time: only check for overflows if they can happen!

6 years agoschannel: fix "no previous prototype" compiler warning
Michael Kaufmann [Fri, 9 Feb 2018 19:10:22 +0000 (20:10 +0100)]
schannel: fix "no previous prototype" compiler warning

6 years agocontent_encoding: Add "none" alias to "identity"
Mohammad AlSaleh [Thu, 8 Feb 2018 18:23:22 +0000 (20:23 +0200)]
content_encoding: Add "none" alias to "identity"

Some servers return a "content-encoding" header with a non-standard
"none" value.

Add "none" as an alias to "identity" as a work-around, to avoid
unrecognised content encoding type errors.

Signed-off-by: Mohammad AlSaleh <CE.Mohammad.AlSaleh@gmail.com>
Closes https://github.com/curl/curl/pull/2298

6 years agobuild-openssl.bat: Follow up to 648679ab8e to suppress copy/move output
Steve Holme [Thu, 8 Feb 2018 21:54:09 +0000 (21:54 +0000)]
build-openssl.bat: Follow up to 648679ab8e to suppress copy/move output

6 years agobuild-openssl.bat: Fixed incorrect move if destination build folder exists
Steve Holme [Thu, 8 Feb 2018 21:22:59 +0000 (21:22 +0000)]
build-openssl.bat: Fixed incorrect move if destination build folder exists

6 years agoschannel: fix compiler warnings
Michael Kaufmann [Wed, 7 Feb 2018 20:39:26 +0000 (21:39 +0100)]
schannel: fix compiler warnings

Closes #2296

6 years agocurl_addrinfo.c: Allow Unix Domain Sockets to compile under Windows
Steve Holme [Wed, 7 Feb 2018 21:33:57 +0000 (21:33 +0000)]
curl_addrinfo.c: Allow Unix Domain Sockets to compile under Windows

Windows 10.0.17061 SDK introduces support for Unix Domain Sockets.
Added the necessary include file to curl_addrinfo.c.

Note: The SDK (which is considered beta) has to be installed, VS 2017
project file has to be re-targeted for Windows 10.0.17061 and #define
enabled in config-win32.h.

6 years agofnmatch: optimize processing of consecutive *s and ?s pattern characters
Patrick Monnerat [Wed, 7 Feb 2018 14:01:51 +0000 (15:01 +0100)]
fnmatch: optimize processing of consecutive *s and ?s pattern characters

Reported-By: Daniel Stenberg
Fixes #2291
Closes #2293

6 years agobuild-openssl.bat/build-wolfssl.bat: Build platform is optional
Steve Holme [Tue, 6 Feb 2018 19:35:13 +0000 (19:35 +0000)]
build-openssl.bat/build-wolfssl.bat: Build platform is optional

Whilst the compiler parameter is mandatory, platform is optional as it
is automatically calculated by the :configure section.

This partially reverts commit 6d62d2c55d.

6 years agoopenssl: Don't add verify locations when verifypeer==0
Patrick Schlangen [Mon, 5 Feb 2018 16:17:15 +0000 (17:17 +0100)]
openssl: Don't add verify locations when verifypeer==0

When peer verification is disabled, calling
SSL_CTX_load_verify_locations is not necessary. Only call it when
verification is enabled to save resources and increase performance.

Closes #2290

6 years agobuild-wolfssl.bat: Extend VC15 support to include Enterprise and Professional
Steve Holme [Mon, 5 Feb 2018 21:23:51 +0000 (21:23 +0000)]
build-wolfssl.bat: Extend VC15 support to include Enterprise and Professional

...and not just the Community Edition.

6 years agobuild-openssl.bat: Extend VC15 support to include Enterprise and Professional
Steve Holme [Mon, 5 Feb 2018 21:18:35 +0000 (21:18 +0000)]
build-openssl.bat: Extend VC15 support to include Enterprise and Professional

...and not just the Community Edition.

6 years agotime-cond: fix reading the file modification time on Windows
Michael Kaufmann [Mon, 5 Feb 2018 20:57:39 +0000 (21:57 +0100)]
time-cond: fix reading the file modification time on Windows

On Windows, stat() may adjust the unix file time by a daylight saving time
offset. Avoid this by calling GetFileTime() instead.

Fixes #2164
Closes #2204

6 years agoformdata: use the mime-content type function
Daniel Stenberg [Sun, 4 Feb 2018 08:23:11 +0000 (09:23 +0100)]
formdata: use the mime-content type function

Reduce code duplication by making Curl_mime_contenttype available and
used by the formdata function. This also makes the formdata function
recognize a set of more file extensions by default.

PR #2280 brought this to my attention.

Closes #2282

6 years agogetdate: return -1 for out of range
Daniel Stenberg [Thu, 1 Feb 2018 21:23:20 +0000 (22:23 +0100)]
getdate: return -1 for out of range

...as that's how the function is documented to work.

Reported-by: Michael Kaufmann
Bug found in an autobuild with 32 bit time_t

Closes #2278

6 years agobuild: fix termios issue on android cross-compile
Ben Greear [Wed, 31 Jan 2018 22:52:05 +0000 (23:52 +0100)]
build: fix termios issue on android cross-compile

Bug: https://curl.haxx.se/mail/lib-2018-01/0122.html
Signed-off-by: Ben Greear <greearb@candelatech.com>
6 years agotime_t-fixes: remove typecasts to 'long' for info.filetime
Daniel Stenberg [Wed, 31 Jan 2018 23:24:19 +0000 (00:24 +0100)]
time_t-fixes: remove typecasts to 'long' for info.filetime

They're now wrong.

Reported-by: Michael Kaufmann
Closes #2277

6 years agocurl_setup: move the precautionary define of SIZEOF_TIME_T
Daniel Stenberg [Wed, 31 Jan 2018 22:01:01 +0000 (23:01 +0100)]
curl_setup: move the precautionary define of SIZEOF_TIME_T

... up to before it may be used for the TIME_T_MAX/MIN logic.

Reported-by: Michael Kaufmann
6 years agoparsedate: s/#if/#ifdef
Daniel Stenberg [Wed, 31 Jan 2018 21:56:00 +0000 (22:56 +0100)]
parsedate: s/#if/#ifdef

Reported-by: Michael Kaufmann
Bug: https://github.com/curl/curl/commit/1c39128d974666107fc6d9ea15f294036851f224#commitcomment-27246479

6 years agofnmatch: pattern syntax can no longer fail
Patrick Monnerat [Tue, 30 Jan 2018 19:22:17 +0000 (20:22 +0100)]
fnmatch: pattern syntax can no longer fail

Whenever an expected pattern syntax rule cannot be matched, the
character starting the rule loses its special meaning and the parsing
is resumed:
- backslash at the end of pattern string matches itself.
- Error in [:keyword:] results in set containing :\[dekorwy.

Unit test 1307 updated for this new situation.

Closes #2273

6 years agofnmatch: accept an alphanum to be followed by a non-alphanum in char set
Patrick Monnerat [Mon, 29 Jan 2018 15:21:50 +0000 (16:21 +0100)]
fnmatch: accept an alphanum to be followed by a non-alphanum in char set

Also be more tolerant about set pattern syntax.
Update unit test 1307 accordingly.

Bug: https://curl.haxx.se/mail/lib-2018-01/0114.html

6 years agofnmatch: do not match the empty string with a character set
Patrick Monnerat [Mon, 29 Jan 2018 12:01:43 +0000 (13:01 +0100)]
fnmatch: do not match the empty string with a character set

6 years agobuild: fix windows build methods for curl_ctype.c
Jay Satiro [Wed, 31 Jan 2018 00:12:25 +0000 (19:12 -0500)]
build: fix windows build methods for curl_ctype.c

- Fix winbuild and the VS project generator to treat curl_ctype.{c,h} as
  curlx files since they are required by both src and lib.

Follow-up to 4272a0b which added curl_ctype.

6 years agoprogress-bar.d: update to match implementation
Daniel Stenberg [Tue, 30 Jan 2018 22:46:09 +0000 (23:46 +0100)]
progress-bar.d: update to match implementation

... since commit 993dd5651a6

Reported-by: Martin Dreher
Bug: https://github.com/curl/curl/pull/2242#issuecomment-361059228

Closes #2271

6 years agohttp2: set DEBUG_HTTP2 to enable more HTTP/2 logging
Daniel Stenberg [Tue, 30 Jan 2018 22:19:53 +0000 (23:19 +0100)]
http2: set DEBUG_HTTP2 to enable more HTTP/2 logging

... instead of doing it unconditionally in debug builds. It cluttered up
the output a little too much.

6 years agofile: Check the return code from Curl_range and bail out on error
Max Dymond [Tue, 30 Jan 2018 09:56:28 +0000 (09:56 +0000)]
file: Check the return code from Curl_range and bail out on error

6 years agoCurl_range: add check to ensure "from <= to"
Max Dymond [Mon, 29 Jan 2018 10:12:40 +0000 (10:12 +0000)]
Curl_range: add check to ensure "from <= to"

6 years agoCurl_range: commonize FTP and FILE range handling
Max Dymond [Mon, 29 Jan 2018 09:50:43 +0000 (09:50 +0000)]
Curl_range: commonize FTP and FILE range handling

Closes #2205

6 years agoRELEASE-NOTES: synced with 811beab9f
Daniel Stenberg [Tue, 30 Jan 2018 09:18:12 +0000 (10:18 +0100)]
RELEASE-NOTES: synced with 811beab9f

6 years agocurlver: next release will be 7.59.0
Daniel Stenberg [Tue, 30 Jan 2018 09:18:21 +0000 (10:18 +0100)]
curlver: next release will be 7.59.0

6 years agocurl/curl.h: fix comment typo for CURLOPT_DNS_LOCAL_IP6
Michał Janiszewski [Mon, 29 Jan 2018 20:23:41 +0000 (21:23 +0100)]
curl/curl.h: fix comment typo for CURLOPT_DNS_LOCAL_IP6

Closes #2275

6 years agotime: support > year 2038 time stamps for system with 32bit long
Daniel Stenberg [Thu, 25 Jan 2018 22:05:24 +0000 (23:05 +0100)]
time: support > year 2038 time stamps for system with 32bit long

... with the introduction of CURLOPT_TIMEVALUE_LARGE and
CURLINFO_FILETIME_T.

Fixes #2238
Closes #2264

6 years agocurl_easy_reset: clear digest auth state
Daniel Stenberg [Thu, 25 Jan 2018 16:51:26 +0000 (17:51 +0100)]
curl_easy_reset: clear digest auth state

Bug: https://curl.haxx.se/mail/lib-2018-01/0074.html
Reported-by: Ruurd Beerstra
Fixes #2255
Closes #2272

6 years agowinbuild: make linker generate proper PDB
Adam Marcionek [Mon, 29 Jan 2018 16:41:11 +0000 (11:41 -0500)]
winbuild: make linker generate proper PDB

Link.exe requires /DEBUG to properly generate a full pdb file on release
builds.

Closes #2274

6 years agocurl: add --proxy-pinnedpubkey
Daniel Stenberg [Sun, 28 Jan 2018 13:15:56 +0000 (14:15 +0100)]
curl: add --proxy-pinnedpubkey

To verify a proxy's public key. For when using HTTPS proxies.

Fixes #2192
Closes #2268

6 years agoconfigure: set PATH_SEPARATOR to colon for PATH w/o separator
Daniel Stenberg [Thu, 25 Jan 2018 22:30:49 +0000 (23:30 +0100)]
configure: set PATH_SEPARATOR to colon for PATH w/o separator

The logic tries to figure out what the path separator in the $PATH
variable is, but if there's only one directory in the $PATH it
fails. This change make configure *guess* on colon instead of erroring
out, simply because that is probably the more common character.

PATH_SEPARATOR can always be set by the user to override the guessing.

(tricky bug to reproduce, as in my case for example the configure script
requires binaries in more than one directory so passing in a PATH with a
single dir fails.)

Reported-by: Earnestly on github
Fixes #2202
Closes #2265

6 years agocurl_ctype: private is*() type macros and functions
Daniel Stenberg [Sun, 28 Jan 2018 23:58:59 +0000 (00:58 +0100)]
curl_ctype: private is*() type macros and functions

... since the libc provided one are locale dependent in a way we don't
want. Also, the "native" isalnum() (for example) works differently on
different platforms which caused test 1307 failures on macos only.

Closes #2269

6 years agobuild: open VC15 projects with VS 2017
Marcel Raad [Mon, 29 Jan 2018 14:35:58 +0000 (15:35 +0100)]
build: open VC15 projects with VS 2017

Previously, they were opened with Visual Studio 2015 by default, which
cannot build them.

6 years agoRELEASE-NOTES: synced with 094647fca
Daniel Stenberg [Mon, 29 Jan 2018 11:30:37 +0000 (12:30 +0100)]
RELEASE-NOTES: synced with 094647fca

6 years agoTODO: UTF-8 filenames in Content-Disposition
Daniel Stenberg [Sun, 28 Jan 2018 13:52:08 +0000 (14:52 +0100)]
TODO: UTF-8 filenames in Content-Disposition

Closes #1888

6 years agoKNOWN_BUGS: DICT responses show the underlying protocol
Daniel Stenberg [Sun, 28 Jan 2018 13:38:38 +0000 (14:38 +0100)]
KNOWN_BUGS: DICT responses show the underlying protocol

Closes #1809

6 years agodocs: fix typos in man pages
Alessandro Ghedini [Wed, 24 Jan 2018 11:13:51 +0000 (11:13 +0000)]
docs: fix typos in man pages

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

6 years agolib555: drop text conversion and encode data as ascii codes
Patrick Monnerat [Fri, 26 Jan 2018 16:45:20 +0000 (17:45 +0100)]
lib555: drop text conversion and encode data as ascii codes

If CURL_DOES_CONVERSION is enabled, uploaded LFs are mapped to CRLFs,
giving a result that is different from what is expected.
This commit avoids using CURLOPT_TRANSFERTEXT and directly encodes data
to upload in ascii.

Bug: https://github.com/curl/curl/pull/1872

6 years agolib517: make variable static to avoid compiler warning
Daniel Stenberg [Fri, 26 Jan 2018 15:50:32 +0000 (16:50 +0100)]
lib517: make variable static to avoid compiler warning

... with clang on macos

6 years agolib544: sync ascii code data with textual data
Patrick Monnerat [Fri, 26 Jan 2018 14:53:22 +0000 (15:53 +0100)]
lib544: sync ascii code data with textual data

Data mismatch caused test 545 to fail when character encoding
conversion is enabled.

Bug: https://github.com/curl/curl/pull/1872

6 years agoGSKit: restore pinnedpubkey functionality
moparisthebest [Thu, 25 Jan 2018 21:47:49 +0000 (16:47 -0500)]
GSKit: restore pinnedpubkey functionality

inadvertently removed in 283babfaf8d8f3bab9d3c63cea94eb0b84e79c37

Closes #2263

6 years agodarwinssl: Don't import client certificates into Keychain on macOS
Dair Grant [Wed, 15 Nov 2017 21:30:58 +0000 (21:30 +0000)]
darwinssl: Don't import client certificates into Keychain on macOS

Closes #2085

6 years agoconfigure: fix the check for unsigned time_t
Daniel Stenberg [Thu, 25 Jan 2018 21:32:57 +0000 (22:32 +0100)]
configure: fix the check for unsigned time_t

Assign the time_t variable negative value and then check if it is
greater than zero, which will evaluate true for unsigned time_t but
false for signed time_t.

6 years agoparsedate: fix date parsing for systems with 32 bit long
Daniel Stenberg [Thu, 18 Jan 2018 19:24:05 +0000 (20:24 +0100)]
parsedate: fix date parsing for systems with 32 bit long

Make curl_getdate() handle dates before 1970 as well (returning negative
values).

Make test 517 test dates for 64 bit time_t.

This fixes bug (3) mentioned in #2238

Closes #2250

6 years agoopenssl: fix pinned public key build error in FIPS mode
McDonough, Tim [Tue, 23 Jan 2018 01:24:59 +0000 (02:24 +0100)]
openssl: fix pinned public key build error in FIPS mode

Here is a version that should work with all versions of openssl 0.9.7
through 1.1.0.

Links to the docs:
https://www.openssl.org/docs/man1.0.2/crypto/EVP_DigestInit.html
https://www.openssl.org/docs/man1.1.0/crypto/EVP_DigestInit.html

At the very bottom of the 1.1.0 documentation there is a history section
that states, " stack allocated EVP_MD_CTXs are no longer supported."

If EVP_MD_CTX_create and EVP_MD_CTX_destroy are not defined, then a
simple mapping can be used as described here:
https://wiki.openssl.org/index.php/Talk:OpenSSL_1.1.0_Changes

Closes #2258

6 years agoSChannel/WinSSL: Replace Curl_none_md5sum with Curl_schannel_md5sum
moparisthebest [Tue, 16 Jan 2018 05:51:46 +0000 (00:51 -0500)]
SChannel/WinSSL: Replace Curl_none_md5sum with Curl_schannel_md5sum

6 years agoSChannel/WinSSL: Implement public key pinning
moparisthebest [Wed, 19 Apr 2017 04:31:23 +0000 (00:31 -0400)]
SChannel/WinSSL: Implement public key pinning

Closes #1429

6 years agobump: towards 7.58.1
Daniel Stenberg [Thu, 25 Jan 2018 21:10:07 +0000 (22:10 +0100)]
bump: towards 7.58.1

6 years agocookies: remove verbose "cookie size:" output
Daniel Stenberg [Thu, 25 Jan 2018 16:33:35 +0000 (17:33 +0100)]
cookies: remove verbose "cookie size:" output

It was once used for some debugging/verifying logic but should never have
ended up in git!

6 years agoTODO: hardcode the "localhost" addresses
Daniel Stenberg [Thu, 25 Jan 2018 16:23:06 +0000 (17:23 +0100)]
TODO: hardcode the "localhost" addresses

6 years agoTODO: CURL_REFUSE_CLEARTEXT
Daniel Stenberg [Thu, 25 Jan 2018 07:16:55 +0000 (08:16 +0100)]
TODO: CURL_REFUSE_CLEARTEXT

An idea that popped up in discussions on twitter.

6 years agoprogress-bar: don't use stderr explicitly, use bar->out
Daniel Stenberg [Wed, 24 Jan 2018 14:27:58 +0000 (15:27 +0100)]
progress-bar: don't use stderr explicitly, use bar->out

Reported-By: Gisle Vanem
Bug: https://github.com/curl/curl/commit/993dd5651a6c853bfe3870f6a69c7b329fa4e8ce#commitcomment-27070080

6 years agoFixes for MSDOS etc.
Gisle Vanem [Wed, 24 Jan 2018 14:02:53 +0000 (15:02 +0100)]
Fixes for MSDOS etc.

djgpp do have 'mkdir(dir, mode)'. Other DOS-compilers does not
But djgpp seems the only choice for MSDOS anyway.

PellesC do have a 'F_OK' defined in it's <unistd.h>.

Update year in Copyright.

6 years agoFix small typo.
Gisle Vanem [Wed, 24 Jan 2018 12:27:19 +0000 (13:27 +0100)]
Fix small typo.

6 years agoRELEASE: 7.58.0 curl-7_58_0
Daniel Stenberg [Mon, 22 Jan 2018 09:06:07 +0000 (10:06 +0100)]
RELEASE: 7.58.0

6 years agoprogress-bar: get screen width on windows
Gisle Vanem [Tue, 23 Jan 2018 21:41:50 +0000 (22:41 +0100)]
progress-bar: get screen width on windows

6 years agotest1454: --connect-to with IPv6 address w/o IPv6 support!
Daniel Stenberg [Mon, 22 Jan 2018 23:02:35 +0000 (00:02 +0100)]
test1454: --connect-to with IPv6 address w/o IPv6 support!

6 years agoCONNECT_TO: fail attempt to set an IPv6 numerical without IPv6 support
Daniel Stenberg [Mon, 22 Jan 2018 14:28:13 +0000 (15:28 +0100)]
CONNECT_TO: fail attempt to set an IPv6 numerical without IPv6 support

Bug: https://curl.haxx.se/mail/lib-2018-01/0087.html
Reported-by: John Hascall
Closes #2257

6 years agodocs: fix man page syntax to make test 1140 OK again
Daniel Stenberg [Tue, 23 Jan 2018 00:28:18 +0000 (01:28 +0100)]
docs: fix man page syntax to make test 1140 OK again

6 years agohttp: prevent custom Authorization headers in redirects
Daniel Stenberg [Fri, 19 Jan 2018 12:19:25 +0000 (13:19 +0100)]
http: prevent custom Authorization headers in redirects

... unless CURLOPT_UNRESTRICTED_AUTH is set to allow them. This matches how
curl already handles Authorization headers created internally.

Note: this changes behavior slightly, for the sake of reducing mistakes.

Added test 317 and 318 to verify.

Reported-by: Craig de Stigter
Bug: https://curl.haxx.se/docs/adv_2018-b3bf.html

6 years agocurl: progress bar refresh, get width using ioctl()
Daniel Stenberg [Tue, 16 Jan 2018 10:46:03 +0000 (11:46 +0100)]
curl: progress bar refresh, get width using ioctl()

Get screen width from the environment variable COLUMNS first, if set. If
not, use ioctl(). If nether works, assume 79.

Closes #2242

The "refresh" is for the -# output when no total transfer size is
known. It will now only use a single updated line even for this case:

The "-=O=-" ship moves when data is transferred. The four flying
"hashes" move (on a sine wave) on each refresh, independent of data.

6 years agoRELEASE-NOTES: synced with bb0ffcc36
Daniel Stenberg [Sat, 20 Jan 2018 21:41:20 +0000 (22:41 +0100)]
RELEASE-NOTES: synced with bb0ffcc36

6 years agolibcurl-env.3: first take
Daniel Stenberg [Sat, 20 Jan 2018 13:32:46 +0000 (14:32 +0100)]
libcurl-env.3: first take

6 years agoTODO: two possible name resolver improvements
Daniel Stenberg [Sat, 20 Jan 2018 12:57:12 +0000 (13:57 +0100)]
TODO: two possible name resolver improvements

6 years agohttp2: don't close connection when single transfer is stopped
Kartik Mahajan [Thu, 18 Jan 2018 16:58:59 +0000 (22:28 +0530)]
http2: don't close connection when single transfer is stopped

Fixes #2237
Closes #2249

6 years agotest558: fix for multissl builds
Daniel Stenberg [Thu, 18 Jan 2018 21:17:05 +0000 (22:17 +0100)]
test558: fix for multissl builds

vtls.c:multissl_init() might do a curl_free() call so strip that out to
make this work with more builds. We just want to verify that
memorytracking works so skipping one line is no harm.

6 years agoexamples/url2file.c: add missing curl_global_cleanup() call
Daniel Stenberg [Thu, 18 Jan 2018 16:10:34 +0000 (17:10 +0100)]
examples/url2file.c: add missing curl_global_cleanup() call

Reported-by: XhstormR on github
Fixes #2245

6 years agoSSH: Fix state machine for ssh-agent authentication
Michael Gmelin [Thu, 18 Jan 2018 00:28:19 +0000 (01:28 +0100)]
SSH: Fix state machine for ssh-agent authentication

In case an identity didn't match[0], the state machine would fail in
state SSH_AUTH_AGENT instead of progressing to the next identity in
ssh-agent. As a result, ssh-agent authentication only worked if the
identity required happened to be the first added to ssh-agent.

This was introduced as part of commit c4eb10e2f06fbd6cc904f1d78e4, which
stated that the "else" statement was required to prevent getting stuck
in state SSH_AUTH_AGENT. Given the state machine's logic and libssh2's
interface I couldn't see how this could happen or reproduce it and I
also couldn't find a more detailed description of the problem which
would explain a test case to reproduce the problem this was supposed to
fix.

[0] libssh2_agent_userauth returning LIBSSH2_ERROR_AUTHENTICATION_FAILED

Closes #2248

6 years agoopenssl: fix potential memory leak in SSLKEYLOGFILE logic
Daniel Stenberg [Thu, 18 Jan 2018 11:10:58 +0000 (12:10 +0100)]
openssl: fix potential memory leak in SSLKEYLOGFILE logic

Coverity CID 1427646.

6 years agoopenssl: fix the libressl build again
Daniel Stenberg [Wed, 17 Jan 2018 22:20:00 +0000 (23:20 +0100)]
openssl: fix the libressl build again

Follow-up to 84fcaa2e7. libressl does not have the API even if it says it is
late OpenSSL version...

Fixes #2246
Closes #2247

Reported-by: jungle-boogie on github
6 years agounit1307: test many wildcards too
Daniel Stenberg [Tue, 16 Jan 2018 14:57:30 +0000 (15:57 +0100)]
unit1307: test many wildcards too

6 years agocurl_fnmatch: only allow 5 '*' sections in a single pattern
Daniel Stenberg [Tue, 16 Jan 2018 14:55:44 +0000 (15:55 +0100)]
curl_fnmatch: only allow 5 '*' sections in a single pattern

... to avoid excessive recursive calls. The number 5 is totally
arbitrary and could be modified if someone has a good motivation.

6 years agoftp-wildcard: fix matching an empty string with "*[^a]"
Daniel Stenberg [Sat, 13 Jan 2018 20:52:15 +0000 (21:52 +0100)]
ftp-wildcard: fix matching an empty string with "*[^a]"

.... and avoid advancing the pointer to trigger an out of buffer read.

Detected by OSS-fuzz
Bug: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=5251
Assisted-by: Max Dymond
6 years agoSMB: fix numeric constant suffix and variable types
Daniel Stenberg [Mon, 15 Jan 2018 19:43:34 +0000 (20:43 +0100)]
SMB: fix numeric constant suffix and variable types

1. don't use "ULL" suffix since unsupported in older MSVC
2. use curl_off_t instead of custom long long ifdefs
3. make get_posix_time() not do unaligned data access

Fixes #2211
Closes #2240
Reported-by: Chester Liu
6 years agoCURLOPT_TCP_NODELAY.3: fix typo
rouzier [Mon, 15 Jan 2018 16:06:38 +0000 (11:06 -0500)]
CURLOPT_TCP_NODELAY.3: fix typo

Closes #2239

6 years agosmtp/pop3/imap_get_message: decrease the data length too...
Daniel Stenberg [Sat, 13 Jan 2018 05:35:12 +0000 (06:35 +0100)]
smtp/pop3/imap_get_message: decrease the data length too...

Follow-up commit to 615edc1f73 which was incomplete.

Assisted-by: Max Dymond
Detected by OSS-fuzz
Bug: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=5206

6 years agoopenssl: enable SSLKEYLOGFILE support by default
Daniel Stenberg [Sun, 14 Jan 2018 06:45:47 +0000 (07:45 +0100)]
openssl: enable SSLKEYLOGFILE support by default

Fixes #2210
Closes #2236

6 years agomime: clone mime tree upon easy handle duplication.
Patrick Monnerat [Sun, 14 Jan 2018 18:43:12 +0000 (19:43 +0100)]
mime: clone mime tree upon easy handle duplication.

A mime tree attached to an easy handle using CURLOPT_MIMEPOST is
strongly bound to the handle: there is a pointer to the easy handle in
each item of the mime tree and following the parent pointer list
of mime items ends in a dummy part stored within the handle.

Because of this binding, a mime tree cannot be shared between different
easy handles, thus it needs to be cloned upon easy handle duplication.

There is no way for the caller to get the duplicated mime tree
handle: it is then set to be automatically destroyed upon freeing the
new easy handle.

New test 654 checks proper mime structure duplication/release.

Add a warning note in curl_mime_data_cb() documentation about sharing
user data between duplicated handles.

Closes #2235

6 years agodocs: comment about CURLE_READ_ERROR returned by curl_mime_filedata
Patrick Monnerat [Sun, 14 Jan 2018 15:08:43 +0000 (16:08 +0100)]
docs: comment about CURLE_READ_ERROR returned by curl_mime_filedata

6 years agotest395: HTTP with overflow Content-Length value
Daniel Stenberg [Tue, 9 Jan 2018 05:01:38 +0000 (18:01 +1300)]
test395: HTTP with overflow Content-Length value

6 years agotest394: verify abort of rubbish in Content-Length: value
Daniel Stenberg [Tue, 9 Jan 2018 04:59:51 +0000 (17:59 +1300)]
test394: verify abort of rubbish in Content-Length: value

6 years agotest393: verify --max-filesize with excessive Content-Length
Daniel Stenberg [Tue, 9 Jan 2018 04:57:35 +0000 (17:57 +1300)]
test393: verify --max-filesize with excessive Content-Length

6 years agoHTTP: bail out on negative Content-Length: values
Daniel Stenberg [Tue, 9 Jan 2018 04:24:48 +0000 (17:24 +1300)]
HTTP: bail out on negative Content-Length: values

... and make the max filesize check trigger if the value is too big.

Updates test 178.

Reported-by: Brad Spencer
Fixes #2212
Closes #2223

6 years agoconfigure.ac: append extra linker flags instead of prepending them.
Dan Johnson [Thu, 28 Dec 2017 18:16:26 +0000 (18:16 +0000)]
configure.ac: append extra linker flags instead of prepending them.

Link order should list libraries after the libraries that use them,
so when we're guessing that we might also need to add -ldl in order
to use -lssl, we should add -ldl after -lssl.

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

6 years agoRELEASE-NOTES: synced with 6fa10c8fa
Daniel Stenberg [Sat, 13 Jan 2018 09:30:25 +0000 (10:30 +0100)]
RELEASE-NOTES: synced with 6fa10c8fa

6 years agosetopt: fix SSLVERSION to allow CURL_SSLVERSION_MAX_ values
Jay Satiro [Wed, 10 Jan 2018 08:14:15 +0000 (03:14 -0500)]
setopt: fix SSLVERSION to allow CURL_SSLVERSION_MAX_ values

Broken since f121575 (precedes 7.56.1).

Bug: https://github.com/curl/curl/issues/2225
Reported-by: cmfrolick@users.noreply.github.com
Closes https://github.com/curl/curl/pull/2227

6 years agosetopt: reintroduce non-static Curl_vsetopt() for OS400 support
Patrick Monnerat [Sat, 13 Jan 2018 00:20:40 +0000 (01:20 +0100)]
setopt: reintroduce non-static Curl_vsetopt() for OS400 support

This also upgrades ILE/RPG bindings with latest setopt options.

Reported-By: jonrumsey on github
Fixes #2230
Closes #2233

6 years agohttp2: fix incorrect trailer buffer size
Zhouyihai Ding [Wed, 10 Jan 2018 18:12:18 +0000 (10:12 -0800)]
http2: fix incorrect trailer buffer size

Prior to this change the stored byte count of each trailer was
miscalculated and 1 less than required. It appears any trailer
after the first that was passed to Curl_client_write would be truncated
or corrupted as well as the size. Potentially the size of some
subsequent trailer could be erroneously extracted from the contents of
that trailer, and since that size is used by client write an
out-of-bounds read could occur and cause a crash or be otherwise
processed by client write.

The bug appears to have been born in 0761a51 (precedes 7.49.0).

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

6 years agoeasy: fix connection ownership in curl_easy_pause
Basuke Suzuki [Fri, 5 Jan 2018 23:39:07 +0000 (15:39 -0800)]
easy: fix connection ownership in curl_easy_pause

Before calling Curl_client_chop_write(), change the owner of connection
to the current Curl_easy handle. This will fix the issue #2217.

Fixes https://github.com/curl/curl/issues/2217
Closes https://github.com/curl/curl/pull/2221

6 years agosystem.h: Additionally check __LONG_MAX__ for defining curl_off_t
Dimitrios Apostolou [Thu, 4 Jan 2018 13:02:59 +0000 (14:02 +0100)]
system.h: Additionally check __LONG_MAX__ for defining curl_off_t

__SIZEOF_LONG__ was introduced in GCC 4.4, __LONG_MAX__ was introduced
in GCC 3.3.

Closes #2216

6 years agoCOPYING: it's 2018!
Daniel Stenberg [Tue, 9 Jan 2018 04:08:14 +0000 (17:08 +1300)]
COPYING: it's 2018!