Commit Graph

28799 Commits

Author SHA1 Message Date
Sean McArthur
be8d2b037d
hyper: use wakers for curl pause/resume
Closes #9070
2022-06-30 10:19:08 +02:00
Viktor Szakats
c7f53b7493
Makefile.m32: do not set the libcurl.rc debug flag [ci skip]
Delete `-DDEBUGBUILD=0` windres option. This was likely meant to
disable VS_FF_DEBUG in FILEFLAGS, but any assigned value enabled
it instead. Delete this unnecessary option and thus sync up with
how CMake compiles libcurl.rc by default.

Reviewed-by: Jay Satiro
Closes #9069
2022-06-30 08:14:29 +00:00
Daniel Stenberg
1dda49a1d3
curl.h: CURLE_CONV_FAILED is obsoleted
The last use was removed in 7.82.0. Updated some docs too to reflect the
current error code situation.

Closes #9067
2022-06-29 16:03:02 +02:00
Daniel Stenberg
f57f96dedc
curl: output warning when a cookie is dropped due to size
Dropped from the request, that is.

Closes #9064
2022-06-29 08:48:03 +02:00
Daniel Stenberg
8ab4499552
curl_mime_data.3: polish the wording
Closes #9063
2022-06-28 17:00:00 +02:00
Daniel Stenberg
a68074b5db
configure: check for the stdatomic.h header in configure
... and only set HAVE_ATOMIC if that header exists since we use
typedefes set in it.

Reported-by: Ryan Schmidt
Fixes #9059
Closes #9060
2022-06-28 16:58:12 +02:00
Daniel Stenberg
33fd57b8ff
easy_lock: fix the #ifdef conditional for ia32_pause
To work better with new and old clang compilers.

Reported-by: Ryan Schmidt
Assisted-by: Joshua Root

Fixes #9058
Closes #9062
2022-06-28 16:56:50 +02:00
Daniel Stenberg
50efb0822a
easy_lock: switch to using atomic_int instead of bool
To work with more compilers without requiring separate libs to
link. Like with gcc-12 for RISC-V on Linux.

Reported-by: Adam Sampson
Fixes #9055
Closes #9061
2022-06-28 12:45:47 +02:00
vvb2060
e631f6e10e
ngtcp2: fix incompatible function pointer types
Closes #9056
2022-06-28 00:02:36 +02:00
vvb2060
5a1a892565
easy_lock.h: use __asm__ instead of asm to fix build
Closes #9056
2022-06-28 00:02:26 +02:00
Samuel Henrique
aa34135e8f
libcurl-security.3: fix typo on macro "SH_"
During the packaging of the latest curl release for Debian, Lintian
warned me about a typo which causes the section name "Secrets in memory"
to not be rendered in the manpage due to "SH_" not being recognized as a
header.

Closes #9057
2022-06-27 23:59:18 +02:00
Daniel Stenberg
e2e7f54b7b
easy_lock.h: include sched.h if available to fix build
Patched-by: Harry Sintonen

Closes #9054
2022-06-27 10:59:52 +02:00
Daniel Stenberg
45ac4d0194
RELEASE-NOTES: synced
Version 7.84.0 release
2022-06-27 08:07:28 +02:00
Daniel Stenberg
4924875726
THANKS: contributors from 7.84.0 release notes 2022-06-27 08:07:28 +02:00
Daniel Stenberg
d64115d7bb
hsts: use Curl_fopen() 2022-06-26 11:04:02 +02:00
Daniel Stenberg
fab970a5d1
altsvc: use Curl_fopen() 2022-06-26 11:04:02 +02:00
Daniel Stenberg
20f9dd6bae
fopen: add Curl_fopen() for better overwriting of files
Bug: https://curl.se/docs/CVE-2022-32207.html
CVE-2022-32207
Reported-by: Harry Sintonen
Closes #9050
2022-06-26 11:03:57 +02:00
Daniel Stenberg
46f8911d39
test444: test many received Set-Cookie:
The amount of sent cookies in the test is limited to 80 because hyper
has its own strict limits in how many headers it allows to be received
which triggers at some point beyond this number.
2022-06-26 11:01:56 +02:00
Daniel Stenberg
ff2b2bcf68
test442/443: test cookie caps
442 - verify that only 150 cookies are sent
443 - verify that the cookie: header remains less than 8K in size
2022-06-26 11:01:01 +02:00
Daniel Stenberg
48d7064a49
cookie: apply limits
- Send no more than 150 cookies per request
- Cap the max length used for a cookie: header to 8K
- Cap the max number of received Set-Cookie: headers to 50

Bug: https://curl.se/docs/CVE-2022-32205.html
CVE-2022-32205
Reported-by: Harry Sintonen
Closes #9048
2022-06-26 11:00:48 +02:00
Daniel Stenberg
7230b19a2e
test387: verify rejection of compression chain attack 2022-06-25 22:14:32 +02:00
Daniel Stenberg
3a09fbb7f2
content_encoding: return error on too many compression steps
The max allowed steps is arbitrarily set to 5.

Bug: https://curl.se/docs/CVE-2022-32206.html
CVE-2022-32206
Reported-by: Harry Sintonen
Closes #9049
2022-06-25 22:14:21 +02:00
Daniel Stenberg
6ecdf5136b
krb5: return error properly on decode errors
Bug: https://curl.se/docs/CVE-2022-32208.html
CVE-2022-32208
Reported-by: Harry Sintonen
Closes #9051
2022-06-25 22:13:09 +02:00
Daniel Stenberg
2b67a0a112
easy_lock.h: remove use of the deprecated ATOMIC_VAR_INIT macro
clang 14 warns about its use. It is being deprecated by the working
group for the programming language C: "The macro ATOMIC_VAR_INIT is
basically useless for the purpose for which it was designed"

Ref: https://www.open-std.org/jtc1/sc22/wg14/www/docs/n2886.htm

Reported-by: Tatsuhiro Tsujikawa
Fixes #9041
Closes #9042
2022-06-23 16:17:09 +02:00
Stefan Eissing
8135d420ee
ngtcp2: avoid supplying 0 length msg_control to sendmsg()
Testing on macOS 12.4, sendmsg() fails with EINVAL when a msg_control
buffer is provided in sengmsg(), even though msg_controllen was set to
0.

Initialize msg.msg_controllen just as needed and also perform the size
assertion only when needed.

Closes #9039
2022-06-23 16:11:32 +02:00
Tom Eccles
71bbabb167
ftp: restore protocol state after http proxy CONNECT
connect_init() (lib/http_proxy.c) swaps out the protocol state while
working on the proxy connection, this is then restored by
Curl_connect_done() after the connection completes.

ftp_do_more() extracted the protocol state pointer to a local variable
at the start of the function then calls Curl_proxy_connect(). If the proxy
connection completes, Curl_proxy_connect() will call Curl_connect_done()
(via Curl_proxyCONNECT()), which restores data->req.p to point to the ftp
protocol state instead of the http proxy protocol state, but the local
variable in ftp_do_more still pointed to the old value.

Ultimately this meant that the state worked on by ftp_do_more() was the
http proxy state not the ftp state initialised by ftp_connect(), but
subsequent calls to any ftp_ function would use the original state.

For my use-case, the visible consequence was that ftp->downloadsize was
never set and so downloaded data was never returned to the application.

This commit updates the ftp protocol state pointer in ftp_do_more() after
Curl_proxy_connect() returns, ensuring that the correct state pointer is
used.

Fixes #8737
Closes #9043
2022-06-23 16:07:20 +02:00
Jay Satiro
f3a7781594 THANKS: add contributor missing from aea8ac1
aea8ac1 fixed #8980 which was reported by Sgharat on github, but that
info was not included in the commit message.
2022-06-23 04:06:23 -04:00
Jay Satiro
3733717509 curl_setup: include _mingw.h
Prior to this change _mingw.h needed to be included in each unit before
evaluating __MINGW{32,64}_xxx_VERSION macros since it defines them. It
is included only in some mingw headers (eg stdio.h) and not others
(eg windows.h) so it's better to explicitly include it once.

Closes https://github.com/curl/curl/pull/9036
2022-06-23 03:34:51 -04:00
Viktor Szakats
70adb81c6f
rand: stop detecting /dev/urandom in cross-builds
- Prevent CMake to auto-detect /dev/urandom when cross-building.
  Before this patch, it would detect it in a cross-build scenario on *nix
  hosts with this device present. This was a problem for example with
  Windows builds, but it could affect any target system with this device
  missing. This also syncs detection behaviour with autotools, which also
  skips it for cross-builds.
- Also, make sure to never use the file RANDOM_FILE as entropy for libcurl's
  fallback random number generator on Windows. Windows does not have the
  concept of reading a random stream from a filename, nor any guaranteed
  non-world-writable path on disk. With this, a manual misconfiguration or
  an overeager auto-detection can no longer result in a user-controllable
  seed source.

Reviewed-by: Daniel Stenberg
Closes #9038
2022-06-22 09:35:46 +00:00
Emanuele Torre
79f915e8ec
ci: avoid cmake -Hpath
This is an undocumented option similar to the `-Spath' option introduced
in cmake 3.13.
Replace all instances of `-Hpath' with `-Spath' in macos workflow.
Replace `-H. -Bpath' with `mkdir path; cd ./path; cmake ..' in zuul
scripts since it runs an older version of cmake.

Fixes #9008
Closes #9014
2022-06-22 10:43:07 +02:00
Daniel Stenberg
8b83fbfe82
INTERNALS: bring back the "Library symbols" section
Most contents was moved, but this text should remain here.

Follow-up to: d324ac8
Reported-by: Viktor Szakats
Bug: https://github.com/curl/curl/pull/9027#discussion_r903382326
Closes #9037
2022-06-22 10:38:03 +02:00
Viktor Szakats
6c501cb624
Makefile.m32: stop forcing XP target with ipv6 enabled [ci skip]
Since this [1] commit in 2011, `_WIN32_WINNT` was set fixed to Windows
XP when the `-ipv6` option is selected. Maybe this was added to support
pre-XP Windows versions (?). These days libcurl builds fine for both XP
and post-XP versions with IPv6 support enabled. The relevance of pre-XP
version is also low by now. Other build methods also do not impose such
limitation for a similar configuration. So, drop this hard-wired
`_WIN32_WINNT` limit from `Makefile.m32`, thus building for the default
Windows version set by the compiler. This is Vista for recent MinGW
versions.

Old behaviour can be restored by setting this envvar:
export CURL_CFLAG_EXTRAS=-D_WIN32_WINNT=0x0501

[1] 98a61d8e2e

Closes #9035
2022-06-22 00:06:48 +00:00
Daniel Stenberg
c717975eaa
CONTRIBUTE: mention how we maintain REUSE compliance
for copyright and license information of all files stored in git

Closes #9032
2022-06-21 23:48:57 +02:00
Daniel Stenberg
d56dbf0a16
CURLOPT_ALTSVC.3: document the file format
Closes #9033
2022-06-21 23:48:00 +02:00
Jay Satiro
51e0b8fc60 runtests: add "threadsafe" to detected features
Follow-up to recent commits which added thread-safety support.

Bug: https://github.com/curl/curl/pull/9012#discussion_r902018782
Reported-by: Marc Hörsken

Closes https://github.com/curl/curl/pull/9030
2022-06-21 03:17:56 -04:00
Daniel Stenberg
d5dc3629eb
easy: remove dead code
Follow-up from 5912da253b

Detected by Coverity (CID 1506519)

Closes #9029
2022-06-20 10:44:28 +02:00
Glenn Strauss
7f43f3dc59
transfer: upload performance; avoid tiny send
Append to the upload buffer when only small amount remains in buffer
rather than performing a separate tiny send to empty buffer.

Avoid degenerative upload behavior which might cause curl to send mostly
1-byte DATA frames after exhausing the h2 send window size

Related discussion: https://github.com/nghttp2/nghttp2/issues/1722

Signed-off-by: Glenn Strauss <gstrauss@gluelogic.com>
Closes #8965
2022-06-20 09:42:40 +02:00
Steve Holme
aea8ac14df
projects: fix third-party SSL library build paths for Visual Studio
The paths used by the build batch files were inconsistent with those in
the Visual Studio project files.

Closes #8991
2022-06-20 08:22:24 +02:00
Pierrick Charron
4bf2c231d7
urlapi: make curl_url_set(url, CURLUPART_URL, NULL, 0) clear all parts
As per the documentation :

> Setting a part to a NULL pointer will effectively remove that
> part's contents from the CURLU handle.

But currently clearing CURLUPART_URL does nothing and returns
CURLUE_OK. This change will clear all parts of the URL at once.

Closes #9028
2022-06-20 08:15:51 +02:00
Philip H
06fc958305
CI: bump FreeBSD 13.0 to 13.1
Signed-off-by: Philip H <47042125+pheiduck@users.noreply.github.com>
Closes #8815
2022-06-18 12:47:17 +02:00
Daniel Stenberg
dd7864da0f
RELEASE-NOTES: synced
and updated release date in RELEASE-PROCEDURE.md
2022-06-18 12:21:48 +02:00
divinity76
8dcbb0f191
CURLOPT_HTTPHEADER.3: improve comment in example
Closes #9025
2022-06-17 23:12:17 +02:00
Marc Hoersken
3084f87757
CI/azure: reduce flakiness by retrying install/prepare steps
Closes #9010
2022-06-16 20:37:06 +02:00
Marc Hoersken
0263c828a5
CI/cirrus: align Windows timeout with Azure CI at 120 minutes
Closes #9009
2022-06-16 20:33:43 +02:00
Jay Satiro
a8a4abb2ae vtls: make curl_global_sslset thread-safe
.. and update some docs to explain curl_global_* is now thread-safe.

Follow-up to 23af112 which made curl_global_init/cleanup thread-safe.

Closes https://github.com/curl/curl/pull/9016
2022-06-16 03:18:40 -04:00
Jay Satiro
9135275f86 curl_easy_pause.3: remove explanation of progress function
- Remove misleading text that says progress function "gets called at
  least once per second, even if the connection is paused."

The progress function behavior is more nuanced and the user is better
served reading the progress function doc rather than attempt to explain
it in the curl_easy_pause doc.

The progress function can only be called at least once per second if an
appropriate multi transfer function is called (eg curl_multi_perform) in
that time. For a paused transfer there may not be such a call. Rather
than explain this in detail in the curl_easy_pause doc, rely on the user
reading the CURLOPT_PROGRESSFUNCTION doc.

Ref: https://github.com/curl/curl/issues/8983

Closes https://github.com/curl/curl/pull/9015
2022-06-16 03:18:04 -04:00
Daniel Stenberg
ef22d5c42a
libssh: skip the fake-close when libssh does the right thing
Starting in libssh 0.10.0 ssh_disconnect() will no longer close our
socket. Instead it will be kept alive as we want it, and it is our
responsibility to close it later.

Ref: #8718
Ref: https://gitlab.com/libssh/libssh-mirror/-/merge_requests/240
Closes #9021
2022-06-15 23:43:35 +02:00
Daniel Stenberg
c828dc72e5
configure: warn about rustls being experimental
Right now a dozen test cases are disabled because they don't work with
rustls.

Closes #9019
2022-06-15 23:33:00 +02:00
Daniel Stenberg
f0f587d347
runtests: skip starting the ssh server if user name is lacking
Because the ssh server startup script *requires* a user name there's no
point in invoking it if no name was found.

Reported-by: Ricardo M. Correia
Ref: #9007
Closes #9013
2022-06-15 08:31:57 +02:00
Daniel Stenberg
4572489c59
copyright.pl: parse and use .reuse/dep5 for skips
Also scan skipped files to be able to find superfluous ignores, shown with -v.

Closes #9006
2022-06-14 14:07:12 +02:00