Daiki Ueno [Thu, 26 Nov 2020 08:37:03 +0000 (09:37 +0100)]
vquic/ngtcp2.h: define local_addr as sockaddr_storage
This field needs to be wide enough to hold sockaddr_in6 when
connecting via IPv6. Otherwise, ngtcp2_conn_read_pkt will drop the
packets because of the address mismatch:
I00000022 [...] con ignore packet from unknown path
We can safely assume that struct sockaddr_storage is available, as it
is used in the public interface of ngtcp2.
Daniel Stenberg [Thu, 26 Nov 2020 16:28:39 +0000 (17:28 +0100)]
socks: check for DNS entries with the right port number
The resolve call is done with the right port number, but the subsequent
check used the wrong one, which then could find a previous resolve which
would return and leave the fresh resolve "incomplete" and leaking
memory.
Daniel Stenberg [Wed, 25 Nov 2020 14:06:56 +0000 (15:06 +0100)]
tool_writeout: use off_t getinfo-types instead of doubles
Commit 3b80d3ca46b12e52342 (June 2017) introduced getinfo replacement
variables that use curl_off_t instead of doubles. Switch the --write-out
function over to use them.
Emil Engler [Wed, 25 Nov 2020 17:26:56 +0000 (18:26 +0100)]
file: avoid duplicated code sequence
file_disconnect() is identical with file_do() except the function header
but as the arguments are unused anyway so why not just return file_do()
directly!
Rikard Falkeborn [Wed, 18 Nov 2020 23:08:30 +0000 (00:08 +0100)]
examples: update .gitignore
Add files that are generated by 'make examples' and remove some that
have been renamed.
The commits that renamed the programs are e9625c5bc6c046a (imap.c and
simplesmtp.c were renamed to imap-fetch.c and smtp-send.c) and ad39e7ec01e7 (pop3slist.c and pop3s.c were renamed to pop3-list.c and
pop3-ssl.c).
Marc Hoersken [Fri, 20 Nov 2020 07:20:04 +0000 (08:20 +0100)]
CI/cirrus: simplify logic for disabled tests
The OpenSSH server instance for the testsuite cannot
be started on FreeBSD, therefore the SFTP and SCP
tests are disabled right away from the beginning.
The previous OS version specific logic for SKIP_TESTS
is no longer needed/used and can therefore be removed.
Reviewed-by: Daniel Stenberg
Follow up to #6211
Closes #6229
EVP_MD_CTX_create will allocate memory for the context and returns
NULL in case the allocation fails. Make sure to catch any allocation
failures and exit early if so.
In passing, also move to EVP_DigestInit rather than EVP_DigestInit_ex
as the latter is intended for ENGINE selection which we don't do.
Closes #6224 Reviewed-by: Daniel Stenberg <daniel@haxx.se> Reviewed-by: Emil Engler <me@emilengler.com>
Tobias Hieta [Tue, 10 Nov 2020 09:45:31 +0000 (10:45 +0100)]
cmake: correctly handle linker flags for static libs
curl CMake was setting the the EXE flags for static libraries which made
the /manifest:no flag ended up when linking the static library, which is
not a valid flag for lib.exe or llvm-lib.exe and caused llvm-lib to exit
with an error.
The better way to handle this is to make sure that we pass the correct
linker flags to CMAKE_STATIC_LINKER_FLAGS instead.
Tobias Hieta [Tue, 10 Nov 2020 09:30:29 +0000 (10:30 +0100)]
cmake: don't pass -fvisibility=hidden to clang-cl on Windows
When using clang-cl on windows -fvisibility=hidden is not an known
argument. Instead it behaves exactly like MSVC in this case. So let's
make sure we take that path.
In CMake clang-cl sets both CMAKE_C_COMPILER_ID=clang and MSVC get's
defined since clang-cl is basically a MSVC emulator. So guarding like we
do in this patch seems logical.
Daniel Stenberg [Mon, 9 Nov 2020 15:24:13 +0000 (16:24 +0100)]
curl_easy_escape: limit output string length to 3 * max input
... instead of the limiting it to just the max input size. As every
input byte can be expanded to 3 output bytes, this could limit the input
string to 2.66 MB instead of the intended 8 MB.
Daniel Stenberg [Sat, 7 Nov 2020 22:53:24 +0000 (23:53 +0100)]
Curl_pgrsStartNow: init speed limit time stamps at start
By setting the speed limit time stamps unconditionally at transfer
start, we can start off a transfer without speed limits and yet allow
them to get set during transfer and have an effect.
Reported-by: Kael1117 on github
Fixes #6162
Closes #6184
Daniel Stenberg [Mon, 2 Nov 2020 22:17:01 +0000 (23:17 +0100)]
hsts: add support for Strict-Transport-Security
- enable in the build (configure)
- header parsing
- host name lookup
- unit tests for the above
- CI build
- CURL_VERSION_HSTS bit
- curl_version_info support
- curl -V output
- curl-config --features
- CURLOPT_HSTS_CTRL
- man page for CURLOPT_HSTS_CTRL
- curl --hsts (sets CURLOPT_HSTS_CTRL and works with --libcurl)
- man page for --hsts
- save cache to disk
- load cache from disk
- CURLOPT_HSTS
- man page for CURLOPT_HSTS
- added docs/HSTS.md
- fixed --version docs
- adjusted curl_easy_duphandle
Daniel Stenberg [Fri, 30 Oct 2020 10:29:22 +0000 (11:29 +0100)]
http: pass correct header size to debug callback for chunked post
... when the chunked framing was added, the size of the "body part" of
the data was calculated wrongly so the debug callback would get told a
header chunk a few bytes too big that would also contain the first few
bytes of the request body.
Jay Satiro [Thu, 29 Oct 2020 04:06:27 +0000 (00:06 -0400)]
tests: fix some http/2 tests for older versions of nghttpx
- Add regex that strips http/2 server header name to those http/2 tests
that don't already have it.
- Improve that regex in all http/2 tests.
Tests 358 and 359 were failing for me before this change on a system
that uses an older version of nghttpx which includes its version number
in the server header.