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

Update RSA and ECDH export steps and OIDs #305

Merged
merged 1 commit into from
Jan 16, 2022

Conversation

twiss
Copy link
Member

@twiss twiss commented Dec 14, 2021

Update the RSA and ECDH spki and pkcs8 export steps and OIDs to match the behavior of all tested implementations:

  • Update the RSA-PSS export steps to change the OID from id-RSASSA-PSS to rsaEncryption (even though RSA-PSS is a signing algorithm, which is unfortunate, but the same is already true for RSASSA-PKCS1-v1_5 - and it seems all underlying crypto libraries use the rsaEncryption OID in all cases, leading to this behavior in all implementations)
  • Update the RSA-OAEP export steps to change the OID from id-RSAES-OAEP to rsaEncryption
  • Update the RSA-PSS and RSA-OAEP export steps to set the parameters to NULL, matching the above
  • Update the ECDH export steps to change the OID from id-ecDH to id-ecPublicKey
  • Editorial: always refer to the OID in the relevant RFC, rather than copying it in this spec

Fixes #300.


Preview | Diff

Copy link
Contributor

@lucacasonato lucacasonato left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great cleanup!

@sideshowbarker sideshowbarker merged commit fc4174f into main Jan 16, 2022
@twiss twiss deleted the update-rsa-ecdh-export branch February 28, 2022 17:58
nodejs-github-bot pushed a commit to nodejs/node that referenced this pull request May 25, 2022
bengl pushed a commit to nodejs/node that referenced this pull request May 30, 2022
targos pushed a commit to nodejs/node that referenced this pull request Jul 12, 2022
targos pushed a commit to nodejs/node that referenced this pull request Jul 31, 2022
littledivy pushed a commit to denoland/deno that referenced this pull request Oct 4, 2022
This PR updates RSA key import/export to a state which is interoperable
with other implementations.

For RSA the only OID in and out is `rsaEncryption`.
For EC the only OID in and out is `id-ecpublickey` (fixed in #16152).

see w3c/webcrypto#307 (comment)
see w3c/webcrypto#307
see w3c/webcrypto#305
see nodejs/node#42816
guangwong pushed a commit to noslate-project/node that referenced this pull request Oct 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Use rsaEncryption OID during exporting for all RSA algorithms
3 participants