| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
|
Review requested:
|
Sorry, something went wrong.
Codecov Report❌ Patch coverage is 65.74586% with 186 lines in your changes missing coverage. Please review. @@ Coverage Diff @@
## main #65484 +/- ##
==========================================
- Coverage 90.11% 90.10% -0.01%
==========================================
Files 751 751
Lines 252473 253977 +1504
Branches 47487 47876 +389
==========================================
+ Hits 227517 228850 +1333
- Misses 16270 16357 +87
- Partials 8686 8770 +84
... and 79 files with indirect coverage changes 🚀 New features to boost your workflow:
|
Sorry, something went wrong.
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 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 Signed-off-by: Filip Skokan <panva.ip@gmail.com>
|
Compared main with this branch at 54489eb, on macOS arm64 using OpenSSL 3.5.7 Release builds and each result uses 30 runs. confidence improvement accuracy (*) (**) (***)
crypto/aes-gcm-throughput.js len=262144 cipher='aes-128-gcm' n=1000 1.30 % ±1.62% ±2.16% ±2.83%
crypto/create-cipheriv.js operation='decrypt' cipher='aes-128-cbc' n=100000 *** -2.16 % ±1.16% ±1.55% ±2.03%
crypto/create-cipheriv.js operation='encrypt' cipher='aes-128-cbc' n=100000 *** -2.00 % ±1.06% ±1.42% ±1.85%
crypto/create-hash.js n=100000 *** -3.52 % ±1.87% ±2.49% ±3.25%
crypto/create-hmac.js keylen=16 algo='sha256' n=100000 -0.18 % ±1.46% ±1.94% ±2.54%
crypto/get-ciphers.js v='crypto' n=500000 *** -41.21 % ±2.65% ±3.57% ±4.73%
crypto/getcipherinfo.js n=100000 cipher='aes-128-cbc' -1.16 % ±1.24% ±1.66% ±2.18%
crypto/hash-stream-throughput.js api='legacy' len=102400 type='buf' algo='sha256' n=500 0.65 % ±1.52% ±2.03% ±2.65%
crypto/oneshot-hash.js n=1000 type='buffer' method='sha256' length=100000 0.98 % ±3.06% ±4.08% ±5.32%
crypto/oneshot-hash.js n=100000 type='buffer' method='sha256' length=1000 0.54 % ±1.77% ±2.36% ±3.08%
crypto/oneshot-sign.js n=1000 keyFormat='keyObject' mode='sync' keyType='rsa' 0.11 % ±0.64% ±0.85% ±1.11%
Be aware that when doing many comparisons the risk of a false-positive
result increases. In this case, there are 11 comparisons, you can thus
expect the following amount of false-positive results:
0.55 false positives, when considering a 5% risk acceptance (*, **, ***),
0.11 false positives, when considering a 1% risk acceptance (**, ***),
0.01 false positives, when considering a 0.1% risk acceptance (***)
One-shot hashing, HMAC, signing, getCipherInfo(), and bulk throughput remain within measurement noise. Ordinary hash and cipher construction retain a small fixed-cost regression of approximately 2–3.5%. The getCiphers() (and getHashes()) dip (41,780,884 ops/s down to 23,969,006 ops/s) is large but these are introspection APIs called infrequently, and the generation check prevents them from returning stale results after setFips() changes the active property query. Hashing and encryption throughput are unaffected by the getCiphers() (and getHashes()) dip. |
Sorry, something went wrong.
Signed-off-by: Filip Skokan <panva.ip@gmail.com>
Signed-off-by: Filip Skokan <panva.ip@gmail.com>
Signed-off-by: Filip Skokan <panva.ip@gmail.com>
| Back | FazBrowse Home | New Git URL |
OpenSSL 3 provider implementations are not necessarily registered in the legacy digest and cipher tables used by EVP_get_digestbyname() and EVP_get_cipherbyname(). As a result, Node.js can omit usable provider-only algorithms from getHashes() and getCiphers() and reject them in crypto operations even when they match the active OpenSSL property query. The permanently memoized algorithm lists can also remain stale after setFips() changes that query.
This change discovers usable hashes, ciphers, and aliases from activated OpenSSL providers while preserving the legacy registries. Numeric OID aliases, NULL implementations, and cipher implementations unsupported by the Node.js Cipher APIs are excluded.
Resolution and API support
Caching and invalidation
Fixes: #43040
Fixes: #64866
Refs: #62982