aboutsummaryrefslogtreecommitdiff
path: root/lib
AgeCommit message (Collapse)Author
2018-08-11Silence GCC 8 cast-function-type warningsMarcel Raad
On Windows, casting between unrelated function types is fine and sometimes even necessary, so just use an intermediate cast to (void (*) (void)) to silence the warning as described in [0]. [0] https://gcc.gnu.org/onlinedocs/gcc-8.1.0/gcc/Warning-Options.html Closes https://github.com/curl/curl/pull/2860
2018-08-11CURLINFO_SIZE_UPLOAD: fix missing counter updateDaniel Stenberg
Adds test 1522 for verification. Reported-by: cjmsoregan Fixes #2847 Closes #2864
2018-08-10openssl: fix potential NULL pointer deref in is_pkcs11_uriDaniel Stenberg
Follow-up to 298d2565e Coverity CID 1438387
2018-08-09asyn-thread: Remove unused macroRikard Falkeborn
The macro seems to never have been used. Closes #2852
2018-08-09http_proxy: Remove unused macro SELECT_TIMEOUTRikard Falkeborn
Usage was removed in 5113ad0424044458ac497fa1458ebe0101356b22. Closes #2852
2018-08-09formdata: Remove unused macro HTTPPOST_CONTENTTYPE_DEFAULTRikard Falkeborn
Its usage was removed in 84ad1fd3047815f9c6e78728bb351b828eac10b1. Closes #2852
2018-08-09telnet: Remove unused macros TELOPTS and TELCMDSRikard Falkeborn
Their usage was removed in 3a145180cc754a5959ca971ef3cd243c5c83fc51. Closes #2852
2018-08-09openssl: fix debug messagesDaniel Jelinski
Fixes #2806 Closes #2843
2018-08-08windows: follow up to the buffer-tuning 1ba1dba7Daniel Stenberg
Somehow I didn't include the amended version of the previous fix. This is the missing piece. Pointed-out-by: Viktor Szakats
2018-08-08windows: implement send buffer tuningDaniel Jelinski
Significantly enhances upload performance on modern Windows versions. Bug: https://curl.haxx.se/mail/lib-2018-07/0080.html Closes #2762 Fixes #2224
2018-08-08ssl: set engine implicitly when a PKCS#11 URI is providedAnderson Toshiyuki Sasaki
This allows the use of PKCS#11 URI for certificates and keys without setting the corresponding type as "ENG" and the engine as "pkcs11" explicitly. If a PKCS#11 URI is provided for certificate, key, proxy_certificate or proxy_key, the corresponding type is set as "ENG" if not provided and the engine is set to "pkcs11" if not provided. Acked-by: Nikos Mavrogiannopoulos Closes #2333
2018-08-08CMake: Respect BUILD_SHARED_LIBSRuslan Baratov
Use standard CMake variable BUILD_SHARED_LIBS instead of introducing custom option CURL_STATICLIB. Use '-DBUILD_SHARED_LIBS=%SHARED%' in appveyor.yml. Reviewed-by: Sergei Nikulov Closes #2755
2018-08-03lib/Makefile: only do symbol hiding if told toDaniel Stenberg
This restores the ability to build a static lib with --disable-symbol-hiding to keep non-curl_ symbols. Researched-by: Dan Fandrich Reported-by: Ran Mozes Fixes #2830 Closes #2831
2018-08-02hostip: fix unused variable warningMarcel Raad
addresses is only used in an infof call, which is a macro expanding to nothing if CURL_DISABLE_VERBOSE_STRINGS is set.
2018-08-01smb: don't mark it done in smb_doDaniel Stenberg
Follow-up to 09e401e01bf9. The SMB protocol handler needs to use its doing function too, which requires smb_do() to not mark itself as done... Closes #2822
2018-08-01general: fix printf specifiersRikard Falkeborn
Closes #2818
2018-07-31HTTP: Don't attempt to needlessly decompress redirect bodyHarry Sintonen
This change fixes a regression where redirect body would needlessly be decompressed even though it was to be ignored anyway. As it happens this causes secondary issues since there appears to be a bug in apache2 that it in certain conditions generates a corrupt zlib response. The regression was created by commit: dbcced8e32b50c068ac297106f0502ee200a1ebd Discovered-by: Harry Sintonen Closes #2798
2018-07-31retry: return error if rewind was necessary but didn't happenDaniel Jelinski
Fixes #2801 Closes #2812
2018-07-30http2: clear the drain counter in Curl_http2_doneDaniel Stenberg
Reported-by: Andrei Virtosu Fixes #2800 Closes #2809
2018-07-30smb: fix memory leak on early failureDaniel Stenberg
... by making sure connection related data (->share) is stored in the connection and not in the easy handle. Detected by OSS-fuzz Bug: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=9369 Fixes #2769 Closes #2810
2018-07-28conn_free: updated comment to clarifyDaniel Stenberg
Let's call it disassociate instead of disconnect since the latter term is used so much for (TCP) connections already.
2018-07-28mime: check Curl_rand_hex's return codeDaniel Stenberg
Bug: https://curl.haxx.se/mail/archive-2018-07/0015.html Reported-by: Jeffrey Walton Closes #2795
2018-07-26wolfSSL/CyaSSL: Fix memory leak in Curl_cyassl_randomCarie Pointer
RNG structure must be freed by call to FreeRng after its use in Curl_cyassl_random. This call fixes Valgrind failures when running the test suite with wolfSSL. Closes #2784
2018-07-26reuse_conn(): free old_conn->optionsEven Rouault
This fixes a memory leak when CURLOPT_LOGIN_OPTIONS is used, together with connection reuse. I found this with oss-fuzz on GDAL and curl master: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=9582 I couldn't reproduce with the oss-fuzz original test case, but looking at curl source code pointed to this well reproducable leak. Closes #2790
2018-07-25system_win32: fix version checkingdjelinski
In the current version, VERSION_GREATER_THAN_EQUAL 6.3 will return false when run on windows 10.0. This patch addresses that error. Closes https://github.com/curl/curl/pull/2792
2018-07-24auth: pick Bearer authentication whenever a token is availableJohannes Schindelin
So far, the code tries to pick an authentication method only if user/password credentials are available, which is not the case for Bearer authentictation... Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Closes #2754
2018-07-24auth: only ever pick CURLAUTH_BEARER if we *have* a Bearer tokenJohannes Schindelin
The Bearer authentication was added to cURL 7.61.0, but there is a problem: if CURLAUTH_ANY is selected, and the server supports multiple authentication methods including the Bearer method, we strongly prefer that latter method (only CURLAUTH_NEGOTIATE beats it), and if the Bearer authentication fails, we will never even try to attempt any other method. This is particularly unfortunate when we already know that we do not have any Bearer token to work with. Such a scenario happens e.g. when using Git to push to Visual Studio Team Services (which supports Basic and Bearer authentication among other methods) and specifying the Personal Access Token directly in the URL (this aproach is frequently taken by automated builds). Let's make sure that we have a Bearer token to work with before we select the Bearer authentication among the available authentication methods. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Closes #2754
2018-07-22vtls: set conn->data when closing TLSDaniel Stenberg
Follow-up to 1b76c38904f0. The VTLS backends that close down the TLS layer for a connection still needs a Curl_easy handle for the session_id cache etc. Fixes #2764 Closes #2771
2018-07-20http2: several cleanupsDaniel Stenberg
- separate easy handle from connections better - added asserts on a number of places - added sanity check of pipelines for debug builds Closes #2751
2018-07-20smb_getsock: always wait for write socket tooDaniel Stenberg
... the protocol is doing read/write a lot, so it needs to write often even when downloading. A more proper fix could check for eactly when it wants to write and only ask for it then. Without this fix, an SMB download could easily get stuck when the event-driven API was used. Closes #2768
2018-07-17CMake: Update scripts to use consistent styleRuslan Baratov
Closes #2727 Reviewed-by: Sergei Nikulov
2018-07-14darwinssl: add support for ALPN negotiationRodger Combs
2018-07-12content_encoding: accept up to 4 unknown trailer bytes after raw deflate dataPatrick Monnerat
Some servers issue raw deflate data that may be followed by an undocumented trailer. This commit makes curl tolerate such a trailer of up to 4 bytes before considering the data is in error. Reported-by: clbr on github Fixes #2719
2018-07-12smb: fix memory-leak in URL parse error pathDaniel Stenberg
Detected by OSS-Fuzz Bug: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=9369 Closes #2740
2018-07-12schannel: enable CALG_TLS1PRF for w32api >= 5.1Marcel Raad
The definition of CALG_TLS1PRF has been fixed in the 5.1 branch: https://osdn.net/projects/mingw/scm/git/mingw-org-wsl/commits/73aedcc0f2e6ba370de0d86ab878ad76a0dda7b5
2018-07-11multi: always do the COMPLETED procedure/stateDaniel Stenberg
It was previously erroneously skipped in some situations. libtest/libntlmconnect.c wrongly depended on wrong behavior (that it would get a zero timeout) when no handles are "running" in a multi handle. That behavior is no longer present with this fix. Now libcurl will always return a -1 timeout when all handles are completed. Closes #2733
2018-07-11Curl_getoff_all_pipelines: improved for multiplexedDaniel Stenberg
On multiplexed connections, transfers can be removed from anywhere not just at the head as for pipelines.
2018-07-11ares: check for NULL in completed-callbackDaniel Stenberg
2018-07-11conn: remove the boolean 'inuse' fieldDaniel Stenberg
... as the usage needs to be counted.
2018-07-11openssl: assume engine support in 1.0.0 or laterPaul Howarth
Commit 38203f1585da changed engine detection to be version-based, with a baseline of openssl 1.0.1. This does in fact break builds with openssl 1.0.0, which has engine support - the configure script detects that ENGINE_cleanup() is available - but <openssl/engine.h> doesn't get included to declare it. According to upstream documentation, engine support was added to mainstream openssl builds as of version 0.9.7: https://github.com/openssl/openssl/blob/master/README.ENGINE This commit drops the version test down to 1.0.0 as version 1.0.0d is the oldest version I have to test with. Closes #2732
2018-07-11schannel: fix MinGW compile breakMarcel Raad
Original MinGW's w32api has a sytax error in its definition of CALG_TLS1PRF [0]. Don't use original MinGW w32api's CALG_TLS1PRF until this bug [1] is fixed. [0] https://osdn.net/projects/mingw/scm/git/mingw-org-wsl/blobs/d1d4a17e51a2b78e252ef0147d483267d56c90cc/w32api/include/wincrypt.h [1] https://osdn.net/projects/mingw/ticket/38391 Fixes https://github.com/curl/curl/pull/2721#issuecomment-403636043 Closes https://github.com/curl/curl/pull/2728
2018-07-09lib/curl_setup.h: remove unicode characterJay Satiro
Follow-up to 82ce416. Ref: https://github.com/curl/curl/commit/8272ec5#commitcomment-29646818
2018-07-09lib/curl_setup.h: remove unicode bom from 8272ec50f02Daniel Stenberg
2018-07-09schannel: fix -Wsign-compare warningMarcel Raad
MinGW warns: /lib/vtls/schannel.c:219:64: warning: signed and unsigned type in conditional expression [-Wsign-compare] Fix this by casting the ptrdiff_t to size_t as we know it's positive. Closes https://github.com/curl/curl/pull/2721
2018-07-09schannel: workaround for wrong function signature in w32apiMarcel Raad
Original MinGW's w32api has CryptHashData's second parameter as BYTE * instead of const BYTE *. Closes https://github.com/curl/curl/pull/2721
2018-07-09schannel: make more cipher options conditionalMarcel Raad
They are not defined in the original MinGW's <wincrypt.h>. Closes https://github.com/curl/curl/pull/2721
2018-07-09curl_setup: include <winerror.h> before <windows.h>Marcel Raad
Otherwise, only part of it gets pulled in through <windows.h> on original MinGW. Fixes https://github.com/curl/curl/issues/2361 Closes https://github.com/curl/curl/pull/2721
2018-07-09smtp: use the upload buffer size for scratch buffer mallocDaniel Stenberg
... not the read buffer size, as that can be set smaller and thus cause a buffer overflow! CVE-2018-0500 Reported-by: Peter Wu Bug: https://curl.haxx.se/docs/adv_2018-70a2.html
2018-07-06darwinssl: allow High Sierra users to build the code using GCCNick Zitzmann
...but GCC users lose out on TLS 1.3 support, since we can't weak-link enumeration constants. Fixes #2656 Closes #2703
2018-07-06libssh: goto DISCONNECT state on error, not SSH_SESSION_FREEDaniel Stenberg
... because otherwise not everything get closed down correctly. Fixes #2708 Closes #2712