Commit Graph
9709 Commits
Author SHA1 Message Date
Cheng 1d8593e3b1 src: fix accessing empty string
PR-URL: https://github.com/nodejs/node/pull/57014
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Ulises Gascón <ulisesgascongonzalez@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2025-02-16 06:45:40 +00:00
Joyee Cheung d3841517e9 src: lock the isolate properly in IsolateData destructor
Otherwise it may fail the DCHECK that uses the locked thread
as a fast path to get the current thread.

PR-URL: https://github.com/nodejs/node/pull/57031
Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Rafael Gonzaga <rafael.nunu@hotmail.com>
2025-02-15 23:49:38 +00:00
Joyee Cheung 579fc67d49 crypto: support --use-system-ca on non-Windows and non-macOS
On other platforms, load from the OpenSSL default certificate
file and diretory.
This is different from --use-openssl-ca in that it caches
the certificates on first load, instead of always reading
from disk every time a new root store is needed.

When used together with the statically-linked OpenSSL, the
default configuration usually leads to this behavior:

- If SSL_CERT_FILE is used, load from SSL_CERT_FILE. Otherwise
  load from /etc/ssl/cert.pem
- If SSL_CERT_DIR is used, load from all the files under
  SSL_CERT_DIR. Otherwise, load from all the files under
  /etc/ssl/certs

PR-URL: https://github.com/nodejs/node/pull/57009
Reviewed-By: Richard Lau <rlau@redhat.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2025-02-15 22:54:31 +00:00
Juan José Arboleda 409e28d5aa fs: handle UV_ENOTDIR in fs.statSync with throwIfNoEntry provided
Fixes: https://github.com/nodejs/node/issues/56993
Signed-off-by: Juan José Arboleda <soyjuanarbol@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/56996
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: James M Snell <jasnell@gmail.com>
2025-02-15 11:47:31 -08:00
Aditi f208027c3b doc: improve documentation on argument validation
PR-URL: https://github.com/nodejs/node/pull/56954
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: Ulises Gascón <ulisesgascongonzalez@gmail.com>
2025-02-14 15:27:33 +00:00
Shelley Vohr fc7682ca4b crypto: fix missing OPENSSL_NO_ENGINE guard
PR-URL: https://github.com/nodejs/node/pull/57012
Reviewed-By: Richard Lau <rlau@redhat.com>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2025-02-14 12:26:15 +00:00
Joyee Cheung 79f96b6e84 crypto: cleanup root certificates and skip PEM deserialization
- We do not actually need them in PEM format, so just pass them
  around as X509 direcrtly.
- The cached global X509 structures were previously never cleaned
  up. Clean them up at process teardown.
- Use function-local static to ensure thread-safety in
  initialization.
- Add more comments about how the various options differ.

PR-URL: https://github.com/nodejs/node/pull/56999
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
2025-02-13 15:58:22 +00:00
Burkov Egor 85f5a6cc1e src: add self-assigment memcpy checks
Fixes: https://github.com/nodejs/node/issues/56718
PR-URL: https://github.com/nodejs/node/pull/56986
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
2025-02-12 13:13:02 +00:00
Dario PiotrowiczandYagiz Nizipli 43ffcf1d2e src: improve node::Dotenv trimming
the trimming functionality that the dotenv parsing uses currently
only takes into consideration plain spaces (' '), other type of
space characters such as tabs and newlines are not trimmed, this
can cause subtle bugs, so the changes here make sure that such
characters get trimmed as well

Co-authored-by: Yagiz Nizipli <yagiz@nizipli.com>
PR-URL: https://github.com/nodejs/node/pull/56983
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2025-02-11 22:26:51 +00:00
James M Snell cbedcd1696 src: improve error handling in string_bytes/decoder
PR-URL: https://github.com/nodejs/node/pull/56978
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
2025-02-11 16:40:02 +00:00
James M Snell 888e5eb4fd src: improve error handling in process_wrap
Replace ToLocalChecked uses.

PR-URL: https://github.com/nodejs/node/pull/56977
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
2025-02-11 16:28:04 +00:00
Michaël Zasso 3186468bed src: use args.This() in zlib
Refs: https://github.com/nodejs/node/pull/53474
PR-URL: https://github.com/nodejs/node/pull/56988
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Marco Ippolito <marcoippolito54@gmail.com>
Reviewed-By: Juan José Arboleda <soyjuanarbol@gmail.com>
2025-02-11 07:26:46 +00:00
Colin Ihrig 72e1a8fbcc sqlite: fix coverity warnings related to backup()
This commit fixes several coverity warnings related to the
recently landed backup() API.

PR-URL: https://github.com/nodejs/node/pull/56961
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2025-02-10 18:27:01 +00:00
Yagiz Nizipli b0c6e10c5e src: replace SplitString with built-in
PR-URL: https://github.com/nodejs/node/pull/54990
Reviewed-By: Daniel Lemire <daniel@lemire.me>
Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
Reviewed-By: Robert Nagy <ronagy@icloud.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
2025-02-10 18:50:42 +01:00
Burkov Egor c5c71b2946 src: add nullptr handling for NativeKeyObject
Fixes: https://github.com/nodejs/node/issues/56899
PR-URL: https://github.com/nodejs/node/pull/56900
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Filip Skokan <panva.ip@gmail.com>
2025-02-10 15:09:22 +00:00
Yagiz Nizipli 6ba36b4e03 src: disallow copy/move fns/constructors
PR-URL: https://github.com/nodejs/node/pull/56811
Reviewed-By: Juan José Arboleda <soyjuanarbol@gmail.com>
Reviewed-By: Daniel Lemire <daniel@lemire.me>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
2025-02-10 10:49:50 +00:00
Node.js GitHub Bot 5e6092bc11 deps: update zlib to 1.3.0.1-motley-788cb3c
PR-URL: https://github.com/nodejs/node/pull/56655
Reviewed-By: Rafael Gonzaga <rafael.nunu@hotmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Marco Ippolito <marcoippolito54@gmail.com>
2025-02-09 12:44:13 +00:00
Chengzhong Wu b18153598b inspector: add Network.Initiator in inspector protocol
Add initiator stack trace in inspector network events, reflecting
the location where the script created the request.

The `http.client.request.created` event is closer to where user code
creates the http request, and correctly reflects which script
initiated the request.

PR-URL: https://github.com/nodejs/node/pull/56805
Refs: https://github.com/nodejs/node/issues/53946
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Kohei Ueno <kohei.ueno119@gmail.com>
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
2025-02-08 13:39:19 +00:00
Chengzhong Wu 297a4dd339 src: add a hard dependency v8_inspector_headers
A GYP hard dependency instructs GYP to not remove the dependency link
between two static library targets in its generated output. This
allows V8 dependents to include V8 inspector protocol headers.

PR-URL: https://github.com/nodejs/node/pull/56805
Refs: https://github.com/nodejs/node/issues/53946
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Kohei Ueno <kohei.ueno119@gmail.com>
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
2025-02-08 13:39:18 +00:00
Jan Krems bf12d72faa zlib: add zstd support
Fixes: https://github.com/nodejs/node/issues/48412
PR-URL: https://github.com/nodejs/node/pull/52100
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
2025-02-08 12:43:53 +00:00
Jan Krems f5353100be deps,tools: add zstd 1.5.6
PR-URL: https://github.com/nodejs/node/pull/52100
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
2025-02-08 12:43:52 +00:00
Joyee Cheung c0953d9de7 crypto: support --use-system-ca on Windows
This patch adds support for --use-system-ca on Windows, the
certificates are collected following Chromium's policy,
though the following are left as TODO and out of this patch.

- Support for user-added intermediate certificates
- Support for distrusted certificates

Since those aren't typically supported by other runtimes/tools
either, and what's implemented in this patch is sufficient for
enough use cases already.

PR-URL: https://github.com/nodejs/node/pull/56833
Reviewed-By: James M Snell <jasnell@gmail.com>
2025-02-07 16:32:25 +00:00
marco-ippolito b74fefa6bd deps: update amaro to 0.3.2
PR-URL: https://github.com/nodejs/node/pull/56916
Reviewed-By: Jacob Smith <jacob@frende.me>
Reviewed-By: Pietro Marchini <pietro.marchini94@gmail.com>
2025-02-07 10:34:17 +00:00
Joyee Cheung 4355b3f162 crypto: fix X509* leak in --use-system-ca
The X509 structures are never freed. Use ncrypto::X509Pointer to
manage it automatically and move the X509* to PEM conversion into
a helper to be reused by integration in other systems.

PR-URL: https://github.com/nodejs/node/pull/56832
Reviewed-By: James M Snell <jasnell@gmail.com>
2025-02-06 09:18:55 -08:00
James M Snell 269496e8e1 src: improve error handling in encoding_binding.cc
PR-URL: https://github.com/nodejs/node/pull/56915
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Xuguang Mei <meixuguang@gmail.com>
Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
2025-02-06 16:12:42 +00:00
Yagiz Nizipli d54641cd38 src: avoid copy by using std::views::keys
PR-URL: https://github.com/nodejs/node/pull/56080
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Daniel Lemire <daniel@lemire.me>
Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
2025-02-06 16:12:30 +00:00
James M Snell ef9dc0857a src: remove obsolete NoArrayBufferZeroFillScope
No longer used or necessary

PR-URL: https://github.com/nodejs/node/pull/56913
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Xuguang Mei <meixuguang@gmail.com>
2025-02-06 13:38:13 +00:00
Colin Ihrig 1671921c4d sqlite: restore changes from #55373
PR #55373 introduced a performance improvement for the all()
method of prepared statements. Those changes appear to have been
accidentally overwritten in #54181. This change restores the
overwritten code.

Refs: https://github.com/nodejs/node/pull/55373
Refs: https://github.com/nodejs/node/pull/54181
PR-URL: https://github.com/nodejs/node/pull/56908
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
2025-02-06 04:12:14 +00:00
RafaelGSS d7aacbebd6 src: set signal inspector io thread name
PR-URL: https://github.com/nodejs/node/pull/56416
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Juan José Arboleda <soyjuanarbol@gmail.com>
2025-02-06 01:36:28 +00:00
RafaelGSS 5669cb03d8 src: set thread name for main thread and v8 worker
PR-URL: https://github.com/nodejs/node/pull/56416
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Juan José Arboleda <soyjuanarbol@gmail.com>
2025-02-06 01:36:28 +00:00
RafaelGSS f32054ffde src: set worker thread name using worker.name
Set the worker thread name using worker.name value
and changing the default to "WorkerThread"

PR-URL: https://github.com/nodejs/node/pull/56416
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Juan José Arboleda <soyjuanarbol@gmail.com>
2025-02-06 01:36:27 +00:00
RafaelGSS 7ba05b8065 src: use a default thread name for inspector
This commit sets a default thread name whenever
the inspector thread is created (InspectorIo)

PR-URL: https://github.com/nodejs/node/pull/56416
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Juan José Arboleda <soyjuanarbol@gmail.com>
2025-02-06 01:36:27 +00:00
Edy Silva 16dc29d4b6 sqlite, test: expose sqlite online backup api
PR-URL: https://github.com/nodejs/node/pull/56253
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Vinícius Lourenço Claro Cardoso <contact@viniciusl.com.br>
2025-02-05 22:26:28 +00:00
James M Snell a08129cb0d src: improve error handling in permission.cc
PR-URL: https://github.com/nodejs/node/pull/56904
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
Reviewed-By: Xuguang Mei <meixuguang@gmail.com>
2025-02-05 07:55:32 -08:00
James M Snell a5cc976254 src: improve error handling in node_sqlite
PR-URL: https://github.com/nodejs/node/pull/56891
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2025-02-05 07:44:25 -08:00
Divy Srivastava cebf4c8a9f sqlite: fix use-after-free in StatementSync due to premature GC
PR-URL: https://github.com/nodejs/node/pull/56840
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2025-02-05 14:33:59 +00:00
Node.js GitHub Bot 9dee7b94bf deps: update undici to 7.3.0
PR-URL: https://github.com/nodejs/node/pull/56624
Reviewed-By: Rafael Gonzaga <rafael.nunu@hotmail.com>
Reviewed-By: Marco Ippolito <marcoippolito54@gmail.com>
Reviewed-By: Michael Dawson <midawson@redhat.com>
Reviewed-By: Ulises Gascón <ulisesgascongonzalez@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
2025-02-05 09:08:28 +00:00
James M Snell 8ac3055501 src: improve error handling in node_os by removing ToLocalChecked
PR-URL: https://github.com/nodejs/node/pull/56888
Reviewed-By: Juan José Arboleda <soyjuanarbol@gmail.com>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
2025-02-05 04:20:01 +00:00
James M Snell 95c04e23ab src: improve error handling in node_url
Eliminate uses of USE and ToLocalChecked to properly
propagate errors

PR-URL: https://github.com/nodejs/node/pull/56886
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
2025-02-05 03:47:55 +00:00
Chengzhong Wu 316ac8c250 src: add memory retainer traits for external types
Add `MemoryRetainerTraits` to reveal external type memory info without
forcing them to inherit from `MemoryRetainer`.

PR-URL: https://github.com/nodejs/node/pull/56881
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
2025-02-04 17:07:11 +00:00
Colin Ihrig c4fb331390 sqlite: handle conflicting SQLite and JS errors
This commit adds support for the situation where SQLite is
trying to report an error while JavaScript already has an
exception pending.

Fixes: https://github.com/nodejs/node/issues/56772
PR-URL: https://github.com/nodejs/node/pull/56787
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
2025-02-04 13:58:33 +00:00
Michael Dawson dd92abc405 deps: update cjs-module-lexer to 2.0.0
Signed-off-by: Michael Dawson <mdawson@devrus.com>
PR-URL: https://github.com/nodejs/node/pull/56855
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Rafael Gonzaga <rafael.nunu@hotmail.com>
Reviewed-By: Marco Ippolito <marcoippolito54@gmail.com>
Reviewed-By: Richard Lau <rlau@redhat.com>
2025-02-04 13:12:33 +00:00
James M Snell eb11adfc02 src,test: expand test coverage for urlpattern and fix error
PR-URL: https://github.com/nodejs/node/pull/56878
Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Juan José Arboleda <soyjuanarbol@gmail.com>
2025-02-04 04:52:39 +00:00
James M Snell a091f4890e src: prevent URLPattern property accessors from crashing on invalid this
PR-URL: https://github.com/nodejs/node/pull/56877
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
2025-02-04 03:34:31 +00:00
James M Snell 6947878268 src: pull in more electron boringssl adjustments
Electron has a number of patches they float in order to
build node.js with boringssl. We already incorporate some
of those, this brings in more of them.

PR-URL: https://github.com/nodejs/node/pull/56858
Reviewed-By: Juan José Arboleda <soyjuanarbol@gmail.com>
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
2025-02-03 18:27:25 -08:00
James M Snell 35d199f27b src: make multiple improvements to node_url_pattern
* remove USE from node_url_pattern to handle error correctly
* simplify if block in node_url_pattern
* improve error handling in node_url_pattern
* fix error propagation on URLPattern init
* use ToV8Value where more convenient in node_url_pattern
* simplify URLPatternInit::ToJsObject by reducing boilerplate

PR-URL: https://github.com/nodejs/node/pull/56871
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
Reviewed-By: Franziska Hinkelmann <franziska.hinkelmann@gmail.com>
Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
2025-02-03 13:54:20 -08:00
James M Snell c21d576579 src: clean up some obsolete crypto methods
Signed-off-by: James M Snell <jasnell@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/56792
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
2025-02-03 08:58:24 -08:00
René 2bd5694cd1 sqlite: allow returning ArrayBufferViews from user-defined functions
PR-URL: https://github.com/nodejs/node/pull/56790
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2025-02-01 21:19:54 +00:00
Richard Lau ad845588d0 Revert "src: modernize cleanup queue to use c++20"
This reverts commit 581b44421a.

PR-URL: https://github.com/nodejs/node/pull/56846
Refs: https://github.com/nodejs/node/pull/56063
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2025-02-01 08:14:18 +00:00
Yagiz NizipliandDaniel Lemire 43c593c428 url: add URLPattern implementation
Co-authored-by: Daniel Lemire <daniel@lemire.me>
PR-URL: https://github.com/nodejs/node/pull/56452
Reviewed-By: Daniel Lemire <daniel@lemire.me>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Jordan Harband <ljharb@gmail.com>
Reviewed-By: Stephen Belanger <admin@stephenbelanger.com>
2025-02-01 02:13:57 +00:00