Commit Graph

12341 Commits

Author SHA1 Message Date
Daniel Gustafsson
79939ec18a gskit: remove unused function set_callback
This function has been unused since the initial commit of the GSKit
backend in 0eba02fd4.  The motivation for the code was getting the
whole certificate chain: the only place where the latter is available
is as a callback parameter.  Unfortunately it is not possible to pass
a user pointer to this callback, which precludes the possibility to
associate the cert chain with a data/conn structure.

For further information, search for pgsk_cert_validation_callback on:
https://www.ibm.com/docs/api/v1/content/ssw_ibm_i_71/apis/gsk_attribute_set_callback.htm

As the upstream library never added a parameter like that to the API,
we give up the wait and remove the dead code.

Closes: #8782
Reviewed-by: Patrick Monnerat <patrick@monnerat.net>
2022-05-01 22:59:25 +02:00
Yusuke Nakamura
2e2767a378
msh3: get msh3 version from MsH3Version
Closes #8762
2022-04-30 10:51:22 +02:00
Yusuke Nakamura
279dfb620b
msh3: psss remote_port to MsH3ConnectionOpen
MsH3 supported additional "Port" parameter to connect not hosted on
443 port QUIC website.

* https://github.com/nibanks/msh3/releases/tag/v0.3.0
* https://github.com/nibanks/msh3/pull/37

Closes #8762
2022-04-30 10:51:09 +02:00
Christian Weisgerber
a3cf94f3ef
openssl: define HAVE_SSL_CTX_SET_EC_CURVES for libressl
SSL_CTX_set1_curves_list() has been available since LibreSSL 2.5.3,
released five years ago.

Bug: https://curl.se/mail/lib-2022-04/0059.html
Closes #8773
2022-04-29 23:02:45 +02:00
Daniel Stenberg
d7b970e46b
http: move Curl_allow_auth_to_host()
It was mistakenly put within the CURL_DISABLE_HTTP_AUTH #ifdef

Reported-by: Michael Olbrich
Fixes #8772
Closes #8775
2022-04-29 22:56:47 +02:00
Daniel Gustafsson
59d89286d4 msh3: print boolean value as text representation
Print the boolean value as its string representation instead of with
%hhu which isn't a format we typically use.

Closes: #8763
Reviewed-by: Nick Banks <nibanks@microsoft.com>
2022-04-29 11:40:25 +02:00
Daniel Stenberg
6eb7fb37d9
mbedtls: fix compile when h2-enabled
Fixes #8766
Reported-by: LigH-de on github
Closes #8768
2022-04-28 17:11:50 +02:00
Adam Rosenfield
e07a9b668a
conn: fix typo 'connnection' -> 'connection' in two function names
Closes #8759
2022-04-27 11:50:13 +02:00
Daniel Stenberg
0935315562
gnutls: don't leak the SRP credentials in redirects
Follow-up to 620ea21410 and 139a54ed0a

Reported-by: Harry Sintonen
Closes #8752
2022-04-26 07:46:20 +02:00
Daniel Stenberg
139a54ed0a
openssl: don't leak the SRP credentials in redirects either
Follow-up to 620ea21410

Reported-by: Harry Sintonen
Closes #8751
2022-04-25 22:34:40 +02:00
Liam Warfield
aad7d9f9a6
hyper: fix tests 580 and 581 for hyper
Hyper now has the ability to preserve header order. This commit adds a
few lines setting the connection options for this feature.

Related to issue #8617
Closes #8707
2022-04-25 17:33:08 +02:00
Daniel Stenberg
030adbceeb
conncache: remove name arg from Curl_conncache_find_bundle
To simplify, and also since the returned name is not the full actual
name used for the check. The port number and zone id is also involved,
so just showing the name is misleading.

Closes #8750
2022-04-25 16:25:42 +02:00
Daniel Stenberg
620ea21410
transfer: redirects to other protocols or ports clear auth
... unless explicitly permitted.

Bug: https://curl.se/docs/CVE-2022-27774.html
Reported-by: Harry Sintonen
Closes #8748
2022-04-25 16:24:33 +02:00
Daniel Stenberg
08b8ef4e72
connect: store "conn_remote_port" in the info struct
To make it available after the connection ended.
2022-04-25 16:24:33 +02:00
Daniel Stenberg
6e65999395
http: avoid auth/cookie on redirects same host diff port
CVE-2022-27776

Reported-by: Harry Sintonen
Bug: https://curl.se/docs/CVE-2022-27776.html
Closes #8749
2022-04-25 13:05:40 +02:00
Daniel Stenberg
8f2079154f
libssh2: make the md5 comparison fail if wrong length
Making it just skip the check unless exactly 32 is too brittle. Even if
the docs says it needs to be exactly 32, it is be safer to make the
comparison fail here instead.

Reported-by: Harry Sintonen
Bug: https://hackerone.com/reports/1549461
Closes #8745
2022-04-25 13:01:20 +02:00
Daniel Stenberg
058f98dc3f
conncache: include the zone id in the "bundle" hashkey
Make connections to two separate IPv6 zone ids create separate
connections.

Reported-by: Harry Sintonen
Bug: https://curl.se/docs/CVE-2022-27775.html
Closes #8747
2022-04-25 11:48:00 +02:00
Patrick Monnerat
852aa5ad35
url: check sasl additional parameters for connection reuse.
Also move static function safecmp() as non-static Curl_safecmp() since
its purpose is needed at several places.

Bug: https://curl.se/docs/CVE-2022-22576.html

CVE-2022-22576

Closes #8746
2022-04-25 11:44:05 +02:00
Daniel Stenberg
ff2f3e8367
libssh2: compare sha256 strings case sensitively
Reported-by: Harry Sintonen
Bug: https://hackerone.com/reports/1549435
Closes #8744
2022-04-25 11:41:20 +02:00
Tatsuhiro Tsujikawa
ca94497a82
ngtcp2: deal with sub-millisecond timeout
Closes #8738
2022-04-25 11:37:18 +02:00
Daniel Stenberg
4ec0549c39
misc: update copyright year ranges 2022-04-25 09:31:09 +02:00
Tatsuhiro Tsujikawa
458c4b1df7
ngtcp2: avoid busy loop in low CWND situation
Closes #8739
2022-04-24 23:21:27 +02:00
Daniel Gustafsson
e498a9b1fe macos: set .plist version in autoconf
Set the libcurl version in libcurl.plist like how libcurl.vers is
created.

Closes: #8692
Reviewed-by: Daniel Stenberg <daniel@haxx.se>
Reviewed-by: Nick Zitzmann <nickzman@gmail.com>
2022-04-20 15:26:13 +02:00
Daniel Gustafsson
a6cdfd24ee cookies: Improve errorhandling for reading cookiefile
The existing programming had some issues with errorhandling for reading
the cookie file. If the file failed to open, we would silently ignore it
and continue as if there was no file (or stdin) passed. In this case, we
would also call fclose() on the NULL FILE pointer, which is undefined
behavior. Fix by ensuring that the FILE pointer is set before calling
fclose on it, and issue a warning in case the file cannot be opened.
Erroring out on nonexisting file would break backwards compatibility of
very old behavior so we can't really go there.

Closes: #8699
Reviewed-by: Daniel Stenberg <daniel@haxx.se>
Reviewed-by: Jay Satiro <raysatiro@yahoo.com>
2022-04-20 14:17:29 +02:00
Jay Dommaschk
c4d032af2a
libssh: fix double close
libssh closes the socket in ssh_diconnect() so make sure that libcurl
does not also close it.

Fixes #8708
Closes #8718
2022-04-20 09:12:36 +02:00
Marc Hoersken
68035af29d
timediff.[ch]: add curlx helper functions for timeval conversions
Also move timediff_t definitions from timeval.h to timediff.h and
then make timeval.h include the new standalone-capable timediff.h.

Reviewed-by: Jay Satiro
Reviewed-by: Daniel Stenberg

Supersedes #5888
Closes #8595
2022-04-17 13:11:27 +02:00
Daniel Stenberg
6968fb9d54
lib: remove exclamation marks
... from infof() and failf() calls. Make them less attention seeking.

Closes #8713
2022-04-16 11:55:05 +02:00
Daniel Gustafsson
34bbf96475 infof: consistent capitalization of warning messages
Ensure that all infof calls with a warning message are capitalized
in the same way.  At some point we should probably set up a style-
guide for infof but until then let's aim for a little consistenncy
where we can.

Closes: #8711
Reviewed-by: Daniel Stenberg <daniel@haxx.se>
2022-04-14 21:13:29 +02:00
Tatsuhiro Tsujikawa
cd29c1651e
ngtcp2: fix memory leak
Closes #8691
2022-04-10 23:10:21 +02:00
Tatsuhiro Tsujikawa
fa25dab7fd
ngtcp2: remove remote_addr which is not used in a meaningful way
Closes #8689
2022-04-10 23:09:41 +02:00
Tatsuhiro Tsujikawa
f15beb6f30
ngtcp2: enlarge H3_SEND_SIZE
Make h3_SEND_SIZE larger because current value (20KiB) is too small
for the high latency environment.

Closes #8690
2022-04-10 23:08:33 +02:00
Tatsuhiro Tsujikawa
990bfdd7bc
ngtcp2: fix HTTP/3 upload stall and avoid busy loop
This commit fixes HTTP/3 upload stall if upload data is larger than
H3_SEND_SIZE.  Only check writability of socket if a stream is
writable to avoid busy loop when QUIC flow control window is filled
up, or upload buffer is full.

Closes #8688
2022-04-10 23:07:42 +02:00
Nick Banks
37492ebbfa
msh3: add support for QUIC and HTTP/3 using msh3
Considered experimental, as the other HTTP/3 backends.

Closes #8517
2022-04-10 18:23:04 +02:00
Daniel Stenberg
fbba7dd796
schannel: remove dead code that will never run
As the condition can't ever evaluate true

Reported-by: Andrey Alifanov
Ref: #8675
Closes #8677
2022-04-06 08:33:20 +02:00
Daniel Stenberg
d4cf98bbd1
connecache: remove duplicate connc->closure_handle check
The superfluous extra check could cause analyzer false positives
and doesn't serve any purpose.

Closes #8676
2022-04-06 08:32:04 +02:00
MAntoniak
ba83c522f5
mbedtls: remove server_fd from backend
Closes #8682
2022-04-06 08:31:12 +02:00
Tatsuhiro Tsujikawa
92c0123585
ngtcp2: use token when detecting :status header field
Closes #8679
2022-04-05 16:48:44 +02:00
Tatsuhiro Tsujikawa
913b80d5fd
ngtcp2: make curl 1ms faster
Pass 0 for an already expired timer.

Closes #8678
2022-04-05 16:47:18 +02:00
Tatsuhiro Tsujikawa
1b1443a8ed
ngtcp2: fix QUIC_IDLE_TIMEOUT
QUIC_IDLE_TIMEOUT should be of type ngtcp2_duration which is
nanoseconds resolution.

Closes #8678
2022-04-05 16:47:07 +02:00
Daniel Stenberg
4a8f6869db
English: use American spelling consistently
Authorization, Initialization, Organization etc.

Closes #8673
2022-04-05 14:55:47 +02:00
Daniel Stenberg
854ec76551
http: streamclose "already downloaded"
Instead of connclose()ing, since when HTTP/2 is used it doesn't need to
close the connection as stopping the current transfer is enough.

Reported-by: Evangelos Foutras
Closes #8665
2022-04-01 23:30:43 +02:00
Jay Satiro
9ca6cd924c ftp: fix error message for partial file upload
- Show the count of bytes written on partial file upload.

Prior to this change the error message mistakenly showed the count of
bytes read, not written.

Bug: https://github.com/curl/curl/discussions/8637
Reported-by: Taras Kushnir

Closes https://github.com/curl/curl/pull/8649
2022-04-01 13:52:13 -04:00
Daniel Stenberg
218cc70028
http: correct the header error message to say colon
Not semicolon

Reported-by: Gisle Vanem
Ref: #8666
Closes #8667
2022-04-01 17:00:18 +02:00
Daniel Stenberg
b716b5aa7e
lib: #ifdef on USE_HTTP2 better
... as nghttp2 might not be the library that provides HTTP/2 support.

Closes #8661
2022-04-01 13:45:52 +02:00
MAntoniak
266627b0bc
mbedtls: remove 'protocols' array from backend when ALPN is not used
Closes #8663
2022-04-01 13:43:11 +02:00
Daniel Stenberg
fda4b81635
http2: RST the stream if we stop it on our own will
For the "simulated 304" case the done-call isn't considered "premature"
but since the server didn't close the stream it needs to be reset to
stop delivering data.

Closes #8664
2022-04-01 13:23:04 +02:00
Daniel Stenberg
3fa634a337
http: close the stream (not connection) on time condition abort
Closes #8664
2022-04-01 13:22:59 +02:00
Daniel Stenberg
b5a9680577
http2: handle DONE called for the paused stream
As it could otherwise stall all streams on the connection

Reported-by: Evangelos Foutras
Fixes #8626
Closes #8664
2022-04-01 13:22:58 +02:00
Daniel Stenberg
7c1acaf61e
tls: make mbedtls and NSS check for h2, not nghttp2
This makes them able to also negotiate HTTP/2 even when built to use
hyper for h2.

Closes #8656
2022-03-31 16:04:00 +02:00
Daniel Stenberg
34ebf3f90d
vtls: use a generic "ALPN, server accepted" message
Closes #8657
2022-03-31 14:21:01 +02:00
Daniel Stenberg
55043b40c1
vtls: use a backend standard message for "ALPN: offers %s"
I call it VTLS_INFOF_ALPN_OFFER_1STR, the '1str' meaning that the
infof() call also needs a string argument: the ALPN ID.

Closes #8657
2022-03-31 14:20:56 +02:00
MonkeybreadSoftware
62d5818242
strcase.h: add comment about the return code
Tool often we run into expecting this to work like strcmp, but it
returns 1 instead of 0 for match.

Closes #8658
2022-03-31 11:35:27 +02:00
Daniel Stenberg
3bc5b32db5
vtls: provide a unified APLN-disagree string for all backends
Also rephrase to make it sound less dangerous:

 "ALPN: server did not agree on a protocol. Uses default."

Reported-by: Nick Coghlan
Fixes #8643
Closes #8651
2022-03-31 09:20:16 +02:00
Daniel Stenberg
a3f4d7cee9
misc: spelling fixes
Mostly in comments but also in the -w documentation for headers_json.

Closes #8647
2022-03-30 10:49:06 +02:00
Daniel Stenberg
5a9d7c4e68
pop3/smtp: return *WEIRD_SERVER_REPLY when not understood
This leaves the CURLE_RECV_ERROR error code for explicit failure to
receive network data and allows users to better separate the problems.

Ref #8356
Reported-by: Rianov Viacheslav
Closes #8506
2022-03-29 14:01:53 +02:00
Daniel Stenberg
87da3e845b
mqtt: better handling of TCP disconnect mid-message
Reported-by: Jenny Heino
Bug: https://hackerone.com/reports/1521610
Closes #8644
2022-03-29 08:43:14 +02:00
Daniel Stenberg
235535cf23
ngtcp2: update to work after recent ngtcp2 updates
Assisted-by: Tatsuhiro Tsujikawa
Reported-by: jurisuk on github
Fixes #8638
Closes #8639
2022-03-26 18:35:23 +01:00
Daniel Stenberg
c2610db63e
headers.h: make Curl_headers_push() be CURLE_OK when not built
... to avoid errors when the function isn't there.

Reported-by: Marcel Raad
Fixes #8627
Closes #8628
2022-03-24 00:52:34 +01:00
Daniel Stenberg
8e22fc68e7
scripts: move three scripts from lib/ to scripts/
Move checksrc.pl, firefox-db2pem.sh and mk-ca-bundle.pl since they don't
particularly belong in lib/

Also created an EXTRA_DIST= in scripts/Makefile.am instead of specifying
those files in the root Makefile.am

Closes #8625
2022-03-23 15:26:11 +01:00
Marc Hoersken
b478d59e9d
lib/warnless.[ch]: only check for WIN32 and ignore _WIN32
curl_setup.h automatically defines WIN32 if just _WIN32 is defined.

Therefore make sure curl_setup.h is included through warnless.h.

Reviewed-by: Daniel Stenberg
Reviewed-by: Jay Satiro

Closes #8594
2022-03-23 05:00:10 +01:00
Philip H
98b40c61bc
firefox-db2pem.sh: make the shell script safer
Reported by lift

Closes #8616
2022-03-22 23:14:34 +01:00
Jay Satiro
8b1cae63b7 gtls: fix build for disabled TLS-SRP
Prior to this change if, at build time, the GnuTLS backend was found to
have TLS-SRP support (HAVE_GNUTLS_SRP) but TLS-SRP was disabled in curl
via --disable-tls-srp (!USE_TLS_SRP) then a build error would occur.

Bug: https://curl.se/mail/lib-2022-03/0046.html
Reported-by: Robert Brose

Closes https://github.com/curl/curl/pull/8604
2022-03-22 14:24:08 -04:00
Daniel Stenberg
2e1ef61560
test1135: sync with recent API updates
This test verifies that the order of functions in public headers remain
the same but hasn't been updated to care for recently added header
files. The order is important for some few platforms - or VERSIONINFO
needs to updated.

This fix also updates VERSIONINFO to be sure.

Closes #8620
2022-03-22 14:28:18 +01:00
Daniel Stenberg
ac81a9c9ae
lib: make the headers API depend on --enable-headers-api 2022-03-22 08:24:26 +01:00
Daniel Stenberg
4133a69f2d
curl: add %{header_json} support in -w handling
Outputs all response headers as a JSON object.
2022-03-22 08:24:25 +01:00
Daniel Stenberg
d1e4a67734
header api: add curl_easy_header and curl_easy_nextheader
Add test 1940 to 1946 to verify.

Closes #8593
2022-03-22 08:24:22 +01:00
Daniel Stenberg
59c44c76de
libssh: unstick SFTP transfers when done event-based
Test 604 and 606 (at least).

Closes #8490
2022-03-21 17:41:20 +01:00
Daniel Stenberg
dcdf2e8a36
http: return error on colon-less HTTP headers
It's a protocol violation and accepting them leads to no good.

Add test case 398 to verify

Closes #8610
2022-03-21 08:37:24 +01:00
Jay Satiro
acf46b1bba rtsp: don't let CSeq error override earlier errors
- When done, if an error has already occurred then don't check the
  sequence numbers for mismatch.

A sequence number may not have been received if an error occurred.

Prior to this change a sequence mismatch error would override earlier
errors. For example, a server that returns nothing would cause error
CURLE_GOT_NOTHING in Curl_http_done which was then overridden by
CURLE_RTSP_CSEQ_ERROR in rtsp_done.

Closes https://github.com/curl/curl/pull/8525
2022-03-18 03:24:37 -04:00
Jay Satiro
d3cb3be520 lib: fix some misuse of curlx_convert_wchar_to_UTF8
curlx_convert_wchar_to_UTF8 must be freed by curlx_unicodefree, but
prior to this change some uses mistakenly called free.

I've reviewed all other uses of curlx_convert_wchar_to_UTF8 and
curlx_convert_UTF8_to_wchar.

Ref: https://github.com/curl/curl/commit/1d5d0ae

Closes https://github.com/curl/curl/pull/8521
2022-03-18 03:20:03 -04:00
Jay Satiro
45cb662b87 mk-ca-bundle.pl: Use stricter logic to process the certificates
.. and bump version to 1.29.

This change makes the script properly ignore unknown blocks and
otherwise fail when Mozilla changes the certdata format in ways we
don't expect. Though this is less flexible behavior it makes it far less
likely that an invalid certificate can slip through.

Prior to this change the state machine did not always properly reset,
and it was possible that a certificate marked as invalid could then
later be marked as valid when there was conflicting trust info or
an unknown block was erroneously processed as part of the certificate.

Ref: https://github.com/curl/curl/pull/7801#pullrequestreview-768384569

Closes https://github.com/curl/curl/pull/8411
2022-03-18 03:15:44 -04:00
Daniel Stenberg
526e0ef4cb
http: reject header contents with nul bytes
They are not allowed by the protocol and allowing them risk that curl
misbehaves somewhere where C functions are used but won't work on the
full contents. Further, they are not supported by hyper and they cause
problems for the new coming headers API work.

Updated test 262 to verify and enabled it for hyper as well

Closes #8601
2022-03-17 10:17:31 +01:00
Jay Satiro
9d55fb4675 libssh: Improve fix for missing SSH_S_ stat macros
- If building libcurl against an old libssh version missing SSH_S_IFMT
  and SSH_S_IFLNK then use the values from a supported version.

Prior to this change if libssh did not define SSH_S_IFMT and SSH_S_IFLNK
then S_IFMT and S_IFLNK, respectively, were used instead. The problem
with that is the user's S_ stat macros don't have the same values across
platforms. For example Windows has values different from Linux.

Follow-up to 7b0fd39.

Ref: https://github.com/curl/curl/pull/8511#discussion_r815292391
Ref: https://github.com/curl/curl/pull/8574

Closes https://github.com/curl/curl/pull/8588
2022-03-14 03:31:20 -04:00
Jan Venekamp
3b4a353025
BearSSL: add CURLOPT_SSL_CTX_FUNCTION support
Closes #8478
2022-03-12 23:03:37 +01:00
Jan Venekamp
f5d79619b1
BearSSL: add CURLOPT_SSL_CIPHER_LIST support
Closes #8477
2022-03-12 22:59:45 +01:00
Jean-Philippe Menil
680245cd39
openssl: check SSL_get_peer_cert_chain return value
Signed-off-by: Jean-Philippe Menil <jpmenil@gmail.com>
Closes #8579
2022-03-11 07:45:35 +01:00
Jay Satiro
e87c53d7ea
mk-ca-bundle.vbs: delete this script in favor of mk-ca-bundle.pl
mk-ca-bundle.vbs is a Windows-specific script for Mozilla certificate
extraction, similar to mk-ca-bundle.pl which runs on any platform. The
vbs version has not been maintained while the perl version has been
maintained with improvements and security fixes. I don't think it's
worth the work to maintain both versions. Windows users should be able
to use mk-ca-bundle.pl without any problems, as long as they have perl.

Closes #8412
2022-03-10 23:18:40 +01:00
Daniel Stenberg
7b0fd39db2
libssh: fix build with old libssh versions
... that don't have the SSH_S_* defines. Spotted on a machine using
libssh 0.7.3

Closes #8574
2022-03-10 19:52:13 +01:00
Daniel Stenberg
7da29df6d3
hyper: fix status_line() return code
Detected while working on #7708 that happened to trigger an error here
with a new test case.

Closes #8572
2022-03-10 17:35:46 +01:00
Tatsuhiro Tsujikawa
c82b281e17
ngtcp2: add client certificate authentication for OpenSSL
Closes #8522
2022-03-10 08:41:37 +01:00
Daniel Stenberg
96edc7954f
ngtcp2: disconnect the QUIC connection proper
Reported-by: mehatzri on github
Reviewed-by: Tatsuhiro Tsujikawa
Fixes #8534
closes #8569
2022-03-10 08:26:18 +01:00
Don
7c44b51956
nonblock: restore setsockopt method to curlx_nonblock
The implementation using setsockopt was removed when BeOS support was
purged. However this functionality wasn't BeOS specific, it is still
used by for example Orbis OS (Playstation 4/5 OS).

Closes #8562
2022-03-09 09:13:42 +01:00
Daniel Stenberg
911714d617
openssl: fix CN check error code
Due to a missing 'else' this returns error too easily.

Regressed in: d15692ebb

Reported-by: Kristoffer Gleditsch
Fixes #8559
Closes #8560
2022-03-08 15:59:04 +01:00
Frank Meier
1b169d5ea1
connect: make Curl_getconnectinfo work with conn cache from share handle
Closes #8524
2022-03-08 09:22:09 +01:00
lwthiker
68dc5bcd46
openssl: enable CURLOPT_SSL_EC_CURVES with BoringSSL
The CURLOPT_SSL_EC_CURVES option (used by the '--curves' flag) in
libcurl was ignored when compiling with BoringSSL because
HAVE_SSL_CTX_SET_EC_CURVES was explicitly disabled if BoringSSL was
detected.  However, this feature is supported in BoringSSL since
5fd1807d. This commit enables it, and also reduces the required minimal
OpenSSL version to 1.0.2 as per OpenSSL's official documentation.

Fixes #8553
Closes #8556
2022-03-08 09:11:19 +01:00
Daniel Stenberg
471d5f44c5
wolfssl: fix compiler error without IPv6
Reported-by: Joseph Chen
Fixes #8550
Closes #8552
2022-03-07 09:47:26 +01:00
MAntoniak
2cd9837e02
connect: use TCP_KEEPALIVE only if TCP_KEEPIDLE is not defined
Closes #8539
2022-03-05 23:57:08 +01:00
Daniel Stenberg
1fa09990ab
misc: update copyright year ranges 2022-03-05 09:41:24 +01:00
Jay Satiro
592f114c67 h2h3: fix typo
Bug: https://github.com/curl/curl/issues/8381#issuecomment-1055440241
Reported-by: Michael Kaufmann
2022-03-01 13:09:02 -05:00
Daniel Stenberg
8a9d93e32b
libssh: fix include files and defines use for Windows builds
Reported-by: 梦终无痕
Bug: https://curl.se/mail/lib-2022-02/0131.html
Closes #8511
2022-02-26 23:44:53 +01:00
Daniel Stenberg
cdf37a53b3
quiche: remove two leftover debug infof() outputs 2022-02-25 11:13:49 +01:00
Tatsuhiro Tsujikawa
6e9373b5f4
ngtcp2: Reset dynbuf when it is fully drained
Reported-by: vl409 on github
Fixes #7351
Closes #8504
2022-02-24 16:56:33 +01:00
Stewart Gebbie
8a1fa3b364
hostip: avoid unused parameter error in Curl_resolv_check
When built without DNS-over-HTTP and without asynchronous resolvers,
neither the dns nor the data parameters are used.

That is Curl_resolv_check appears to call
Curl_resolver_is_resolved(data, dns). But,
with CURL_DISABLE_DOH without CURLRES_ASYNCH, the call is actually
elided via a macro definition.

This fix resolves the resultant: "unused parameter 'data'" error.

Closes #8505
2022-02-24 14:17:33 +01:00
Daniel Stenberg
0694037032
http2: move two infof calls to debug-h2-only
and remove a superflous one

Ref: https://github.com/curl/curl/discussions/8498
Closes #8502
2022-02-24 11:00:12 +01:00
Jean-Philippe Menil
145d0803bb
quiche: fix upload for bigger content-length
Signed-off-by: Jean-Philippe Menil <jpmenil@gmail.com>
Closes #8421
2022-02-24 09:34:37 +01:00
MAntoniak
e9e79622d0
vtls: fix socket check conditions
fix condition to check the second socket during associate and
disassociate connection

Closes #8493
2022-02-22 13:39:54 +01:00
Daniel Stenberg
999c2179a1
libssh2: don't typecast socket to int for libssh2_session_handshake
Since libssh2_socket_t uses SOCKET on windows which can be larger than
int.

Closes #8492
2022-02-21 17:17:25 +01:00
Jay Satiro
f7ba0eccf7 openssl: check if sessionid flag is enabled before retrieving session
Ideally, Curl_ssl_getsessionid should not be called unless sessionid
caching is enabled. There is a debug assertion in the function to help
ensure that. Therefore, the pattern in all vtls is basically:

  if(primary.sessionid) {lock(); Curl_ssl_getsessionid(...); unlock();}

There was one instance in openssl.c where sessionid was not checked
beforehand and this change fixes that.

Prior to this change an assertion would occur in openssl debug builds
during connection stage if session caching was disabled.

Reported-by: Jim Beveridge

Fixes https://github.com/curl/curl/issues/8472
Closes https://github.com/curl/curl/pull/8484
2022-02-21 03:23:47 -05:00
Jay Satiro
e0dc9765a7 multi: allow user callbacks to call curl_multi_assign
Several years ago a change was made to block user callbacks from calling
back into the API when not supported (recursive calls). One of the calls
blocked was curl_multi_assign. Recently the blocking was extended to the
multi interface API, however curl_multi_assign may need to be called
from within those user callbacks (eg CURLMOPT_SOCKETFUNCTION).

I can't think of any callback where it would be unsafe to call
curl_multi_assign so I removed the restriction entirely.

Reported-by: Michael Wallner

Ref: https://github.com/curl/curl/commit/b46cfbc
Ref: https://github.com/curl/curl/commit/340bb19

Fixes https://github.com/curl/curl/issues/8480
Closes https://github.com/curl/curl/pull/8483
2022-02-21 03:23:12 -05:00
MAntoniak
ccc2752ce8
ssl: reduce allocated space for ssl backend when FTP is disabled
Add assert() for the backend pointer in many places

Closes #8471
2022-02-21 08:39:55 +01:00