Commit Graph

35966 Commits

Author SHA1 Message Date
Daniel Stenberg
4a3ed6fc16
urlglob: only accept 255 globs
- using {} with single entries makes little sense
- when using {} sets with two entry lists, there can only be 64 to reach
  maximum number of URLs

Verify the max check in test 761
2025-08-30 22:27:28 +02:00
Viktor Szakats
598078dcf8
curl_setup.h: include stdint.h earlier
To have it included by the time checking for `SIZE_MAX` and `SSIZE_MAX`.

Ref: 93f333c18f #18426 #18406

Closes #18430
2025-08-29 21:14:35 +02:00
Stefan Eissing
fa9151b41a
cw-out: handle error codes for 0len writes
Handle errors returned by the callback the same for 0-length writes as
for all the others.

Closes #18428
2025-08-29 16:01:16 +02:00
XCas13
21c288902d
ngtcp2: handshake timeout should be equal to --connect-timeout
Default timeout is hardcoded (10 seconds) and doesn't respect
--connect-timeout parameter. In some cases 10 seconds can be not enough
or too long to "establish a connection". Moreover the non-working
--connect-timeout parameter for http3 is confusing. This change makes
the handshake timeout equal to --connect-timeout, if it's set.
Discussion is here https://github.com/curl/curl/discussions/18427

Closes #18431
2025-08-29 15:59:06 +02:00
Viktor Szakats
5bb49a485c
GHA/windows: fix perl 5.40.3 bump fallout with custom-built modules
Perl got bumped from 5.38.4 to 5.40.3. The new version crashes when
loading the `Win32::Process*` modules built and cached in CI. The build
job uses Perl 5.38.4.

To avoid the crash, include the Perl version (hashed) in the cache key,
so that it's only loaded when the Perl version matches.

This solution is imperfect, because some of the jobs will not use the
Perl modules in transition periods, when different jobs use different
Perl versions. Anyway, can't think of a better one for now. Another
option is to drop the effort with these modules. After all they did not
help with crashes and hangs, nor with performance. While adding quite
a bit of CI complexity.

Also:
- test early if the modules load and log the result.

Follow-up to 52775a7fb4 #18296

Closes #18425
2025-08-29 15:26:55 +02:00
Daniel Stenberg
93f333c18f
curl_setup: use SIZE_MAX instead of SIZE_T_MAX
As SIZE_MAX exists in C99

Assisted-by: Stefan Eissing
Assisted-by: Jay Satiro

Ref: #18406
Closes #18426
2025-08-29 09:45:06 +02:00
Viktor Szakats
7ceb9c54aa
clang-tidy: disable clang-analyzer-security.ArrayBound
It's causing false-positives with clang-tidy v21, in cases in system
headers (seen in `FD_ISSET()` with macOS SDK). In some cases in
tests/server, there was no distinct source line that was triggering it.

Example:
```
/Applications/Xcode_16.4.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX15.5.sdk/usr/include/sys/_types/_fd_def.h:83:10: error: Potential out of bound access to 'fds_read.fds_bits' with tainted index [clang-analyzer-security.ArrayBound,-warnings-as-errors]
   83 |                 return _p->fds_bits[(unsigned long)_fd / __DARWIN_NFDBITS] & ((__int32_t)(((unsigned long)1) << ((unsigned long)_fd % __DARWIN_NFDBITS)));
      |                        ^
[...]
/Users/runner/work/curl/curl/tests/server/socksd.c:679:5: note: Taking false branch
  679 |     if(rc < 0) {
      |     ^
```

Closes #18422
2025-08-29 03:07:42 +02:00
Daniel Stenberg
c3bbd41eef
DEPRECATE.md: drop old OpenSSL versions
Closes #18413
2025-08-28 17:52:40 +02:00
Daniel Stenberg
fe01ace248
cookie: simplifications
- add Curl_secure_context(), to have it determined in a single place.

- tweak the Curl_cookie_getlist() proto. Move some logic into the
  function - at is only called in a single place. Instead of forcing the
  caller to do it.

- make 'is_ip' a const

Closes #18419
2025-08-28 17:52:07 +02:00
Stefan Eissing
f08ecdc586
requests: fix uninitialized var
init char whose address is passed for a 0-length buffer, clang does not
like it

Refs #18418
Closes #18420
2025-08-28 14:58:59 +02:00
Stefan Eissing
fa3baabbd8
websocket: improve handling of 0-len frames
Write out 9-length frames to client's WRITEFUNCTION
Read 0-length frames from READFUNCTION *if* the function
started a new frame via `curl_ws_start_frame()`.

Fixes #18286
Closes #18332
Reported-by: Andriy Druk
2025-08-28 11:00:02 +02:00
Daniel Stenberg
fd2a204c23
RELEASE-NOTES: synced 2025-08-28 09:51:22 +02:00
Viktor Szakats
3c64ffaff4
HTTP3.md: avoid configure issue for ngtcp2 1.14.0+ compatibility
Applied the same workaround to the build examples as used earlier in CI.
That is, drop `<path> from `--with-ngtcp2=<path>` and configure env
`PKG_CONFIG_PATH` instead.

Till the root cause is fixed.

Ref: 99500660af #18028

Reported-by: Pavel Kropachev
Fixes #18188
Closes #18415
2025-08-27 16:38:16 +02:00
Daniel Stenberg
0718ae7c61
DEPRECATE.md: drop support for c-ares versions before 1.16.0
in March 2026

That month, c-ares 1.16.0 celebrates its sixth birthday.

Closes #18408
2025-08-27 10:45:23 +02:00
Jay Satiro
cd015c8819 schannel: fix renegotiation
- Move the schannel_recv renegotiation code to function
  schannel_recv_renegotiate.

- Save the state of a pending renegotiation.

- Pre-empt schannel_recv and schannel_send to continue a pending
  renegotation.

- Partially block during renegotiation if necessary.

Prior to this change, since a1850ad7 (precedes 8.13.0), schannel_recv
did not properly complete renegotiation before attempting to decrypt
data. In some cases that could cause an error SEC_E_CONTEXT_EXPIRED.
Most of the time though DecryptMessage would succeed by chance and
return SEC_I_RENEGOTIATE which allowed the renegotiation to continue.

Reported-by: stephannn@users.noreply.github.com
Reported-by: Dustin L. Howett

Fixes https://github.com/curl/curl/issues/18029
Closes https://github.com/curl/curl/pull/18125
2025-08-27 02:10:05 -04:00
Jay Satiro
b9be9f9466 schannel: fix memory leak during handshake
Follow-up to b6a5f672 which improved the handshake procedure.

Ref: https://github.com/curl/curl/pull/18323

Closes https://github.com/curl/curl/pull/18410
2025-08-27 02:10:04 -04:00
Daniel Stenberg
d77a23c263
tests: remove the QUIT filters
Once added in cd4aee156f to work around connection shutdown
issues.

Closes #18405
2025-08-27 08:03:59 +02:00
Daniel Stenberg
0f3f6e3a93
wolfssl: simplify Curl_wssl_ctx_init
by splitting out functions for client certificate and setting min/max
TLS version

Closes #18402
2025-08-27 08:02:24 +02:00
Viktor Szakats
0a96b878f7
GHA/linux: build -O3 job with unity batches to save 10-15s
Before (build, test run):
https://github.com/curl/curl/actions/runs/16974205126/job/48118716664 25s, 12m56
https://github.com/curl/curl/actions/runs/16973102133/job/48114977897 24s, 12m51

After, with batch size 50 (build, test run):
https://github.com/curl/curl/actions/runs/17250901063/job/48952645881?pr=18293 16s, 12m51
https://github.com/curl/curl/actions/runs/17250901063/job/48953665204?pr=18293 17s, 12m42

Closes #18293
2025-08-27 00:15:30 +02:00
Daniel Stenberg
5beb644661
ftp: simplify
- Avoid checking what's always true. The ftpcode pointer is always
  passed in, so use it.
- Simplified an indent level somewhat
- Split out two functions from the state machine

Closes #18403
2025-08-26 23:34:52 +02:00
Daniel Stenberg
98c78b2f14
runtests: remove warning message
Every time we first run runtests with -j and then again *without* -j,
this message was shown:

  "Warning: $runnerid: cleardir(log) failed"

Not anymore.

Closes #18404
2025-08-26 23:33:13 +02:00
Daniel Stenberg
05407422fb
socks_sspi: simplify, clean up Curl_SOCKS5_gssapi_negotiate
This function returned error on MANY places, each with its own cleanup
sequence and by the look of it almost all of them were incomplete,
making them leak resources on errors.

This take now gotos to the error label where it cleans everything up
before returning error. This also simplifies the function a lot.

Closes #18315
2025-08-26 15:01:47 +02:00
Daniel Stenberg
ebff00f1af
tool_getparam: let --trace-config override -v
If --trace-config is used to set a level before -v is used, don't reset
the state on first -v (to "-all") as it otherwise does. This way,
--trace-config can be used to set specific trace items before -v on the
command line and it still works.

Previously, the first -v use would otherwise reset and undo the earlier
--trace-config items.

Fixes #18346
Closes #18361
2025-08-26 14:59:59 +02:00
Viktor Szakats
455cd07410
GHA/http3-linux: add AWS-LC and BoringSSL jobs
Closes #18391
2025-08-26 12:01:39 +02:00
Viktor Szakats
e2c747bb5d
GHA/curl-for-win: drop x86, fix zlib-classic, switch back to libssh
- switch x86 job to x64. x86 is not longer actively maintained in
  curl-for-win.
  Ref: https://github.com/curl/curl-for-win/discussions/68

- switch back from libssh2 to libssh.
  Reverts af8e1aa4b0 #18257

- fix to really build with zlib-classic.
  Follow-up to 8076824870 #17357

Closes #18400
2025-08-26 11:59:23 +02:00
Daniel Stenberg
022f9a428a
write-out.md: header_json is not included the json object
Fixes #18390
Reported-by: Sebastian Carlos
Closes #18399
2025-08-26 10:10:33 +02:00
Daniel Stenberg
fef318553b
tool_urlglob: add integer overflow protection
It is most likely impossible to actually overflow, but this makes it
certain.

Closes #18398
2025-08-26 09:50:00 +02:00
Viktor Szakats
57d349fe0e
projects: generate from a single template
The three projects (VC10, VC11, VC12) are identical except 5 repeated
strings in them. They also require running `generate.bat` before use,
to populate source files. Reduce the 3 almost identical projects to
a single template project and populate the repeated strings also via
`generate.bat`. This reduces the maintenance burden to a single copy of
the project files. Also saving 10000 LOCs.

Closes #18396
2025-08-26 09:41:30 +02:00
Daniel Stenberg
bc6be7adf8
RELEASE-NOTES: synced 2025-08-25 22:52:55 +02:00
Viktor Szakats
1611e87d66
docs: point two broken links to archive.org
Closes #18393
2025-08-25 19:43:03 +02:00
Viktor Szakats
cda243d053
projects: drop unused logic from generate.bat
Follow-up to 5a0644fae8 #8442

Closes #18397
2025-08-25 19:19:48 +02:00
Viktor Szakats
ca6d6dcb20
openssl: assume OPENSSL_VERSION_NUMBER
It's defined in all supported OpenSSL versions and forks.

Also formatting in `md4.c`.

Closes #18388
2025-08-24 00:59:39 +02:00
Viktor Szakats
d65436d9a0
openssl: BoringSSL / AWS-LC tidy-ups
- schannel: apply BoringSSL workaround to AWS-LC too.
  Affects Schannel + AWS-LC MultiSSL builds. (not tested in CI)
  Ref: 274940d743 #2643 #2634

- curl_ntlm_core: deduplicate macro defines.

- curl_ntlm_core: document version thresholds for an AWS-LC-specific
  workaround.
  It was necessary between v1.2.0 2022-09-01 and v1.30.1 2024-06-21.
  No longer necessary since v1.31.0 2024-07-01:
  ba94617d99
  Follow-up to 34ef4fab22 #10320

- lib758: drop redundant OpenSSL version guards.
  `OPENSSL_VERSION_NUMBER > 3` automatically guards against LibreSSL,
  BoringSSL and AWS-LC.
  Ref: 6ddd8f2c0b
  Follow-up to a5f0ab7995 #18288

- dllmain, curl_sha512_256: formatting.

Closes #18387
2025-08-24 00:30:06 +02:00
Viktor Szakats
4c40f8b8e0
GHA/linux: add BoringSSL job, with runtests, pytests and cache
Ref: cff4c16b83 #18385
Cherry-picked from #18384
Closes #18386
2025-08-23 23:40:16 +02:00
Simon Dalvai
a855bdee90
docs: fix link CONTRIBUTE.md link
Closes #18372
2025-08-23 23:14:04 +02:00
Daniel Stenberg
aa4596a97e
mdlinkcheck: handle links with a leading slash properly
Ref: #18372
Closes #18382
2025-08-23 23:07:13 +02:00
Viktor Szakats
cff4c16b83
pytest: fix test_17_09_ssl_min_max for BoringSSL
Ref: https://github.com/curl/curl/actions/runs/17179514833/job/48740057095

Also fix indent.

Cherry-picked from #18384
Closes #18385
2025-08-23 23:04:02 +02:00
Viktor Szakats
f67090679f
openssl: sync an AWS-LC guard with BoringSSL
BoringSSL always used the same type:
https://boringssl.googlesource.com/boringssl/+/103ed08549a74af9f03363c633028faf9a475066
103ed08549

But, this codepath isn't built with BoringSSL, because it defines
`OPENSSL_NO_OCSP` via `opensslconf.h`.

Also drop an out-of-place `#endif` comment.

Ref: 20f4e94eeb #11568

Closes #18384
2025-08-23 22:57:30 +02:00
Viktor Szakats
1fc622db8e
openssl: drop single-use interim macro USE_OPENSSL_SRP
Closes #18383
2025-08-23 21:32:24 +02:00
Stefan Eissing
d57cfc1a8d
asyn-thrdd: more simplifications
- use wakeup sockets non-locked.
- send wakeup notify only in normal control flow (not cancel). close
  wakeup sockets in unlink only.
- remove 5ms thread lifetime wait crutch before pthread_cancel().

Closes #18380
2025-08-23 16:25:39 +02:00
Viktor Szakats
41923af5fc
GHA/http3-linux: build ngtcp2 for LibreSSL too, add LibreSSL jobs
Also: Build LibreSSL with cmake. It's 3x faster (90s -> 30s).

Follow-up to e724259bcb #18379
Follow-up to 31e6798544 #18377
Cherry-picked from #18377
Closes #18381
2025-08-23 16:11:00 +02:00
Viktor Szakats
31e6798544
build: support LibreSSL native crypto lib with ngtcp2 1.15.0+
In ngtcp2 1.15.0 the LibreSSL crypto interface library got its own name:
`libngtcp2_crypto_libressl`. In previous versions it used
`libngtcp2_crypto_quictls`, shared with quictls itself (but not
compatible with).

Adapt autotools and cmake scripts to look for the new name first, and
fall back to the old one if not found.

Fallback to quictls tested OK in CI with both autotools and cmake:
https://github.com/curl/curl/actions/runs/17174994908?pr=18377

Ref: https://github.com/ngtcp2/ngtcp2/releases/tag/v1.15.0
Ref: https://github.com/ngtcp2/ngtcp2/pull/1716

Closes #18377
2025-08-23 15:45:36 +02:00
renovate[bot]
e724259bcb
GHA: update ngtcp2/ngtcp2 to v1.15.0
Closes #18379
2025-08-23 13:44:50 +02:00
Daniel Stenberg
29e4a124a3
tool_operate: bail out better on no URL
To avoid NULL derferences with many outputs and --next.

Follow-up to 034612cd51

Add test 760 to verify

Reported-by: BobodevMm on github
Fixes #18375
Closes #18376
2025-08-23 13:43:46 +02:00
Viktor Szakats
1e430f806a
configure: tidy up internal names in ngtcp2 ossl detection logic
Replace "quictls" with "ossl".

Follow-up to 5eefdd71a3 #17027
Cherry-picked from #18377
Closes #18378
2025-08-23 12:42:05 +02:00
Viktor Szakats
4f0e530c77
tidy-up: formatting
Closes #18373
2025-08-23 01:12:27 +02:00
Viktor Szakats
03868ca714
asyn-thrdd: fix no HAVE_GETADDRINFO builds
mingw32ce, CM 4.4.0-arm schannel:
```
lib/asyn-thrdd.c: In function 'gethostbyname_thread':
lib/asyn-thrdd.c:349: error: too many arguments to function 'async_thrd_cleanup'
```
Ref: https://github.com/curl/curl/actions/runs/17158865566/job/48682687295?pr=18039#step:9:21

Follow-up to 88fc6c491f #18263
Closes #18371
2025-08-23 00:16:06 +02:00
Viktor Szakats
d6c51a8fda
cmake: CURL_CA_FALLBACK only works with OpenSSL
Ref: 2f6524ce3c #18364
Ref: #18362

Closes #18365
2025-08-23 00:02:33 +02:00
Daniel Stenberg
6d53263f0b
TODO: remove the expand ~ idea
As we can expand evironment variables now, HOME can easily be used
instead.

Ref: #18240
Closes #18363
2025-08-22 23:55:51 +02:00
Daniel Stenberg
2f6524ce3c
acinclude: --with-ca-fallback only works with OpenSSL
Make it error if another TLS backend is used. Also tweaked the
documentation for it to make it more clear it is only for OpenSSL.

Follow-up to 9cf4759354

Reported-by: Michael Osipov
Fixes #18362
Closes #18364
2025-08-22 23:54:14 +02:00