GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — crypto: honor prime checks and support empty SEC1 passphrases by boorad · Pull Request #67039 · nodejs/node

Conversation

@boorad

@boorad boorad commented Oct 26, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

Fix two provider-backed ncrypto behaviors:

  • Allow an explicitly empty passphrase when exporting encrypted SEC1 EC PEM by extending the traditional-PEM helper already used for RSA. Include EC domain parameters in the encoder selection, matching the normal SEC1 path.
  • Honor requested primality-check counts above the minimum performed by one 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 on main) 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.
  • Focused test-crypto-key-export-sec1-passphrase and existing test-crypto-keygen-missing-oid JavaScript tests: 2/2 pass; the SEC1 test passes 200/200 repeated runs.
  • Scoped JavaScript/C++ lint, changed-line clang-format, and git diff --check pass.

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.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@nodejs-github-bot

nodejs-github-bot commented Oct 26, 2026

Copy link
Copy Markdown
Collaborator

Review requested:

  • @nodejs/crypto
  • @nodejs/security-wg
All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@nodejs-github-bot nodejs-github-bot added dependencies PRs that add, update, or configure Node.js dependencies. needs-ci PRs that need a full CI run. labels Oct 26, 2026
@github-actions

github-actions Bot commented Oct 26, 2026

Copy link
Copy Markdown
Contributor

Welcome to Node.js, and thank you for your first contribution!

Before review, please take a moment to read:

  • the guide for first-time contributors
  • the contribution and automation policies
  • the pull request guide
  • the AI use policy
  • the Code of Conduct

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.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@boorad boorad mentioned this pull request Oct 26, 2026
build: add an opt-in OpenSSL 3.6 EVP-only profile nodejs/ncrypto#55
Closed
@codecov

codecov Bot commented Oct 27, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 90.73%. Comparing base (9aa379e) to head (1f05382).
⚠️ Report is 2 commits behind head on main.

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     

see 28 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.
All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

panva
panva previously requested changes Nov 9, 2026
View reviewed changes
Comment thread test/parallel/test-crypto-key-export-sec1-passphrase.js Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread deps/ncrypto/ncrypto.cc Resolved

Uh oh!

There was an error while loading. Please reload this page.

@boorad
crypto: fix ncrypto provider behavior
1f05382
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 <[email protected]>
@boorad
boorad force-pushed the fix/ncrypto-provider-behavior branch from f1c2aab to 1f05382 Compare November 9, 2026 14:50
@panva
panva dismissed their stale review November 9, 2026 14:56

addressed.

@boorad
boorad requested a review from panva November 9, 2026 15:01
panva
panva approved these changes Nov 9, 2026
View reviewed changes
@panva panva added author ready PRs with CI started, the required approvals, and no outstanding review comments. request-ci Add this label to start a Jenkins CI on a PR. Only starts once the PR has an approving review. labels Nov 9, 2026
@github-actions github-actions Bot removed the request-ci Add this label to start a Jenkins CI on a PR. Only starts once the PR has an approving review. label Nov 9, 2026
@nodejs-github-bot

nodejs-github-bot commented Nov 9, 2026

Copy link
Copy Markdown
Collaborator

CI: https://ci.nodejs.org/job/node-test-pull-request/78925/

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@panva panva added the resume-ci Add this label to resume the latest eligible Jenkins CI run on a PR with an approving review. label Nov 9, 2026
@github-actions github-actions Bot removed the resume-ci Add this label to resume the latest eligible Jenkins CI run on a PR with an approving review. label Nov 9, 2026
@nodejs-github-bot

nodejs-github-bot commented Nov 9, 2026

Copy link
Copy Markdown
Collaborator

CI: https://ci.nodejs.org/job/node-test-pull-request/78931/

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@panva panva added the commit-queue PRs queued for automated landing through the Commit Queue. label Nov 9, 2026
@nodejs-github-bot
nodejs-github-bot merged commit f39899d into nodejs:main Nov 9, 2026
72 checks passed

Uh oh!

There was an error while loading. Please reload this page.

@nodejs-github-bot

nodejs-github-bot commented Nov 9, 2026

Copy link
Copy Markdown
Collaborator

Landed in f39899d

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@nodejs-github-bot nodejs-github-bot removed the commit-queue PRs queued for automated landing through the Commit Queue. label Nov 9, 2026
@panva panva mentioned this pull request Nov 9, 2026
fix: preserve provider serialization and prime-check behavior nodejs/ncrypto#54
Closed
This was referenced Nov 10, 2026
Align vendored ncrypto prime checks and empty SEC1 passphrases with Node f39899d margelo/react-native-quick-crypto#1094
Closed
fix(ncrypto): align prime-check cancellation and SEC1 empty-passphrase export with Node f39899d margelo/react-native-quick-crypto#1095
Merged
aduh95 pushed a commit that referenced this pull request Nov 11, 2026
@boorad @aduh95
crypto: fix ncrypto provider behavior
d026815
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 <[email protected]>
PR-URL: #67039
Reviewed-By: Filip Skokan <[email protected]>
@github-actions github-actions Bot mentioned this pull request Nov 11, 2026
2026-11-12, Version 27.0.0-alpha.0.1.0 (Alpha) #67415
Merged
@panva panva mentioned this pull request Nov 12, 2026
[v26.x backport] crypto and TLS fixes and features #67442
Closed
@panva panva added the backport-open-v26.x Indicate that the PR has an open backport label Nov 12, 2026
panva pushed a commit to panva/node that referenced this pull request Nov 12, 2026
@boorad @panva
crypto: fix ncrypto provider behavior
e3de004
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 <[email protected]>
PR-URL: nodejs#67039
Reviewed-By: Filip Skokan <[email protected]>
aduh95 pushed a commit that referenced this pull request Nov 13, 2026
@boorad @aduh95
crypto: fix ncrypto provider behavior
7265f62
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 <[email protected]>
PR-URL: #67039
Backport-PR-URL: #67442
Reviewed-By: Antoine du Hamel <[email protected]>
@panva panva added backported-to-v26.x PRs backported to the v26.x-staging branch. and removed backport-open-v26.x Indicate that the PR has an open backport labels Nov 13, 2026
aduh95 pushed a commit that referenced this pull request Nov 20, 2026
@boorad @aduh95
crypto: fix ncrypto provider behavior
1db6022
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 <[email protected]>
PR-URL: #67039
Backport-PR-URL: #67442
Reviewed-By: Antoine du Hamel <[email protected]>
This was referenced Nov 20, 2026
2026-11-30, Version 24.23.0 'Krypton' (LTS) #67663
Open
2026-11-30, Version 26.14.0 'Lithium' (LTS) #67664
Open
Renegade334 pushed a commit to Renegade334/node that referenced this pull request Nov 21, 2026
@boorad @aduh95
crypto: fix ncrypto provider behavior
35ff55a
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 <[email protected]>
PR-URL: nodejs#67039
Backport-PR-URL: nodejs#67442
Reviewed-By: Antoine du Hamel <[email protected]>
gabylb pushed a commit to gabylb/node that referenced this pull request Nov 27, 2026
@boorad @gabylb
crypto: fix ncrypto provider behavior
1d5c023
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 <[email protected]>
PR-URL: nodejs#67039
Reviewed-By: Filip Skokan <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@panva panva panva approved these changes

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

author ready PRs with CI started, the required approvals, and no outstanding review comments. backported-to-v26.x PRs backported to the v26.x-staging branch. dependencies PRs that add, update, or configure Node.js dependencies. needs-ci PRs that need a full CI run.

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

3 participants

@boorad @nodejs-github-bot @panva
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.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.