Commit Graph

35979 Commits

Author SHA1 Message Date
Michał Petryka
37c6744997 .editorconfig: add
This allows IDEs that support this standard to automatically use the
correct formatting options.

Closes #18409
2025-09-02 08:36:40 +02:00
Daniel Stenberg
f8e6e11725 parsedate: make Curl_getdate_capped able to return epoch
By returning error separately on parse errors and avoiding magic
numbers, this function can now return 0 or -1 as proper dates when such
a date string is provided.

Closes #18445
2025-09-02 07:55:34 +02:00
Stefan Eissing
4d040c71d7 Curl_http(), decomplexify
Split out adding of individual request headers into a switch. Check
the connection http version only on fresh connections, use separate
methods.

Add TE: header directly without allocation. Add bit for indicating
Connection: header has been added and custom headers should not do
that again.

Closes #18444
2025-09-02 07:54:46 +02:00
Daniel Stenberg
e00cb001c6 CURLINFO_FILETIME*.md: correct the examples
Only -1 means bad value, all others are acceptable.

Ref: #18424
Closes #18447
2025-09-02 07:51:14 +02:00
Daniel Stenberg
9598ccee59 tool_filetime: correct the conditions
The libcurl API for CURLINFO_FILETIME_T clearly says it contains -1 if
not set. Everything else is a valid time stamp so use that.

Follow-up to 54f1ef05d6
Closes #18446
2025-09-02 07:50:11 +02:00
Stefan Eissing
e65dc7fa23 aws-lc: do not use large buffer
test_10_08, uploading larger files for a h2 proxy, sporadically fails
with a decrpytion error on received data in AWS-LC. The frequency can
be increased by simulated network receive blocks.

Not setting a 4 * TLS record sized buffer, leaving AWS-LC at its
default buffer size seems to mitigate this problem.

Closes #18434
2025-09-01 23:27:11 +02:00
Yedaya Katsman
63b7d8b8f4 autotools: make curl-config executable
This was already done when building using CMake:
fa9151b41a/CMakeLists.txt (L2391-L2394)

Closes #18433
2025-09-01 09:41:30 +02:00
Daniel Stenberg
5256ce229e cw-out: add assert for data->conn
Instead of checking it runtime. CodeSonar pointed out that if it
actually CAN legitimately be NULL here, then we need to do more checks
for it...

Closes #18440
2025-09-01 08:53:39 +02:00
Daniel Stenberg
84c92f7113 tool: move the error buffer to the per transfer struct
To avoid having to alloc or manage it separately.

Closes #18442
2025-09-01 08:52:57 +02:00
Daniel Stenberg
54f1ef05d6 tool_filetime: accept setting negative filetime
This allows --remote-time to set dates before 1970.

Due to a minor omission in the API, it will still avoid setting the time
if it is indeed exactly epoch 0 (jan 1 1970).

Verified by test 762

Fixes #18424
Reported-by: Terence Eden
Closes #18443
2025-09-01 08:51:36 +02:00
Daniel Stenberg
a5798a51f0 test500: accept 81 allocations
In some configs they happen

Closes #18441
2025-08-31 23:25:37 +02:00
renovate[bot]
db32083f4a GHA/http3-linux: update dependency ngtcp2/ngtcp2 to v1.15.1
Closes #18439
2025-08-31 11:55:07 +02:00
renovate[bot]
5249b99a70 GHA/windows: update msys2/setup-msys2 digest to fb197b7
https://github.com/msys2/setup-msys2/releases/tag/v2.29.0

Includes perl 5.40.3.

Ref: 5bb49a485c #18425

Closes #18438
2025-08-31 11:28:10 +02:00
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