Commit Graph

27662 Commits

Author SHA1 Message Date
Jay Satiro
b0eda8dc6e strerror: use sys_errlist instead of strerror on Windows
- Change Curl_strerror to use sys_errlist[errnum] instead of strerror to
  retrieve the error message on Windows.

Windows' strerror writes to a static buffer and is not thread-safe.

Follow-up to 2f0bb86 which removed most instances of strerror in favor
of calling Curl_strerror (which calls strerror_r for other platforms).

Ref: https://github.com/curl/curl/pull/7685
Ref: https://github.com/curl/curl/commit/2f0bb86

Closes https://github.com/curl/curl/pull/7735
2021-09-17 03:44:54 -04:00
Daniel Stenberg
4a4617756a
dist: provide lib/.checksrc in the tarball
So that debug builds work (checksrc really)

Reported-by: Marcel Raad
Reported-by: tawmoto on github
Fixes #7733
Closes #7734
2021-09-16 22:55:09 +02:00
Daniel Stenberg
f2f3c8ce07
TODO: Improve documentation about fork safety
Closes #6968
2021-09-16 13:44:06 +02:00
Daniel Stenberg
da2598f823
hsts: CURLSTS_FAIL from hsts read callback should fail transfer
... and have CURLE_ABORTED_BY_CALLBACK returned.

Extended test 1915 to verify.

Reported-by: Jonathan Cardoso
Fixes #7726
Closes #7729
2021-09-16 12:36:12 +02:00
Daniel Stenberg
5b7aaefc07
test1184: disable
The test should be fine and it works for me repeated when run manually,
but clearly it causes CI failures and it needs more research.

Reported-by: RiderALT on github
Fixes #7725
Closes #7732
2021-09-16 12:16:48 +02:00
Daniel Stenberg
901804ef95
Curl_http2_setup: don't change connection data on repeat invokes
Regression from 3cb8a74867 (releasde in 7.79.0). That change moved
transfer oriented inits to before the check but also erroneously moved a
few connection oriented ones, which causes problems.

Reported-by: Evangelos Foutras
Fixes #7730
Closes #7731
2021-09-16 11:23:55 +02:00
Daniel Stenberg
9e4298faae
RELEASE-NOTES: synced
and bump to 7.79.1
2021-09-16 10:08:09 +02:00
Kamil Dudka
ab78d2c679 tests/sshserver.pl: make it work with openssh-8.7p1
... by not using options with no argument where an argument is required:

=== Start of file tests/log/ssh_server.log
curl_sshd_config line 6: no argument after keyword "DenyGroups"
curl_sshd_config line 7: no argument after keyword "AllowGroups"
curl_sshd_config line 10: Deprecated option AuthorizedKeysFile2
curl_sshd_config line 29: Deprecated option KeyRegenerationInterval
curl_sshd_config line 39: Deprecated option RhostsRSAAuthentication
curl_sshd_config line 40: Deprecated option RSAAuthentication
curl_sshd_config line 41: Deprecated option ServerKeyBits
curl_sshd_config line 45: Deprecated option UseLogin
curl_sshd_config line 56: no argument after keyword "AcceptEnv"
curl_sshd_config: terminating, 3 bad configuration options
=== End of file tests/log/ssh_server.log

=== Start of file log/sftp_server.log
curl_sftp_config line 33: Unsupported option "rhostsrsaauthentication"
curl_sftp_config line 34: Unsupported option "rsaauthentication"
curl_sftp_config line 52: no argument after keyword "sendenv"
curl_sftp_config: terminating, 1 bad configuration options
Connection closed.
Connection closed
=== End of file log/sftp_server.log

Closes #7724
2021-09-16 08:37:25 +02:00
Daniel Stenberg
54f6d836d8
hsts: handle unlimited expiry
When setting a blank expire string, meaning unlimited, curl would pass
TIME_T_MAX to getime_r() when creating the output, while on 64 bit
systems such a large value cannot be convetered to a tm struct making
curl to exit the loop with an error instead. It can't be converted
because the year it would represent doesn't fit in the 'int tm_year'
field!

Starting now, unlimited expiry is instead handled differently by using a
human readable expiry date spelled out as "unlimited" instead of trying
to use a distant actual date.

Test 1660 and 1915 have been updated to help verify this change.

Reported-by: Jonathan Cardoso
Fixes #7720
Closes #7721
2021-09-15 14:37:36 +02:00
Daniel Stenberg
d5a70e77b2
curl_multi_fdset: make FD_SET() not operate on sockets out of range
The VALID_SOCK() macro was made to only check for FD_SETSIZE if curl was
built to use select(), even though the curl_multi_fdset() function
always and unconditionally uses FD_SET and needs the check.

Reported-by: 0xee on github
Fixes #7718
Closes #7719
2021-09-15 14:34:00 +02:00
Daniel Stenberg
7aa79dce10
FAQ: add GOPHERS + curl works on data, not files 2021-09-15 14:33:05 +02:00
Daniel Stenberg
8e82f2a04a
RELEASE-NOTES: synced
For the 7.79.0 release
2021-09-14 09:02:52 +02:00
Daniel Stenberg
622d911921
THANKS: add contributors from 7.79.0 release cycle 2021-09-14 09:02:52 +02:00
Daniel Stenberg
352b07fcce
FAQ: add two dev related questions
8.1 Why does curl use C89?
  8.2 Will curl be rewritten?

Spell-checked-by: Paul Johnson
Closes #7715
2021-09-14 08:17:42 +02:00
Daniel Stenberg
331039ad52
zuul.d/jobs: disable three tests for *-openssl-disable-proxy
... as they mysteriously seem to permfail without being related to
proxy.

Closes #7714
2021-09-13 17:28:41 +02:00
Patrick Monnerat
8ef147c436
ftp,imap,pop3,smtp: reject STARTTLS server response pipelining
If a server pipelines future responses within the STARTTLS response, the
former are preserved in the pingpong cache across TLS negotiation and
used as responses to the encrypted commands.

This fix detects pipelined STARTTLS responses and rejects them with an
error.

CVE-2021-22947

Bug: https://curl.se/docs/CVE-2021-22947.html
2021-09-13 16:51:31 +02:00
Patrick Monnerat
364f174724
ftp,imap,pop3: do not ignore --ssl-reqd
In imap and pop3, check if TLS is required even when capabilities
request has failed.

In ftp, ignore preauthentication (230 status of server greeting) if TLS
is required.

Bug: https://curl.se/docs/CVE-2021-22946.html

CVE-2021-22946
2021-09-13 16:51:31 +02:00
z2_ on hackerone
43157490a5
mqtt: clear the leftovers pointer when sending succeeds
CVE-2021-22945

Bug: https://curl.se/docs/CVE-2021-22945.html
2021-09-13 16:51:31 +02:00
Daniel Stenberg
409a441240
zuul: bump the rustls job to use v0.7.2
... and add -lm when using a rust library.

Closes #7701
2021-09-13 16:45:48 +02:00
Daniel Stenberg
60bf9f528f
RELEASE-PROCEDURE: add release dates from now to 8.0.0 in 2023 2021-09-13 16:32:41 +02:00
Daniel Stenberg
408f61dc30
SECURITY-PROCESS: tweak a little to match current practices
Closes #7713
2021-09-13 16:26:30 +02:00
Daniel Stenberg
4a8fa48946
http_proxy: fix the User-Agent inclusion in CONNECT
It should not refer to the uagent string that is allocated and created
for the end server http request, as that pointer may be cleared on
subsequent CONNECT requests.

Added test case 1184 to verify.

Reported-by: T200proX7 on github
Fixes #7705
Closes #7707
2021-09-13 12:29:59 +02:00
Daniel Stenberg
8822ecf7a1
Curl_hsts_loadcb: don't attempt to load if hsts wasn't inited
Reported-by: Jonathan Cardoso
Fixes #7710
Closes #7711
2021-09-12 23:43:51 +02:00
Tatsuhiro Tsujikawa
24a7cbe9d2
ngtcp2: fix build with ngtcp2 and nghttp3
ngtcp2_conn_client_new and nghttp3_conn_client_new are now macros.
Check the wrapped functions instead.

ngtcp2_stream_close callback now takes flags parameter.

Closes #7709
2021-09-12 12:34:32 +02:00
Daniel Stenberg
dbe693e769
write-out.d: clarify size_download/upload
They show the number of "body" bytes transfered.
Fixes #7702
Closes #7706
2021-09-12 12:33:02 +02:00
Daniel Stenberg
3cb8a74867
http2: Curl_http2_setup needs to init stream data in all invokes
Thus function was written to avoid doing multiple connection data
initializations, which is fine, but since it also initiates stream
related data it is crucial that it doesn't skip those even if called
again for the same connection. Solved by moving the stream
initializations before the "doing-it-again" check.

Reported-by: Inho Oh
Fixes #7630
Closes #7692
2021-09-11 23:01:23 +02:00
Daniel Stenberg
e41e1b2a4d
url: fix compiler warning in no-verbose builds
Follow-up from 2f0bb864c1

Closes #7700
2021-09-10 19:10:14 +02:00
Daniel Stenberg
94da56269f
non-ascii: fix build errors from strerror fix
Follow-up to 2f0bb864c1

Closes #7697
2021-09-10 19:07:18 +02:00
Daniel Stenberg
2b99f5e02c
parse_args: redo the warnings for --remote-header-name combos
... to avoid the memory leak risk pointed out by scan-build.

Follow-up from 7a3e981781

Closes #7698
2021-09-10 17:02:21 +02:00
Daniel Stenberg
4fb5a643c8
ngtcp2: adapt to new size defintions upstream
Reviewed-by: Tatsuhiro Tsujikawa
Closes #7699
2021-09-10 16:52:29 +02:00
Daniel Stenberg
0cc8fc8825
rustls: add strerror.h include
Follow-up to 2f0bb864c1
2021-09-10 15:20:20 +02:00
Daniel Stenberg
ab2f27cf88
docs: the security list is reached at security at curl.se now
Also update the FAQ section a bit to encourage users to rather submit
security issues on hackerone than sending email.

Closes #7689
2021-09-10 10:51:12 +02:00
Marc Hoersken
60efeb1e0d
runtests: add option -u to error on server unexpectedly alive
Let's try to actually handle the server unexpectedly alive
case by first making them visible on CI builds as failures.

This is needed to detect issues with killing of the test
servers completely including nested process chains with
multiple PIDs per test server (including bash and perl).

On Windows/cygwin platforms this is especially helpful with
debugging PID mixups due to cygwin using its own PID space.

Reviewed-by: Daniel Stenberg
Closes #7180
2021-09-09 21:28:26 +02:00
Daniel Stenberg
1fbd822b64
opts docs: unify phrasing in NAME header
- avoid writing "set ..." or "enable/disable ..." or "specify ..."
  *All* options for curl_easy_setopt() are about setting or enabling
  things and most of the existing options didn't use that way of
  description.

- start with lowercase letter, unless abbreviation. For consistency.

- Some additional touch-ups

Closes #7688
2021-09-09 09:55:24 +02:00
Daniel Stenberg
fe7b64228d
strerror.h: remove the #include from files not using it 2021-09-09 07:53:42 +02:00
Daniel Stenberg
2f0bb864c1
lib: don't use strerror()
We have and provide Curl_strerror() internally for a reason: strerror()
is not necessarily thread-safe so we should always try to avoid it.

Extended checksrc to warn for this, but feature the check disabled by
default and only enable it in lib/

Closes #7685
2021-09-09 07:53:42 +02:00
Daniel Gustafsson
71f9a8fa6f cirrus: Add FreeBSD 13.0 job and disable sanitizer build
As alluded to the in the now removed comment, a 13.0 image became
available and is now ready to be used.

The sanitizer builds were running on the 12.1 image which since has
been removed from the config, leaving the builds not running at all.
When enabled it turns out that they don't actually work due to very
long timeouts in executing the tests, so keep the disabled for now
but a bit more controlled.

Closes #7592
2021-09-08 10:14:45 +02:00
Daniel Stenberg
d9b2d1d90f
copyrights: update copyright year ranges 2021-09-08 09:36:49 +02:00
Daniel Stenberg
a22b9980b9
RELEASE-NOTES: synced 2021-09-08 08:54:29 +02:00
Daniel Stenberg
a2f8ec038d
INTERNALS: c-ares has a new home: c-ares.org 2021-09-07 14:56:09 +02:00
Daniel Stenberg
3c40840ca7
docs: remove experimental mentions from HSTS and MQTT
Reported-by: Jonathan Cardoso
Bug: https://github.com/curl/curl/pull/6700#issuecomment-913792863
Closes #7681
2021-09-07 08:21:40 +02:00
Cao ZhenXiang
7a3e981781
curl: add warning for incompatible parameters usage
--continue-at - and --remote-header-name are known incompatible parameters

Closes #7674
2021-09-06 16:59:08 +02:00
git-bruh
033d15a6c5
examples/*hiperfifo.c: fix calloc arguments to match function proto
Closes #7678
2021-09-06 16:16:52 +02:00
Daniel Stenberg
db50fc6e95
INTERNALS: bump c-ares requirement to 1.16.0
Since ba904db070 we use ares_getaddrinfo, added in c-ares 1.16.0
2021-09-06 16:00:52 +02:00
Daniel Stenberg
eb2a5171da
curl: stop retry if Retry-After: is longer than allowed
If Retry-After: specifies a period that is longer than what fits within
--retry-max-time, then stop retrying immediately.

Added test 366 to verify.

Reported-by: Kari Pahula
Fixes #7675
Closes #7676
2021-09-06 14:46:45 +02:00
MAntoniak
37fb213a2e
mbedtls: avoid using a large buffer on the stack
Use dynamic memory allocation for the buffer used in checking "pinned
public key". The PUB_DER_MAX_BYTES parameter with default settings is
set to a value greater than 2kB.

Co-authored-by: Daniel Stenberg
Closes #7586
2021-09-06 10:02:08 +02:00
Daniel Stenberg
9829b94361
configure: make --disable-hsts work
The AC_ARG_ENABLE() macro itself uses a variable called
'enable_[option]', so when our script also used a variable with that
name for the purpose of storing what the user wants, it also
accidentally made it impossible to switch off the feature with
--disable-hsts. Fix this by renaming our variable.

Reported-by: Michał Antoniak
Fixes #7669
Closes #7672
2021-09-05 22:28:18 +02:00
Jay Satiro
c1f7a7b525 config.d: note that curlrc is used even when --config
Bug: https://github.com/curl/curl/pull/7666#issuecomment-912214751
Reported-by: Viktor Szakats

Closes https://github.com/curl/curl/pull/7667
2021-09-05 02:34:14 -04:00
Daniel Stenberg
e514e67c61
RELEASE-NOTES: synced 2021-09-04 11:42:05 +02:00
Daniel Stenberg
8fbdf8331e
test1173: check references to libcurl options
... that they refer to actual existing libcurl options.

Reviewed-by: Daniel Gustafsson
Closes #7656
2021-09-04 11:27:56 +02:00