Skip to content

lib,src: updates for BoringSSL#63125

Open
panva wants to merge 14 commits intonodejs:mainfrom
panva:make-crypto-boring-again
Open

lib,src: updates for BoringSSL#63125
panva wants to merge 14 commits intonodejs:mainfrom
panva:make-crypto-boring-again

Conversation

@panva
Copy link
Copy Markdown
Member

@panva panva commented May 5, 2026

wip Issues and PRs that are still a work in progress.

aarch64-linux: with shared boringssl-0.20260413.0

===
=== All tests succeeded
===

All tests passed.

@panva panva added wip Issues and PRs that are still a work in progress. test-shared-boringssl labels May 5, 2026
@panva panva force-pushed the make-crypto-boring-again branch 2 times, most recently from 121a7ab to 97a3c8f Compare May 5, 2026 13:30
@nodejs-github-bot

This comment was marked as outdated.

@codecov
Copy link
Copy Markdown

codecov Bot commented May 5, 2026

Codecov Report

❌ Patch coverage is 90.62500% with 9 lines in your changes missing coverage. Please review.
✅ Project coverage is 89.69%. Comparing base (480ee08) to head (97a3c8f).
⚠️ Report is 4 commits behind head on main.

Files with missing lines Patch % Lines
lib/internal/crypto/webidl.js 50.00% 5 Missing ⚠️
lib/internal/tls/wrap.js 71.42% 2 Missing ⚠️
src/crypto/crypto_pqc.cc 93.33% 0 Missing and 2 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main   #63125      +/-   ##
==========================================
+ Coverage   89.67%   89.69%   +0.01%     
==========================================
  Files         712      712              
  Lines      221256   221284      +28     
  Branches    42397    42416      +19     
==========================================
+ Hits       198404   198471      +67     
+ Misses      14676    14635      -41     
- Partials     8176     8178       +2     
Files with missing lines Coverage Δ
lib/internal/crypto/util.js 96.61% <100.00%> (+0.10%) ⬆️
lib/internal/errors.js 97.64% <100.00%> (+<0.01%) ⬆️
src/crypto/crypto_aes.cc 54.16% <ø> (ø)
src/crypto/crypto_aes.h 33.33% <ø> (ø)
src/crypto/crypto_argon2.cc 64.13% <ø> (ø)
src/crypto/crypto_argon2.h 50.00% <ø> (ø)
src/crypto/crypto_chacha20_poly1305.cc 58.13% <ø> (ø)
src/crypto/crypto_cipher.cc 77.62% <ø> (+0.19%) ⬆️
src/crypto/crypto_hash.cc 76.94% <ø> (ø)
src/crypto/crypto_kem.cc 80.74% <ø> (ø)
... and 10 more

... and 25 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@panva panva force-pushed the make-crypto-boring-again branch from 97a3c8f to 6b8d741 Compare May 5, 2026 15:49
@nodejs-github-bot

This comment was marked as outdated.

panva added 14 commits May 5, 2026 19:17
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>
Signed-off-by: Filip Skokan <panva.ip@gmail.com>
Signed-off-by: Filip Skokan <panva.ip@gmail.com>
Introduce explicit OPENSSL_WITH_* feature macros for crypto
capabilities that vary by OpenSSL version or BoringSSL support.

Use those macros at call sites instead of repeating version and
backend checks, and centralize PQC key metadata so key handling can
query helper functions instead of duplicating algorithm switch lists.

Signed-off-by: Filip Skokan <panva.ip@gmail.com>
BoringSSL declares EVP_CIPHER_do_all_sorted and
EVP_MD_do_all_sorted, but stock no-decrepit builds do not provide
those symbols. Add a Node build flag that keeps ncrypto and its
dependents on a local BoringSSL fallback list when libdecrepit is
absent.

Keep embedders that provide the EVP enumeration symbols on the normal
OpenSSL-compatible path, matching Electron's patched BoringSSL build.

Signed-off-by: Filip Skokan <panva.ip@gmail.com>
Map BoringSSL's native renegotiation failure to
ERR_TLS_RENEGOTIATION_UNSUPPORTED when TLSSocket#renegotiate() is
called. This avoids exposing an implementation-specific OpenSSL error
when the TLS backend does not support caller-initiated renegotiation.

Signed-off-by: Filip Skokan <panva.ip@gmail.com>
Signed-off-by: Filip Skokan <panva.ip@gmail.com>
Factor ML-DSA and ML-KEM seed sizes and seed import/export
helpers into shared helpers. Keep the provider-specific OpenSSL
and BoringSSL paths contained in those helpers.

Signed-off-by: Filip Skokan <panva.ip@gmail.com>
Reject raw-private and raw-seed imports before key construction
when the selected asymmetric key type does not support that raw
private material.

Signed-off-by: Filip Skokan <panva.ip@gmail.com>
Reject raw-public object input in createPrivateKey() before it
reaches native raw key import. Cover matching-length raw public
keys across the supported raw-public key types.

Signed-off-by: Filip Skokan <panva.ip@gmail.com>
Use the raw-seed key format constant for WebCrypto ML-KEM raw-seed
imports instead of passing the raw-private constant to native key
import.

Signed-off-by: Filip Skokan <panva.ip@gmail.com>
@panva panva force-pushed the make-crypto-boring-again branch from 6b8d741 to db65e65 Compare May 5, 2026 17:17
@nodejs-github-bot
Copy link
Copy Markdown
Collaborator

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

wip Issues and PRs that are still a work in progress.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants