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

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

Closed
tniessen opened this issue Aug 29, 2021 · 0 comments
Closed

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

tniessen opened this issue Aug 29, 2021 · 0 comments
Labels
confirmed-bug Issues with confirmed bugs. crypto Issues and PRs related to the crypto subsystem.

Comments

@tniessen
Copy link
Member

tniessen commented Aug 29, 2021

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.

@tniessen tniessen added confirmed-bug Issues with confirmed bugs. crypto Issues and PRs related to the crypto subsystem. labels Aug 29, 2021
tniessen added a commit to tniessen/node that referenced this issue Aug 29, 2021
@panva panva closed this as completed in 73d5f8a Sep 1, 2021
targos pushed a commit that referenced this issue Sep 6, 2021
Fixes: #39936
Refs: #35093

PR-URL: #39937
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Filip Skokan <panva.ip@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
targos pushed a commit that referenced this issue Sep 6, 2021
Fixes: #39936
Refs: #35093

PR-URL: #39937
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
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