]> git.ipfire.org Git - thirdparty/curl.git/log
thirdparty/curl.git
2 years agoopenssl: store the CA after first send (ClientHello)
Stefan Eissing [Wed, 8 Feb 2023 09:39:03 +0000 (10:39 +0100)] 
openssl: store the CA after first send (ClientHello)

move Curl_ssl_setup_x509_store() call after the first send (ClientHello)
this gives time to parse CA anchors while waiting on the server reply

Ref: #10389
Closes #10432

2 years agoRELEASE-NOTES: synced
Daniel Stenberg [Wed, 8 Feb 2023 08:31:29 +0000 (09:31 +0100)] 
RELEASE-NOTES: synced

2 years agowolfssl: remove deprecated post-quantum algorithms
Anthony Hu [Tue, 7 Feb 2023 22:47:50 +0000 (17:47 -0500)] 
wolfssl: remove deprecated post-quantum algorithms

Closes #10440

2 years agomisc: fix spelling
John Bampton [Tue, 7 Feb 2023 21:50:36 +0000 (07:50 +1000)] 
misc: fix spelling

Closes #10437

2 years agoman pages: call the custom user pointer 'clientp' consistently
Daniel Stenberg [Tue, 7 Feb 2023 14:58:17 +0000 (15:58 +0100)] 
man pages: call the custom user pointer 'clientp' consistently

The variable had a few different names. Now try to use 'clientp'
consistently for all man pages using a custom pointer set by the
application.

Reported-by: Gerrit Renker
Fixes #10434
Closes #10435

2 years agovtls: infof using %.*s needs to provide the length as int
Daniel Stenberg [Tue, 7 Feb 2023 15:09:12 +0000 (16:09 +0100)] 
vtls: infof using %.*s needs to provide the length as int

Fixes a Coverity warning.

Closes #10436

2 years agovrls: addressing issues reported by coverity
Stefan Eissing [Tue, 7 Feb 2023 08:34:49 +0000 (09:34 +0100)] 
vrls: addressing issues reported by coverity

I believe the code was secure before this, but limiting the accepted
name length to what is used in the structures should help Coverity's
analysis.

Closes #10431

2 years agotool_operate: move the 'updated' variable
Daniel Stenberg [Tue, 7 Feb 2023 11:15:26 +0000 (12:15 +0100)] 
tool_operate: move the 'updated' variable

This was already done by Dan Fandrich in the previous PR but somehow I
lost that fixup.

Follow-up to 349c5391f2121e

2 years agotool_operate: Fix error codes during DOS filename sanitize
Dan Fandrich [Mon, 6 Feb 2023 18:40:59 +0000 (10:40 -0800)] 
tool_operate: Fix error codes during DOS filename sanitize

It would return CURLE_URL_MALFORMAT in an OOM condition.

Closes #10414

2 years agotool_operate: Fix error codes on bad URL & OOM
Dan Fandrich [Sun, 5 Feb 2023 00:05:35 +0000 (16:05 -0800)] 
tool_operate: Fix error codes on bad URL & OOM

curl would erroneously report CURLE_OUT_OF_MEMORY in some cases instead
of CURLE_URL_MALFORMAT. In other cases, it would erroneously return
CURLE_URL_MALFORMAT instead of CURLE_OUT_OF_MEMORY.  Add a test case to
test the former condition.

Fixes #10130
Closes #10414

2 years agosetopt: use >, not >=, when checking if uarg is larger than uint-max
Daniel Stenberg [Mon, 6 Feb 2023 16:37:52 +0000 (17:37 +0100)] 
setopt: use >, not >=, when checking if uarg is larger than uint-max

Closes #10421

2 years agovtls: fix failf() format argument type for %.*s handling
Daniel Stenberg [Mon, 6 Feb 2023 16:50:09 +0000 (17:50 +0100)] 
vtls: fix failf() format argument type for %.*s handling

Reported by Coverity

Closes #10422

2 years agoopenssl: fix "Improper use of negative value"
Daniel Stenberg [Mon, 6 Feb 2023 16:52:44 +0000 (17:52 +0100)] 
openssl: fix "Improper use of negative value"

By getting the socket first and returning error in case of bad socket.

Detected by Coverity.

Closes #10423

2 years agopackages: Remove Android.mk from makefile
Dan Fandrich [Mon, 6 Feb 2023 22:02:06 +0000 (14:02 -0800)] 
packages: Remove Android.mk from makefile

This was missed in commit #44141512

Ref: #10418

2 years agocurl_ws_send.3: clarify how to send multi-frame messages
Daniel Stenberg [Mon, 6 Feb 2023 10:24:03 +0000 (11:24 +0100)] 
curl_ws_send.3: clarify how to send multi-frame messages

2 years agows: fix multiframe send handling
Mike Duglas [Mon, 6 Feb 2023 09:34:46 +0000 (10:34 +0100)] 
ws: fix multiframe send handling

Fixes #10413
Closes #10420

2 years agounit2600: make sure numerical curl_easy_setopt sets long
Daniel Stenberg [Mon, 6 Feb 2023 08:52:33 +0000 (09:52 +0100)] 
unit2600: make sure numerical curl_easy_setopt sets long

Follow-up to 671158242db3203

Reported-by: Marcel Raad
Fixes #10410
Closes #10419

2 years agoGHA: move Slackware test into matrix
andy5995 [Sat, 4 Feb 2023 05:50:33 +0000 (23:50 -0600)] 
GHA: move Slackware test into matrix

Closes #10412

2 years agourlapi: fix part of conditional expression is always true: qlen
Pronyushkin Petr [Fri, 3 Feb 2023 06:35:15 +0000 (11:35 +0500)] 
urlapi: fix part of conditional expression is always true: qlen

Closes #10408

2 years agourl: fix part of conditional expression is always true
Pronyushkin Petr [Fri, 3 Feb 2023 06:26:30 +0000 (11:26 +0500)] 
url: fix part of conditional expression is always true

Closes #10407

2 years agoRELEASE-NOTES: synced
Daniel Stenberg [Mon, 6 Feb 2023 07:35:03 +0000 (08:35 +0100)] 
RELEASE-NOTES: synced

2 years agoGHA/macos.yml: bump to gcc-12
Philip H [Sun, 5 Feb 2023 10:53:19 +0000 (11:53 +0100)] 
GHA/macos.yml: bump to gcc-12

Closes #10415

2 years agopackages: remove Android, update README
Daniel Stenberg [Sun, 5 Feb 2023 22:29:49 +0000 (23:29 +0100)] 
packages: remove Android, update README

- Nobody builds curl for Android using this anymore
- Refreshed the README and converted to markdown

Reported-by: John Porter
Fixes #10416
Closes #10418

2 years agofopen: remove unnecessary assignment
Kvarec Lezki [Thu, 2 Feb 2023 11:16:01 +0000 (16:16 +0500)] 
fopen: remove unnecessary assignment

[CWE-1164] V1048: The '* tempname' variable was assigned the same value.

Ref: https://pvs-studio.com/en/docs/warnings/v1048/

Closes https://github.com/curl/curl/pull/10398

2 years agolibtest: add a sleep macro for Windows
Gisle Vanem [Fri, 13 Jan 2023 13:51:55 +0000 (14:51 +0100)] 
libtest: add a sleep macro for Windows

.. because sleep() is used in some libtests.

Closes https://github.com/curl/curl/pull/10295

2 years agohttp_aws_sigv4: remove typecasts from HMAC_SHA256 macro
Kvarec Lezki [Thu, 2 Feb 2023 11:56:01 +0000 (16:56 +0500)] 
http_aws_sigv4: remove typecasts from HMAC_SHA256 macro

V220: Suspicious sequence of types castings: memsize -> 32-bit integer -> memsize.

https://pvs-studio.com/en/docs/warnings/v220/

Closes #10400

2 years agomailmap: Thomas1664 on github
Daniel Stenberg [Fri, 3 Feb 2023 09:04:34 +0000 (10:04 +0100)] 
mailmap: Thomas1664 on github

2 years agoCURLOPT_WRITEFUNCTION.3: fix memory leak in example
Thomas1664 [Wed, 1 Feb 2023 12:59:25 +0000 (13:59 +0100)] 
CURLOPT_WRITEFUNCTION.3: fix memory leak in example

Closes #10390

2 years agodoh: ifdef IPv6 code
Kvarec Lezki [Thu, 2 Feb 2023 11:07:51 +0000 (16:07 +0500)] 
doh: ifdef IPv6 code

For disabled IPv6 a condition (conn->ip_version != CURL_IPRESOLVE_V4) is
always false. https://pvs-studio.com/en/docs/warnings/v560/

Closes #10397

2 years agourlapi: remove pathlen assignment
Daniel Stenberg [Thu, 2 Feb 2023 19:56:34 +0000 (20:56 +0100)] 
urlapi: remove pathlen assignment

"Value stored to 'pathlen' is never read"

Follow-up to 804d5293f89

Reported-by: Kvarec Lezki
Closes #10405

2 years agohttp: fix "part of conditional expression is always false"
Kvarec Lezki [Thu, 2 Feb 2023 11:37:42 +0000 (16:37 +0500)] 
http: fix "part of conditional expression is always false"

[CWE-570] V560: A part of conditional expression is always false: conn->bits.authneg.
[CWE-570] V560: A part of conditional expression is always false: conn->handler->protocol & (0 | 0).

https://pvs-studio.com/en/docs/warnings/v560/

Closes #10399

2 years agourlapi: skip the extra dedotdot alloc if no dot in path
Daniel Stenberg [Thu, 2 Feb 2023 10:15:47 +0000 (11:15 +0100)] 
urlapi: skip the extra dedotdot alloc if no dot in path

Saves an allocation for many/most URLs.

Updates test 1395 accordingly

Closes #10403

2 years agoconnections: introduce http/3 happy eyeballs
Stefan Eissing [Wed, 1 Feb 2023 16:13:12 +0000 (17:13 +0100)] 
connections: introduce http/3 happy eyeballs

New cfilter HTTP-CONNECT for h3/h2/http1.1 eyeballing.
- filter is installed when `--http3` in the tool is used (or
  the equivalent CURLOPT_ done in the library)
- starts a QUIC/HTTP/3 connect right away. Should that not
  succeed after 100ms (subject to change), a parallel attempt
  is started for HTTP/2 and HTTP/1.1 via TCP
- both attempts are subject to IPv6/IPv4 eyeballing, same
  as happens for other connections
- tie timeout to the ip-version HAPPY_EYEBALLS_TIMEOUT
- use a `soft` timeout at half the value. When the soft timeout
  expires, the HTTPS-CONNECT filter checks if the QUIC filter
  has received any data from the server. If not, it will start
  the HTTP/2 attempt.

HTTP/3(ngtcp2) improvements.
- setting call_data in all cfilter calls similar to http/2 and vtls filters
  for use in callback where no stream data is available.
- returning CURLE_PARTIAL_FILE for prematurely terminated transfers
- enabling pytest test_05 for h3
- shifting functionality to "connect" UDP sockets from ngtcp2
  implementation into the udp socket cfilter. Because unconnected
  UDP sockets are weird. For example they error when adding to a
  pollset.

HTTP/3(quiche) improvements.
- fixed upload bug in quiche implementation, now passes 251 and pytest
- error codes on stream RESET
- improved debug logs
- handling of DRAIN during connect
- limiting pending event queue

HTTP/2 cfilter improvements.
- use LOG_CF macros for dynamic logging in debug build
- fix CURLcode on RST streams to be CURLE_PARTIAL_FILE
- enable pytest test_05 for h2
- fix upload pytests and improve parallel transfer performance.

GOAWAY handling for ngtcp2/quiche
- during connect, when the remote server refuses to accept new connections
  and closes immediately (so the local conn goes into DRAIN phase), the
  connection is torn down and a another attempt is made after a short grace
  period.
  This is the behaviour observed with nghttpx when we tell it to  shut
  down gracefully. Tested in pytest test_03_02.

TLS improvements
- ALPN selection for SSL/SSL-PROXY filters in one vtls set of functions, replaces
  copy of logic in all tls backends.
- standardized the infof logging of offered ALPNs
- ALPN negotiated: have common function for all backends that sets alpn proprty
  and connection related things based on the negotiated protocol (or lack thereof).

- new tests/tests-httpd/scorecard.py for testing h3/h2 protocol implementation.
  Invoke:
    python3 tests/tests-httpd/scorecard.py --help
  for usage.

Improvements on gathering connect statistics and socket access.
- new CF_CTRL_CONN_REPORT_STATS cfilter control for having cfilters
  report connection statistics. This is triggered when the connection
  has completely connected.
- new void Curl_pgrsTimeWas(..) method to report a timer update with
  a timestamp of when it happend. This allows for updating timers
  "later", e.g. a connect statistic after full connectivity has been
  reached.
- in case of HTTP eyeballing, the previous changes will update
  statistics only from the filter chain that "won" the eyeballing.
- new cfilter query CF_QUERY_SOCKET for retrieving the socket used
  by a filter chain.
  Added methods Curl_conn_cf_get_socket() and Curl_conn_get_socket()
  for convenient use of this query.
- Change VTLS backend to query their sub-filters for the socket when
  checks during the handshake are made.

HTTP/3 documentation on how https eyeballing works.

TLS improvements
- ALPN selection for SSL/SSL-PROXY filters in one vtls set of functions, replaces
  copy of logic in all tls backends.
- standardized the infof logging of offered ALPNs
- ALPN negotiated: have common function for all backends that sets alpn proprty
  and connection related things based on the negotiated protocol (or lack thereof).

Scorecard with Caddy.
- configure can be run with `--with-test-caddy=path` to specify which caddy to use for testing
- tests/tests-httpd/scorecard.py now measures download speeds with caddy

pytest improvements
- adding Makfile to clean gen dir
- adding nghttpx rundir creation on start
- checking httpd version 2.4.55 for test_05 cases where it is needed. Skipping with message if too old.
- catch exception when checking for caddy existance on system.

Closes #10349

2 years agoCODEOWNERS: remove the peeps mentioned as CI owners
Daniel Stenberg [Wed, 1 Feb 2023 08:20:09 +0000 (09:20 +0100)] 
CODEOWNERS: remove the peeps mentioned as CI owners

These owners do not have the bandwidth/energy to do the reviews which
makes PRs stall and this ownership claim flawed. We can bring people
back when the situation is different.

Follow-up to c04c78ac87c4d46737934345a

Closes #10386

2 years agowrite-out.d: add 'since version' to %{header_json} documentation
Martin D'Aloia [Thu, 2 Feb 2023 01:27:23 +0000 (22:27 -0300)] 
write-out.d: add 'since version' to %{header_json} documentation

The documentation of `%{header_json}` missed to mention since which
version this variable for `--write-out` is present.

Based on commit https://github.com/curl/curl/commit/4133a69f2daa476bb
we can determine from the tags were this commit is present that the
first version to include it was `7.83.0`.
This could be also checked with:
`git tag --contains 4133a69f2daa476bb6d902687f1dd6660ea9c3c5`

Closes #10395

2 years agourlapi: avoid Curl_dyn_addf() for hex outputs
Daniel Stenberg [Tue, 31 Jan 2023 23:17:28 +0000 (00:17 +0100)] 
urlapi: avoid Curl_dyn_addf() for hex outputs

Inspired by the recent fixes to escape.c, we should avoid calling
Curl_dyn_addf() in loops, perhaps in particular when adding something so
simple as %HH codes - for performance reasons. This change makes the
same thing for the URL parser's two URL-encoding loops.

Closes #10384

2 years agourlapi: skip path checks if path is just "/"
Daniel Stenberg [Wed, 1 Feb 2023 07:26:08 +0000 (08:26 +0100)] 
urlapi: skip path checks if path is just "/"

As a miniscule optimization, treat a path of the length 1 as the same as
non-existing, as it can only be a single leading slash, and that's what
we do for no paths as well.

Closes #10385

2 years agoGHA/macos: use Xcode_14.0.1 for cmake builds
Philip H [Tue, 31 Jan 2023 14:57:41 +0000 (15:57 +0100)] 
GHA/macos: use Xcode_14.0.1 for cmake builds

Fixes #10356
Closes #10381

2 years agotls: fixes for wolfssl + openssl combo builds
Viktor Szakats [Wed, 1 Feb 2023 09:44:57 +0000 (09:44 +0000)] 
tls: fixes for wolfssl + openssl combo builds

1. Add `USE_WOLFSSL` to the TLS backend priority list in
   `lib/curl_ntlm_core.c`.

2. Fix `lib/curl_ntlm_core.h` to respect TLS backend priority, bringing
   it in sync with the above list and `lib/curl_ntlm_core.c` itself.

Reported-by: Mark Roszko
   Ref: https://github.com/curl/curl/issues/10321

3. Allow enabling both wolfSSL and OpenSSL at the same time in
   `lib/Makefile.mk` bringing this in line with cmake/autotools builds.
   Update logic to select the crypto-specific lib for `ngtcp2`, which
   supports a single TLS backend at the same time.

Closes #10322

2 years agoRELEASE-NOTES: synced
Daniel Stenberg [Wed, 1 Feb 2023 07:08:07 +0000 (08:08 +0100)] 
RELEASE-NOTES: synced

2 years agodocs/INSTALL: document how to use multiple TLS backends
Daniel Stenberg [Tue, 31 Jan 2023 22:29:23 +0000 (23:29 +0100)] 
docs/INSTALL: document how to use multiple TLS backends

And document how OpenSSL forks and wolfSSL cannot be used at the same
time.

Reported-by: Mark Roszko
Fixes #10321
Closes #10382

2 years agocookies: fp is always not NULL
Kvarec Lezki [Wed, 1 Feb 2023 06:00:03 +0000 (11:00 +0500)] 
cookies: fp is always not NULL

Closes #10383

2 years agoescape: use table lookup when adding %-codes to output
Daniel Stenberg [Tue, 31 Jan 2023 11:34:08 +0000 (12:34 +0100)] 
escape: use table lookup when adding %-codes to output

On my dev host, this code runs 7.8 times faster.

Closes #10377

2 years agounit2600: avoid error: ‘TEST_CASES’ defined but not used
Daniel Stenberg [Tue, 31 Jan 2023 13:41:15 +0000 (14:41 +0100)] 
unit2600: avoid error: â€˜TEST_CASES’ defined but not used

Follow-up to d55de24dce9d51

Closes #10379

2 years agoescape: hex decode with a lookup-table
Daniel Stenberg [Tue, 31 Jan 2023 08:36:07 +0000 (09:36 +0100)] 
escape: hex decode with a lookup-table

Makes the decoding 2.8 times faster in my tests.

Closes #10376

2 years agocf-socket: fix build error wo TCP_FASTOPEN_CONNECT
Daniel Stenberg [Tue, 31 Jan 2023 12:48:30 +0000 (13:48 +0100)] 
cf-socket: fix build error wo TCP_FASTOPEN_CONNECT

Follow-up to 5651a36d1a

Closes #10378

Reviewed-by: Stefan Eissing
2 years agoCI: add pytest github workflow to CI test/tests-httpd on a HTTP/3 setup
Stefan Eissing [Wed, 18 Jan 2023 10:11:41 +0000 (11:11 +0100)] 
CI: add pytest github workflow to CI test/tests-httpd on a HTTP/3 setup

Closes #10317

2 years agoconnect: fix strategy testing for attempts, timeouts and happy-eyeball
Stefan Eissing [Tue, 17 Jan 2023 14:58:49 +0000 (15:58 +0100)] 
connect: fix strategy testing for attempts, timeouts and happy-eyeball

- add test2600 as a unit test that triggers various connect conditions
  and monitors behaviour, available in a debug build only.

- this exposed edge cases in connect.c that have been fixed

Closes #10312

2 years agocf-socket: improvements in socket I/O handling
Stefan Eissing [Mon, 30 Jan 2023 15:03:00 +0000 (16:03 +0100)] 
cf-socket: improvements in socket I/O handling

- Curl_write_plain/Curl_read_plain have been eliminated. Last code use
  now uses Curl_conn_send/recv so that requests use conn->send/revc
  callbacks which defaults to cfilters use.
- Curl_recv_plain/Curl_send_plain have been internalized in cf-socket.c.
- USE_RECV_BEFORE_SEND_WORKAROUND (active on Windows) has been moved
  into cf-socket.c. The pre_recv buffer is held at the socket filter
  context.  `postponed_data` structures have been removed from
  `connectdata`.
- the hanger in HTTP/2 request handling was a result of read buffering
  on all sends and the multi handling is not prepared for this. The
  following happens:

   - multi preforms on a HTTP/2 easy handle
   - h2 reads and processes data
   - this leads to a send of h2 data
   - which receives and buffers before the send
   - h2 returns
   - multi selects on the socket, but no data arrives (its in the buffer already)
   the workaround now receives data in a loop as long as there is something in
   the buffer. The real fix would be for multi to change, so that `data_pending`
   is evaluated before deciding to wait on the socket.

io_buffer, optional, in cf-socket.c, http/2 sets state.drain if lower
filter have pending data.

This io_buffer is only available/used when the
-DUSE_RECV_BEFORE_SEND_WORKAROUND is active, e.g. on Windows
configurations. It also maintains the original checks on protocol
handler being HTTP and conn->send/recv not being replaced.

The HTTP/2 (nghttp2) cfilter now sets data->state.drain when it finds
out that the "lower" filter chain has still pending data at the end of
its IO operation. This prevents the processing from becoming stalled.

Closes #10280

2 years agoopenssl: only use CA_BLOB if verifying peer
Daniel Stenberg [Sun, 29 Jan 2023 10:32:33 +0000 (11:32 +0100)] 
openssl: only use CA_BLOB if verifying peer

Reported-by: Paul Groke
Bug: https://curl.se/mail/lib-2023-01/0070.html
Fixes #10351
Closes #10359

2 years agocurl_free.3: fix return type of `curl_free`
Thomas1664 on github [Mon, 30 Jan 2023 22:51:32 +0000 (23:51 +0100)] 
curl_free.3: fix return type of `curl_free`

Fixes #10373
Closes #10374

2 years agozuul: stop using this CI service
Daniel Stenberg [Mon, 30 Jan 2023 10:38:50 +0000 (11:38 +0100)] 
zuul: stop using this CI service

The important jobs have already transitioned. The remaining ones we can
skip for now.

Closes #10368

2 years agocopyright: remove "m4/ax_compile_check_sizeof.m4" from skips
Daniel Stenberg [Mon, 30 Jan 2023 10:47:07 +0000 (11:47 +0100)] 
copyright: remove "m4/ax_compile_check_sizeof.m4" from skips

and report if skipped files do not exist.

Follow-up to 9e11c2791fb960758 which removed the file.

Closes #10369

2 years agows: unstick connect-only shutdown
Daniel Stenberg [Mon, 30 Jan 2023 08:35:39 +0000 (09:35 +0100)] 
ws: unstick connect-only shutdown

As this mode uses blocking sockets, it must set them back to
non-blocking in disconnect to avoid the risk of getting stuck.

Closes #10366

2 years agows: remove bad assert
Daniel Stenberg [Mon, 30 Jan 2023 08:35:23 +0000 (09:35 +0100)] 
ws: remove bad assert

Reported-by: Stanley Wucw
Fixes #10347
Closes #10366

2 years agoopenssl: adapt to boringssl's error code type
Daniel Stenberg [Sun, 29 Jan 2023 11:26:18 +0000 (12:26 +0100)] 
openssl: adapt to boringssl's error code type

BoringSSL uses uint32_t, OpenSSL uses 'unsigned 'long'

Closes #10360

2 years agotool_operate: repair --rate
Daniel Stenberg [Sun, 29 Jan 2023 09:59:56 +0000 (10:59 +0100)] 
tool_operate: repair --rate

Regression from a55256cfb242 (7.87.0)
Reported-by: highmtworks on github
Fixes #10357
Closes #10358

2 years agodict: URL decode the entire path always
Daniel Stenberg [Sat, 28 Jan 2023 21:05:11 +0000 (22:05 +0100)] 
dict: URL decode the entire path always

Reported-by: dekerser on github
Fixes #10298
Closes #10354

2 years agovtls: do not null-check when we already assume cf-ctx exists
Stefan Eissing [Sun, 29 Jan 2023 13:10:20 +0000 (14:10 +0100)] 
vtls: do not null-check when we already assume cf-ctx exists

Fixes #10361
Closes #10362

2 years agoRELEASE-NOTES: synced
Daniel Stenberg [Sun, 29 Jan 2023 09:44:11 +0000 (10:44 +0100)] 
RELEASE-NOTES: synced

2 years agoCURLOPT_READFUNCTION.3: the callback 'size' arg is always 1
Daniel Stenberg [Sat, 28 Jan 2023 22:40:59 +0000 (23:40 +0100)] 
CURLOPT_READFUNCTION.3: the callback 'size' arg is always 1

Reported-by: Brian Green
Fixes #10328
Closes #10355

2 years agocopyright.pl: cease doing year verifications
Daniel Stenberg [Sat, 28 Jan 2023 10:22:35 +0000 (11:22 +0100)] 
copyright.pl: cease doing year verifications

As we have (mostly) removed the copyright year ranges.

Reported-by: Ryan Schmidt
Fixes #10345
Closes #10352

2 years agoCI: Work around a labeler bug that removes labels
Dan Fandrich [Sun, 29 Jan 2023 03:48:02 +0000 (19:48 -0800)] 
CI: Work around a labeler bug that removes labels

2 years agowrite-out.d: clarify Windows % symbol escaping
Jay Satiro [Mon, 23 Jan 2023 08:44:16 +0000 (03:44 -0500)] 
write-out.d: clarify Windows % symbol escaping

- Clarify that in Windows batch files the % must be escaped as %%, and
  at the command prompt it cannot be escaped which could lead to
  incorrect expansion.

Prior to this change the doc implied % must be escaped as %% in win32
always.

---

Examples showing how a write-out argument is received by curl:

If curl --write-out "%{http_code}" is executed in a batch file:
{http_code}

If curl --write-out "%%{http_code}" is executed in a batch file:
%{http_code}

If curl --write-out "%{http_code}" is executed from the command prompt:
%{http_code}

If curl --write-out "%%{http_code}" is executed from the command prompt:
%%{http_code}

At the command prompt something like "%{speed_download}%{http_code}"
would first be parsed by the command interpreter as %{speed_download}%
and would be expanded as environment variable {speed_download} if it
existed, though that's highly unlikely since Windows environment names
don't use braces.

---

Reported-by: Muhammad Hussein Ammari
Ref: https://github.com/bagder/everything-curl/pull/279

Fixes https://github.com/curl/curl/issues/10323
Closes https://github.com/curl/curl/pull/10337

2 years agoconnect: Fix build when not ENABLE_IPV6
Ryan Schmidt [Thu, 26 Jan 2023 01:30:23 +0000 (19:30 -0600)] 
connect: Fix build when not ENABLE_IPV6

Check for ENABLE_IPV6 before accessing AF_INET6. Fixes build failure
introduced in 1c5d8ac.

Closes https://github.com/curl/curl/pull/10344

2 years agocf-socket: Fix build when not HAVE_GETPEERNAME
Ryan Schmidt [Thu, 26 Jan 2023 01:05:02 +0000 (19:05 -0600)] 
cf-socket: Fix build when not HAVE_GETPEERNAME

Remove remaining references to conn and sockfd, which were removed from
the function signature when conninfo_remote was renamed to
conn_set_primary_ip in 6a8d7ef.

Closes https://github.com/curl/curl/pull/10343

2 years agovtls: Manage current easy handle in nested cfilter calls
Stefan Eissing [Mon, 23 Jan 2023 10:41:23 +0000 (11:41 +0100)] 
vtls: Manage current easy handle in nested cfilter calls

The previous implementation cleared `data` so the outer invocation lost
its data, which could lead to a crash.

Bug: https://github.com/curl/curl/issues/10336
Reported-by: Fujii Hironori
Closes https://github.com/curl/curl/pull/10340

2 years agoCI: Add even more paths to the labeler config (#10326)
Dan Fandrich [Thu, 26 Jan 2023 02:06:11 +0000 (18:06 -0800)] 
CI: Add even more paths to the labeler config (#10326)

2 years agoscripts: Fix Appveyor job detection in cijobs.pl
Dan Fandrich [Wed, 25 Jan 2023 23:30:59 +0000 (15:30 -0800)] 
scripts: Fix Appveyor job detection in cijobs.pl

The reorganization in #9769 broke the script. This should probably be
rewritten to use a YAML parser for better upward compatibility.

2 years agoCI: Add a few more paths to the labeler config (#10326)
Dan Fandrich [Wed, 25 Jan 2023 23:02:36 +0000 (15:02 -0800)] 
CI: Add a few more paths to the labeler config (#10326)

2 years agoCI: Switch the labeler event to pull_request_target
Dan Fandrich [Wed, 25 Jan 2023 18:42:17 +0000 (10:42 -0800)] 
CI: Switch the labeler event to pull_request_target

Otherwise, the action won't work on PRs from forked repositories
(#10326).

2 years agocmake: delete redundant macro definition `SECURITY_WIN32`
Viktor Szakats [Wed, 25 Jan 2023 11:55:57 +0000 (11:55 +0000)] 
cmake: delete redundant macro definition `SECURITY_WIN32`

Stop explicitly defining `SECURITY_WIN32` in CMake builds.

No other build systems define this macro, because it's unconditionally
defined in `lib/curl_sspi.h` already. This is the only curl source using
the `sspi.h` and `security.h` Win32 headers, and no other Win32 headers
need this macro.

Reviewed-by: Jay Satiro
Closes #10341

2 years agowinbuild: document that arm64 is supported
Fredrik [Sun, 22 Jan 2023 16:59:03 +0000 (17:59 +0100)] 
winbuild: document that arm64 is supported

Building an arm64 version works flawlessly with the VS arm64 toolset.

Closes https://github.com/curl/curl/pull/10332

2 years agoopenssl: don't log raw record headers
Cherish98 [Sun, 15 Jan 2023 18:15:23 +0000 (18:15 +0000)] 
openssl: don't log raw record headers

- Skip content type SSL3_RT_HEADER in verbose TLS output.

This commit prevents bogus and misleading verbose TLS header messages as
discussed in #10299.

Assisted-by: Peter Wu
Closes https://github.com/curl/curl/pull/10299

2 years agocmake: use list APPEND syntax for CMAKE_REQUIRED_DEFINITIONS
Marc Aldorasi [Mon, 9 Jan 2023 21:38:28 +0000 (16:38 -0500)] 
cmake: use list APPEND syntax for CMAKE_REQUIRED_DEFINITIONS

- Use list() instead of set() for CMAKE_REQUIRED_DEFINITIONS list since
  the former is clearer.

Closes https://github.com/curl/curl/pull/10272

2 years agoCI: Add a workflow to automatically label pull requests
Dan Fandrich [Fri, 20 Jan 2023 19:35:48 +0000 (11:35 -0800)] 
CI: Add a workflow to automatically label pull requests

The labeler language is quite restrictive right now so labels are added
quite conservatively, meaning that many PRs won't get labels when it's
"obvious" they should. It will still save some manual work on those
that it can label.

2 years agosystem.h: assume OS400 is always built with ILEC compiler
Jay Satiro [Fri, 20 Jan 2023 23:37:44 +0000 (18:37 -0500)] 
system.h: assume OS400 is always built with ILEC compiler

Prior to this change the OS400 types were only defined when __ILEC400__.
That symbol is only defined by IBM's C compiler and not their C++
compiler, which led to missing types when users on OS400 would compile a
C++ application that included curl.

The IBM C and C++ compilers are the only native compilers on the
platform.

Assisted-by: Jon Rumsey
Reported-by: John Sherrill
Fixes https://github.com/curl/curl/issues/10305
Closes https://github.com/curl/curl/pull/10329

2 years agocmake: Remove deprecated symbols check
xgladius [Tue, 17 Jan 2023 18:08:10 +0000 (12:08 -0600)] 
cmake: Remove deprecated symbols check

curl stopped use of CMAKE_USE_ as a prefix for its own build symbols in
2021 and added a check, meant to last 1 year, to fatally error on those
symbols. This commit removes that check.

Closes https://github.com/curl/curl/pull/10314

2 years agodocs: POSTFIELDSIZE must be set to -1 with read function
Dan Fandrich [Tue, 17 Jan 2023 22:21:07 +0000 (14:21 -0800)] 
docs: POSTFIELDSIZE must be set to -1 with read function

Reported-by: RanBarLavie on github
Closes #10313

2 years agovtls: fix hostname handling in filters
Stefan Eissing [Tue, 17 Jan 2023 10:21:29 +0000 (11:21 +0100)] 
vtls: fix hostname handling in filters

- Copy the hostname and dispname to ssl_connect_data.

Use a copy instead of referencing the `connectdata` instance since this
may get free'ed on connection reuse.

Reported-by: Stefan Talpalaru
Reported-by: sergio-nsk@users.noreply.github.com
Fixes https://github.com/curl/curl/issues/10273
Fixes https://github.com/curl/curl/issues/10309

Closes https://github.com/curl/curl/pull/10310

2 years agolib: fix typos
Sergey Bronnikov [Mon, 16 Jan 2023 16:49:57 +0000 (19:49 +0300)] 
lib: fix typos

Closes https://github.com/curl/curl/pull/10307

2 years agocurl_version_info.3: fix typo
Sergey Bronnikov [Mon, 16 Jan 2023 16:42:03 +0000 (19:42 +0300)] 
curl_version_info.3: fix typo

Closes https://github.com/curl/curl/pull/10306

2 years agoopenssl: Don't ignore CA paths when using Windows CA store (redux)
Jay Satiro [Thu, 5 Jan 2023 23:32:27 +0000 (18:32 -0500)] 
openssl: Don't ignore CA paths when using Windows CA store (redux)

.. and remove 'experimental' designation from CURLSSLOPT_NATIVE_CA.

This commit restores the behavior of CURLSSLOPT_NATIVE_CA so that it
does not override CURLOPT_CAINFO / CURLOPT_CAPATH, or the hardcoded
default locations. Instead the native Windows CA store can be used at
the same time.

---

This behavior was originally added over two years ago in abbc5d60
(#5585) but then 83393b1a (#7892) broke it over a year ago, I assume
inadvertently.

The CURLSSLOPT_NATIVE_CA feature was marked experimental and likely
rarely used.

Ref: https://github.com/curl/curl/pull/5585
Ref: https://github.com/curl/curl/pull/7892
Ref: https://curl.se/mail/lib-2023-01/0019.html

Closes https://github.com/curl/curl/pull/10244

2 years agoRELEASE-NOTES: synced
Daniel Stenberg [Fri, 13 Jan 2023 15:25:02 +0000 (16:25 +0100)] 
RELEASE-NOTES: synced

2 years agows: fix autoping handling
Daniel Stenberg [Fri, 13 Jan 2023 12:34:18 +0000 (13:34 +0100)] 
ws: fix autoping handling

Reported-by: Alexey Savchuk
Fixes #10289
Closes #10294

2 years agocurl_log: avoid printf() format checking with mingw
Daniel Stenberg [Fri, 13 Jan 2023 09:58:54 +0000 (10:58 +0100)] 
curl_log: avoid printf() format checking with mingw

Since it does not seem to like %zu and more

Follow-up to db91dbbf2

Fixes #10291
Closes #10292

2 years agotool_getparam: fix compiler warning when !HAVE_WRITABLE_ARGV
Daniel Stenberg [Thu, 12 Jan 2023 22:06:15 +0000 (23:06 +0100)] 
tool_getparam: fix compiler warning when !HAVE_WRITABLE_ARGV

Follow-up to 2ed0e1f70ee176edf3d2

Closes #10286

2 years agoopenssl: make the BIO_METHOD a local variable in the connection filter
Stefan Eissing [Thu, 12 Jan 2023 15:43:35 +0000 (16:43 +0100)] 
openssl: make the BIO_METHOD a local variable in the connection filter

This avoids UAF issues when `curl_global_cleanup()` is called before all
transfers have been completely handled. Unfortunately this seems to be a
more common pattern than we like.

Closes #10285

2 years agocurl: output warning at --verbose output for debug-enabled version
Daniel Stenberg [Wed, 11 Jan 2023 13:15:26 +0000 (14:15 +0100)] 
curl: output warning at --verbose output for debug-enabled version

+ a libcurl warning in the debug output

Assisted-by: Jay Satiro
Ref: https://curl.se/mail/lib-2023-01/0039.html
Closes #10278

2 years agosrc: add --http3-only 10264/head
Daniel Stenberg [Mon, 9 Jan 2023 14:00:34 +0000 (15:00 +0100)] 
src: add --http3-only

Warning: --http3 and --http3-only are subject to change again (or be
removed) before HTTP/3 support goes non-experimental.

Closes #10264

2 years agocurl.h: add CURL_HTTP_VERSION_3ONLY
Daniel Stenberg [Mon, 9 Jan 2023 13:59:27 +0000 (14:59 +0100)] 
curl.h: add CURL_HTTP_VERSION_3ONLY

As the previous CURL_HTTP_VERSION_3 option gets a slightly altered meaning.

Closes #10264

2 years agoconnect: fix access of pointer before NULL check
Daniel Stenberg [Thu, 12 Jan 2023 13:38:21 +0000 (14:38 +0100)] 
connect: fix access of pointer before NULL check

Detected by Coverity CID 1518992

Closes #10284

2 years agoeasyoptions: Fix header printing in generation script
Daniel Gustafsson [Wed, 11 Jan 2023 10:35:08 +0000 (11:35 +0100)] 
easyoptions: Fix header printing in generation script

The optiontable.pl script prints the header comment when generating
easyoptions.c, but it wasn't escaping all characters which jumbled the
curl ascii logo.  Fix by escaping.

Cloes #10275

2 years agotool_getparam: fix hiding of command line secrets
Harry Sintonen [Wed, 11 Jan 2023 10:39:33 +0000 (11:39 +0100)] 
tool_getparam: fix hiding of command line secrets

Closes #10276

2 years agotests: document the cfilter debug logging options
Stefan Eissing [Thu, 12 Jan 2023 09:46:21 +0000 (10:46 +0100)] 
tests: document the cfilter debug logging options

Closes #10283

2 years agocurl_log: for failf/infof and debug logging implementations
Stefan Eissing [Wed, 11 Jan 2023 09:30:42 +0000 (10:30 +0100)] 
curl_log: for failf/infof and debug logging implementations

 - new functions and macros for cfilter debugging
 - set CURL_DEBUG with names of cfilters where debug logging should be
   enabled
 - use GNUC __attribute__ to enable printf format checks during compile

Closes #10271

2 years agoRELEASE-NOTES: synced
Daniel Stenberg [Tue, 10 Jan 2023 12:54:29 +0000 (13:54 +0100)] 
RELEASE-NOTES: synced

2 years agomsh3: update to v0.6
Nick Banks [Sun, 8 Jan 2023 15:23:21 +0000 (15:23 +0000)] 
msh3: update to v0.6

Closes #10192

2 years agongtcp2: add CURLOPT_SSL_CTX_FUNCTION support for openssl+wolfssl
Stefan Eissing [Thu, 5 Jan 2023 16:01:42 +0000 (17:01 +0100)] 
ngtcp2: add CURLOPT_SSL_CTX_FUNCTION support for openssl+wolfssl

Using common method for SSL_CTX initialization of verfiy peer and CA
settings. This also provides X509_STORE sharing to become available for
ngtcp2+openssl HTTP/3.

Reported-by: violetlige on github
Fixes #10222
Closes #10239

2 years agocf-socket: make infof() call use %zu for size_t output
Daniel Stenberg [Tue, 10 Jan 2023 09:08:47 +0000 (10:08 +0100)] 
cf-socket: make infof() call use %zu for size_t output

Detected by Coverity CID 1518986 and CID 1518984

Closes #10268