Skip to content

crypto.sign swallows OpenSSL errors #40794

Closed
@tniessen

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    confirmed-bugIssues with 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