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

Invalid RsaKeyAlgorithm publicExponent returned #48

Closed
panva opened this issue Sep 28, 2022 · 4 comments
Closed

Invalid RsaKeyAlgorithm publicExponent returned #48

panva opened this issue Sep 28, 2022 · 4 comments
Labels
bug Something isn't working

Comments

@panva
Copy link
Contributor

panva commented Sep 28, 2022

crypto.subtle.generateKey({
  name: 'RSA-PSS',
  hash: { name: 'SHA-256' },
  modulusLength: 2048,
  publicExponent: new Uint8Array([0x01, 0x00, 0x01]),
}, false, ['sign', 'verify'])

An RSA-PSS, RSASSA-PKCS1-v1_5, or RSA-OAEP crypto key that's generated or imported is supposed to have an algorithm.publicExponent property that's supposed to be a Uint8Array. ref.

Workerd (and most likely also the workers platform) returns an ArrayBuffer.

cc @jasnell

@jasnell
Copy link
Member

jasnell commented Sep 28, 2022

Yeah, looks like we get this wrong. Unfortunately it'll need a compat flag to change. We should check all of webcrypto in case there are more of these and update them all at once under the same flag.

@panva
Copy link
Contributor Author

panva commented May 26, 2023

ping @jasnell

@jasnell
Copy link
Member

jasnell commented May 26, 2023

ah right, yeah forgot about this one. Making a ticket internally to make sure we remember!

@panva
Copy link
Contributor Author

panva commented Oct 13, 2023

Fixed in #1268

@panva panva closed this as completed Oct 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants