Commit Graph

27763 Commits

Author SHA1 Message Date
Daniel Stenberg
ccb466fd36
misc: update copyright years 2021-10-15 17:07:19 +02:00
Daniel Stenberg
b75045aa12
examples/htmltidy: correct wrong printf() use
... and update the includes to match how current htmltidy wants them
used.

Reported-by: Stathis Kapnidis
Fixes #7860
Closes #7861
2021-10-15 10:00:11 +02:00
Jay Satiro
b1d08d295f http: set content length earlier
- Make content length (ie download size) accessible to the user in the
  header callback, but only after all headers have been processed (ie
  only in the final call to the header callback).

Background:

For a long time the content length could be retrieved in the header
callback via CURLINFO_CONTENT_LENGTH_DOWNLOAD_T as soon as it was parsed
by curl.

Changes were made in 8a16e54 (precedes 7.79.0) to ignore content length
if any transfer encoding is used. A side effect of that was that
content length was not set by libcurl until after the header callback
was called the final time, because until all headers are processed it
cannot be determined if content length is valid.

This change keeps the same intention --all headers must be processed--
but now the content length is available before the final call to the
header function that indicates all headers have been processed (ie
a blank header).

Bug: https://github.com/curl/curl/commit/8a16e54#r57374914
Reported-by: sergio-nsk@users.noreply.github.com

Co-authored-by: Daniel Stenberg

Fixes https://github.com/curl/curl/issues/7804
Closes https://github.com/curl/curl/pull/7803
2021-10-15 03:40:16 -04:00
Abhinav Singh
8c6f126279
aws-sigv4: make signature work when post data is binary
User sets the post fields size for binary data.  Hence, we should not be
using strlen on it.

Added test 1937 and 1938 to verify.

Closes #7844
2021-10-15 08:46:23 +02:00
a1346054
7759552b80
MacOSX-Framework: remove redundant ';'
Closes #7859
2021-10-15 08:08:14 +02:00
Daniel Stenberg
d79a2664ae
RELEASE-NOTES: synced 2021-10-14 23:04:27 +02:00
Daniel Stenberg
f3c215e18a
openssl: with OpenSSL 1.1.0+ a failed RAND_status means goaway
One reason we know it can fail is if a provider is used that doesn't do
a proper job or is wrongly configured.

Reported-by: Michael Baentsch
Fixes #7840
Closes #7856
2021-10-14 22:44:58 +02:00
Ryan Mast
a132b927d7
cmake: add CURL_ENABLE_SSL option and make CMAKE_USE_* SSL backend options depend on it
Closes https://github.com/curl/curl/pull/7822
2021-10-14 16:47:04 +02:00
Daniel Stenberg
d36fded576
http: remove assert that breaks hyper
Reported-by: Jay Satiro
Fixes #7852
Closes #7855
2021-10-14 11:16:37 +02:00
Daniel Stenberg
975a54dd86
http_proxy: fix one more result assign for hyper
and remove the bad assert again, since it was run even with no error!

Closes #7854
2021-10-14 11:15:40 +02:00
Jay Satiro
afd489885e sws: fix memory leak on exit
- Free the allocated http request struct on cleanup.

Prior to this change if sws was built with leak sanitizer it would
report a memory leak error during testing.

Closes https://github.com/curl/curl/pull/7849
2021-10-14 03:24:18 -04:00
Daniel Stenberg
a3030b7db6
c-hyper: make Curl_http propagate errors better
Pass on better return codes when errors occur within Curl_http instead
of insisting that CURLE_OUT_OF_MEMORY is the only possible one.

Pointed-out-by: Jay Satiro
Closes #7851
2021-10-14 07:49:09 +02:00
Daniel Stenberg
95c6abe135
http_proxy: make hyper CONNECT() return the correct error code
For every 'goto error', make sure the result variable holds the error
code for what went wrong.

Reported-by: Rafał Mikrut
Fixes #7825
Closes #7846
2021-10-14 07:47:29 +02:00
Daniel Stenberg
f9174a5073
docs/Makefile.am: repair 'make html'
by removing index.html which isn't around anymore

Closes #7853
2021-10-14 07:46:13 +02:00
Борис Верховский
3aead057a1
curl: correct grammar in generated libcurl code
Closes #7802
2021-10-13 00:33:20 +02:00
Daniel Stenberg
3723ba62a5
tests: disable test 2043
It uses revoked.badssl.com which now is expired and therefor this now
permafails. We should not use external sites for tests, this test should
be converted to use our own infra.

Closes #7845
2021-10-13 00:02:30 +02:00
Daniel Stenberg
8a534f8838
runtests: split out ignored tests
Report ignore tests separately from the actual fails.

Don't exit non-zero if test servers couldn't get killed.

Assisted-by: Jay Satiro

Fixes #7818
Closes #7841
2021-10-12 17:00:50 +02:00
Daniel Stenberg
1fed8feaf1
http2: make getsock not wait for write if there's no remote window
While uploading, check for remote window availability in the getsock
function so that we don't wait for a writable socket if no data can be
sent.

Reported-by: Steini2000 on github
Fixes #7821
Closes #7839
2021-10-12 11:19:22 +02:00
Daniel Stenberg
e38d2e5a50
test368: verify dash is appended for "-r [num]"
Follow-up to 8758a26f88
2021-10-11 22:52:30 +02:00
Борис Верховский
8758a26f88
curl: actually append "-" to --range without number only
Closes #7837
2021-10-11 22:51:13 +02:00
Daniel Stenberg
1edc423883
RELEASE-NOTES: synced 2021-10-11 17:14:16 +02:00
Daniel Stenberg
9a8564a920
urlapi: URL decode percent-encoded host names
The host name is stored decoded and can be encoded when used to extract
the full URL. By default when extracting the URL, the host name will not
be URL encoded to work as similar as possible as before. When not URL
encoding the host name, the '%' character will however still be encoded.

Getting the URL with the CURLU_URLENCODE flag set will percent encode
the host name part.

As a bonus, setting the host name part with curl_url_set() no longer
accepts a name that contains space, CR or LF.

Test 1560 has been extended to verify percent encodings.

Reported-by: Noam Moshe
Reported-by: Sharon Brizinov
Reported-by: Raul Onitza-Klugman
Reported-by: Kirill Efimov
Fixes #7830
Closes #7834
2021-10-11 17:04:14 +02:00
Marc Hoersken
ab1671cafe
CI/makefiles: introduce dedicated test target
Make it easy to use the same set of test flags
throughout all current and future CI builds.

Reviewed-by: Jay Satiro

Follow up to #7690
Closes #7785
2021-10-08 20:16:15 +02:00
Daniel Stenberg
aceff6088c
maketgz: redirect updatemanpages.pl output to /dev/null 2021-10-08 15:16:34 +02:00
Daniel Stenberg
33882a066e
CURLOPT_HTTPHEADER.3: add descripion for specific headers
Settting Host: or Transfer-Encoding: chunked actually have special
meanings to libcurl. This change tries to document them

Closes #7829
2021-10-08 15:15:30 +02:00
Daniel Stenberg
4e0c28923a
c-hyper: use hyper_request_set_uri_parts to make h2 better
and make sure to not send Host: over h2.

Fixes #7679
Reported-by: David Cook
Closes #7827
2021-10-08 15:14:29 +02:00
Michael Afanasiev
9597d2def7
curl-openssl.m4: modify library order for openssl linking
lcrypto may depend on lz, and configure corrently fails with when
statically linking as the order is "-lz -lcrypto". This commit switches
the order to "-lcrypto -lz".

Closes #7826
2021-10-08 10:50:57 +02:00
Marcel Raad
94696e1b51 sha256: use high-level EVP interface for OpenSSL
Available since OpenSSL 0.9.7. The low-level SHA256 interface is
deprecated in OpenSSL v3, and its usage was discouraged even before.

Closes https://github.com/curl/curl/pull/7808
2021-10-07 18:41:27 +02:00
Marcel Raad
802d864450 curl_ntlm_core: use OpenSSL only if DES is available
This selects another SSL backend then if available, or otherwise at
least gives a meaningful error message.

Closes https://github.com/curl/curl/pull/7808
2021-10-07 18:41:23 +02:00
Marcel Raad
b352e03ec8 md5: fix compilation with OpenSSL 3.0 API
Only use OpenSSL's MD5 code if it's available.

Also fix wolfSSL build with `NO_MD5`, in which case neither the
wolfSSL/OpenSSL implementation nor the fallback implementation was
used.

Closes https://github.com/curl/curl/pull/7808
2021-10-07 18:40:03 +02:00
Daniel Stenberg
8dd0f1aa46
print_category: printf %*s needs an int argument
... not a size_t!

Detected by Coverity: CID 1492331.
Closes #7823
2021-10-07 11:15:12 +02:00
Jay Satiro
5044909ca2 version_win32: use actual version instead of manifested version
- Use RtlVerifyVersionInfo instead of VerifyVersionInfo, when possible.

Later versions of Windows have normal version functions that compare and
return versions based on the way the application is manifested, instead
of the actual version of Windows the application is running on. We
prefer the actual version of Windows so we'll now call the Rtl variant
of version functions (RtlVerifyVersionInfo) which does a proper
comparison of the actual version.

Reported-by: Wyatt O'Day

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

Fixes https://github.com/curl/curl/issues/7742
Closes https://github.com/curl/curl/pull/7810
2021-10-07 03:18:22 -04:00
Daniel Stenberg
a031614a84
RELEASE-NOTES: synced 2021-10-06 22:52:09 +02:00
Daniel Stenberg
87907d56f0
http: fix Basic auth with empty name field in URL
Add test 367 to verify.

Reported-by: Rick Lane
Fixes #7819
Closes #7820
2021-10-06 22:45:52 +02:00
Jeffrey Tolar
5f563495f1
CURLOPT_MAXLIFETIME_CONN: maximum allowed lifetime for conn reuse
... and close connections that are too old instead of reusing them.

By default, this behavior is disabled.

Bug: https://curl.se/mail/lib-2021-09/0058.html
Closes #7751
2021-10-06 14:38:59 +02:00
Daniel Gustafsson
013cb2ff7d docs/examples: add missing binaries to gitignore
Commit f65d7889b added getreferrer, and commit ae8e11ed5 multi-legacy,
both of which missed adding .gitignore clauses for the built binaries.

Closes #7817
Reviewed-by: Daniel Stenberg <daniel@haxx.se>
2021-10-06 10:46:00 +02:00
Josip Medved
2ac10a9ea0
HTTP3: fix the HTTP/3 Explained book link
Closes #7813
2021-10-05 08:40:24 +02:00
Lucas Holt
18480f71be
misc: fix a few issues on MidnightBSD
Closes #7812
2021-10-05 08:35:24 +02:00
8U61ife
5ce380d65a tool_main: fix typo in comment
Closes: #7811
Reviewed-by: Daniel Gustafsson <daniel@yesql.se>
2021-10-04 23:38:58 +02:00
Ryan Mast
a232788ad8
BINDINGS: URL updates
For cpr, BBHTTP, Eiffel, Harbour, Haskell, Mono, and Rust

Closes #7809
2021-10-04 22:44:38 +02:00
Daniel Stenberg
343644fc32
scripts/delta: hide a git error message we don't care about
fatal: path 'src/tool_listhelp.c' exists on disk, but not in [tag]
2021-10-02 23:36:51 +02:00
Patrick Monnerat
3e2c1dcda8
sasl: binary messages
Capabilities of sasl module are extended to exchange messages in binary
as an alternative to base64.

If http authentication flags have been set, those are used as sasl
default preferred mechanisms.

Closes #6930
2021-10-02 23:30:37 +02:00
Hayden Roche
e12dc2dd97
wolfssl: use for SHA256, MD4, MD5, and setting DES odd parity
Prior to this commit, OpenSSL could be used for all these functions, but
not wolfSSL. This commit makes it so wolfSSL will be used if USE_WOLFSSL
is defined.

Closes #7806
2021-10-02 13:55:31 +02:00
Daniel Stenberg
8bb5f4ddf3
scripts/delta: count command line options in the new file
... which makes the shown delta number wrong until next release.
2021-10-01 08:49:12 +02:00
Daniel Stenberg
147c39b99c
RELEASE-NOTES: synced 2021-10-01 08:46:30 +02:00
Daniel Stenberg
24ffdc8826
print_category: print help descriptions aligned
Adjust the description position to make an aligned column when doing
help listings, which is more pleasing to the eye.

Suggested-by: Gisle Vanem
Closes #7792
2021-10-01 08:35:59 +02:00
Daniel Stenberg
85f91248cf
lib/mk-ca-bundle.pl: skip certs passed Not Valid After date
With this change applied, the now expired 'DST Root CA X3' cert will no
longer be included in the output.

Details: https://letsencrypt.org/docs/dst-root-ca-x3-expiration-september-2021/

Closes #7801
2021-09-30 23:37:55 +02:00
Daniel Stenberg
ffb634d4ef
tool_listhelp: easier to generate with gen.pl
tool_listhelp.c is now a separate file with only the command line --help
output, exactly as generated by gen.pl. This makes it easier to generate
updates according to what's in the docs/cmdline-opts docs.

  cd $srcroot/docs/cmdline-opts
  ./gen.pl listhelp *.d > $srcroot/src/tool_listhelp.c

With a configure build, this also works:

  make -C src listhelp

Closes #7787
2021-09-30 17:50:48 +02:00
Anthony Hu
d10a0af2f3
wolfssl: allow setting of groups/curves
In particular, the quantum safe KEM and hybrid curves if wolfSSL is
built to support them.

Closes #7728
2021-09-30 17:28:56 +02:00
Jan Mazur
0fe9018e1a
connnect: use sysaddr_un fron sys/un.h or custom-defined for windows
Closes #7737
2021-09-30 12:27:47 +02:00