Skip to content

crypto.sign swallows OpenSSL errors #40794

Description

@tniessen

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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    confirmed-bugIssues and PRs for confirmed bugs.cryptoIssues and PRs related to the crypto subsystem.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions