]> git.ipfire.org Git - thirdparty/curl.git/log
thirdparty/curl.git
4 weeks 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

4 weeks 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

4 weeks 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

4 weeks 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

4 weeks 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

4 weeks 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

4 weeks 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

4 weeks 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

4 weeks 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

4 weeks 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

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

4 weeks 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

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

4 weeks 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

4 weeks 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 weeks 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 weeks 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 weeks 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 weeks 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 weeks 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 weeks 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 weeks 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 weeks 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 weeks 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 weeks 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 weeks agotidy-up: miscellaneous rc-8_18_0-3
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

5 weeks 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

5 weeks 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

5 weeks 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

5 weeks 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

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

5 weeks 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

5 weeks 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

5 weeks 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

5 weeks 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

5 weeks 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

5 weeks 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

5 weeks 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

5 weeks 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

5 weeks 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

5 weeks 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

5 weeks 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

5 weeks 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

5 weeks 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

5 weeks 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

5 weeks 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

5 weeks 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

5 weeks 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

5 weeks 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

5 weeks 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

5 weeks 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

5 weeks 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

5 weeks 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

5 weeks 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

5 weeks 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

5 weeks 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

5 weeks 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

5 weeks 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

5 weeks 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

5 weeks 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

5 weeks 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

5 weeks 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

5 weeks 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

5 weeks 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

5 weeks 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

5 weeks 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

5 weeks 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

5 weeks 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

5 weeks 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

5 weeks 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

5 weeks 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

5 weeks 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

5 weeks 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

5 weeks 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

5 weeks 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

5 weeks 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

5 weeks agocurlx: use curl alloc in `curlx_win32_stat()` (Windows)
Viktor Szakats [Sat, 20 Dec 2025 00:54:35 +0000 (01:54 +0100)] 
curlx: use curl alloc in `curlx_win32_stat()` (Windows)

It's safe because we do not call `curlx_win32_stat()` from memdebug.c.

Closes #20043

5 weeks agotool_urlglob: constify an argument
Viktor Szakats [Sat, 20 Dec 2025 03:41:02 +0000 (04:41 +0100)] 
tool_urlglob: constify an argument

Also: add argument names to prototypes.

Closes #20045

5 weeks agocmake: match filename suffixes with file content
Viktor Szakats [Fri, 19 Dec 2025 13:57:10 +0000 (14:57 +0100)] 
cmake: match filename suffixes with file content

To:
- simplify recognizing CMake sources.
- ensure syntax highlighters use the correct file type.
- sync .h template filename with its autotools counterpart.

Also:
- cmakelint.sh: simplify, alpha sort the filelist.
- perlcheck.sh: simplify.

Closes #20039

5 weeks agocmake: delete unused file `CMake/CMakeConfigurableFile.in`
Viktor Szakats [Fri, 19 Dec 2025 14:10:15 +0000 (15:10 +0100)] 
cmake: delete unused file `CMake/CMakeConfigurableFile.in`

Follow-up to 8cb010144964019b865fa224e166eb37f4e1d169

Closes #20038

6 weeks agoscorecard: more upload options
Stefan Eissing [Fri, 19 Dec 2025 12:06:34 +0000 (13:06 +0100)] 
scorecard: more upload options

`--upload-no-cl` for uploads without "Content-Length:"
`--upload-parallel=1` for testing only serial uploads

Closes #20035

6 weeks agongtcp2: retune window sizes
Stefan Eissing [Fri, 19 Dec 2025 10:53:51 +0000 (11:53 +0100)] 
ngtcp2: retune window sizes

With 24b36fd stream flow control window sizes have been set too
restrictive, crippling transfer rates when no rate limit is in effect.

Disable ngtcp3 stream window auto-tuning and extend the stream window
from the small initial size to the effective rate limit. If no rate
limit is configured, extend stream window to maximum value right away.

This cannot shrink the stream window later, however. But growing the
limit or removing it, will work mid download.

Fixes #20030
Reported-by: koujaz on github
Closes #20033

6 weeks agohttp: more unfold fixing
Daniel Stenberg [Fri, 19 Dec 2025 12:22:29 +0000 (13:22 +0100)] 
http: more unfold fixing

Extended test 798 with some mini-sleeps to better trigger a problem that
was

Reported-by: Stefan Eissing
Closes #20036

6 weeks agosocketpair: drop redundant `_WIN32` branch and include
Viktor Szakats [Fri, 19 Dec 2025 10:00:53 +0000 (11:00 +0100)] 
socketpair: drop redundant `_WIN32` branch and include

`io.h` already included via `curl_setup.h`, the other headers are
already guarded off for Windows. `INADDR_LOOPBACK` fallback remains
a no-op on Windows.

Closes #20032

6 weeks agoRELEASE-NOTES: synced
Daniel Stenberg [Fri, 19 Dec 2025 10:07:40 +0000 (11:07 +0100)] 
RELEASE-NOTES: synced

6 weeks agocontributors.sh: only check -by: lines for names
Daniel Stenberg [Fri, 19 Dec 2025 10:06:41 +0000 (11:06 +0100)] 
contributors.sh: only check -by: lines for names

Avoid catching lines that otherwise just says "by:" something.

6 weeks agobuild: drop duplicate include `curl/curl.h` and others
Viktor Szakats [Fri, 19 Dec 2025 01:09:15 +0000 (02:09 +0100)] 
build: drop duplicate include `curl/curl.h` and others

- curl_range: replace `sendf.h` with direct header dependency
  `curl_trc.h`.
- drop `curl/curl.h` includes from internal sourcees in favor of the
  include made from `curl_setup.h`. Replace it with the latter where
  it's the only include.
- include `curl_setup.h` before using macros, where missing.
- drop redundant `stdlib.h`, `string.h` includes, in favor of
  `curl_setup_once.h` including them.
- drop redundant `limits.h` in favor of `curl_setup.h` including it.
- fake_addrinfo.h: fix typo in comment.
- curl_setup_once.h: drop `stdio.h` in favor of earlier include in
  `curl_setup.h`.
- drop stray, unused, `stddef.h` includes.
- memdebug.h: add missing `stddef.h` include. (relying on accidental
  includes via other headers before this patch.)
- stddef.h: document why it's included.
- strerr: drop `curl/mprintf.h` in favor of `curl/curl.h` including it
  via `curl_setup.h`.

Closes #20027

6 weeks agohttp: fix for unfolding line starting with TAB
Daniel Stenberg [Fri, 19 Dec 2025 08:15:40 +0000 (09:15 +0100)] 
http: fix for unfolding line starting with TAB

It should still insert a (single) space when unfolding

Follow-up to 9941e7c95bf26f00fd87888a3 following up to 67ae101666f10232.

Updated test 1274 and 1940 accordingly.

Closes #20029

6 weeks agoCURLOPT_ACCEPT_ENCODING.md: warn about the expansion
Daniel Stenberg [Fri, 19 Dec 2025 09:14:14 +0000 (10:14 +0100)] 
CURLOPT_ACCEPT_ENCODING.md: warn about the expansion

also mention it in KNOWN_RISKS.md

Closes #20031

6 weeks agocompressed.md: might generate a huge amount of bytes
Daniel Stenberg [Fri, 19 Dec 2025 08:04:16 +0000 (09:04 +0100)] 
compressed.md: might generate a huge amount of bytes

Make sure this is not a surprise

Closes #20028

6 weeks agobuild: drop unused includes
Viktor Szakats [Thu, 18 Dec 2025 23:56:34 +0000 (00:56 +0100)] 
build: drop unused includes

`curl_endian.h`, `easyif.h`, `llist.h`, `progress.h`, `slist.h`.

Also:
- multi_ev.h: delete unused include, add a missing direct one.

Closes #20025

6 weeks agobuild: drop unused `multiif.h` includes
Viktor Szakats [Thu, 18 Dec 2025 23:37:13 +0000 (00:37 +0100)] 
build: drop unused `multiif.h` includes

Closes #20023

6 weeks agocurl_trc: delete unused DoH remains
Viktor Szakats [Fri, 19 Dec 2025 00:09:45 +0000 (01:09 +0100)] 
curl_trc: delete unused DoH remains

Closes #20026

6 weeks agobuild: drop unused `curlx/inet_pton.h` includes
Viktor Szakats [Thu, 18 Dec 2025 23:48:39 +0000 (00:48 +0100)] 
build: drop unused `curlx/inet_pton.h` includes

Closes #20024

6 weeks agobuild: drop unused `curl_share.h` includes
Viktor Szakats [Thu, 18 Dec 2025 23:27:59 +0000 (00:27 +0100)] 
build: drop unused `curl_share.h` includes

Closes #20022

6 weeks agotimeval: scope a variable, merge two PP branches
Viktor Szakats [Thu, 18 Dec 2025 22:14:27 +0000 (23:14 +0100)] 
timeval: scope a variable, merge two PP branches

Closes #20021

6 weeks agoTIME-KEEPING.md: fold long lines
Viktor Szakats [Thu, 18 Dec 2025 22:00:06 +0000 (23:00 +0100)] 
TIME-KEEPING.md: fold long lines

6 weeks agotime-keeping: keep timestamp in multi, always update
Stefan Eissing [Thu, 18 Dec 2025 12:55:07 +0000 (13:55 +0100)] 
time-keeping: keep timestamp in multi, always update

Always use curlx_now() when calling Curl_pgrs_now(data). Tests with the
"manual" updates to now proved differ more then 100ms in parallel testing.

Add `curlx_nowp()` to set current time into a struct curltime.
Add `curlx_ptimediff_ms() and friends, passing pointers.

Update documentation.

Closes #19998

6 weeks agotidy-up: miscellaneous
Viktor Szakats [Fri, 12 Dec 2025 19:51:52 +0000 (20:51 +0100)] 
tidy-up: miscellaneous

- apply more clang-format.
- lib/version: use `CURL_ARRAYSIZE()`.
- INSTALL-CMAKE.md: sync-up an option description with others.
- examples: delete unused main args.
- examples/ftpgetinfo: document `_CRT_SECURE_NO_WARNINGS` symbol.
- delete remaining stray duplicate lines.
- acinclude.m4: drop an unnecessary x-hack.
- vtls/mbedtls: join a URL split into two lines.
- src/tool_cb_see: add parentheses around macro expressions.
- src/tool_operate: move literals to the right side of comparisons.
- libtests: sync up fopen/fstat error messages between tests.
- curl_setup.h: replace `if ! defined __LP64` with `ifndef __LP64`.
  I assume it makes no difference on Tandem systems, as the latter form
  is already used in `include/curl/system.h`.

Closes #20018

6 weeks agoINSTALL-CMAKE.md: add recently added targets
Viktor Szakats [Thu, 18 Dec 2025 20:14:31 +0000 (21:14 +0100)] 
INSTALL-CMAKE.md: add recently added targets

Follow-up to d7bde803ee839eb438c95a1142411ceff2a11672 #20014

Closes #20020