Commit Graph

12341 Commits

Author SHA1 Message Date
Daniel Stenberg
3c8b969de6
links: update dead links
The wiki pages are gone, remove and link to more long-living docs.

Closes #8897
2022-05-23 08:40:13 +02:00
Daniel Stenberg
216636a4ce
ntlm: (void) typecast msnprintf() where we ignore return code
Follow-up to 5a41abef6, to please Coverity
2022-05-23 08:13:48 +02:00
Daniel Gustafsson
5a41abef6d ntlm: copy NTLM_HOSTNAME to host buffer
Commit 709ae2454f added a fake hostname to avoid leaking the local
hostname, but omitted copying it to the host buffer.  Fix by copying
and adjust the test fallout.

Closes: #8895
Fixes: #8893
Reported-by: Patrick Monnerat <patrick@monnerat.net>
Reviewed-by: Daniel Stenberg <daniel@haxx.se>
2022-05-22 23:26:24 +02:00
Tatsuhiro Tsujikawa
8ea851b29d
ngtcp2: Allow curl to send larger UDP datagrams
Allow curl to send larger UDP datagram if Path MTU Discovery finds the
availability of larger path MTU.  To make it work and not to send
fragmented packet, we need to set DF bit.  That makes send(2) fail with
EMSGSIZE if UDP datagram is too large.  In that case, just let it be
lost.  This patch enables DF bit for Linux only.

Closes #8883
2022-05-20 17:50:38 +02:00
Daniel Stenberg
709ae2454f
ntlm: provide a fixed fake host name
The NTLM protocol includes providing the local host name, but apparently
other implementations already provide a fixed fake name instead to avoid
leaking the real local name.

The exact name used is 'WORKSTATION', because Firefox uses that.

The change is written to allow someone to "back-pedal" fairly easy in
case of need.

Reported-by: Carlo Alberto
Fixes #8859
Closes #8889
2022-05-20 16:24:13 +02:00
Daniel Stenberg
a7a18d7589
wolfssl: correct the failf() message when a handle can't be made
Closes #8885
2022-05-19 19:05:17 +02:00
Viktor Szakats
a820c55a72
Makefile.m32: delete two obsolete OpenSSL options [ci skip]
- -DOPENSSL_NO_KRB5: No longer used by OpenSSL 1.1.x, 3.x, or
  LibreSSL 3.5.x, yet it collides with the latter, which defines
  it unconditionally, resulting in this warning:
    ../../libressl/include/openssl/opensslfeatures.h:14:9: warning: 'OPENSSL_NO_KRB5' macro redefined [-Wmacro-redefined]
  It was originally added to curl in 2004.

- -DHAVE_OPENSSL_PKCS12_H: No longer used by OpenSSL 1.1.x, 3.x, or
  LibreSSL back to at least 2.5.5. Originally added in the same
  commit as the above, in 2004.

Closes #8884
2022-05-19 16:47:54 +00:00
Balakrishnan Balasubramanian
dfa84a0450
socks: support unix sockets for socks proxy
Usage:
  curl -x "socks5h://localhost/run/tor/socks" "https://example.com"

Updated runtests.pl to run a socksd server listening on unix socket

Added tests test1467 test1468

Added documentation for proxy command line option and socks proxy
options

Closes #8668
2022-05-19 15:35:03 +02:00
Vincent Torri
ee52bead4d
cmake: add libpsl support
Fixes #8865
Closes #8867
2022-05-19 15:29:55 +02:00
Tatsuhiro Tsujikawa
9accb9a5be
ngtcp2: extend QUIC transport parameters buffer
Extend QUIC transport parameters buffer because 64 bytes are too
short for the ever increasing parameters.

Closes #8872
2022-05-19 14:56:50 +02:00
Tatsuhiro Tsujikawa
136ab928c8
ngtcp2: handle error from ngtcp2_conn_submit_crypto_data
Closes #8871
2022-05-19 14:55:37 +02:00
Tatsuhiro Tsujikawa
fe1d00e71b
ngtcp2: send appropriate connection close error code
Closes #8870
2022-05-19 14:54:46 +02:00
Harry Sintonen
e9a8451a3b
cookie: address secure domain overlay
Bug: https://hackerone.com/reports/1560324
Co-authored-by: Daniel Stenberg
Closes #8840
2022-05-19 14:48:26 +02:00
Frank Gevaerts
b12c2b91df
strcase: some optimisations
Lookup tables for toupper() and tolower() make Curl_strcasecompare()
about 1.5 times faster. Reorganising Curl_strcasecompare() to fully exit
early then also allows simplifying the check at the end, for another
15%. In total, the changes make Curl_strcasecompare() around 1.6 to 1.7
times faster.

Note that these optimisation assume ASCII. The original
Curl_raw_toupper() and raw_tolower() look like they already made that
assumption.

Closes #8875
2022-05-19 12:03:57 +02:00
Daniel Stenberg
0842936292
lib/vssh/wolfssh.h: removed
Unused header file

Reported-by: Illarion Taev
Fixes #8863
Closes #8866
2022-05-17 17:31:02 +02:00
Elms
835a205370
wolfSSL: explicitly use compatibility layer
This change removes adding an include `$prefix/wolfssl` or similar to
allow for openssl include aliasing. Include paths of `wolfssl/openssl/`
are used to explicitly use wolfSSL includes. This fixes cmake builds as
well as avoiding potentially using openSSL headers since include path
order is not guaranteed.

Closes #8864
2022-05-17 16:58:03 +02:00
Daniel Stenberg
8d86718f3f
opts: deprecate RANDOM_FILE and EGDSOCKET
These two options were only ever used for the OpenSSL backend for
versions before 1.1.0. They were never used for other backends and they
are not used with recent OpenSSL versions. They were never used much by
applications.

The defines RANDOM_FILE and EGD_SOCKET can still be set at build-time
for ancient EOL OpenSSL versions.

Closes #8670
2022-05-17 11:05:54 +02:00
Harry Sintonen
1b3dcaed9f
bindlocal: don't use a random port if port number would wrap
Earlier if CURLOPT_LOCALPORT + CURLOPT_LOCALPORTRANGE would go past port
65535 the code would fall back to random port rather than giving up.

Closes #8862
2022-05-17 08:53:25 +02:00
Daniel Gustafsson
542c78dda7 transfer: Fix potential NULL pointer dereference
Commit 0ef54abf52 accidentally used the conn variable before the
assertion for it being NULL. Fix by moving the assignment which use
conn to after the assertion.

Closes: #8857
Reviewed-by: Daniel Stenberg <daniel@haxx.se>
2022-05-16 21:18:46 +02:00
vvb2060 on github
adde9f0e8c
ngtcp2: support boringssl crypto backend
Closes #8789
2022-05-16 18:21:54 +02:00
Tatsuhiro Tsujikawa
6fcd3e6f51
quic: add Curl_quic_idle
Add Curl_quic_idle which is called when no HTTP level read or write is
performed.  It is a good place to handle timer expiry for QUIC transport
(.e.g, retransmission).

Closes #8698
2022-05-16 18:19:08 +02:00
Gregor Jasny
53678992d5
mprintf: ignore clang non-literal format string
Closes #8740
2022-05-16 18:18:12 +02:00
Nick Zitzmann
e0b43c8eb9
sectransp: check for a function defined when __BLOCKS__ is undefined
SecTrustEvaluateAsync() is defined in the macOS 10.7 SDK, but it
requires Grand Central Dispatch to be supported by the compiler, and
some third-party macOS compilers do not support Grand Central Dispatch.
SecTrustCopyPublicKey() is not present in macOS 10.6, so this shouldn't
adversely affect anything.

Fixes #8846
Reported-by: Egor Pugin
Closes #8854
2022-05-16 18:15:04 +02:00
Tatsuhiro Tsujikawa
5980068c87
ngtcp2: Correct use of ngtcp2 and nghttp3 signed integer types
Closes #8851
2022-05-16 10:02:50 +02:00
Tatsuhiro Tsujikawa
33e819d799
ngtcp2: Fix alert_read_func return value
Closes #8852
2022-05-16 09:57:37 +02:00
Harry Sintonen
8540f95444
Curl_parsenetrc: don't access local pwbuf outside of scope
Accessing local variables outside of the scope is forbidden and
depending on the compiler can result in the value being
overwritten. Fixed by moving the pwbuf to be in scope.

Closes #8850
2022-05-16 09:56:26 +02:00
Daniel Stenberg
06d12105c7
url: free old conn better on reuse
Make use of conn_free() better and avoid duplicate code.

Reported-by: Andrea Pappacoda
Fixes #8841
Closes #8842
2022-05-14 18:05:20 +02:00
Daniel Gustafsson
f1cdeff37a gssapi: initialize gss_buffer_desc strings
Explicitly initialize gss_buffer_desc strings such that a call to
freeing resources will succeed even if no data has been allocated
to it.

Reported-by: Jay Satiro <raysatiro@yahoo.com>
2022-05-12 14:12:41 +02:00
Daniel Gustafsson
7360f9a565 gssapi: improve handling of errors from gss_display_status
In case gss_display_status() returns an error, avoid trying to add
it to the buffer as the message may well be a NULL pointer.

Originally this fix comes from a discussion in issue #8816.

Closes: #8832
Reviewed-by: Jay Satiro <raysatiro@yahoo.com>
2022-05-12 14:11:52 +02:00
steini2000
f9bc378ab7 http2: always debug print stream id in decimal with %u
Prior to this change the stream id shown could be hex or decimal which
was inconsistent and confusing.

Closes https://github.com/curl/curl/pull/8808
2022-05-12 01:31:32 -04:00
Kamil Dudka
9494cdc3d2 url: remove redundant #ifdefs in allocate_conn()
No change in behavior intended by this commit.
2022-05-11 15:51:29 +02:00
Daniel Gustafsson
37f892fb8c aws-sigv4: fix potentional NULL pointer arithmetic
We need to check if the strchr() call returns NULL (due to missing
char) before we use the returned value in arithmetic.  There is no
live bug here, but fixing it before it can become for hygiene.

Closes: #8814
Reviewed-by: Daniel Stenberg <daniel@haxx.se>
2022-05-11 10:52:56 +02:00
Daniel Stenberg
fdb5e21b4d
quiche: support ca-fallback
Follow-up to b01f3e679f which added this for ngtcp2/openssl

Removed from KNOWN_BUGS

Fixes #8696
Closes #8830
2022-05-11 10:49:31 +02:00
Daniel Gustafsson
bcf03dd213 x509asn1: mark msnprintf return as unchecked
We have lots of unchecked msnprintf calls, and this particular msnprintf
call isn't more interesting than the others, but this one yields a Coverity
warning so let's implicitly silence it. Going over the other invocations
is probably a worthwhile project, but for now let's keep the static
analyzers happy.

Closes: #8831
Reviewed-by: Daniel Stenberg <daniel@haxx.se>
2022-05-11 10:38:08 +02:00
Tatsuhiro Tsujikawa
b01f3e679f
ngtcp2: add ca-fallback support for OpenSSL backend
Closes #8828
2022-05-10 09:43:08 +02:00
Daniel Stenberg
1645e9b445
url: check SSH config match on connection reuse
CVE-2022-27782

Reported-by: Harry Sintonen
Bug: https://curl.se/docs/CVE-2022-27782.html
Closes #8825
2022-05-09 23:13:53 +02:00
Daniel Stenberg
f18af4f874
tls: check more TLS details for connection reuse
CVE-2022-27782

Reported-by: Harry Sintonen
Bug: https://curl.se/docs/CVE-2022-27782.html
Closes #8825
2022-05-09 23:13:53 +02:00
Daniel Stenberg
7e92d12b4e
cookies: make bad_domain() not consider a trailing dot fine
The check for a dot in the domain must not consider a single trailing
dot to be fine, as then TLD + trailing dot is fine and curl will accept
setting cookies for it.

CVE-2022-27779

Reported-by: Axel Chong
Bug: https://curl.se/docs/CVE-2022-27779.html
Closes #8820
2022-05-09 16:47:28 +02:00
Daniel Stenberg
fae6fea209
hsts: ignore trailing dots when comparing hosts names
CVE-2022-30115

Reported-by: Axel Chong
Bug: https://curl.se/docs/CVE-2022-30115.html
Closes #8821
2022-05-09 12:54:39 +02:00
Daniel Stenberg
914aaab915
urlapi: reject percent-decoding host name into separator bytes
CVE-2022-27780

Reported-by: Axel Chong
Bug: https://curl.se/docs/CVE-2022-27780.html
Closes #8826
2022-05-09 12:50:34 +02:00
Daniel Stenberg
5c7da89d40
nss: return error if seemingly stuck in a cert loop
CVE-2022-27781

Reported-by: Florian Kohnhäuser
Bug: https://curl.se/docs/CVE-2022-27781.html
Closes #8822
2022-05-09 10:07:15 +02:00
Daniel Stenberg
a1d23f287e
altsvc: fix host name matching for trailing dots
Closes #8819
2022-05-09 09:39:15 +02:00
Garrett Squire
652fd3fab8
hyper: fix test 357
This change fixes the hyper API such that PUT requests that receive a
417 response can retry without the Expect header.

Closes #8811
2022-05-08 23:19:05 +02:00
Harry Sintonen
4fc35c829c
sectransp: bail out if SSLSetPeerDomainName fails
Before the code would just warn about SSLSetPeerDomainName() errors.

Closes #8798
2022-05-06 16:25:20 +02:00
Daniel Stenberg
a8a1dd8ecc
http_proxy/hyper: handle closed connections
Enable test 1021 for hyper builds.

Patched-by: Prithvi MK
Fixes #8700
Closes #8806
2022-05-06 11:01:54 +02:00
Jay Satiro
6285957f1d mbedtls: fix some error messages
Prior to this change some of the error messages misidentified the
function that failed.
2022-05-05 03:13:24 -04:00
Sergey Markelov
137a668e8c
x509asn1: make do_pubkey handle EC public keys
Closes #8757
2022-05-05 08:44:23 +02:00
Harry Sintonen
d7fb9ab7ce
mbedtls: bail out if rng init fails
There was a failf() call but no actual error return.

Closes #8796
2022-05-05 08:40:38 +02:00
Sergey Markelov
b5b86856a9
urlapi: address (harmless) UndefinedBehavior sanitizer warning
`while(i--)` causes runtime error: unsigned integer overflow: 0 - 1
cannot be represented in type 'size_t' (aka 'unsigned long')

Closes #8797
2022-05-05 08:38:06 +02:00
Harry Sintonen
1a78051732
gskit_connect_step1: fixed bogus setsockopt calls
setsockopt takes a reference to value, not value. With the current
code this just leads to -1 return value with errno EFAULT.

Closes #8793
2022-05-04 23:33:17 +02:00