]> git.ipfire.org Git - thirdparty/curl.git/log
thirdparty/curl.git
3 months agoVULN-DISCLOSURE-POLICY.md: CRLF in data
Daniel Stenberg [Fri, 2 Jan 2026 09:54:47 +0000 (10:54 +0100)] 
VULN-DISCLOSURE-POLICY.md: CRLF in data

we reject the idea of *CRLF injection* by the user itself as a general
security problem

Closes #20157

3 months agoprogress: make it one column narrower
Daniel Stenberg [Fri, 2 Jan 2026 10:44:33 +0000 (11:44 +0100)] 
progress: make it one column narrower

To make it fit 80 columns appropriately

Reported-by: Jay Satiro
Fixes #20122
Closes #20124

3 months agobadwords.pl: don't mention the whitelisted finds
Daniel Stenberg [Fri, 2 Jan 2026 09:59:43 +0000 (10:59 +0100)] 
badwords.pl: don't mention the whitelisted finds

They obscure the real finds

Closes #20158

3 months agovtls: drop unused `use_alpn` from `ssl_connect_data` struct
Viktor Szakats [Fri, 2 Jan 2026 02:27:27 +0000 (03:27 +0100)] 
vtls: drop unused `use_alpn` from `ssl_connect_data` struct

Closes #20154

3 months agosrc: drop redundant definition of `BIT()`
Viktor Szakats [Fri, 2 Jan 2026 01:51:12 +0000 (02:51 +0100)] 
src: drop redundant definition of `BIT()`

It's defined in `lib/curl_setup_once.h` which is always included before
the duplicate definition in `src/tool_cfgable.h`. Delete the latter.

Follow-up to 06bb1587373dcc42ffbe104b214c900936acfb3c #16211

Closes #20152

3 months agows: replace a cast by matching the format string
Viktor Szakats [Thu, 1 Jan 2026 18:59:21 +0000 (19:59 +0100)] 
ws: replace a cast by matching the format string

Closes #20151

3 months agocmake: set found status to OFF when not found (for compression deps)
Joshua VandaĆ«le [Thu, 1 Jan 2026 21:54:14 +0000 (22:54 +0100)] 
cmake: set found status to OFF when not found (for compression deps)

This fixes curl using libraries if `CURL_{BROTLI|ZLIB|ZSTD}` is set to
`OFF` but the library was found in a parent project that includes curl.

Closes #20147

3 months agopytest: replace allowlist with feature check to enable OCSP test 17_08
Viktor Szakats [Wed, 31 Dec 2025 17:15:17 +0000 (18:15 +0100)] 
pytest: replace allowlist with feature check to enable OCSP test 17_08

Add a `cert-status` feature flag to `curlinfo`, based on the conditions
used in `lib/vtls` sources.

To:
- fix disabling this test when using OpenSSL (or fork) built with
  the `no-ocsp` option.
- enable this test for AWS-LC in CI.

Note:
- BoringSSL (and quiche) has OSCP disabled by default.
- MultiSSL dynamic selection continues to confuse this test.
  (To fix it, support would need to be detected by querying libcurl
  via curl. Probably overkill given that OCSP is on its way out.)

Follow-up to f2c765028fcf91c4f7bf15eeb0249d525e13ac8f #20149

Closes #20133

3 months agopytest: enable OCSP test 17_08 for LibreSSL
Viktor Szakats [Thu, 1 Jan 2026 22:19:07 +0000 (23:19 +0100)] 
pytest: enable OCSP test 17_08 for LibreSSL

Before: 735 passed, 115 skipped
After: 738 passed, 112 skipped

Closes #20149

3 months agomqtt: return error when a too large packet is decoded
Daniel Stenberg [Thu, 1 Jan 2026 22:07:53 +0000 (23:07 +0100)] 
mqtt: return error when a too large packet is decoded

Closes #20148

3 months agoGHA/non-native: stop building examples in a cross-job
Viktor Szakats [Thu, 1 Jan 2026 21:47:18 +0000 (22:47 +0100)] 
GHA/non-native: stop building examples in a cross-job

To make the longest running FreeBSD job finish 1.5 minutes faster
(9.5m -> 8m).

Examples are still built with both autotools and cmake, one on Intel and
one on ARM.

Closes #20146

3 months agoGHA: bump pip-dependencies
dependabot[bot] [Thu, 1 Jan 2026 14:27:11 +0000 (14:27 +0000)] 
GHA: bump pip-dependencies

- update `ruff` from 0.14.9 to 0.14.10
- update `psutil` from 7.1.3 to 7.2.0

Closes #20141

3 months agoGHA: bump gha-dependencies
dependabot[bot] [Thu, 1 Jan 2026 14:06:15 +0000 (14:06 +0000)] 
GHA: bump gha-dependencies

- update `github/codeql-action` from 4.31.8 to 4.31.9
- update `cross-platform-actions/action` from 0.30.0 to 0.32.0
  - support for OmniOS and FreeBSD 15.0
  - releases are now immutable

Closes #20140

3 months agoinet_ntop: avoid the strlen()
Daniel Stenberg [Thu, 1 Jan 2026 11:45:45 +0000 (12:45 +0100)] 
inet_ntop: avoid the strlen()

Also, skip adding the terminating null that is not used.

Closes #20139

3 months agosource: misc typos
Daniel Stenberg [Thu, 1 Jan 2026 11:18:39 +0000 (12:18 +0100)] 
source: misc typos

Found by typos-cli

Closes #20138

3 months agotool_getparam: simplify the --rate parser
Daniel Stenberg [Tue, 30 Dec 2025 22:45:23 +0000 (23:45 +0100)] 
tool_getparam: simplify the --rate parser

Avoids a memcpy()

Closes #20119

3 months agoCHANGES: fix typo in filename
Stuart Henderson [Thu, 1 Jan 2026 10:43:36 +0000 (10:43 +0000)] 
CHANGES: fix typo in filename

Closes #20137

3 months agotool_paramhlp: simplify number parsing
Daniel Stenberg [Wed, 31 Dec 2025 17:17:15 +0000 (18:17 +0100)] 
tool_paramhlp: simplify number parsing

Closes #20134

3 months agotests: drop redundant parenthesis from two macro expressions
Viktor Szakats [Wed, 31 Dec 2025 16:12:16 +0000 (17:12 +0100)] 
tests: drop redundant parenthesis from two macro expressions

Closes #20136

3 months agolibssh: fix indent
Viktor Szakats [Mon, 29 Dec 2025 20:12:13 +0000 (21:12 +0100)] 
libssh: fix indent

Closes #20135

3 months agotool_paramhlp: remove a malloc+free from proto2num()
Daniel Stenberg [Tue, 30 Dec 2025 23:13:24 +0000 (00:13 +0100)] 
tool_paramhlp: remove a malloc+free from proto2num()

Closes #20120

3 months agotest1664: extend with more tests for curlx_str_quotedword
Daniel Stenberg [Wed, 31 Dec 2025 10:06:36 +0000 (11:06 +0100)] 
test1664: extend with more tests for curlx_str_quotedword

Closes #20123

3 months agohostip.h: drop redundant `setjmp.h` include
Viktor Szakats [Wed, 31 Dec 2025 15:20:32 +0000 (16:20 +0100)] 
hostip.h: drop redundant `setjmp.h` include

Already included directly via `hostip.c`, and other header users do not
use it.

Also add comment about why `setjmp.h` is used.

Cherry-picked from #20106

Closes #20132

3 months agotests: include headers only when used
Viktor Szakats [Mon, 29 Dec 2025 02:44:27 +0000 (03:44 +0100)] 
tests: include headers only when used

Cherry-picked from #20106

Closes #20131

3 months agoopenssl: stop checking for `OPENSSL_NO_SHA*` macros
Viktor Szakats [Wed, 31 Dec 2025 14:08:06 +0000 (15:08 +0100)] 
openssl: stop checking for `OPENSSL_NO_SHA*` macros

Macros have been deleted upstream and never defined in OpenSSL 1.1.0+:
https://github.com/openssl/openssl/commit/474e469bbd056aebcf7e7d3207ef820f2faed4ce

BoringSSL deleted the last internals uses in 2014:
https://github.com/google/boringssl/commit/457112e1973251a721ae419128d7108844d3c1a3

LibreSSL refers to them internally and in two public headers, but never
set them via `openssl/opensslfeatures.h` / `openssl/opensslconf.h`.

Follow-up to 69c89bf3d3137fcbb2b8bc57233182adcf1e2817 #18330

Closes #20130

3 months agoopenssl: stop checking for `OPENSSL_NO_TLSEXT` macro
Viktor Szakats [Wed, 31 Dec 2025 13:45:05 +0000 (14:45 +0100)] 
openssl: stop checking for `OPENSSL_NO_TLSEXT` macro

The macro has been deleted upstream and never defined in OpenSSL 1.1.0+:
https://github.com/openssl/openssl/commit/e481f9b90b164fd1053015d1c4e0a0d92076d7a8

BoringSSL and LibreSSL deleted the last uses in 2014:
https://github.com/google/boringssl/commit/6dbd73db5d58ec44304266012d23ff8d297eca55
https://github.com/libressl/openbsd/commit/7b2f3298f7eb7ce5cfd1c3eb55b1ecc89118f52c

Also:
- drop internal guard `HAS_ALPN_OPENSSL`. It's always set.

Follow-up to 69c89bf3d3137fcbb2b8bc57233182adcf1e2817 #18330

Closes #20129

3 months agolib: drop unused or duplicate `curlx/timeval.h` includes
Viktor Szakats [Wed, 31 Dec 2025 11:28:46 +0000 (12:28 +0100)] 
lib: drop unused or duplicate `curlx/timeval.h` includes

Note: This patch doesn't aim to add `timeval.h` includes missing from
local headers using `curltime` type. They remain relying on `urldata.h`
being included first. This patch also doesn't delete existing, used
includes already present in local headers (as internal users may rely
on them).

Ref: #20106
Closes #20126

3 months agoopenssl: fix building against no-ocsp openssl with Apple SecTrust
Viktor Szakats [Wed, 31 Dec 2025 13:35:20 +0000 (14:35 +0100)] 
openssl: fix building against no-ocsp openssl with Apple SecTrust

(Not tested in CI. Regression in 8.17.0.)

Fixing:
```
lib/vtls/openssl.c:4750:8: error: variable 'sectrust_verified' set but not used [-Werror,-Wunused-but-set-variable]
 4750 |   bool sectrust_verified = FALSE;
      |        ^
1 error generated.
```

Follow-up to b4630ed8faef1834e2b64f30acc24e5101d4d2fb #19308

Closes #20128

3 months agoopenssl: fix building against no-dsa openssl
Viktor Szakats [Wed, 31 Dec 2025 13:29:24 +0000 (14:29 +0100)] 
openssl: fix building against no-dsa openssl

(Not tested in CI. Regression within this release cycle.)

Fixing:
```
lib/vtls/openssl.c:304:48: error: unused parameter 'data' [-Werror,-Wunused-parameter]
  304 | static CURLcode get_pkey_dsa(struct Curl_easy *data,
      |                                                ^
lib/vtls/openssl.c:305:40: error: unused parameter 'pubkey' [-Werror,-Wunused-parameter]
  305 |                              EVP_PKEY *pubkey, BIO *mem, int i)
      |                                        ^
lib/vtls/openssl.c:305:53: error: unused parameter 'mem' [-Werror,-Wunused-parameter]
  305 |                              EVP_PKEY *pubkey, BIO *mem, int i)
      |                                                     ^
lib/vtls/openssl.c:305:62: error: unused parameter 'i' [-Werror,-Wunused-parameter]
  305 |                              EVP_PKEY *pubkey, BIO *mem, int i)
      |                                                              ^
```

Follow-up to 833efb437dd8fb8b3ff48274531b83a03798b24b #19471

Closes #20127

3 months agoDockerfile: update debian:bookworm-slim Docker digest to d5d3f9c
renovate[bot] [Tue, 30 Dec 2025 05:08:30 +0000 (05:08 +0000)] 
Dockerfile: update debian:bookworm-slim Docker digest to d5d3f9c

Closes #20115

3 months agobadwords: add fist -> first, fix fallouts
Yedaya Katsman [Sun, 21 Dec 2025 19:53:58 +0000 (21:53 +0200)] 
badwords: add fist -> first, fix fallouts

There are still `curl_fistrgs` in packages/OS400/curl.inc.in but
I'm not sure what that's supposed to be exactly.

Closes #20066

3 months agotool_doswin: add debug envs to test filename sanitization failure modes
Viktor Szakats [Wed, 31 Dec 2025 10:21:18 +0000 (11:21 +0100)] 
tool_doswin: add debug envs to test filename sanitization failure modes

- `CURL_FN_SANITIZE_BAD=<any-value>` to simulate
  `SANITIZE_ERR_INVALID_PATH`.

- `CURL_FN_SANITIZE_OOM=<any-value>` to simulate
  `SANITIZE_ERR_OUT_OF_MEMORY`.

Both are Windows/MS-DOS-specific and require debug-enabled curl build.

Cherry-picked from #20116
Closes #20125

3 months agotool_getparam: use memdup0() instead of malloc + copy
Daniel Stenberg [Tue, 30 Dec 2025 22:19:01 +0000 (23:19 +0100)] 
tool_getparam: use memdup0() instead of malloc + copy

Closes #20118

3 months agodigest: fix OWS and escaped quote handling
trxvorr [Sun, 28 Dec 2025 18:28:18 +0000 (23:58 +0530)] 
digest: fix OWS and escaped quote handling

The migration to the strparse API introduced regressions in Digest
authentication parsing where Optional Whitespace (OWS) after commas was
not skipped, and escaped quotes in values were not correctly parsed.

This change ensures whitespace is skipped before key lookups and escaped
characters are properly handled and unescaped in quoted values.

Reported-by: herdiyanitdev on hackerone
Closes #20102

3 months agoRELEASE-NOTES: codespell
Viktor Szakats [Tue, 30 Dec 2025 16:35:00 +0000 (17:35 +0100)] 
RELEASE-NOTES: codespell

3 months agodelta: fix grep patterns after white space edits
Daniel Stenberg [Tue, 30 Dec 2025 13:04:10 +0000 (14:04 +0100)] 
delta: fix grep patterns after white space edits

To make the command line option counter work again

Follow-up to 308c347c8b

3 months agoRELEASE-NOTES: synced
Daniel Stenberg [Tue, 30 Dec 2025 13:02:03 +0000 (14:02 +0100)] 
RELEASE-NOTES: synced

3 months agolibcurl-errors: delete stray double quote
Viktor Szakats [Tue, 30 Dec 2025 10:45:15 +0000 (11:45 +0100)] 
libcurl-errors: delete stray double quote

Closes #20117

3 months agotool_doswin: increase allowable length of path sanitizer
Jay Satiro [Sat, 20 Dec 2025 09:08:09 +0000 (04:08 -0500)] 
tool_doswin: increase allowable length of path sanitizer

- Use 32767-1 instead of PATH_MAX-1 (260-1) as the maximum allowable
  length of a path in Windows.

Prior to this change the path sanitizer in Windows used 32767-1 as the
maximum length only for paths that had the "\\" prefix like
"\\?\longpath". Since then we added some workarounds to open longer
paths without "\\?\" prefix by normalizing the path and adding that
prefix, and the sanitizer is called before the prefix is added.

Bug: https://github.com/curl/curl/issues/20044
Reported-by: Viktor Szakats
Closes https://github.com/curl/curl/pull/20046

4 months agoratelimit blocking: fix busy loop
Stefan Eissing [Mon, 29 Dec 2025 10:21:31 +0000 (11:21 +0100)] 
ratelimit blocking: fix busy loop

Fix the pollset in perform state to not add sockets for directions
that are blocked. This otherwise will lead to busy loops for a
transfer that cannot be progressed.

Reported-by: Fizn-Ahmd on github
Fixes #20091
Closes #20109

4 months agolibssh: require private key or user-agent for public key auth
Harry Sintonen [Mon, 29 Dec 2025 15:56:39 +0000 (16:56 +0100)] 
libssh: require private key or user-agent for public key auth

Closes #20110

4 months agotelnet: abort on bad suboption sequence
Daniel Stenberg [Mon, 29 Dec 2025 09:11:20 +0000 (10:11 +0100)] 
telnet: abort on bad suboption sequence

Instead of trying to repair.

Reported-by: Huseyin Tintas
Closes #20108

4 months agourlapi: set uncondtional return code
Daniel Stenberg [Sun, 28 Dec 2025 21:40:47 +0000 (22:40 +0100)] 
urlapi: set uncondtional return code

Curl_parse_login_details() can only return a single return code so
adjust accordingly.

Pointed out by CodeSonar

Closes #20107

4 months agourl: return error at once when OOM in netrc handling
Daniel Stenberg [Sat, 27 Dec 2025 16:06:31 +0000 (17:06 +0100)] 
url: return error at once when OOM in netrc handling

Closes #20103

4 months agostrcopy: minor comment edit to avoid matching a grep for strcpy use
Daniel Stenberg [Sat, 27 Dec 2025 22:25:13 +0000 (23:25 +0100)] 
strcopy: minor comment edit to avoid matching a grep for strcpy use

4 months agocurl_quiche: refuse headers with CR, LF or null bytes
Daniel Stenberg [Sat, 27 Dec 2025 09:19:08 +0000 (10:19 +0100)] 
curl_quiche: refuse headers with CR, LF or null bytes

Also renamed the struct field to 'h1hdr' from 'scratch' to better say
what its purpose is.

Closes #20101

4 months agourlapi: return OOM correctly from parse_hostname_login()
Daniel Stenberg [Fri, 26 Dec 2025 12:05:20 +0000 (13:05 +0100)] 
urlapi: return OOM correctly from parse_hostname_login()

Closes #20100

4 months agoftp: return from ftp_state_use_port immediately on OOM
Daniel Stenberg [Fri, 26 Dec 2025 11:52:34 +0000 (12:52 +0100)] 
ftp: return from ftp_state_use_port immediately on OOM

Closes #20100

4 months agocf-socket: return OOM error if socket() failes due to OOM
Daniel Stenberg [Fri, 26 Dec 2025 10:00:00 +0000 (11:00 +0100)] 
cf-socket: return OOM error if socket() failes due to OOM

Closes #20100

4 months agotidy-up: miscellaneous
Viktor Szakats [Sat, 20 Dec 2025 13:32:49 +0000 (14:32 +0100)] 
tidy-up: miscellaneous

- asyn-thrdd.c: scope an include.
- apply more clang-format suggestions.
- tidy-up PP guard comments.
- delete empty line from the top of headers.
- add empty line after `curl_setup.h` include where missing.
- fix indent.
- CODE_STYLE.md: add `strcpy`.
  Follow-up to 8636ad55dfbdbcc2809a61e65c3511baf5e7b0e8 #20088
- lib1901.c: drop unnecessary line.
  Follow-up to 436e67f65b9dee1e80aa063c39450f0d1df6ac72 #20076

Closes #20070

4 months agoftp: return better on OOM in two places
Daniel Stenberg [Thu, 25 Dec 2025 22:17:24 +0000 (23:17 +0100)] 
ftp: return better on OOM in two places

Found with strict torture testing.

Closes #20099

4 months agomemdebug: stop tracking send and recv
Daniel Stenberg [Thu, 25 Dec 2025 22:21:34 +0000 (23:21 +0100)] 
memdebug: stop tracking send and recv

- they rarely catch any problems
- we have other ways to test different send/recv problems
- the number of such calls vary much more per invoke than others, making
  memdebugging harder
- reducing the total number of fallible functions per test is good
- they were not used as intended anyway

Closes #20097

4 months agocurl_threads: don't do another malloc if the first fails
Daniel Stenberg [Thu, 25 Dec 2025 17:06:37 +0000 (18:06 +0100)] 
curl_threads: don't do another malloc if the first fails

Closes #20095

4 months agosrc: drop unused includes
Viktor Szakats [Thu, 25 Dec 2025 17:05:53 +0000 (18:05 +0100)] 
src: drop unused includes

Also replace some indirect includes with direct ones.

Closes #20096

4 months agoRELEASE-NOTES: synced
Daniel Stenberg [Thu, 25 Dec 2025 11:13:55 +0000 (12:13 +0100)] 
RELEASE-NOTES: synced

4 months agocookie: flush better
Daniel Stenberg [Thu, 25 Dec 2025 09:53:11 +0000 (10:53 +0100)] 
cookie: flush better

The cookie flushing (saving to a cookie jar) should only be done if a
transfer has been started. This is now done by checking the
cookies->running field, which is not reset in curl_easy_reset() so the
saving works correctly even after a call to that.

Follow-up to fd6eb8d6e77d95e71c

Verified by test 1920

Reported-by: Alexander Batischev
Fixes #20090
Closes #20094

4 months agolib: drop unused protocol headers
Viktor Szakats [Wed, 24 Dec 2025 23:26:48 +0000 (00:26 +0100)] 
lib: drop unused protocol headers

- drop unused `http.h` includes.
- drop unused `http1.h` include.
- drop unused `http2.h` includes.
- vssh/ssh.h: drop unused `vssh.h` include.
- urldata.h: drop unused protocol includes.
- url: include `smtp.h` directly.
- rtsp.h: include directly where used.
- imap, smtp: drop redundant include, move another from .h to .c.

Verified with an all non-unity CI run.

Closes #20093

4 months agolibssh: set both knownhosts options to the same file
Daniel Stenberg [Wed, 24 Dec 2025 16:47:03 +0000 (17:47 +0100)] 
libssh: set both knownhosts options to the same file

Reported-by: Harry Sintonen
Closes #20092

4 months agoos400sys: replace `strcpy()` with `memcpy()`
Viktor Szakats [Wed, 24 Dec 2025 00:13:19 +0000 (01:13 +0100)] 
os400sys: replace `strcpy()` with `memcpy()`

Source and target are the same size, null-terminator is already present
in the target buffer.

Closes #20089

4 months agocurl_ntlm_core: fix DES_* symbols for some wolfSSL builds
Daniel Stenberg [Tue, 23 Dec 2025 21:22:37 +0000 (22:22 +0100)] 
curl_ntlm_core: fix DES_* symbols for some wolfSSL builds

Recent wolfSSL with OPENSSL_COEXIST enabled does not provide the DES_*
symbols, so we do.

Reported-by: Daniel Pouzzner
Closes #20083

4 months agoescape: add a length check in curl_easy_escape
Daniel Stenberg [Tue, 23 Dec 2025 23:09:37 +0000 (00:09 +0100)] 
escape: add a length check in curl_easy_escape

Only accept up to SIZE_MAX/16 input bytes. To avoid overflows, mistakes
and abuse.

Follow-up to 9bfc7f923479235b2fdf0e

Reported-by: Daniel Santos
Closes #20086

4 months agochecksrc: ban `strcpy`
Viktor Szakats [Wed, 24 Dec 2025 00:08:58 +0000 (01:08 +0100)] 
checksrc: ban `strcpy`

No longer used in the codebase. Replacement is `curlx_strcopy()`, possibly
`memcpy()` or dynbuf.

Also:
- OS400: allow three calls.

Closes #20088

4 months agobuild: stop disabling `strcpy` checks with clang-tidy
Viktor Szakats [Tue, 23 Dec 2025 11:16:52 +0000 (12:16 +0100)] 
build: stop disabling `strcpy` checks with clang-tidy

Follow-up to 436e67f65b9dee1e80aa063c39450f0d1df6ac72 #20076

Closes #20084

4 months agotests: replace `strcpy()` with `curlx_strcopy()`
Viktor Szakats [Tue, 23 Dec 2025 10:59:59 +0000 (11:59 +0100)] 
tests: replace `strcpy()` with `curlx_strcopy()`

Also:
- examples/hsts-preload: apply the same change as it's based on lib1915
  in tests. Make a local clone of `curlx_strcopy()`. Then drop the
  `_CRT_SECURE_NO_WARNINGS` hack, that's no longer necessary.
- curl_setup.h: delete `strcpy()` from the `_CRT_SECURE_NO_WARNINGS`
  list.

Closes #20076

4 months agolib547, 555: fix off-by-one null-terminator in read callback
Viktor Szakats [Tue, 23 Dec 2025 11:03:10 +0000 (12:03 +0100)] 
lib547, 555: fix off-by-one null-terminator in read callback

`strcpy()` wrote an unnecessary null-terminator past the available read
buffer.

test551 was also affected because it reuses lib547.

Cherry-picked from #20076
Closes #20082

4 months agocf-h1-proxy: support folded headers in CONNECT responses
Daniel Stenberg [Tue, 23 Dec 2025 12:54:12 +0000 (13:54 +0100)] 
cf-h1-proxy: support folded headers in CONNECT responses

Update test 1941 to verify this

Remove unused code from dynhds for handling folded headers, and the
associated unit tests of those functions in test 2602 and 2603.

Closes #20080

4 months agoGHA: update ngtcp2/nghttp3 to v1.14.0
renovate[bot] [Tue, 23 Dec 2025 12:35:07 +0000 (12:35 +0000)] 
GHA: update ngtcp2/nghttp3 to v1.14.0

Closes #20078

4 months agoGHA: update ngtcp2/ngtcp2 to v1.19.0
renovate[bot] [Tue, 23 Dec 2025 12:35:13 +0000 (12:35 +0000)] 
GHA: update ngtcp2/ngtcp2 to v1.19.0

Closes #20079

4 months agovquic: initialize new callback in nghttp3 1.14.0+
Viktor Szakats [Tue, 23 Dec 2025 11:24:30 +0000 (12:24 +0100)] 
vquic: initialize new callback in nghttp3 1.14.0+

Fixing (seen in curl-for-win production build):
```
lib/vquic/curl_ngtcp2.c:1257:1: error: missing field 'recv_settings2' initializer [-Werror,-Wmissing-field-initializers]
 1257 | };
      | ^
1 error generated.
```
Ref: https://ci.appveyor.com/project/curlorg/curl-for-win/builds/53281785#L6752
Ref: https://github.com/curl/curl/actions/runs/20459295003/job/58788229134#step:3:5513

Also:
- Mark previous callback deprecated.
- Document ngtcp2, nghttp3 versions for callback entry feature guards.

Refs:
https://github.com/ngtcp2/nghttp3/releases/tag/v1.14.0
https://github.com/ngtcp2/nghttp3/pull/432
https://github.com/ngtcp2/nghttp3/commit/1616ab835061d7cdd2ef114bc3ddb917ce269611

Closes #20077

4 months agocurlx: curlx_strcopy() instead of strcpy()
Daniel Stenberg [Sun, 21 Dec 2025 22:40:24 +0000 (23:40 +0100)] 
curlx: curlx_strcopy() instead of strcpy()

This function REQUIRES the size of the target buffer as well as the
length of the source string. Meant to make it harder to do a bad
strcpy().

Removes 23 calls to strcpy().

Closes #20067

4 months agoapple sectrust: fix ancient evaluation
Stefan Eissing [Wed, 17 Dec 2025 11:31:39 +0000 (12:31 +0100)] 
apple sectrust: fix ancient evaluation

On versions before macOS 10.14, ios 12 and watchos 5, check the
evaluation code to return the error from evaluation.

Reported-by: Stanislav Fort
Closes #20074

4 months agoCURLOPT_HAPROXY_CLIENT_IP.md: emphasize reused connection use
Daniel Stenberg [Mon, 22 Dec 2025 21:36:23 +0000 (22:36 +0100)] 
CURLOPT_HAPROXY_CLIENT_IP.md: emphasize reused connection use

Closes #20075

4 months agocontent_encoding: avoid strcpy
Daniel Stenberg [Mon, 22 Dec 2025 10:36:42 +0000 (11:36 +0100)] 
content_encoding: avoid strcpy

Build list with dynbuf.

Closes #20072

4 months agocurlx: rename `Curl_`-prefixed symbols to `curlx_`
Viktor Szakats [Sun, 21 Dec 2025 23:48:33 +0000 (00:48 +0100)] 
curlx: rename `Curl_`-prefixed symbols to `curlx_`

Closes #20069

4 months agobinmode: delete extra nop instruction from fallback macro
Viktor Szakats [Sun, 21 Dec 2025 22:42:21 +0000 (23:42 +0100)] 
binmode: delete extra nop instruction from fallback macro

Follow-up to 250d613763dfc29f73010696ee7948f19d07dba9 #15787

Closes #20068

4 months agochecksrc: ensure using `ifdef`/`ifndef` when possible, fix fallouts
Viktor Szakats [Sun, 21 Dec 2025 14:45:53 +0000 (15:45 +0100)] 
checksrc: ensure using `ifdef`/`ifndef` when possible, fix fallouts

Follow-up to 89771d19d58d16cfe6e1d7fda7acd65a0a316eba #18018

Closes #20065

4 months agolib: drop, or replace `sendf.h` with `curl_trc.h` where possible
Viktor Szakats [Sun, 21 Dec 2025 01:40:10 +0000 (02:40 +0100)] 
lib: drop, or replace `sendf.h` with `curl_trc.h` where possible

- replace `sendf.h` with `curl_trc.h` where it was included just for it.
- drop unused `curl_trc.h` includes.
- easy: delete obsolete comment about `send.h` include reason.

Also:
- move out `curl_trc.h` include from `sendf.h` and include it directly
  in users, where not done already. To flatten the include tree and
  to less rely on indirect includes.
- stop including `sendf.h` from other headers, replace it with forward
  declaration of `Curl_easy`, as done already elsewhere.

Verified with an all non-unity CI run.

Closes #20061

4 months agotest96: fix to accept non-unity memdump content with MSVC
Viktor Szakats [Sun, 21 Dec 2025 10:28:42 +0000 (11:28 +0100)] 
test96: fix to accept non-unity memdump content with MSVC

In unity builds the source filename (via `__FILE__`) has no path (or
uses slashes?), while in non-unity ones it does contain backslashes
on Windows, with MSVC. Fix the test to recognize backslashes in the
`stripfile` regexp.

Seen in MSVC jobs in CI:
```diff
-MEM tool_cfgable.c[LF]
-MEM tool_paramhlp.c[LF]
-MEM tool_cfgable.c[LF]
-MEM tool_cfgable.c[LF]
-MEM tool_cfgable.c[LF]
-MEM tool_cfgable.c[LF]
+MEM D:\a\curl\curl\src\tool_cfgable.c[LF]
+MEM D:\a\curl\curl\src\tool_paramhlp.c[LF]
+MEM D:\a\curl\curl\src\tool_cfgable.c[LF]
+MEM D:\a\curl\curl\src\tool_cfgable.c[LF]
+MEM D:\a\curl\curl\src\tool_cfgable.c[LF]
+MEM D:\a\curl\curl\src\tool_cfgable.c[LF]
```
Ref: https://github.com/curl/curl/actions/runs/20408366058/job/58641468316?pr=20061#step:13:303
Ref: https://github.com/curl/curl/actions/runs/20408522070/job/58641826216?pr=20064#step:13:298

Closes #20064

4 months agox509asn1: drop unused `hostcheck.h`, `vtls_int.h` includes
Viktor Szakats [Sun, 21 Dec 2025 09:57:05 +0000 (10:57 +0100)] 
x509asn1: drop unused `hostcheck.h`, `vtls_int.h` includes

Closes #20063

4 months agolib: include `curlx/warnless.h` from `curl_setup.h`
Viktor Szakats [Sat, 20 Dec 2025 23:40:32 +0000 (00:40 +0100)] 
lib: include `curlx/warnless.h` from `curl_setup.h`

To make it available for all files. Drop includes from individual
sources. This header was already included from most sources and not
specific to any internal subsystem.

Also to ensure that two system symbol redefines on Windows (`read()` and
`write()`) get applied to all sources. Move them to `curl_setup.h`.

Closes #20056

4 months agolib: drop unused `vssh/ssh.h` includes
Viktor Szakats [Sun, 21 Dec 2025 00:28:49 +0000 (01:28 +0100)] 
lib: drop unused `vssh/ssh.h` includes

Closes #20060

4 months agotransfer: drop unused `vquic/vquic.h` include
Viktor Szakats [Sun, 21 Dec 2025 00:25:14 +0000 (01:25 +0100)] 
transfer: drop unused `vquic/vquic.h` include

Closes #20059

4 months agocurl_ntlm_core: move `vauth/vauth.h` include from header to source
Viktor Szakats [Sun, 21 Dec 2025 00:22:26 +0000 (01:22 +0100)] 
curl_ntlm_core: move `vauth/vauth.h` include from header to source

To not include it implicitly for all `curl_ntlm_core.h` users.

Closes #20058

4 months agotidy-up: `curlx/nonblock.h` includes
Viktor Szakats [Sat, 20 Dec 2025 23:08:44 +0000 (00:08 +0100)] 
tidy-up: `curlx/nonblock.h` includes

Delete where unused, include where to used to avoid relying on
side-effect of other headers.

Also: delete "for curlx_nonblock" comments. That's the only symbol
offered by this header.

Closes #20055

4 months agolib: drop unused `vtls/vtls.h` includes
Viktor Szakats [Sun, 21 Dec 2025 00:11:06 +0000 (01:11 +0100)] 
lib: drop unused `vtls/vtls.h` includes

Closes #20057

4 months agolib: drop unused curlx headers
Viktor Szakats [Sat, 20 Dec 2025 23:02:40 +0000 (00:02 +0100)] 
lib: drop unused curlx headers

`curlx/base64.h` and `curlx/strparse.h`.

Closes #20054

4 months agolib: drop includes unused or duplicate
Viktor Szakats [Sat, 20 Dec 2025 16:16:10 +0000 (17:16 +0100)] 
lib: drop includes unused or duplicate

Closes #20051

4 months agosocks.h: delete obsolete, unused, macros
Viktor Szakats [Sat, 20 Dec 2025 18:21:19 +0000 (19:21 +0100)] 
socks.h: delete obsolete, unused, macros

Unused since dafdb20a26d0c890e83dea61a104b75408481ebd #9855

Cherry-picked from #20051

Closes #20053

4 months agolib: use `SOCKET_WRITABLE()`/`SOCKET_READABLE()` where possible
Viktor Szakats [Sat, 20 Dec 2025 17:50:12 +0000 (18:50 +0100)] 
lib: use `SOCKET_WRITABLE()`/`SOCKET_READABLE()` where possible

Closes #20052

4 months agocontrithanks.sh: adopt the stricter by: check from contributors.sh
Daniel Stenberg [Sat, 20 Dec 2025 16:45:15 +0000 (17:45 +0100)] 
contrithanks.sh: adopt the stricter by: check from contributors.sh

4 months agocontributors.sh: even stricter requirements for the -by: line
Daniel Stenberg [Sat, 20 Dec 2025 16:44:18 +0000 (17:44 +0100)] 
contributors.sh: even stricter requirements for the -by: line

4 months agombedTLS: cleanup insecure/deprecated code
Wyatt O'Day [Mon, 15 Dec 2025 17:17:13 +0000 (12:17 -0500)] 
mbedTLS: cleanup insecure/deprecated code

1. With `MBEDTLS_SSL_PROTO_TLS1_2` not enabled, the mbedTLS code was not
able to connect to any server due to broken logic in curl's
`mbed_set_ssl_version_min_max()`. Now it correctly sets the minimum
supported TLS version based on what is compiled in the library.

2. If debugging is enabled, move the debugging enabling earlier in the
`mbed_connect_step1()` so that verbose errors are actually displayed if
failures happen (see the previous point -- it would've made debugging
that issue easier).

3. Remove the constant `mbedtls_x509_crt_profile_fr` and instead use
mbedTLS-included profile `mbedtls_x509_crt_profile_next` with
`mbedtls_ssl_conf_cert_profile()`. This will follow the latest standards
as new mbedTLS versions are released (rather than being stuck-in-time
until someone comes along to fix what was hard-coded here). This has the
immediate benefit of no longer supporting SHA1 certs and insecure RSA
key-lengths (1024). This fix immediately prevents previously possible
MITM attacks (SHA1 hashes and RSA-1024 keys can be forged relatively
easily by nation-state actors and criminal organizations with
deep-pockets).

4. Added [predictive
resistance](https://mbed-tls.readthedocs.io/en/latest/kb/how-to/add-a-random-generator/#enabling-prediction-resistance)
to the random number generator (adding more entropy to the RNG).

5. Split the random number generator into initialization, the actual
random generation, and the "freeing" of the resources. This
significantly reduces the overhead of using the RNG.

6. Removed the separate RNG function in the TLS connect stage (instead
use the "main" one) and remove the ad-hoc threading support. Instead
properly document how to enable threading in mbedTLS. As it was, other
internals of mbedTLS could have race conditions (in the RSA module in
particular) if `MBEDTLS_THREADING_C` was *not* enabled. And if it is
enabled, then these race-conditions cannot happen. And also, if
MBEDTLS_THREADING_C is enabled then the RNG functions [are fully
thread-safe](https://mbed-tls.readthedocs.io/en/latest/kb/development/thread-safety-and-multi-threading/).

   So, the previous ad-hoc threading support was both partial and broken.

7. Enable support for disabling `MBEDTLS_PEM_PARSE_C`.

8. Add support for `CURLOPT_SSLCERTTYPE` so user can specify `PEM` or
`DER` and get faster execution.

Closes #19983

4 months agomulti-notify: add check macro
Stefan Eissing [Fri, 19 Dec 2025 11:52:30 +0000 (12:52 +0100)] 
multi-notify: add check macro

Since Curl_mntfy_dispatch_all() is called with high frequency and
mostly unnecessary, add a check macro to avoid the call when not
needed.

Closes #20034

4 months agohttp: minor cleanup after the unfold rework
Daniel Stenberg [Fri, 19 Dec 2025 13:21:19 +0000 (14:21 +0100)] 
http: minor cleanup after the unfold rework

Closes #20037

4 months agocurlx: add `curlx_rename()`, fix to support long filenames on Windows
Viktor Szakats [Sat, 20 Dec 2025 00:44:46 +0000 (01:44 +0100)] 
curlx: add `curlx_rename()`, fix to support long filenames on Windows

Move existing `Curl_rename()` `rename()` wrapper from lib to
curlx/fopen, and make it a curlx macro/function. To allow using
the local worker function to fixup long filenames on Windows.

Then fix the Windows-specific rename implementation to support long
filenames. This operation may happen when using a cookie jar, HSTS cache
or alt-svc cache, via libcurl or the curl tool.

Before this patch, when passing a long filename to the above options,
a `<random>.tmp` file was left on the disk without renaming it to the
filename passed to curl. There was also 1 second delay for each
attempted rename operation.

Also:
- checksrc: ban raw `rename()` and `MoveFileEx*()` functions.
- Note: `Curl_rename()` returned 1 on failure before this patch, while
  `curlx_rename()` returns -1 after, to match POSIX `rename()`.

Refs:
https://learn.microsoft.com/windows/win32/api/winbase/nf-winbase-movefileexa
https://learn.microsoft.com/windows/win32/fileio/maximum-file-path-limitation

Ref: #20040

Closes #20042

4 months agoGHA/http3-linux: set minimum number of runtest tests
Viktor Szakats [Sat, 20 Dec 2025 14:00:49 +0000 (15:00 +0100)] 
GHA/http3-linux: set minimum number of runtest tests

Tailored for each job with a relatively tight limits. Also with no
tolerance in valgrind tests: 4 of the 4 has to be run.

Based on Test Clutch feature matrix which displays the minimum and
actual number of tests:
https://testclutch.curl.se/static/reports/feature-matrix.html

Also:
- runtests.pl: include total number of tests in the error message shown
  when the limit was not met.

Assisted-by: Dan Fandrich
Follow-up to 3f1cd809eeae05f39fec72fe780f3a69d21972fb #19942

Closes #20050

4 months agowindows: fix `CreateFile()` calls to support long filenames
Viktor Szakats [Fri, 19 Dec 2025 22:26:10 +0000 (23:26 +0100)] 
windows: fix `CreateFile()` calls to support long filenames

It makes them work in Schannel's CA bundle loader, and curl tool's
set/get file timestamp operations (e.g. in `-R`/`--remote-time`). Also
to match file open operations, that already support long filenames.

E.g. when using `--remote-time`, fixing:
```
Warning: Failed to set filetime 1741363917 on outfile: CreateFile failed:
Warning: GetLastError 0x00000003
```

The special long filename logic is necessary to support Windows releases
prior to Windows 10 v1607. With the latter, it's possible to opt-in to
this behavior via a manifest setting. Note that Windows itself also needs
to opt-in to support this. Finally note that curl itself needs passing
`--globoff` to let long filenames through, pending #20044 and #20046.

Refs:
https://learn.microsoft.com/windows/win32/api/fileapi/nf-fileapi-createfilea
https://learn.microsoft.com/windows/win32/fileio/maximum-file-path-limitation

Ref: #8361
Inspired by: #19286
Inspired-by: Mathesh V
Closes #19286
Closes #20040

4 months agoopenssl: drop includes unused or duplicate
Viktor Szakats [Sat, 20 Dec 2025 11:38:19 +0000 (12:38 +0100)] 
openssl: drop includes unused or duplicate

Also:
- vquic-tls.h: do not include unused headers for non-H3 builds.
- autotools: stop looking for `openssl/x509.h` header.
- cmp-config.pl: delete exception for `openssl/x509.h`.
- examples: format/comment sync between the two touched files.
- openssl: drop unused `curlx/wait.h` include.

Closes #20049

4 months agolib: drop unused `rand.h` includes
Viktor Szakats [Sat, 20 Dec 2025 11:18:34 +0000 (12:18 +0100)] 
lib: drop unused `rand.h` includes

Closes #20047

4 months agocurl_ntlm_core: drop unused OpenSSL/wolfSSL headers
Viktor Szakats [Sat, 20 Dec 2025 11:23:21 +0000 (12:23 +0100)] 
curl_ntlm_core: drop unused OpenSSL/wolfSSL headers

`openssl/rand.h` and `openssl/ssl.h`.

Closes #20048