-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
feat(ext/crypto): export elliptic keys as "raw" #14764
Conversation
There are two types of tests for Web Crypto. Some simple ones in https://github.com/denoland/deno/blob/main/cli/tests/unit/webcrypto_test.ts, and an extensive test suite in the Web Platform Tests. You probably just need to update the WPT expectations file to match this new feature. See Manual: Contributing > Web Platform Tests. |
I've added some unit tests. Oddly enough, the WPT suite does not seem to test exportKey, only importKey. |
I've signed the CLA three times in the last week, and it's still pending. |
@diachedelic are you sure you used the same GH account to sign the CLA? |
Right you are! I had to sign it with my other GitHub account, because the CLAssistant looks at the email address in the actual commit. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, just one minor nit.
ext/crypto/shared.rs
Outdated
@@ -144,7 +144,7 @@ impl RawKeyData { | |||
) | |||
})?; | |||
let point = p384::EncodedPoint::from_bytes(&ec_key.encoded_point) | |||
.map_err(|_| data_error("expected valid public EC key"))?; | |||
.map_err(|_| data_error("expected valid private EC key"))?; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is the public encoded point - the error should not be for private key decoding.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oops, fixed.
This commit chips away at the WebCrypto roadmap (#11690). It adds support for the "raw" format when exporting public ECDH/ECDSA keys via the SubtleCrypto.exportKey method.
This pull request chips away at the WebCrypto roadmap (#11690). It adds support for the "raw" format when exporting public ECDH/ECDSA keys via the SubtleCrypto.exportKey method.
The WebCrypto specification explicitly states that support for the "raw" format is encouraged for interoperability.
As a newbie contributor, are there tests for ext/crypto? I could not find any.