Conversation
Collaborator
|
Review requested:
|
panva
force-pushed
the
backport-crypto-wpt-v24-20260919
branch
2 times, most recently
from
September 19, 2026 10:38
16d1257 to
2ae99fb
Compare
aduh95
force-pushed
the
v24.x-staging
branch
from
September 19, 2026 12:50
f93a4b8 to
00d2960
Compare
panva
force-pushed
the
backport-crypto-wpt-v24-20260919
branch
from
September 19, 2026 12:53
2ae99fb to
9aec979
Compare
This comment has been minimized.
This comment has been minimized.
panva
marked this pull request as draft
September 19, 2026 13:39
Member
Author
|
@aduh95 i'll put this back to draft until v24.x-staging stabilizes and passes its own Jenkins CI |
aduh95
force-pushed
the
v24.x-staging
branch
from
September 19, 2026 14:06
00d2960 to
4396c9b
Compare
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## v24.x-staging #66128 +/- ##
=================================================
- Coverage 90.31% 90.23% -0.09%
=================================================
Files 711 714 +3
Lines 228425 234475 +6050
Branches 43160 44622 +1462
=================================================
+ Hits 206293 211567 +5274
- Misses 14090 14478 +388
- Partials 8042 8430 +388
🚀 New features to boost your workflow:
|
Constrain context parameters, ML-KEM derived-key imports, HKDF output lengths, and RSA key generation. PR-URL: nodejs#65222 Refs: https://redirect.github.com/w3c/webcrypto/pull/558 Refs: https://redirect.github.com/WICG/webcrypto-modern-algos/pull/76 Refs: https://redirect.github.com/WICG/webcrypto-modern-algos/pull/77 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com> Reviewed-By: Tobias Nießen <tniessen@tnie.de> Assisted-by: Codex Signed-off-by: Filip Skokan <panva.ip@gmail.com>
Closes nodejs#63393 PR-URL: nodejs#63411 Reviewed-By: James M Snell <jasnell@gmail.com> Assisted-by: Codex Signed-off-by: Filip Skokan <panva.ip@gmail.com>
Enumerate usable digests and aliases from activated OpenSSL 3 providers rather than relying only on the legacy digest registry. Normalize provider aliases, omit numeric OIDs and NULL, and validate them against the active default property query. Preserve legacy names and the OpenSSL 1.1.1 and BoringSSL paths. Expose KECCAK-KMAC-128, KECCAK-256, SHA256-192, and other provider digests. Add `functionName` and `customization` options for cSHAKE digests in `createHash()` and `crypto.hash()` with OpenSSL 4.0 or later. Resolve provider-only digest names across hashing, HMAC, KDF, signing, verification, and RSA digest options. Keep ordinary hash construction and one-shot hashing on the original binding arities and direct initialization paths. Use parameterized setup only when cSHAKE options are supplied. Lazily cache successful provider fetches per Environment. Index entries by case-insensitive query, canonical, and alias names. Deduplicate owners by provider and canonical identity. Return borrowed pointers on warm hits. Introduce a process-wide FIPS-state generation that advances only after successful, state-changing `setFips()` calls. Use it to invalidate per-Environment digest caches and refresh `getHashes()` snapshots in the main thread and workers. Keep cache IDs monotonic across invalidation because JavaScript Realms can retain them. Existing hash contexts can finish across a transition. Release provider owners before unloading worker addon DSOs. Document provider-dependent availability and operation-specific restrictions. Add known-answer vectors, option validation, provider resolution, property-query, FIPS transition, worker, snapshot, and cross-API coverage. Refs: nodejs#62982 PR-URL: nodejs#65484 Fixes: nodejs#43040 Fixes: nodejs#64866 Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com> Assisted-by: Codex Signed-off-by: Filip Skokan <panva.ip@gmail.com>
Enumerate usable ciphers and aliases from activated OpenSSL 3 providers instead of maintaining lists of provider-only algorithms. Skip numeric OID aliases and filter NULL, TLS composite, multiblock, and encrypt-then-MAC implementations that the Cipher APIs cannot use. Preserve the OpenSSL 1.1.1 and BoringSSL paths. Expose CBC-CTS, SM4-GCM, SM4-CCM, SM4-XTS, and additional AES key wrap implementations. Add `ctsMode` (CS1/CS2/CS3) and `xtsStandard` (GB/IEEE) options for selecting provider CTS and SM4-XTS variants. Keep ordinary cipher construction on the original binding and legacy lookup paths. Lazily cache successful provider fetches per Environment for string initialization and `getCipherInfo()`. Index entries by case-insensitive query, canonical, and alias names. Deduplicate owners by provider and canonical identity. Return borrowed pointers on warm hits. Use the shared process-wide FIPS-state generation to invalidate per-Environment cipher caches and refresh `getCiphers()` snapshots in the main thread and workers. Existing cipher contexts retain their implementation and can finish across a transition. Release provider owners before unloading worker addon DSOs. Enforce one-shot updates for CBC-CTS, AES key wrap, SIV/GCM-SIV, and CCM decryption. Reject finalization without required input or CCM tags, and defer authentication failures to `final()`. Document streaming and XTS data-unit constraints. Add known-answer vectors, option validation, provider round trips, cache, worker, snapshot, FIPS transition, and construction benchmark coverage. Fixes: nodejs#43040 Fixes: nodejs#64866 Refs: nodejs#62982 PR-URL: nodejs#65484 Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com> Assisted-by: Codex Signed-off-by: Filip Skokan <panva.ip@gmail.com>
Let OpenSSL handle representable salt lengths so verification of an impossible length resolves false. Guard values outside the native int32 parameter range to prevent SignJob from silently ignoring them. Move the digest-size helper next to HKDF, its remaining consumer. PR-URL: nodejs#65550 Reviewed-By: Aviv Keller <me@aviv.sh> Reviewed-By: James M Snell <jasnell@gmail.com> Assisted-by: Codex Signed-off-by: Filip Skokan <panva.ip@gmail.com>
Check requested usages against the JWK public or private key type before validating key_ops. This preserves the SyntaxError precedence specified for RSA, EC, CFRG, ML-DSA, and ML-KEM imports. PR-URL: nodejs#65550 Reviewed-By: Aviv Keller <me@aviv.sh> Reviewed-By: James M Snell <jasnell@gmail.com> Assisted-by: Codex Signed-off-by: Filip Skokan <panva.ip@gmail.com>
Add getMacs() and createMac() to node:crypto as a layer on top of OpenSSL EVP_MAC. Support incremental and streaming operations with provider parameter validation and configurable output sizes. PR-URL: nodejs#65553 Refs: nodejs#32433 Refs: nodejs#40921 Refs: nodejs#48314 Refs: nodejs#32448 Refs: nodejs#32477 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Gürgün Dayıoğlu <hey@gurgun.day> Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com> Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com> Assisted-by: Codex Signed-off-by: Filip Skokan <panva.ip@gmail.com>
This extends explicit resource management support to prepared statements, allowing a StatementSync to be deterministically finalized via a `using` declaration, mirroring the existing DatabaseSync and Session dispose methods. Signed-off-by: Guilherme Araújo <arauujogui@gmail.com> PR-URL: nodejs#64232 Reviewed-By: René <contact.9a5d6388@renegade334.me.uk> Assisted-by: Codex Signed-off-by: Filip Skokan <panva.ip@gmail.com>
Signed-off-by: Guilherme Araújo <arauujogui@gmail.com> PR-URL: nodejs#64232 Reviewed-By: René <contact.9a5d6388@renegade334.me.uk> Assisted-by: Codex Signed-off-by: Filip Skokan <panva.ip@gmail.com>
SQLite requires that an authorizer callback not modify the connection that invoked it, and counts sqlite3_prepare_v2() and sqlite3_step() as modifications. node:sqlite let the callback call prepare(), exec(), the statement execution methods, and other connection-mutating APIs on the same DatabaseSync. Track authorizer depth on DatabaseSync with an RAII guard around the callback and throw ERR_INVALID_STATE from the affected entry points while it is on the stack. Covering every authorizer invocation, including the re-prepare that SQLite can run during sqlite3_step(), exposed a second and distinct hazard: reentering a statement that is currently being stepped is a use-after-free rather than a contract violation, since finalizing it frees the virtual machine under sqlite3_step() and re-running it resets that machine mid-execution. Any callback SQLite invokes during execution can reach it, so a user-defined function is enough. Track the statements currently being stepped and reject reentry into only those, which leaves a user-defined function free to prepare, run, and finalize its own helper statements. Signed-off-by: Trevor Burnham <trevorburnham@gmail.com> Fixes: nodejs#63207 PR-URL: nodejs#65156 Reviewed-By: Xuguang Mei <meixuguang@gmail.com> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com> Assisted-by: Codex Signed-off-by: Filip Skokan <panva.ip@gmail.com>
Signed-off-by: Guilherme Araújo <arauujogui@gmail.com> PR-URL: nodejs#62241 Reviewed-By: Stephen Belanger <admin@stephenbelanger.com> Reviewed-By: René <contact.9a5d6388@renegade334.me.uk> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com> Assisted-by: Codex Signed-off-by: Filip Skokan <panva.ip@gmail.com>
OpenSSL 3.4 added an indicator callback for operations that its FIPS provider allows after an approved-mode check has been relaxed. Publish these indicators on the crypto.fips.indicator diagnostics channel when Node.js is started with --enable-fips-indicator-events. Leave the OpenSSL callback unset otherwise so ordinary cryptographic operations have no indicator callback overhead. Keep the channel observation-only so enforcement remains the responsibility of the provider configuration, and independent diagnostic subscribers can coexist. Install the native callback during process initialization so it is not changed while Workers or thread-pool jobs can be using OpenSSL. Preserve callbacks installed by embedders, and queue bounded, coalesced messages for asynchronous delivery on the main environment. Document the channel as best-effort telemetry that cannot identify the originating call or establish FIPS validation. PR-URL: nodejs#65645 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com> Assisted-by: Codex Signed-off-by: Filip Skokan <panva.ip@gmail.com>
Allow --force-fips to take an optional provider or strict mode. Keep provider as the current default and explicit compatibility mode. In strict mode, return failure from the OpenSSL 3.4+ FIPS indicator callback when it reports a non-approved operation. Install the callback for enforcement without implicitly enabling diagnostics; --enable-fips-indicator-events remains the independent observation opt-in. Keep the bare form mapped to provider for compatibility, allowing the default to change to strict in a future major release. Preserve the mode when forwarding flags to child test processes, and keep the parser's internal mode storage out of process.allowedNodeEnvironmentFlags. Document the callback scope limitations and cover provider compatibility, validation, synchronous crypto, WebCrypto, Workers, and opt-in event publication. PR-URL: nodejs#65645 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com> Assisted-by: Codex Signed-off-by: Filip Skokan <panva.ip@gmail.com>
Avoid repeating EC key-pair validation after a pair has already been established or validated. Invalidate the positive-only cache whenever public-key mutation can make the pair inconsistent. PR-URL: nodejs#65615 Reviewed-By: James M Snell <jasnell@gmail.com> Assisted-by: Codex Signed-off-by: Filip Skokan <panva.ip@gmail.com>
Preserve additional RSA prime information when exporting and importing private JWKs across supported OpenSSL versions. PR-URL: nodejs#65649 Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com> Assisted-by: Codex Signed-off-by: Filip Skokan <panva.ip@gmail.com>
Signed-off-by: Adam Mcgrath <adam.mcgrath@okta.com> PR-URL: nodejs#65073 Reviewed-By: Filip Skokan <panva.ip@gmail.com> Reviewed-By: Aviv Keller <me@aviv.sh> Assisted-by: Codex Signed-off-by: Filip Skokan <panva.ip@gmail.com>
Signed-off-by: Tim Perry <pimterry@gmail.com> PR-URL: nodejs#63249 Signed-off-by: Filip Skokan <panva.ip@gmail.com> Assisted-by: Codex Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Richard Lau <richard.lau@ibm.com> Reviewed-By: Tim Perry <pimterry@gmail.com>
Use the fixture snapshots from upstream v26.x for WebCryptoAPI, WebIDL, and interfaces. Assisted-by: Codex Signed-off-by: Filip Skokan <panva.ip@gmail.com>
panva
force-pushed
the
backport-crypto-wpt-v24-20260919
branch
from
September 19, 2026 18:20
9aec979 to
b6a0fb9
Compare
panva
marked this pull request as ready for review
September 19, 2026 18:21
Collaborator
Collaborator
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Backports the following
cryptochanges tov24.x-staging:Includes the diagnostics-channel prerequisite and its dependencies:
Also includes the partial backport of #63249 from #65953, supplying the missing reset-cleanup prerequisite for #65440, which is already in
v24.x-staging. This fixes thetest-http2-many-writes-and-destroyhang while preserving buffered reads, errors, and compatibility API events.The final commit updates the WebCryptoAPI, WebIDL, and interfaces WPT fixtures to match v26.x, combining #65478 and the fixture changes from #65679.