Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

crypto: fix generateKeyPair type checks #38364

Closed
wants to merge 2 commits into from

Conversation

Linkgoron
Copy link
Member

There were a few mismatches between the type checks in keygen and the types in the c++ code, which could cause a crash.

I've changed saltLength (rsa-pss), divisorLength (dsa), primeLength (dh) and generator (dh) checks in keygen to int32 from uint32, to align with the c++ code.

fixes: #38358

Change saltLength, divisorLength, primeLength and generator
checks in generateKeyPair to int32 from uint32, to align
with c++ code.

fixes: nodejs#38358
@nodejs-github-bot nodejs-github-bot added crypto Issues and PRs related to the crypto subsystem. needs-ci PRs that need a full CI run. labels Apr 22, 2021
@nodejs-github-bot
Copy link
Collaborator

@nodejs-github-bot
Copy link
Collaborator

@Linkgoron Linkgoron added author ready PRs that have at least one approval, no pending requests for changes, and a CI started. and removed author ready PRs that have at least one approval, no pending requests for changes, and a CI started. needs-ci PRs that need a full CI run. labels Apr 23, 2021
@Linkgoron Linkgoron added the needs-ci PRs that need a full CI run. label Apr 24, 2021
@Linkgoron Linkgoron removed the author ready PRs that have at least one approval, no pending requests for changes, and a CI started. label Apr 24, 2021
@Linkgoron
Copy link
Member Author

Linkgoron commented Apr 24, 2021

I'm doing a few checks, to see if there's some negative value validation that needs to be added after my changes

Added negative checks.

@nodejs-github-bot
Copy link
Collaborator

@Linkgoron Linkgoron added the author ready PRs that have at least one approval, no pending requests for changes, and a CI started. label Apr 24, 2021
@nodejs-github-bot
Copy link
Collaborator

@nodejs-github-bot
Copy link
Collaborator

@nodejs-github-bot
Copy link
Collaborator

@nodejs-github-bot
Copy link
Collaborator

@nodejs-github-bot
Copy link
Collaborator

@jasnell
Copy link
Member

jasnell commented Apr 26, 2021

Landed in 09c97b8

@jasnell jasnell closed this Apr 26, 2021
jasnell pushed a commit that referenced this pull request Apr 26, 2021
Change saltLength, divisorLength, primeLength and generator
checks in generateKeyPair to int32 from uint32, to align
with c++ code.

fixes: #38358

PR-URL: #38364
Fixes: #38358
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Darshan Sen <raisinten@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
targos pushed a commit that referenced this pull request Apr 29, 2021
Change saltLength, divisorLength, primeLength and generator
checks in generateKeyPair to int32 from uint32, to align
with c++ code.

fixes: #38358

PR-URL: #38364
Fixes: #38358
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Darshan Sen <raisinten@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
@targos targos mentioned this pull request May 3, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
author ready PRs that have at least one approval, no pending requests for changes, and a CI started. crypto Issues and PRs related to the crypto subsystem. needs-ci PRs that need a full CI run.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

crypto.generateKeyPair results in an abort
7 participants