aboutsummaryrefslogtreecommitdiff
path: root/lib
AgeCommit message (Collapse)Author
2020-03-02md4: use init/update/final functions in Secure TransportNick Zitzmann
We can use CC_MD4_Init/Update/Final without having to allocate memory directly. Closes #4979
2020-03-02multi_wait: stop loop when sread() returns zeroDaniel Stenberg
It's unclear why it would ever return zero here, but this change fixes Robert's problem and it shouldn't loop forever... Reported-by: Robert Dunaj Bug: https://curl.haxx.se/mail/archive-2020-02/0011.html Closes #5019
2020-03-02http: mark POSTs with no body as "upload done" from the startDaniel Stenberg
As we have logic that checks if we get a >= 400 reponse code back before the upload is done, which then got confused since it wasn't "done" but yet there was no data to send! Reported-by: IvanoG on github Fixes #4996 Closes #5002
2020-03-02formdata/mime: copyright year range updateDaniel Stenberg
Due to the merge/revert cycle
2020-03-02Revert "mime: latch last read callback status."Daniel Stenberg
This reverts commit 87869e38d7afdec3ef1bb4965711458b088e254f. Fixes #5014 Closes #5015 Reopens #4833
2020-03-02Revert "mime: do not perform more than one read in a row"Daniel Stenberg
This reverts commit ed0f357f7d25566110d4302f33759f4ffb5a6f83.
2020-03-02Revert "mime: fix the binary encoder to handle large data properly"Daniel Stenberg
This reverts commit b2caaa0681f329eed317ffb6ae6927f4a539f0c1.
2020-03-02altsvc: both h3 backends now speak h3-27Daniel Stenberg
... also updated the HTTP3 build description for ngtcp2 accordingly.
2020-03-02mime: fix the binary encoder to handle large data properlyPatrick Monnerat
New test 666 checks this is effective. As upload buffer size is significant in this kind of tests, shorten it in similar test 652. Fixes #4860 Reported-by: RuurdBeerstra on github
2020-03-02mime: do not perform more than one read in a rowPatrick Monnerat
Input buffer filling may delay the data sending if data reads are slow. To overcome this problem, file and callback data reads do not accumulate in buffer anymore. All other data (memory data and mime framing) are considered as fast and still concatenated in buffer. As this may highly impact performance in terms of data overhead, an early end of part data check is added to spare a read call. When encoding a part's data, an encoder may require more bytes than made available by a single read. In this case, the above rule does not apply and reads are performed until the encoder is able to deliver some data. Tests 643, 644, 645, 650 and 654 have been adapted to the output data changes, with test data size reduced to avoid the boredom of long lists of 1-byte chunks in verification data. New test 664 checks mimepost using single-byte read callback with encoder. New test 665 checks the end of part data early detection. Fixes #4826 Reported-by: MrdUkk on github
2020-03-02mime: latch last read callback status.Patrick Monnerat
In case a read callback returns a status (pause, abort, eof, error) instead of a byte count, drain the bytes read so far but remember this status for further processing. Takes care of not losing data when pausing, and properly resume a paused mime structure when requested. New tests 670-673 check unpausing cases, with easy or multi interface and mime or form api. Fixes #4813 Reported-by: MrdUkk on github Closes #4833
2020-03-01build: remove all HAVE_OPENSSL_ENGINE_H definesDaniel Stenberg
... as there's nothing in the code that actually uses the define! The last reference was removed in 38203f158. Closes #5007
2020-03-01polarssl: Additional removalSteve Holme
Follow up to 6357a19f. Reviewed-by: Daniel Stenberg Closes #5004
2020-02-29md5: Added implementation for mbedTLSSteve Holme
Reviewed-by: Jay Satiro Closes #4980
2020-02-29md5: Use pointer notation for array parameters in GnuTLS implementationSteve Holme
2020-02-29md4: Use non-deprecated functions in mbedTLS >= 2.7.0Steve Holme
Closes #4983
2020-02-29pause: force-drain the transfer on unpauseDaniel Stenberg
... since the socket might not actually be readable anymore when for example the data is already buffered in the TLS layer. Fixes #4966 Reported-by: Anders Berg Closes #5000
2020-02-28smtp: overwriting 'from' leaks memoryDaniel Stenberg
Detected by Coverity. CID 1418139. Also, make sure to return error if the new 'from' allocation fails. Closes #4997
2020-02-27smtp: fix memory leak on exit pathDaniel Stenberg
Detected by Coverity. CID 1418139. "leaked_storage: Variable 'from' going out of scope leaks the storage it points to" Closes #4990
2020-02-27gtls: Fixed compilation when using GnuTLS < 3.5.0Steve Holme
Reverts the functionality from 41fcb4f when compiling with GnuTLS older than 3.5.0. Reviewed-by: Daniel Stenberg Closes #4984
2020-02-27Curl_is_ASCII_name: handle a NULL argumentDaniel Stenberg
Make the function tolerate a NULL pointer input to avoid dereferencing that pointer. Follow-up to efce3ea5a85126d Detected by OSS-Fuzz Reviewed-By: Steve Holme Bug: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=20907 Fixes #4985 Closes #4986
2020-02-27http2: make pausing/unpausing set/clear local stream windowDaniel Stenberg
This reduces the HTTP/2 window size to 32 MB since libcurl might have to buffer up to this amount of data in memory and yet we don't want it set lower to potentially impact tranfer performance on high speed networks. Requires nghttp2 commit b3f85e2daa629 (https://github.com/nghttp2/nghttp2/pull/1444) to work properly, to end up in the next release after 1.40.0. Fixes #4939 Closes #4940
2020-02-27libssh: improve known hosts handlingAnderson Toshiyuki Sasaki
Previously, it was not possible to get a known hosts file entry due to the lack of an API. ssh_session_get_known_hosts_entry(), introduced in libssh-0.9.0, allows libcurl to obtain such information and behave the same as when compiled with libssh2. This also tries to avoid the usage of deprecated functions when the replacements are available. The behaviour will not change if versions older than libssh-0.8.0 are used. Signed-off-by: Anderson Toshiyuki Sasaki <ansasaki@redhat.com> Fixes #4953 Closes #4962
2020-02-26cookie: remove unnecessary check for 'out != 0'Daniel Stenberg
... as it will always be non-NULL at this point. Detected by Coverity: CID 1459009
2020-02-26http: added 417 response treatmentDaniel Stenberg
When doing a request with a body + Expect: 100-continue and the server responds with a 417, the same request will be retried immediately without the Expect: header. Added test 357 to verify. Also added a control instruction to tell the sws test server to not read the request body if Expect: is present, which the new test 357 uses. Reported-by: bramus on github Fixes #4949 Closes #4964
2020-02-26smtp: Tidy up, following recent changes, to maintain the coding styleSteve Holme
Closes #4892
2020-02-26smtp: Support the SMTPUTF8 extension for the EXPN commandSteve Holme
Simply notify the server we support the SMTPUTF8 extension if it does.
2020-02-26smtp: Support the SMTPUTF8 extension in the VRFY commandSteve Holme
2020-02-26smtp: Support the SMTPUTF8 extension in the RCPT TO commandSteve Holme
Note: The RCPT TO command isn't required to advertise to the server that it contains UTF-8 characters, instead the server is told that a mail may contain UTF-8 in any envelope command via the MAIL command.
2020-02-26smtp: Support the SMTPUTF8 extension in the MAIL commandSteve Holme
Support the SMTPUTF8 extension when sending mailbox information in the MAIL command (FROM and AUTH parameters). Non-ASCII domain names will be ACE encoded, if IDN is supported, whilst non-ASCII characters in the local address part are passed to the server. Reported-by: ygthien on github Fixes #4828
2020-02-26smtp: Detect server support for the UTF-8 extension as defined in RFC-6531Steve Holme
2020-02-26smtp: Support UTF-8 based host names in the VRFY commandSteve Holme
2020-02-26smtp: Support UTF-8 based host names in the RCPT TO commandSteve Holme
2020-02-26smtp: Support UTF-8 based host names in the MAIL commandSteve Holme
Non-ASCII host names will be ACE encoded if IDN is supported.
2020-02-26url: Make the IDN conversion functions available to othersSteve Holme
2020-02-24ntlm: Moved the HMAC MD5 function into the HMAC module as a generic functionSteve Holme
2020-02-23md4: Use const for the length input parameterSteve Holme
This keeps the interface the same as md5 and sha256.
2020-02-23ntlm: Removed the dependency on the TLS libaries when using MD5Steve Holme
As we have our own MD5 implementation use the MD5 wrapper to remove the TLS dependency. Closes #4967
2020-02-23md5/sha256: Updated the functions to allow non-string data to be hashedSteve Holme
2020-02-23digest: Corrected the name of the local HTTP digest functionSteve Holme
Follow up to 2b5b37cb. Local static functions do not require the Curl prefix.
2020-02-22tests: Added a unit test for SHA256 digest generationSteve Holme
Follow up to 2b5b37c. Closes #4968
2020-02-22md4: Fixed compilation issues when using GNU TLS gcryptSteve Holme
* Don't include 'struct' in the gcrypt MD4_CTX typedef * The call to gcry_md_read() should use a dereferenced ctx * The call to gcry_md_close() should use a dereferenced ctx Additional minor whitespace issue in the USE_WIN32_CRYPTO code. Closes #4959
2020-02-21http2: now require nghttp2 >= 1.12.0Daniel Stenberg
To simplify our code and since earlier versions lack important function calls libcurl needs to function correctly. nghttp2 1.12.0 was relased on June 26, 2016. Closes #4961
2020-02-21gtls: fix the copyright yearDaniel Stenberg
Follow-up from 41fcb4f609
2020-02-21GnuTLS: Always send client certjethrogb
TLS servers may request a certificate from the client. This request includes a list of 0 or more acceptable issuer DNs. The client may use this list to determine which certificate to send. GnuTLS's default behavior is to not send a client certificate if there is no match. However, OpenSSL's default behavior is to send the configured certificate. The `GNUTLS_FORCE_CLIENT_CERT` flag mimics OpenSSL behavior. Authored-by: jethrogb on github Fixes #1411 Closes #4958
2020-02-21cleanup: comment typosDaniel Stenberg
Spotted by 'codespell' Closes #4957
2020-02-20win32: USE_WIN32_CRYPTO to enable Win32 based MD4, MD5 and SHA256 functionsSteve Holme
Whilst lib\md4.c used this pre-processor, lib\md5.c and src\tool_metalink.c did not and simply relied on the WIN32 pre-processor directive. Reviewed-by: Marcel Raad Closes #4955
2020-02-19connect: remove some spurious infof() callsDaniel Stenberg
As they were added primarily for debugging, they provide little use for users. Closes #4951
2020-02-19nit: Copyright year out of dateDaniel Stenberg
Follow-up to 1fc0617dcc
2020-02-18tool_util: Improve Windows version of tvnow()Jay Satiro
- Change tool_util.c tvnow() for Windows to match more closely to timeval.c Curl_now(). - Create a win32 init function for the tool, since some initialization is required for the tvnow() changes. Prior to this change the monotonic time function used by curl in Windows was determined at build-time and not runtime. That was a problem because when curl was built targeted for compatibility with old versions of Windows (eg _WIN32_WINNT < 0x0600) it would use GetTickCount which wraps every 49.7 days that Windows has been running. This change makes curl behave similar to libcurl's tvnow function, which determines at runtime whether the OS is Vista+ and if so calls QueryPerformanceCounter instead. (Note QueryPerformanceCounter is used because it has higher resolution than the more obvious candidate GetTickCount64). The changes to tvnow are basically a copy and paste but the types in some cases are different. Ref: https://github.com/curl/curl/issues/3309 Closes https://github.com/curl/curl/pull/4847