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: return clear errors when loading invalid PFX data by pimterry · Pull Request #49566 · nodejs/node

Conversation

@pimterry

@pimterry pimterry commented Sep 8, 2023

Copy link
Copy Markdown
Member

This fixes #49562

Without this change, the provided test fails with 'passed a null parameter', telling you nothing about what's actually wrong (since no nulls are present in this test code).

With this change, the test correctly receives a 'Unable to load private key from PFX data' error, telling you exactly what's wrong.

I've also covered the cert case here. I have confirmed that the same 'null parameter' error would be unhelpfully thrown if cert was null, so I think that's similarly useful. I'm not sure how to actually produce a pfx that would trigger this, so I haven't included a test, and it's possible that this isn't a possible condition (i.e. maybe PKCS12_parse would fail in that case) but it seems likely that it's technically possible and worth covering, and it's very easy to do so.

Sorry, something went wrong.

Uh oh!

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

bricss reacted with thumbs up emoji
All reactions
  • 👍 1 reaction
@nodejs-github-bot

nodejs-github-bot commented Sep 8, 2023

Copy link
Copy Markdown
Collaborator

Review requested:

  • @nodejs/crypto
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 c++ Issues and PRs that require attention from people who are familiar with C++. crypto Issues and PRs related to the crypto subsystem. needs-ci PRs that need a full CI run. labels Sep 8, 2023
@pimterry
crypto: return clear errors when loading invalid PFX data
2ad8af6
@pimterry
pimterry force-pushed the fix-pfx-missing-key-error branch from e3bebf3 to 2ad8af6 Compare September 8, 2023 19:58
bnoordhuis
bnoordhuis reviewed Sep 9, 2023
View reviewed changes
Comment thread src/crypto/crypto_context.cc Resolved

Uh oh!

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

Comment thread src/crypto/crypto_context.cc Resolved

Uh oh!

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

Comment thread src/crypto/crypto_context.cc Resolved

Uh oh!

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

@pimterry
Refactor LoadPKCS12 after review
dbc7ee0
bnoordhuis
bnoordhuis approved these changes Sep 11, 2023
View reviewed changes
@debadree25 debadree25 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 Sep 12, 2023
@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 Sep 12, 2023
@nodejs-github-bot

nodejs-github-bot commented Sep 12, 2023

Copy link
Copy Markdown
Collaborator

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

All reactions

Sorry, something went wrong.

Uh oh!

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

@nodejs-github-bot

nodejs-github-bot commented Sep 12, 2023

Copy link
Copy Markdown
Collaborator

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

All reactions

Sorry, something went wrong.

Uh oh!

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

This was referenced Sep 16, 2023
CI Reliability 2023-09-16 nodejs/reliability#667
Open
CI Reliability 2023-09-17 nodejs/reliability#668
Open
aymen94
aymen94 approved these changes Sep 18, 2023
View reviewed changes
@pimterry

pimterry commented Sep 21, 2023

Copy link
Copy Markdown
Member Author

This is reviewed & passing CI, I think it's ready to go AFAICT. Can somebody please add to the commit queue?

All reactions

Sorry, something went wrong.

Uh oh!

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

@aduh95 aduh95 added commit-queue PRs queued for automated landing through the Commit Queue. commit-queue-squash PRs the Commit Queue should land as one squashed commit. labels Sep 29, 2023
@nodejs-github-bot nodejs-github-bot removed the commit-queue PRs queued for automated landing through the Commit Queue. label Sep 29, 2023
@nodejs-github-bot
nodejs-github-bot merged commit 17b9925 into nodejs:main Sep 29, 2023
@nodejs-github-bot

nodejs-github-bot commented Sep 29, 2023

Copy link
Copy Markdown
Collaborator

Landed in 17b9925

All reactions

Sorry, something went wrong.

Uh oh!

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

@pimterry

pimterry commented Sep 29, 2023

Copy link
Copy Markdown
Member Author

Amazing thanks @aduh95!

All reactions

Sorry, something went wrong.

Uh oh!

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

@RafaelGSS RafaelGSS mentioned this pull request Oct 9, 2023
2023-10-17, Version 21.0.0 (Current) #49870
Merged
targos pushed a commit that referenced this pull request Nov 11, 2023
@pimterry @targos
crypto: return clear errors when loading invalid PFX data
55485ff
PR-URL: #49566
Reviewed-By: Ben Noordhuis <[email protected]>
@targos targos mentioned this pull request Nov 12, 2023
v20.10.0 release proposal #50682
Merged
@juanarbol juanarbol mentioned this pull request Dec 6, 2023
2023-12-06, N|Solid v5.0.1 Iron Release nodesource/nsolid#41
Merged
debadree25 pushed a commit to debadree25/node that referenced this pull request Apr 15, 2024
@pimterry @debadree25
crypto: return clear errors when loading invalid PFX data
9f848d2
PR-URL: nodejs#49566
Reviewed-By: Ben Noordhuis <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@bnoordhuis bnoordhuis bnoordhuis approved these changes
+1 more reviewer
@aymen94 aymen94 aymen94 approved these changes
Reviewers whose approvals may not affect merge requirements

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. c++ Issues and PRs that require attention from people who are familiar with C++. commit-queue-squash PRs the Commit Queue should land as one squashed commit. crypto Issues and PRs related to the crypto subsystem. 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.

Provide clearer error messages when a TLS pfx does not contain a private key

Uh oh!

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

6 participants

@pimterry @nodejs-github-bot @bnoordhuis @aymen94 @aduh95 @debadree25
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 01402503 — 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.