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.sign swallows OpenSSL errors #40794

Closed
tniessen opened this issue Nov 12, 2021 · 0 comments · Fixed by #40796
Closed

crypto.sign swallows OpenSSL errors #40794

tniessen opened this issue Nov 12, 2021 · 0 comments · Fixed by #40796
Labels
confirmed-bug Issues with confirmed bugs. crypto Issues and PRs related to the crypto subsystem.

Comments

@tniessen
Copy link
Member

Version

current

Platform

all

Subsystem

crypto

What steps will reproduce the bug?

crypto.sign('sha512', '', crypto.generateKeyPairSync('rsa', { modulusLength: 512 }).privateKey)

How often does it reproduce? Is there a required condition?

One of the internal OpenSSL calls must fail, in this case, due to incompatible digest and modulus length.

What is the expected behavior?

A useful error message.

What do you see instead?

Uncaught Error: Deriving bits failed
    at Object.signOneShot [as sign] (node:internal/crypto/sig:181:42)

Additional information

No response

@tniessen tniessen added confirmed-bug Issues with confirmed bugs. crypto Issues and PRs related to the crypto subsystem. labels Nov 12, 2021
tniessen added a commit to tniessen/node that referenced this issue Nov 12, 2021
nodejs-github-bot pushed a commit that referenced this issue Nov 15, 2021
Fixes: #40794

PR-URL: #40796
Reviewed-By: Filip Skokan <panva.ip@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
targos pushed a commit that referenced this issue Nov 21, 2021
Fixes: #40794

PR-URL: #40796
Reviewed-By: Filip Skokan <panva.ip@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
danielleadams pushed a commit that referenced this issue Jan 30, 2022
Fixes: #40794

PR-URL: #40796
Reviewed-By: Filip Skokan <panva.ip@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
danielleadams pushed a commit that referenced this issue Feb 1, 2022
Fixes: #40794

PR-URL: #40796
Reviewed-By: Filip Skokan <panva.ip@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
confirmed-bug Issues with confirmed bugs. crypto Issues and PRs related to the crypto subsystem.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant