Commit Graph

45109 Commits

Author SHA1 Message Date
Rafael Gonzaga 62c62056ca
benchmark: calibrate length of util.diff
500 + 1000 already cover the curve. 2000 doesn’t add
new qualitative insight — it just extends the same curve
further down (another ~3–4× slowdown).

According to https://github.com/nodejs/performance/issues/186
this benchmark takes one minute to conclude a single run.
This should fix it.

PR-URL: https://github.com/nodejs/node/pull/59588
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Chemi Atlow <chemi@atlow.co.il>
2025-08-24 20:57:38 +00:00
Tobias Nießen f86b652bc8
src: enforce assumptions in FIXED_ONE_BYTE_STRING
These functions are both meant to be used with a null-terminated and
thus non-empty sequence of `char`s. However, there is nothing stopping
call sites from passing zero-length sequences, which would certainly not
be null-terminated and also would cause an underflow in `N - 1`.
Therefore, this commit

- changes the size `N` of the array from `int` to `std::size_t`,
- ensures that compilation will fail if `N = 0`, and
- adds a runtime assertion that fails if the `N`-th `char` is not `\0`.

Note that the runtime assertion should be eliminated by any optimizing
compiler when given a string literal, which is how these functions are
used for the most part (though not exclusively).

PR-URL: https://github.com/nodejs/node/pull/58155
Reviewed-By: Daniel Lemire <daniel@lemire.me>
Reviewed-By: Darshan Sen <raisinten@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Gerhard Stöbich <deb2001-github@yahoo.de>
2025-08-24 11:07:37 +00:00
Filip Skokan 8692e601cc
crypto: add AES-OCB Web Cryptography algorithm
PR-URL: https://github.com/nodejs/node/pull/59539
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: James M Snell <jasnell@gmail.com>
2025-08-24 09:47:20 +00:00
Node.js GitHub Bot 28e6ba8e4d
crypto: update root certificates to NSS 3.114
This is the certdata.txt[0] from NSS 3.114.

This is the version of NSS that shipped in Firefox 142.0 on 2025-08-19.

Certificates added:
- TrustAsia TLS ECC Root CA
- TrustAsia TLS RSA Root CA
- SwissSign RSA TLS Root CA 2022 - 1

Certificates removed:
- GlobalSign Root CA
- Entrust.net Premium 2048 Secure Server CA
- Baltimore CyberTrust Root
- Comodo AAA Services root
- XRamp Global CA Root
- Go Daddy Class 2 CA
- Starfield Class 2 CA

[0] https://raw.githubusercontent.com/nss-dev/nss/refs/tags/NSS_3_114_RTM/lib/ckfw/builtins/certdata.txt

PR-URL: https://github.com/nodejs/node/pull/59571
Reviewed-By: Richard Lau <richard.lau@ibm.com>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
2025-08-23 23:12:43 +00:00
Alex Yang d1eabcb044
sqlite: add sqlite-type symbol for DatabaseSync
PR-URL: https://github.com/nodejs/node/pull/59405
Reviewed-By: Edy Silva <edigleyssonsilva@gmail.com>
2025-08-23 21:45:43 +00:00
René 52f616d42f
test_runner: do not error when getting `fullName` of root context
PR-URL: https://github.com/nodejs/node/pull/59377
Reviewed-By: Chemi Atlow <chemi@atlow.co.il>
Reviewed-By: Pietro Marchini <pietro.marchini94@gmail.com>
Reviewed-By: Moshe Atlow <moshe@atlow.co.il>
2025-08-23 19:40:58 +00:00
Filip Skokan 589ef79bf8
crypto: support ML-KEM in Web Cryptography
PR-URL: https://github.com/nodejs/node/pull/59569
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: James M Snell <jasnell@gmail.com>
2025-08-23 17:01:51 +02:00
Aviv Keller 19d2cee62c
meta: update devcontainer to the latest schema
PR-URL: https://github.com/nodejs/node/pull/54347
Reviewed-By: James M Snell <jasnell@gmail.com>
2025-08-23 14:20:51 +00:00
Filip Skokan 0fab11805f
crypto: require HMAC key length with SHA-3 hashes in Web Cryptography
PR-URL: https://github.com/nodejs/node/pull/59567
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
2025-08-23 10:25:50 +00:00
Sohyeon Kim fb07edc82f
test: use mustSucceed in test-repl-tab-complete-import
Refactor test/parallel/test-repl-tab-complete-import.js to use
mustSucceed in places where no error is expected in the callback. This
clarifies the intent of the tests and improves assertion accuracy.

Refs: https://github.com/nodejs/node/pull/59204
PR-URL: https://github.com/nodejs/node/pull/59368
Reviewed-By: Zeyu "Alex" Yang <himself65@outlook.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
2025-08-23 09:28:02 +00:00
Richard Lau 6fd67ec6e3
test: skip sea tests on Linux ppc64le
Theses tests are failing when compiled with clang. Skip for now to
avoid breaking the CI when we switch over to building with clang.

PR-URL: https://github.com/nodejs/node/pull/59563
Refs: https://github.com/nodejs/node/issues/59561
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Xuguang Mei <meixuguang@gmail.com>
Reviewed-By: Marco Ippolito <marcoippolito54@gmail.com>
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
2025-08-22 19:23:39 +00:00
Filip Skokan 7178e9141a
crypto: fix subtle.getPublicKey error for secret type key inputs
PR-URL: https://github.com/nodejs/node/pull/59558
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
2025-08-22 15:56:56 +00:00
Chengzhong Wu 3b4f9b26b1
module: allow overriding linked requests for a ModuleWrap
This allows overriding linked requests for a `ModuleWrap`. The
`statusOverride` in `vm.SourceTextModule` could call `moduleWrap.link`
a second time when `statusOverride` of `linking` is set to undefined.

Overriding of linked requests should be no harm but better to be
avoided. However, this will require a follow-up fix on `statusOverride`
in `vm.SourceTextModule`.

PR-URL: https://github.com/nodejs/node/pull/59527
Fixes: https://github.com/nodejs/node/issues/59480
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: Marco Ippolito <marcoippolito54@gmail.com>
2025-08-22 12:57:07 +00:00
Edy Silva 3c1521cfa0
sqlite: handle ?NNN parameters as positional
PR-URL: https://github.com/nodejs/node/pull/59350
Reviewed-By: Zeyu "Alex" Yang <himself65@outlook.com>
2025-08-22 12:56:58 +00:00
Joyee Cheung b85e77bf27
src: use simdjson to parse --snapshot-config
PR-URL: https://github.com/nodejs/node/pull/59473
Refs: https://github.com/nodejs/node/issues/59288
Reviewed-By: Daniel Lemire <daniel@lemire.me>
2025-08-22 11:07:50 +00:00
Chengzhong Wu 5ced518860
node-api: link to other programming language bindings
PR-URL: https://github.com/nodejs/node/pull/59516
Refs: https://github.com/nodejs/node/pull/59498
Reviewed-By: Vladimir Morozov <vmorozov@microsoft.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
2025-08-22 10:57:45 +00:00
Pietro Marchini 08556f0555
test: support standalone env comment in tests
PR-URL: https://github.com/nodejs/node/pull/59546
Reviewed-By: Marco Ippolito <marcoippolito54@gmail.com>
Reviewed-By: Chemi Atlow <chemi@atlow.co.il>
2025-08-22 09:24:31 +00:00
Aviv Keller 56de98b13c
doc: link to `TypedArray.from()` in signature
PR-URL: https://github.com/nodejs/node/pull/59226
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Ulises Gascón <ulisesgascongonzalez@gmail.com>
Reviewed-By: Tierney Cyren <hello@bnb.im>
Reviewed-By: Zeyu "Alex" Yang <himself65@outlook.com>
Reviewed-By: Qingyu Deng <i@ayase-lab.com>
2025-08-21 23:30:30 +00:00
성우현 | Woohyun Sung 5abb0666e7
typings: add missing URLBinding methods
PR-URL: https://github.com/nodejs/node/pull/59468
Reviewed-By: Daeyeon Jeong <daeyeon.dev@gmail.com>
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
2025-08-21 20:39:21 +00:00
Meghan Denny 553f236865
test: rename test-net-server-drop-connections-in-cluster.js to -http-
PR-URL: https://github.com/nodejs/node/pull/59532
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
2025-08-21 19:38:09 +00:00
PhistucK a73a9a028b
doc: fix typos in `environment_variables.md`
PR-URL: https://github.com/nodejs/node/pull/59536
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
2025-08-21 16:55:34 +02:00
Filip Skokan d30090b427 crypto: return cached copies from CryptoKey algorithm and usages getters
Fixes: https://github.com/nodejs/node/issues/59534
PR-URL: https://github.com/nodejs/node/pull/59538
Fixes: https://github.com/nodejs/node/issues/59535
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
Reviewed-By: Rafael Gonzaga <rafael.nunu@hotmail.com>
2025-08-21 14:14:57 +00:00
Filip Skokan 9d744b5b63 crypto: use CryptoKey internal slots in Web Cryptography
PR-URL: https://github.com/nodejs/node/pull/59538
Fixes: https://github.com/nodejs/node/issues/59535
Fixes: https://github.com/nodejs/node/issues/59534
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
Reviewed-By: Rafael Gonzaga <rafael.nunu@hotmail.com>
2025-08-21 14:14:57 +00:00
Filip Skokan 7a47cbf4c5 crypto: normalize RsaHashedKeyParams publicExponent
Fixes: https://github.com/nodejs/node/issues/59535
PR-URL: https://github.com/nodejs/node/pull/59538
Fixes: https://github.com/nodejs/node/issues/59534
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
Reviewed-By: Rafael Gonzaga <rafael.nunu@hotmail.com>
2025-08-21 14:14:56 +00:00
Node.js GitHub Bot b6b7f39d3a
deps: update undici to 7.14.0
PR-URL: https://github.com/nodejs/node/pull/59507
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Matthew Aitken <maitken033380023@gmail.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
Reviewed-By: Rafael Gonzaga <rafael.nunu@hotmail.com>
Reviewed-By: Richard Lau <richard.lau@ibm.com>
2025-08-21 13:54:51 +00:00
Tim Perry b5e8247339
http2: add support for raw header arrays in h2Stream.respond()
PR-URL: https://github.com/nodejs/node/pull/59455
Reviewed-By: Ethan Arrowood <ethan@arrowood.dev>
Reviewed-By: Gerhard Stöbich <deb2001-github@yahoo.de>
2025-08-21 11:18:10 +00:00
Khafra 44d9e6d8ad
stream: add brotli support to CompressionStream and DecompressionStream
Refs: https://github.com/whatwg/compression/issues/34
PR-URL: https://github.com/nodejs/node/pull/59464
Reviewed-By: Mattias Buelens <mattias@buelens.com>
Reviewed-By: Jason Zhang <xzha4350@gmail.com>
Reviewed-By: Ethan Arrowood <ethan@arrowood.dev>
2025-08-21 02:22:19 +00:00
Pietro Marchini 3e1ae63451
test: lazy-load internalTTy
PR-URL: https://github.com/nodejs/node/pull/59517
Reviewed-By: Moshe Atlow <moshe@atlow.co.il>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Chemi Atlow <chemi@atlow.co.il>
2025-08-20 19:50:01 +00:00
Pietro Marchini 2782b4dd2d
tools: avoid parsing test files twice
PR-URL: https://github.com/nodejs/node/pull/59526
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Marco Ippolito <marcoippolito54@gmail.com>
2025-08-20 19:33:00 +00:00
Antoine du Hamel 499a5c3451
test: fix `test-setproctitle` status when `ps` is not available
PR-URL: https://github.com/nodejs/node/pull/59523
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
2025-08-20 18:24:04 +00:00
Rafael Gonzaga a43f984761
doc: add security incident reponse plan
PR-URL: https://github.com/nodejs/node/pull/59470
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Ulises Gascón <ulisesgascongonzalez@gmail.com>
2025-08-20 17:57:45 +00:00
Joyee Cheung 7535aa1f72 esm: link modules synchronously when no async loader hooks are used
When no async loader hooks are registered, perform the linking as
synchronously as possible to reduce the chance of races from the
the shared module loading cache.

PR-URL: https://github.com/nodejs/node/pull/59519
Fixes: https://github.com/nodejs/node/issues/59366
Refs: https://github.com/abejfehr/node-22.18-issue-repro
Reviewed-By: Geoffrey Booth <webadmin@geoffreybooth.com>
Reviewed-By: Filip Skokan <panva.ip@gmail.com>
Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
2025-08-20 14:31:08 +00:00
Joyee Cheung db70ceb49f esm: show race error message for inner module job race
The race can not only happen when the ESM is loaded by
the CommonJS loader, but can also happen to inner
module jobs in the dependency graph.

PR-URL: https://github.com/nodejs/node/pull/59519
Fixes: https://github.com/nodejs/node/issues/59366
Refs: https://github.com/abejfehr/node-22.18-issue-repro
Reviewed-By: Geoffrey Booth <webadmin@geoffreybooth.com>
Reviewed-By: Filip Skokan <panva.ip@gmail.com>
Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
2025-08-20 14:31:08 +00:00
Filip Skokan f8d68d30ae
crypto: support ML-KEM, DHKEM, and RSASVE key encapsulation mechanisms
PR-URL: https://github.com/nodejs/node/pull/59491
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Rafael Gonzaga <rafael.nunu@hotmail.com>
2025-08-20 14:30:58 +00:00
Richard Lau 70690be494
build: do not set `-mminimal-toc` with `clang`
This is a gcc-only option, do not pass to clang.

PR-URL: https://github.com/nodejs/node/pull/59484
Refs: https://github.com/nodejs/build/issues/4091
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Rafael Gonzaga <rafael.nunu@hotmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Darshan Sen <raisinten@gmail.com>
2025-08-20 13:55:28 +00:00
Krishnadas PC 6c215fb746
http: trim off brackets from IPv6 addresses with string operations
This is simpler than using regular expressions.

PR-URL: https://github.com/nodejs/node/pull/59420
Reviewed-By: Daniel Lemire <daniel@lemire.me>
Reviewed-By: Vinícius Lourenço Claro Cardoso <contact@viniciusl.com.br>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
2025-08-20 11:34:26 +00:00
Lee Jiho ebbdea29ac
benchmark, test: replace CRLF variable with string literal
PR-URL: https://github.com/nodejs/node/pull/59466
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Marco Ippolito <marcoippolito54@gmail.com>
Reviewed-By: Paolo Insogna <paolo@cowtech.it>
Reviewed-By: Tim Perry <pimterry@gmail.com>
Reviewed-By: Rafael Gonzaga <rafael.nunu@hotmail.com>
Reviewed-By: Daeyeon Jeong <daeyeon.dev@gmail.com>
2025-08-20 07:10:17 +00:00
Pietro Marchini 518d80d48a
test: add parseTestMetadata support
PR-URL: https://github.com/nodejs/node/pull/59503
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: Chemi Atlow <chemi@atlow.co.il>
2025-08-20 06:58:13 +00:00
Alex Yang 3e5885b3cb
doc: clarify maxRSS unit in `process.resourceUsage()`
PR-URL: https://github.com/nodejs/node/pull/59511
Fixes: https://github.com/nodejs/node/issues/59508
Reviewed-By: Daeyeon Jeong <daeyeon.dev@gmail.com>
Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
2025-08-20 05:36:07 +00:00
Ranieri Althoff bdcab711b8
crypto: add argon2() and argon2Sync() methods
Co-authored-by: Filip Skokan <panva.ip@gmail.com>
Co-authored-by: James M Snell <jasnell@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/50353
Reviewed-By: Ethan Arrowood <ethan@arrowood.dev>
Reviewed-By: Filip Skokan <panva.ip@gmail.com>
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
2025-08-19 19:30:38 +00:00
RANDRIAMANANTENA Narindra Tiana Annaick ef58be6f0c
doc: add missing Zstd strategy constants
PR-URL: https://github.com/nodejs/node/pull/59312
Fixes: https://github.com/nodejs/node/issues/59290
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
2025-08-19 18:38:44 +00:00
Node.js GitHub Bot 3755e8b144
test: update WPT for WebCryptoAPI to ff26d9b307
PR-URL: https://github.com/nodejs/node/pull/59497
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Filip Skokan <panva.ip@gmail.com>
Reviewed-By: Jason Zhang <xzha4350@gmail.com>
2025-08-19 16:55:44 +00:00
hotpineapple a97562896f
child_process: remove unsafe array iteration
PR-URL: https://github.com/nodejs/node/pull/59347
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
2025-08-19 18:14:48 +02:00
Filip Skokan eaf1c15749
crypto: support ML-DSA spki/pkcs8 key formats in Web Cryptography
PR-URL: https://github.com/nodejs/node/pull/59365
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Ethan Arrowood <ethan@arrowood.dev>
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
2025-08-19 15:57:27 +02:00
Filip Skokan 5329f73816
lib: refactor kSupportedAlgorithms
PR-URL: https://github.com/nodejs/node/pull/59365
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Ethan Arrowood <ethan@arrowood.dev>
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
2025-08-19 15:57:25 +02:00
Filip Skokan 0cc2c83e32
crypto: subject some algorithms in Web Cryptography on BoringSSL absence
PR-URL: https://github.com/nodejs/node/pull/59365
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Ethan Arrowood <ethan@arrowood.dev>
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
2025-08-19 15:57:23 +02:00
Filip Skokan 84aaed7597
crypto: add ChaCha20-Poly1305 Web Cryptography algorithm
PR-URL: https://github.com/nodejs/node/pull/59365
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Ethan Arrowood <ethan@arrowood.dev>
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
2025-08-19 15:57:08 +02:00
Filip Skokan cec039f786
test: add Web Cryptography wrap/unwrap vectors
PR-URL: https://github.com/nodejs/node/pull/59365
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Ethan Arrowood <ethan@arrowood.dev>
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
2025-08-19 15:56:02 +02:00
Filip Skokan 0606d0822e
doc: compress Web Cryptography Algorithm matrix
PR-URL: https://github.com/nodejs/node/pull/59365
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Ethan Arrowood <ethan@arrowood.dev>
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
2025-08-19 15:56:01 +02:00
Filip Skokan 6dabd43e17
test: cleanup test-webcrypto-supports
PR-URL: https://github.com/nodejs/node/pull/59365
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Ethan Arrowood <ethan@arrowood.dev>
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
2025-08-19 15:55:59 +02:00