-
Notifications
You must be signed in to change notification settings - Fork 59
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-OAEP & RSA-PSS errors different between spki and pkcs8 key importing #297
Comments
Yep, I believe you're right, thanks for the report. I tested some other implementations and most throw a Somewhat unrelated; while testing, I noticed that when exporting, all implementations I tested set the OID to |
@twiss this is also the case for The problem is underlying crypto library support for these three oids (id-RSASSA-PSS, id-RSASSA-OAEP, and id-ecDH). Given that the most widely used browser as well as server js runtime won't support these I wouldn't mind the spec reflecting these deviations from the spec that have, essentially, become the expected behaviour. |
Yeah, I'd be very much in favor of switching the OID the spec mandates. Deno also uses |
For tracking: we should add some form of WPT test for this behaviour (the error kind) before closing this issue. @twiss If you can provide the spki/pkcs8 keys you used for testing, I can go add the WPTs (unless you want to do it yourself) :-) |
I split out the |
Before we test the error case, we should test the success case as well for these algorithm-specific OIDs (otherwise the easiest way to pass the tests would be to reject all keys with these OIDs 😅). I've created #307 for that, and will create some test keys (I have malformed ones but creating well-formed ones is a bit more tricky). I'll close this issue as fixed by #299 :) |
For RSA-PSS the spec says the following for
pkcs8
importing in the block that validates algorithm OID:For
spki
:One throws a
NotSupportedError
, the other aDataError
for the same class of issue. This is also not tested in WPT (having it wrong doesn't make the tests fail). Found during some routine maintenance of Deno's Web Crypto implementation.The same is the case for the same bit of code in RSA-OAEP's import key operation.
The question is: is this wrong? Shouldn't both return
DataError
?The text was updated successfully, but these errors were encountered: