]> git.ipfire.org Git - thirdparty/curl.git/log
thirdparty/curl.git
5 days agohttp_aws_sigv4: check the return value of curl_maprintf()
x2018 [Sun, 2 Nov 2025 05:28:34 +0000 (13:28 +0800)] 
http_aws_sigv4: check the return value of curl_maprintf()

Closes #9328

5 days agoGHA/dependabot: tidy-ups
Viktor Szakats [Sun, 2 Nov 2025 16:45:33 +0000 (17:45 +0100)] 
GHA/dependabot: tidy-ups

5 days agoGHA: bump the pip-dependencies group across 2 directories with 3 updates
dependabot[bot] [Sat, 1 Nov 2025 14:19:58 +0000 (14:19 +0000)] 
GHA: bump the pip-dependencies group across 2 directories with 3 updates

Closes #19321

5 days agoGHA/dependabot: fix update group names
Viktor Szakats [Sun, 2 Nov 2025 16:10:00 +0000 (17:10 +0100)] 
GHA/dependabot: fix update group names

5 days agoruntests: fix Perl warning after recent patch
Viktor Szakats [Sun, 2 Nov 2025 03:45:05 +0000 (04:45 +0100)] 
runtests: fix Perl warning after recent patch

```
Use of uninitialized value $hash{"crlf"} in string eq at tests/runtests.pl line 1406.
```

Follow-up to 6cf3d7b1b161bc45501d17b401225befe3c43943 #19318
Closes #19327

6 days agotests: avoid more hard-coded CRLFs in `protocol` sections
Viktor Szakats [Sat, 1 Nov 2025 00:28:55 +0000 (01:28 +0100)] 
tests: avoid more hard-coded CRLFs in `protocol` sections

- fix regex to not catch CR (from CRLF), in `PORT`, `EPRT`
  commands, allowing to use `crlf="yes"` more.
- add `crlf="headers"` mode for `protocol` sections.
  To call `subnewlines()` without its force option.
  This is the mode used in `data` sections when `crlf="yes"`.
  (This confusion may be subject to a future commit.)
- subnewlines: apply CRLF to `HEAD` and `CONNECT` HTTP requests.
- subnewlines: apply CRLF to RTSP requests.
- delete remaining empty `protocol` sections.

Reducing the number of `tests/data/test*`:
- CRLF newlines from 11325 to 10295. (119984 lines total)
- files with mixed newlines from 707 to 656. (1890 files total)

Follow-up to 4d2a05d3fe8ba4db9168b03057029ea5ce7dab77 #19284

Closes #19318

6 days agovtls: properly handle SSL shutdown timeout
x2018 [Sat, 1 Nov 2025 15:28:07 +0000 (23:28 +0800)] 
vtls: properly handle SSL shutdown timeout

Closes #19323

6 days agodoh: cleanup resources on error paths
x2018 [Fri, 31 Oct 2025 19:43:26 +0000 (03:43 +0800)] 
doh: cleanup resources on error paths

Closes #19310

6 days agohttpsrr: send HTTPS query to the right target
Daniel Stenberg [Sat, 1 Nov 2025 19:21:25 +0000 (20:21 +0100)] 
httpsrr: send HTTPS query to the right target

When the target host is on a different port than 443, the name
"_[port]._https.[name]" shall be used.

Fixes #19301
Reported-by: Gunni on github
Closes #19324

6 days agotests/data: delete stray CRLFs in markup lines
Viktor Szakats [Sat, 1 Nov 2025 03:02:13 +0000 (04:02 +0100)] 
tests/data: delete stray CRLFs in markup lines

Closes #19317

6 days agoCI: two display name tweaks
Viktor Szakats [Fri, 31 Oct 2025 23:47:21 +0000 (00:47 +0100)] 
CI: two display name tweaks

- use `AM`/`CM` where missing.
  In GHA/linux-old and AppVeyor CI.
  To denote autotools and CMake, and to align with rest of the jobs.

- rename `Old Linux` to `Linux Old` to align with the rest of Linux
  jobs on GitHub web views sorted by name.

Closes #19316

7 days agotests: replace standalone significant tabs with macro
Viktor Szakats [Fri, 31 Oct 2025 22:25:17 +0000 (23:25 +0100)] 
tests: replace standalone significant tabs with macro

Follow-up to d29f14b9cf0d38f3887b6eadc71af16903bc7f5b #19300

Closes #19315

7 days agotests/libtest: consistent variable naming for easy/multi/share handles
Viktor Szakats [Fri, 31 Oct 2025 17:36:43 +0000 (18:36 +0100)] 
tests/libtest: consistent variable naming for easy/multi/share handles

Follow-up to 928363f28ca533d743adcb70597c3e30917c6cbd #19299

Closes #19311

7 days agoscorecard: more params for upload tests
Stefan Eissing [Fri, 31 Oct 2025 15:44:38 +0000 (16:44 +0100)] 
scorecard: more params for upload tests

Add --upload-parallel=n for controlling upload parallelism. Make upload
processing similar to download processing.

Closes #19302

7 days agoschannel: properly close the certfile on error
x2018 [Fri, 31 Oct 2025 15:58:52 +0000 (23:58 +0800)] 
schannel: properly close the certfile on error

Closes #19304

7 days agoopenssl: combine all the x509-store flags
Daniel Stenberg [Fri, 31 Oct 2025 16:22:36 +0000 (17:22 +0100)] 
openssl: combine all the x509-store flags

... intead of overwriting the previous ones in ossl_populate_x509_store()

Pointed out by ZeroPath

Closes #19306

7 days agosectrust: fix verifystatus via sectrust
Stefan Eissing [Fri, 31 Oct 2025 16:57:53 +0000 (17:57 +0100)] 
sectrust: fix verifystatus via sectrust

When openssl does not verify the certificate, but apple sectrust
does, we also pass it the ocsp stapled response when configured and
available.

When openssl does not verify the cert chain, it will also not be able
to verify the ocsp stapling. Do not call it if sectrust is the
verifier of the cert chain.

Fixes #19307
Reported-by: Harry Sintonen
Closes #19308

7 days agoopenssl: fix the ocsp len arg to Curl_vtls_apple_verify
Daniel Stenberg [Fri, 31 Oct 2025 16:09:31 +0000 (17:09 +0100)] 
openssl: fix the ocsp len arg to Curl_vtls_apple_verify

If it has no data, pass in a zero.

Fixes #19303
Reported-by: Harry Sintonen
Closes #19305

7 days agospelling: fix new finds by typos-cli 1.39.0
Viktor Szakats [Fri, 31 Oct 2025 20:17:31 +0000 (21:17 +0100)] 
spelling: fix new finds by typos-cli 1.39.0

Closes #19312

7 days agotests/libtest/cli*: fix init/deinit, leaks, and more
Viktor Szakats [Fri, 31 Oct 2025 16:36:27 +0000 (17:36 +0100)] 
tests/libtest/cli*: fix init/deinit, leaks, and more

- add global init and deinit where missing.
- check global init success.
- improve cleaning up on error codepaths.
- drop `CLI_ERR()` macro, that could quit.
  Also make error messages tell the reason.

Closes #19309

7 days agotests: replace significant invisible spaces with macros
Viktor Szakats [Thu, 30 Oct 2025 23:55:13 +0000 (00:55 +0100)] 
tests: replace significant invisible spaces with macros

To make them explicit, visible, avoid being accidentally trimmed.
Also prevents Git warnings, e.g. on `git am`.

Also:
- runtests: add support for `%spc%` and `%tab%` macros.
- test59: delete non-significant line-ending space.
- spacecheck.pl: drop line-ending whitespace exception for tests.

Closes #19300

7 days agoexamples: consistent variable naming across examples
Daniel Stenberg [Fri, 31 Oct 2025 13:42:30 +0000 (14:42 +0100)] 
examples: consistent variable naming across examples

- 'CURL *' handles are called 'curl'
- 'CURLM *' handles are called 'multi'
- write callbacks are called 'write_cb'
- read callbacs are called 'read_cb'
- CURLcode variables are called 'res'

It makes the examples look and feel more consistent. It allows for
easier copy and pasting between examples.

Closes #19299

7 days agoRELEASE-NOTES: synced
Daniel Stenberg [Fri, 31 Oct 2025 15:28:13 +0000 (16:28 +0100)] 
RELEASE-NOTES: synced

7 days agoBINDINGS.md: point flaky URL to archive.org
Viktor Szakats [Sat, 25 Oct 2025 09:06:40 +0000 (11:06 +0200)] 
BINDINGS.md: point flaky URL to archive.org

To avoid linkcheck CI fails. It was failing regularly in the last months.

7 days agoscp/sftp: fix disconnect
Stefan Eissing [Fri, 31 Oct 2025 12:46:18 +0000 (13:46 +0100)] 
scp/sftp: fix disconnect

When a SCP/SFTP connection calls the protocol handler disconnect, it
required the connections *and* the easy handles SSH meta data to be
present. When the disconnect is called with an admin handle, the easy
meta data is not present, which prevented the shutdown to run.

The easy meta data is however not necessary to run the shutdown state
machine. Calling it with a NULL `sshp` is fine. To avoid any mixups,
check `sshp` in state operations that need it.

Fixes #19293
Reported-by: And-yW on github
Closes #19295

7 days agotest446, 1034, 1160: set US-ASCII encoding in XML header
Viktor Szakats [Fri, 31 Oct 2025 13:35:32 +0000 (14:35 +0100)] 
test446, 1034, 1160: set US-ASCII encoding in XML header

To match the ASCII-7 requirement for curl test data files.

Follow-up to 9243ed59b387a90940fa4a16ebfd99ad7d6c2f63 #17329
Follow-up to 87ba80a6df1dfd7ceaaa52352c9f23afff0ed513

Closes #19297

7 days agotest429: use `%repeat[]%`
Viktor Szakats [Thu, 30 Oct 2025 18:24:13 +0000 (19:24 +0100)] 
test429: use `%repeat[]%`

Follow-up to eb22e37060a8f3ad4fd9511db136c1edbb3b2a85 #19281
Follow-up to 55d4767876eae8678ab069082aa7fe8fe316a021 #19279

Closes #19296

7 days agotests: use `crlf=yes` attribute more
Viktor Szakats [Thu, 30 Oct 2025 14:46:17 +0000 (15:46 +0100)] 
tests: use `crlf=yes` attribute more

To make special newlines more explicit and visible.
Mostly in `<protocol>` sections, some in `<data*>` and `<upload>`.

Reducing the number of `tests/data/test*`:
- CRLF newlines from 21535 to 11337.
- files with mixed newlines from 1335 to 707.

Also delete empty `<protocol>` sections.

Closes #19284

7 days agoexamples: fix more potential resource leaks, and more
Viktor Szakats [Fri, 31 Oct 2025 03:22:42 +0000 (04:22 +0100)] 
examples: fix more potential resource leaks, and more

Also:
- delete dead code.
- sync `http2-download.c` and `http2-upload.c` sources.
- simplessl: fix constant expression.
- simplessl: avoid `expression is constant` VS2010 warning, drop pragma.
- replace large stack buffers with dynamic allocation.
- http2-download: fix to fill transfer number.

Some of these were pointed out by TIOBE scanner via Coverity 2025.3.0.

Closes #19292

7 days agoexamples/http2-serverpush: fix file handle leaks
Viktor Szakats [Fri, 31 Oct 2025 02:33:14 +0000 (03:33 +0100)] 
examples/http2-serverpush: fix file handle leaks

Also:
- tests/libtest/cli_h2_serverpush: re-sync formatting.

Previously fixed in tests based on a local clang-tidy v20 report.

Pointed out by TIOBE scanner via Coverity 2025.3.0.
Follow-up to 83a8818cfebe5f2a4bab5c9ddc55fd64b5629296 #17706

Closes #19291

7 days agoftp: fix leaking internal buffer `newhost` on error
Viktor Szakats [Fri, 31 Oct 2025 02:41:53 +0000 (03:41 +0100)] 
ftp: fix leaking internal buffer `newhost` on error

Pointed out by TIOBE scanner via Coverity 2025.3.0.

Closes #19290

7 days agotest1100: fix missing `<protocol>` section
Viktor Szakats [Thu, 30 Oct 2025 22:21:00 +0000 (23:21 +0100)] 
test1100: fix missing `<protocol>` section

To make it actually run. Also fix the NTLM expected result, also syncing
it with other tests.

Follow-up to e6b21d422e631a7c0cc81abf956af179b3b4c5e8 #6037

Closes #19288

8 days agotool/var: explain how the null termination byte is there
Daniel Stenberg [Thu, 30 Oct 2025 17:18:22 +0000 (18:18 +0100)] 
tool/var: explain how the null termination byte is there

Closes #19287

8 days agotests: use %repeat[] to make tests smaller (cont.)
Viktor Szakats [Thu, 30 Oct 2025 11:57:06 +0000 (12:57 +0100)] 
tests: use %repeat[] to make tests smaller (cont.)

tests: 46, 265, 304, 316, 397, 443, 551, 552, 559, 651, 742, 775, 1003,
1005, 1006, 1008, 1062, 1070, 1086, 1112, 1151, 1160, 1178, 1192, 1193,
1205, 1237, 3207.

Total `test*` size reduction: 2,395,537 -> 2,165,631 bytes.

Follow-up to 55d4767876eae8678ab069082aa7fe8fe316a021 #19279

Closes #19281

8 days agoGHA: update libressl/portable to v4.2.1
renovate[bot] [Thu, 30 Oct 2025 14:41:48 +0000 (14:41 +0000)] 
GHA: update libressl/portable to v4.2.1

Closes #19283

8 days agobase64: make base64_encode() error on too long input
Daniel Stenberg [Thu, 30 Oct 2025 10:32:15 +0000 (11:32 +0100)] 
base64: make base64_encode() error on too long input

The maximum size is set to 16MB.

It should not possible to call this function with this large input, but
this is a precaution to catch mistakes and replaces the earlier check on
architectures with small size_t.

Closes #19280

8 days agolib: reduce memcpy calls
Daniel Stenberg [Thu, 30 Oct 2025 13:42:03 +0000 (14:42 +0100)] 
lib: reduce memcpy calls

socks_gssapi: the malloc + memcpy was superflous and can be skipped

cleartext: avoid malloc + three memcpy with aprintf()

digest_sspi: use memdup0 instead of malloc + memcpy

vtls: use memdup0 instead of malloc + memcpy

Closes #19282

8 days agoconncache: prevent integer overflow in maxconnects calculation
x2018 [Tue, 28 Oct 2025 15:35:45 +0000 (23:35 +0800)] 
conncache: prevent integer overflow in maxconnects calculation

Closes #19271

8 days agopop3: check for CAPA responses case insensitively
Daniel Stenberg [Thu, 30 Oct 2025 07:44:51 +0000 (08:44 +0100)] 
pop3: check for CAPA responses case insensitively

Reported by ZeroPath

Closes #19278

8 days agotests: use %repeat[] to make tests smaller
Daniel Stenberg [Thu, 30 Oct 2025 07:53:09 +0000 (08:53 +0100)] 
tests: use %repeat[] to make tests smaller

Avoid putting huge chunks of repeated texts in test cases.

test3206, test1060, test1061 and test22

Closes #19279

8 days agoimap: fix custom FETCH commands to handle literal responses
TheBitBrine [Sun, 26 Oct 2025 04:39:02 +0000 (04:39 +0000)] 
imap: fix custom FETCH commands to handle literal responses

Custom IMAP commands using -X (e.g. 'FETCH 123 BODY[1]') were only
returning the first line of responses containing literals, instead of
the full multi-line body data.

The issue was that custom commands route through imap_perform_list()
and imap_state_listsearch_resp(), which didn't detect or handle IMAP
literal syntax {size}.

This commit adds literal detection to imap_state_listsearch_resp():
- Detects literal syntax {size} in untagged responses
- Writes the response header line containing the literal marker
- Handles any literal body data already in the pingpong buffer
- Sets up transfer layer to read remaining literal data from socket
- Configures maxdownload and transfer size to include header + body
- Initializes pp->overflow to 0 when no buffered data present
- Modifies imap_done() to transition to FETCH_FINAL for custom
  commands that set up downloads

Test 841 and 3206 verify.

Fixes #18847
Reported-by: BohwaZ
Bug: https://github.com/curl/curl/issues/18847
Closes #19246

9 days agohttp: fix `-Wunused-variable` in !alt-svc !proxy !ws builds
Viktor Szakats [Wed, 29 Oct 2025 13:18:11 +0000 (14:18 +0100)] 
http: fix `-Wunused-variable` in !alt-svc !proxy !ws builds

```
lib/http.c:2783:23: error: unused variable 'conn' [-Werror,-Wunused-variable]
 2783 |   struct connectdata *conn = data->conn;
      |                       ^~~~
1 error generated.
```

Closes #19276

9 days agohttp: fix `-Wunreachable-code` in !websockets !unity builds
Viktor Szakats [Wed, 29 Oct 2025 12:31:23 +0000 (13:31 +0100)] 
http: fix `-Wunreachable-code` in !websockets !unity builds

Also requires non-unity build. Possibly more non-default options are
necessary to reproduce. Seen with llvm/clang.

```
lib/http.c:1856:15: error: code will never be executed [-Werror,-Wunreachable-code]
 1856 |     httpreq = HTTPREQ_GET;
      |               ^~~~~~~~~~~
1 error generated.
```

Closes #19275

9 days agongtcp2: overwrite rate-limits defaults
Stefan Eissing [Wed, 29 Oct 2025 08:48:50 +0000 (09:48 +0100)] 
ngtcp2: overwrite rate-limits defaults

In pytests test_08 with the Caddy server, the new rate-limiting in
ngtcp2 did close the connection because it found "too many" stream data
packet repeats.

It is unclear if this is some Caddy issue or if the ngtcp2 implementaton
is wrong. Or if curl can do anything here.

Reported as https://github.com/ngtcp2/ngtcp2/issues/1850

This PR overwrites the ratelimit defaults in ngtcp2 with ten times
increased values. This makes the errors disappear on macOS.

Enable test_08_04/05 in CI again to see if there are any issues
to be found there. (We had those disabled before having parallel
pytests.)

Closes #19274

9 days agoopenldap/ldap; check for binary attribute case insensitively
Daniel Stenberg [Wed, 29 Oct 2025 08:11:09 +0000 (09:11 +0100)] 
openldap/ldap; check for binary attribute case insensitively

This bug was found with ZeroPath

Fixes #19240
Reported-by: Joshua Rogers
Closes #19273

9 days agoGHA: update pyspelling to v2.12
renovate[bot] [Mon, 27 Oct 2025 20:57:13 +0000 (20:57 +0000)] 
GHA: update pyspelling to v2.12

Closes #19262

9 days agoGHA: update reuse to v6.2.0
renovate[bot] [Mon, 27 Oct 2025 15:33:24 +0000 (15:33 +0000)] 
GHA: update reuse to v6.2.0

Closes #19257

9 days agossl-session-cache: check use on config and availability
Stefan Eissing [Mon, 27 Oct 2025 09:33:41 +0000 (10:33 +0100)] 
ssl-session-cache: check use on config and availability

Replace the check if a ssl session cache is configured with
a function checking if it is configured *and* if an ssl session
cache is available.

During normal operations, a session cache is always there, however
for "connect-only" transfers this might not be the case. When such
transfers receive new sessions/tickets, they need to silently
discard those and not fail.

Reported-by: Marc Aldorasi
Fixes https://github.com/curl/curl/issues/18983
Closes https://github.com/curl/curl/pull/19251

9 days agotool_operate: move the checks that skip ca cert detection
Jay Satiro [Sun, 19 Oct 2025 15:42:37 +0000 (11:42 -0400)] 
tool_operate: move the checks that skip ca cert detection

- Move the checks into the function that needs them, cacertpaths().

Prior to this change the caller made the determination whether to skip
calling cacertpaths for cert detection. However for posterity it is
better to have the checks in cacertpaths since other code could call it.

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

10 days agoRELEASE-NOTES: synced rc-8_17_0-3
Daniel Stenberg [Tue, 28 Oct 2025 22:33:16 +0000 (23:33 +0100)] 
RELEASE-NOTES: synced

10 days agotests: reduce max allowed allocations for four tests
Daniel Stenberg [Mon, 27 Oct 2025 16:18:25 +0000 (17:18 +0100)] 
tests: reduce max allowed allocations for four tests

and completely remove the check for one

Closes #19260

10 days agoschannel: handle Curl_conn_cf_send() errors better
Daniel Stenberg [Tue, 28 Oct 2025 08:05:25 +0000 (09:05 +0100)] 
schannel: handle Curl_conn_cf_send() errors better

Avoid a resource leak in the error path.

Reported-by: Joshua Rogers
Closes #19265

10 days agocookie: remove the temporary file on (all) errors
Daniel Stenberg [Tue, 28 Oct 2025 10:56:03 +0000 (11:56 +0100)] 
cookie: remove the temporary file on (all) errors

Fixes #19267
Reported-by: Harry Sintonen
Closes #19268

10 days agoCurl_resolv: explicitly set *entry to NULL at the top
x2018 [Tue, 28 Oct 2025 05:16:36 +0000 (13:16 +0800)] 
Curl_resolv: explicitly set *entry to NULL at the top

Closes #19263

10 days agosingleuse.pl: fix string warning
Daniel Stenberg [Tue, 28 Oct 2025 08:37:39 +0000 (09:37 +0100)] 
singleuse.pl: fix string warning

"Use of uninitialized value $unittests in concatenation on line 170"

Closes #19266

11 days agotests/server/dnsd: fix potential buffer overflow
Viktor Szakats [Mon, 27 Oct 2025 18:23:37 +0000 (19:23 +0100)] 
tests/server/dnsd: fix potential buffer overflow

When handling incoming DNS packets.

Reported-by: Joshua Rogers
Closes #19261

11 days agoheader: see-also --proxy-header and vice versa
Daniel Stenberg [Mon, 27 Oct 2025 15:40:52 +0000 (16:40 +0100)] 
header: see-also --proxy-header and vice versa

Closes #19259

11 days agoCURLOPT_SERVER_RESPONSE_TIMEOUT*: add default and see-also
Daniel Stenberg [Mon, 27 Oct 2025 15:37:03 +0000 (16:37 +0100)] 
CURLOPT_SERVER_RESPONSE_TIMEOUT*: add default and see-also

Also move the old name mention to a HISTORY section

Closes #19258

11 days agoTLS: IP address verification, extend test
Stefan Eissing [Mon, 27 Oct 2025 11:16:59 +0000 (12:16 +0100)] 
TLS: IP address verification, extend test

Change the test certificate to carry a altname 'dns:127.0.0.1' which
should *not* match in test_17_05_bad_ip_addr.

wolfSSL: since `wolfSSL_check_domain_name()` does not differentiate
between DNS and IP names, use if only for DNS names. For IP addresses,
get the peer certificate after the handshake and check that using
wolfSSL_X509_check_ip_asc().

Unfortunately, this succeeds where it should not, as wolfSSL internally
used the same check code for both cases. So, skip the test case until
wolfSSL fixes that.

Reported-by: Joshua Rogers
Closes #19252

11 days agopingpong: change repsonse timeout to one minute
Daniel Stenberg [Mon, 27 Oct 2025 13:16:26 +0000 (14:16 +0100)] 
pingpong: change repsonse timeout to one minute

It was previously two minutes by default and sometimes one minute.
Removes a struct field.

Closes #19254

11 days agosocks: properly maintain the status of 'done'
x2018 [Mon, 27 Oct 2025 14:29:38 +0000 (22:29 +0800)] 
socks: properly maintain the status of 'done'

Closes #19255

11 days agotest1802: test --proxy-headers and --headers setting user-agent
Daniel Stenberg [Sat, 25 Oct 2025 16:58:49 +0000 (18:58 +0200)] 
test1802: test --proxy-headers and --headers setting user-agent

11 days agohttp_proxy: fix adding custom proxy headers
Daniel Stenberg [Sat, 25 Oct 2025 16:48:36 +0000 (18:48 +0200)] 
http_proxy: fix adding custom proxy headers

Reported-by: Joshua Rogers
Fixes #19227
Closes #19239

11 days agowcurl: sync to +dev snapshot
Samuel Henrique [Sun, 26 Oct 2025 17:34:46 +0000 (17:34 +0000)] 
wcurl: sync to +dev snapshot

Closes #19247

11 days agoGHA/linux: make OpenLDAP local build smaller
Viktor Szakats [Mon, 27 Oct 2025 06:02:39 +0000 (07:02 +0100)] 
GHA/linux: make OpenLDAP local build smaller

By disabling its `slapd` component, that's not needed for curl.

Cache size: 2.7 -> 1.7 MB

Also merge two `make` invocations.

Closes #19250

12 days agopop3: fix CAPA response termination detection
TheBitBrine [Sun, 26 Oct 2025 03:15:07 +0000 (03:15 +0000)] 
pop3: fix CAPA response termination detection

The code was checking if a line starts with '.', which would
incorrectly match capability names starting with dots. Per RFC 2449,
the terminator must be a line containing only a single dot.

RFC 2449 also explicitly excludes '.' from valid capability name
starting characters, so this is purely theoretical, but the code
should match the spec.

Changed to check for exact match: line length of 3 with '.\r' or
length 2 with '.\n' to handle both CRLF and LF-only servers.

(Mistake detected with ZeroPath)

Fixes #19228
Reported-by: Joshua Rogers
Closes #19245

12 days agotest776: set as 'flaky'
Daniel Stenberg [Sat, 25 Oct 2025 20:28:01 +0000 (22:28 +0200)] 
test776: set as 'flaky'

I have not figured out why, but having this test failing in CI every so often
is disturbing.

Reported-by: Viktor Szakatas
Fixes #19235
Closes #19243

12 days agosocks_gssapi: also reset buffer length after free
Viktor Szakats [Mon, 20 Oct 2025 20:23:39 +0000 (22:23 +0200)] 
socks_gssapi: also reset buffer length after free

To mimic this behavior of the previously used `gss_release_buffer()`.

Some or all of these zero assignments may be redundant.

Follow-up to e7818999dbeff5acb00c032860d2259a1c5f9c5b #19018

Closes #19167

12 days agoECH.md: make OpenSSL branch clone instructions work
Viktor Szakats [Sat, 25 Oct 2025 08:45:39 +0000 (10:45 +0200)] 
ECH.md: make OpenSSL branch clone instructions work

Closes #19237

13 days agoGHA: update nghttp2/nghttp2 to v1.68.0
renovate[bot] [Sat, 25 Oct 2025 09:42:00 +0000 (09:42 +0000)] 
GHA: update nghttp2/nghttp2 to v1.68.0

Closes #19238

13 days agoRELEASE-NOTES: synced
Daniel Stenberg [Sat, 25 Oct 2025 15:55:58 +0000 (17:55 +0200)] 
RELEASE-NOTES: synced

13 days agoschannel: lower the maximum allowed time to block to 7 seconds
Daniel Stenberg [Thu, 23 Oct 2025 14:25:24 +0000 (16:25 +0200)] 
schannel: lower the maximum allowed time to block to 7 seconds

During TLS renegotiation, the schannel_recv_renegotiate() function is
allowed to block for a short while. Reduce the maximum allowed time to
block from 10 minutes down to 7 seconds.

Closes #19205

2 weeks agoGHA/windows: delete MSYS2 ARM64 workaround
Viktor Szakats [Fri, 24 Oct 2025 21:21:27 +0000 (23:21 +0200)] 
GHA/windows: delete MSYS2 ARM64 workaround

Follow-up to 5249b99a70be6d5689092e3cbe1f938e98124569 #18438
Follow-up to c4e776cafa22533fe8a6113a39f6a9f624e8c467 #17103

Closes #19234

2 weeks agoGHA: bump GitHub artifact Actions
renovate[bot] [Fri, 24 Oct 2025 20:56:14 +0000 (20:56 +0000)] 
GHA: bump GitHub artifact Actions

- actions/download-artifact: v5.0.0 -> v6.0.0
- actions/upload-artifact: v4.6.2 -> v5.0.0

Closes #19232

2 weeks agolib: delete unused header includes
Viktor Szakats [Fri, 24 Oct 2025 17:21:18 +0000 (19:21 +0200)] 
lib: delete unused header includes

`escape.h`, `getinfo.h`, `strdup.h`.

Tested OK with full non-unity CI run.

Closes #19231

2 weeks agotidy-up: miscellaneous
Viktor Szakats [Tue, 7 Oct 2025 10:49:02 +0000 (12:49 +0200)] 
tidy-up: miscellaneous

- cmake/Find*: make double quotes consistent.
- drop redundant parenthesis.
- GHA/checksrc: sync a step name with others.
- whitespace.

Closes #19233

2 weeks agocurl_ngtcp2: fix `-Wunreachable-code` with H3 !verbose !unity clang
Viktor Szakats [Fri, 24 Oct 2025 19:12:37 +0000 (21:12 +0200)] 
curl_ngtcp2: fix `-Wunreachable-code` with H3 !verbose !unity clang

Not tested in default CI.

macOS / CM clang OpenSSL gsasl rtmp AppleIDN SecTrust +examples,
macOS / CM llvm@18 OpenSSL gsasl rtmp AppleIDN SecTrust +examples:
```
lib/vquic/curl_ngtcp2.c:530:5: error: code will never be executed [-Werror,-Wunreachable-code]
  530 |     const ngtcp2_transport_params *rp;
      |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1 error generated.
```
Ref: https://github.com/curl/curl/actions/runs/18787154442/job/53608230871?pr=19225#step:11:183

Confirmed fixed via #19225
Closes #19226

2 weeks agolib: delete unused crypto header includes
Viktor Szakats [Fri, 24 Oct 2025 16:46:50 +0000 (18:46 +0200)] 
lib: delete unused crypto header includes

Tested OK with full non-unity CI run.

Closes #19225

2 weeks agoautotools: merge `if`s in GnuTLS/OpenSSL feature detection
Viktor Szakats [Fri, 24 Oct 2025 16:03:52 +0000 (18:03 +0200)] 
autotools: merge `if`s in GnuTLS/OpenSSL feature detection

Closes #19222

2 weeks agovtls: drop duplicate `CURL_SHA256_DIGEST_LENGTH` definition
Viktor Szakats [Fri, 24 Oct 2025 16:41:20 +0000 (18:41 +0200)] 
vtls: drop duplicate `CURL_SHA256_DIGEST_LENGTH` definition

Closes #19224

2 weeks agombedtls: fix building with sha-256 missing from PSA
Viktor Szakats [Fri, 24 Oct 2025 16:34:35 +0000 (18:34 +0200)] 
mbedtls: fix building with sha-256 missing from PSA

Fixing:
```
lib/vtls/mbedtls.c:1505:10: error: call to undeclared function 'Curl_sha256it'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
 1505 |   return Curl_sha256it(sha256sum, input, inputlen);
      |          ^
1 error generated.
```

with mbedTLS configuration:
```
tf-psa-crypto/scripts/config.py unset PSA_WANT_ALG_SHA_256
tf-psa-crypto/scripts/config.py unset PSA_WANT_ALG_TLS12_ECJPAKE_TO_PMS
tf-psa-crypto/scripts/config.py unset MBEDTLS_LMS_C
```

Follow-up to 3a305831d1a9d10b2bfd4fa3939ed41275fee7f7 #19077

Closes #19223

2 weeks agoGHA/dependabot: group updates
Viktor Szakats [Fri, 24 Oct 2025 12:57:52 +0000 (14:57 +0200)] 
GHA/dependabot: group updates

To avoid update spam and PR that can't be applied on top of each other.

Ref: #19217 #19218 #19219

Closes #19220

2 weeks agoGHA: bump pips
dependabot[bot] [Fri, 24 Oct 2025 12:02:18 +0000 (12:02 +0000)] 
GHA: bump pips

- cryptography from 46.0.2 to 46.0.3 in /tests
- filelock from 3.19.1 to 3.20.0 in /tests
- psutil from 7.1.0 to 7.1.1 in /tests

Closes #19217
Closes #19218
Closes #19219

2 weeks agoGHA/checksrc: extend zizmor to Dependabot, set cooldown periods
Viktor Szakats [Fri, 24 Oct 2025 11:49:51 +0000 (13:49 +0200)] 
GHA/checksrc: extend zizmor to Dependabot, set cooldown periods

Closes #19216

2 weeks agoGHA/fuzz: try fixing concurrency group deadlock
Viktor Szakats [Fri, 24 Oct 2025 11:44:44 +0000 (13:44 +0200)] 
GHA/fuzz: try fixing concurrency group deadlock

```
Fuzzer
Canceling since a deadlock was detected for concurrency group:
'Fuzzer-82fa9862dfa3083d4014d6dcfb721a7278e66f0b' between a top level workflow and 'Fuzzing'
```
https://github.com/curl/curl/actions/runs/18778617351

Follow-up to 82fa9862dfa3083d4014d6dcfb721a7278e66f0b #19215

2 weeks agoGHA: set `concurrency:` where missing
Viktor Szakats [Fri, 24 Oct 2025 11:02:55 +0000 (13:02 +0200)] 
GHA: set `concurrency:` where missing

To silence zizmor 1.16.0 warnings.

Also:
- http3-linux: replace hard-coded workflow name with variable.
  Follow-up to a8174176b5425c5692b55b78e40aef3a2331155f #13841
- codeql: set `cancel-in-progress: true`.
  zizmor apparently does not allow `false` in pedantic mode anymore:
  https://github.com/zizmorcore/zizmor/pull/1227
- codeql: sync concurrency setting with the rest of the jobs.
  (I'm not sure this is correct, or why it was previously special-cased.)

Expressions used (before and after this patch):
- `group: ${{ github.workflow }}-${{ github.event.sha }}-${{ github.event.target_url }}`
  for GHA/appveyor-status.
- `group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }}`
  for all the rest.

Ref: https://github.com/curl/curl/actions/runs/18776245057/job/53571438139?pr=19209

Closes #19215

2 weeks agodes: merge curl_des into `curl_ntlm_core.c`
Viktor Szakats [Fri, 24 Oct 2025 00:28:46 +0000 (02:28 +0200)] 
des: merge curl_des into `curl_ntlm_core.c`

`curl_des.c` contained a single, short, function
`Curl_des_set_odd_parity()`, called from `curl_ntlm_core.c` alone.

Move it there, and define it only when needed.

Follow-up to 300876a7a62ff598c3be359e45a00b79cf9944ad
Follow-up to 8cc70db2db5f58e519a1bdfed266ca6514013145

Closes #19209

2 weeks agoNTLM: disable if DES support missing from OpenSSL or mbedTLS
Viktor Szakats [Thu, 23 Oct 2025 20:08:53 +0000 (22:08 +0200)] 
NTLM: disable if DES support missing from OpenSSL or mbedTLS

Make autotools and cmake detect DES support in OpenSSL and mbedTLS.
Forward feature macros to C and omit NTLM from the feature preview list.
Use the feature macros in source. This ensure that `-V` output matches
the preview.

OpenSSL doesn't support DES when built with `no-des` or `no-deprecated`.
mbedTLS 4.x no longer supports it, and it's possible to disable it in
<4 with `scripts/config.py unset MBEDTLS_DES_C`.

Before this patch this worked for
mbedTLS 4 only, and with a regression for pending PR #16973.

Also:

- drop NTLM feature check from `curl_setup.h` in favour of autotools/
  cmake feature macros. This makes `curl_setup.h` no longer need
  to include an mbedTLS header, which in turn makes tests/server build
  without depending on mbedTLS.
  Fixing, in #16973:
  ```
  In file included from tests/server/first.h:40,
                   from bld/tests/server/servers.c:3:
  lib/curl_setup.h:741:10: fatal error: mbedtls/version.h: No such file or directory
    741 | #include <mbedtls/version.h>
        |          ^~~~~~~~~~~~~~~~~~~
  ```
  Ref: https://github.com/curl/curl/actions/runs/18689537893/job/53291322012?pr=16973
  Ref: #19181 (initial fix idea)
  Follow-up to 3a305831d1a9d10b2bfd4fa3939ed41275fee7f7 #19077

- move back mbedTLS header include and version check from
  `curl_setup.h` to each source which consumes mbedTLS.

- GHA/http3-linux: drop workaround that disabled NTLM for
  `no-deprecated` OpenSSL builds.
  Follow-up to 006977859dcc4b8670878bd669276d778a2715bb #12384

- curl_ntlm_core: drop pointless macro `CURL_NTLM_NOT_SUPPORTED`.
  Follow-up to 006977859dcc4b8670878bd669276d778a2715bb #12384

Closes #19206

2 weeks agombedtls: fix building with <3.6.1
Viktor Szakats [Thu, 23 Oct 2025 22:55:37 +0000 (00:55 +0200)] 
mbedtls: fix building with <3.6.1

```
lib/vtls/mbedtls.c:786:3: error: call to undeclared function 'mbedtls_ssl_conf_tls13_enable_signal_new_session_tickets'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
  786 |   mbedtls_ssl_conf_tls13_enable_signal_new_session_tickets(&backend->config,
      |   ^
lib/vtls/mbedtls.c:787:5: error: use of undeclared identifier 'MBEDTLS_SSL_TLS1_3_SIGNAL_NEW_SESSION_TICKETS_ENABLED'; did you mean 'MBEDTLS_SSL_TLS1_3_NEW_SESSION_TICKET_FLUSH'?
  787 |     MBEDTLS_SSL_TLS1_3_SIGNAL_NEW_SESSION_TICKETS_ENABLED);
      |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      |     MBEDTLS_SSL_TLS1_3_NEW_SESSION_TICKET_FLUSH
dep/mbedtls-3.4.0/_pkg/include/mbedtls/ssl.h:700:5: note: 'MBEDTLS_SSL_TLS1_3_NEW_SESSION_TICKET_FLUSH' declared here
  700 |     MBEDTLS_SSL_TLS1_3_NEW_SESSION_TICKET_FLUSH,
      |     ^
2 errors generated.
```

Regression from d63e40f8e6298efaabae57c714ef8df57c54474d #18271 (8.16.0)

Closes #19208

2 weeks agoTODO: a fixed FTP directory listing format
Daniel Stenberg [Fri, 24 Oct 2025 07:22:40 +0000 (09:22 +0200)] 
TODO: a fixed FTP directory listing format

Closes #19212

2 weeks agocfilters: check return code from Curl_pollset_set_out_only()
Daniel Stenberg [Fri, 24 Oct 2025 06:55:01 +0000 (08:55 +0200)] 
cfilters: check return code from Curl_pollset_set_out_only()

I added WARN_UNUSED_RESULT to two of the cfilter functions to make this
mistake harder to slip in next time.

Pointed out by CodeSonar

Closes #19211

2 weeks agotool_cfgable: remove superfluous free calls
Dalei [Fri, 24 Oct 2025 08:02:47 +0000 (08:02 +0000)] 
tool_cfgable: remove superfluous free calls

Fixes #19213
Closes #19214

2 weeks agoconnect: for CONNECT_ONLY, CURLOPT_TIMEOUT does not apply
Daniel Stenberg [Thu, 23 Oct 2025 14:20:01 +0000 (16:20 +0200)] 
connect: for CONNECT_ONLY, CURLOPT_TIMEOUT does not apply

Since using CONNECT_ONLY is by defintion only a connect, we make the
timeleft function return 0 after the connection is done so that it does
not - surprisingly - timeout later.

Fixes #18991
Reported-by: Pavel P
Closes #19204

2 weeks agoschannel: replace a run-time condition with an assert
Daniel Stenberg [Thu, 23 Oct 2025 14:00:46 +0000 (16:00 +0200)] 
schannel: replace a run-time condition with an assert

For detecting a bad function argument that probably also would cause a
compiler warning.

Closes #19203

2 weeks agomd4: drop mbedtls implementation (not available in mbedtls v3+)
Viktor Szakats [Thu, 23 Oct 2025 13:10:30 +0000 (15:10 +0200)] 
md4: drop mbedtls implementation (not available in mbedtls v3+)

Follow-up to 01a2308236ffd4a13a45c3d9850a66a602839af6 #18254

Closes #19202

2 weeks agohttp: only accept ';' as a separator for custom headers
Daniel Stenberg [Thu, 23 Oct 2025 09:16:03 +0000 (11:16 +0200)] 
http: only accept ';' as a separator for custom headers

When parsing incoming headers, they need to have a plain normal colon.

Previously out of convenience we used the same parser function for both
cases (incoming + custom set headers via the API) which made the
function too liberal for incoming HTTP traffic.

Closes #19200

2 weeks agovtls: remove call to PKCS12_PBE_add()
Theo Buehler [Thu, 23 Oct 2025 11:12:48 +0000 (13:12 +0200)] 
vtls: remove call to PKCS12_PBE_add()

Curl is one of the last callers of PKCS12_PBE_add(). It has been a noop
since OpenSSL 0.9.8k (2006) stubbed it out when moving the built-in PBE
algorithms to a static table:
https://github.com/openssl/openssl/commit/b8f702a0affa2087758230967b55df504a176774

Closes #19201

2 weeks agonetrc: when the cached file is discarded, unmark it as loaded
Daniel Stenberg [Thu, 23 Oct 2025 08:51:03 +0000 (10:51 +0200)] 
netrc: when the cached file is discarded, unmark it as loaded

Pointed out by ZeroPath

Closes #19199

2 weeks agosmtp: fix EOB handling
Stefan Eissing [Wed, 22 Oct 2025 13:04:53 +0000 (15:04 +0200)] 
smtp: fix EOB handling

SMTP automatically appends a \n.\n to an upload if there is not already
one at the end of the input. The implementation had a bug where this did
not happen, depending on read size and buffering.

Change test 900 to reproduce the failure. The bug only happened for mail
body input of known length, where EOS was known on the last chunk read.
Change test 900 to use an input file and make it large enough.

Fixes #18798
Closes #19193
Reported-by: madoe on github
2 weeks agotransfer: fix retry for empty downloads on reuse
Stefan Eissing [Wed, 22 Oct 2025 10:37:59 +0000 (12:37 +0200)] 
transfer: fix retry for empty downloads on reuse

When a reused connection did transfer 0 bytes, it assumed the transfer
had failed and needed a retry. Add a check for data->red.done, so we can
successfully accept the transfer of a 0-length file via SFTP.

Add test case 1583 to verfiy.

Fix SFTP disconnect debug trace when there was nothing to
disconnect (like when reusing a connection).

Fixes #19165
Reported-by: Alexander Blach
Closes #19189