Skip to content

RSA-PSS key pair generation incorrectly adds params since v15 #39936

Closed
@tniessen

Description

@tniessen

Version

≥ 15.0.0

Platform

Any

Subsystem

crypto

What steps will reproduce the bug?

node -p "crypto.generateKeyPairSync('rsa-pss', { modulusLength: 2048 }).publicKey.export({ format: 'pem', type: 'spki' })" | openssl asn1parse

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

Always.

What is the expected behavior?

    0:d=0  hl=4 l= 288 cons: SEQUENCE          
    4:d=1  hl=2 l=  11 cons: SEQUENCE          
    6:d=2  hl=2 l=   9 prim: OBJECT            :rsassaPss
   17:d=1  hl=4 l= 271 prim: BIT STRING

What do you see instead?

    0:d=0  hl=4 l= 295 cons: SEQUENCE          
    4:d=1  hl=2 l=  18 cons: SEQUENCE          
    6:d=2  hl=2 l=   9 prim: OBJECT            :rsassaPss
   17:d=2  hl=2 l=   5 cons: SEQUENCE          
   19:d=3  hl=2 l=   3 cons: cont [ 2 ]        
   21:d=4  hl=2 l=   1 prim: INTEGER           :00
   24:d=1  hl=4 l= 271 prim: BIT STRING

Additional information

Likely caused by #35093.

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