Repository navigation
crypto: honor prime checks and support empty SEC1 passphrases - #67039
Merged
nodejs-github-bot merged 1 commit intoNov 9, 2026
Merged
Conversation
Collaborator
|
Review requested:
|
Contributor
|
Welcome to Node.js, and thank you for your first contribution! Before review, please take a moment to read:
Please make sure every commit is signed off. For a first pull request, GitHub Actions require collaborator approval and Jenkins CI must be started by a collaborator or triager, so an initial wait is normal. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #67039 +/- ##
=======================================
Coverage 90.72% 90.73%
=======================================
Files 798 798
Lines 280015 280015
Branches 53858 53848 -10
=======================================
+ Hits 254046 254059 +13
+ Misses 16264 16240 -24
- Partials 9705 9716 +11 🚀 New features to boost your workflow:
|
panva
previously requested changes
Nov 9, 2026
Honor requested primality check counts with provider-backed OpenSSL. Support empty passphrases for encrypted SEC1 PEM output. Assisted-by: Codex Signed-off-by: Brad Anderson <brad@sankatygroup.com>
boorad
force-pushed
the
fix/ncrypto-provider-behavior
branch
from
November 9, 2026 14:50
f1c2aab to
1f05382
Compare
panva
approved these changes
Nov 9, 2026
Collaborator
Collaborator
Collaborator
|
Landed in f39899d |
This was referenced Nov 10, 2026
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.
Fix two provider-backed ncrypto behaviors:
BN_check_prime()call. Preserve cancellation and error propagation (including a cancellation check between repetitions, since OpenSSL resolves small primes by trial division without invoking the callback), and handle allocation failure.Adds a public API regression for empty/binary SEC1 passphrases and missing/incorrect passwords, plus cctests for requested prime-check counts, cancellation during a repeated check, and cancellation of a small prime handled by trial division. The new empty-passphrase, count, and repeated-check cancellation assertions fail on the unpatched implementation.
Validation at
1f05382cee77240fe925f17b7f208fc2bbb9131b(rebased onmain) on macOS with the built Node v28.0.0-pre and bundled OpenSSL 4.1.0:make -j8 node cctest: 306/306 cctests pass.out/Release/cctest --gtest_filter='NodeCrypto.BignumPrime*': 3/3 pass.test-crypto-key-export-sec1-passphraseand existingtest-crypto-keygen-missing-oidJavaScript tests: 2/2 pass; the SEC1 test passes 200/200 repeated runs.git diff --checkpass.Proposed here first at the request of the ncrypto maintainers in nodejs/ncrypto#54. Explicit EC parameter handling already works on current Node and is excluded from this port.