Repository navigation
Accept JWK alg "Ed25519" when importing an Ed25519 key - #8553
Conversation
There was a problem hiding this comment.
Superseded by the review of
ded43784.
This review, of 275a2b78
💬 Approved with comments — The fix is correct, narrowly scoped and has a regression test. The only note is an INFO asking for a clearer WPT expectation comment.
Findings: 1 info (1 is an inline comment on the diff)
The decision is advisory: this review is a comment and never approves, blocks or requests changes on the pull request.
📋 Code Quality: 💬 1 info
The fix is correct and has a test; the only note is about the wording of the WPT expectation comment.
Recommendation: 💬 Optional Nits
- [INFO] WPT expectation comment doesn't clearly explain why the
alg EdDSAcases also fail (src/wpt/WebCryptoAPI-test.ts:191)
View full review
src/workerd/api/crypto/ec.c++:573-580: the looseralgcheck applies only toNID_ED25519, and anyalgother thanEd25519/EdDSAstill throwsDOMDataError.crypto-extras-test.js: the new test covers both acceptedalgvalues for public and private keys and the rejection case.src/wpt/WebCryptoAPI-test.ts:190-191: the expected-failure list also includes everyGood parameters with JWK alg EdDSAcase. A reader may wonder why those fail, since export already emitsEdDSA. A small wording change would make that clear.
✅ All other checks passed
🔒 Security: ✅ LGTM
Import still rejects any alg other than the two allowed by the spec, and the crv check is unchanged.
📖 AGENTS.md: ✅ LGTM
The change follows the repository's conventions.
⚡ Performance: ✅ LGTM
No performance impact.
📝 Documentation: ✅ LGTM
No documentation issues.
Reviewed commit: 275a2b78
275a2b7 to
ded4378
Compare
There was a problem hiding this comment.
Superseded by the review of
1d06190b.
This review, of ded43784
✅ Approved — The fix is correct and narrowly scoped, and it has a regression test. The one earlier note, about the WPT expectation comment, is resolved and there are no new findings.
The decision is advisory: this review is a comment and never approves, blocks or requests changes on the pull request.
✅ All checks passed
🔒 Security: ✅ LGTM
Import still rejects any alg other than the two the spec allows, and the crv check is unchanged.
📖 AGENTS.md: ✅ LGTM
The change follows the repository's conventions, and the commit message records the compatibility decision.
📋 Code Quality: ✅ LGTM
src/workerd/api/crypto/ec.c++:573-580: the check only applies toNID_ED25519. It acceptsEd25519andEdDSAand rejects every otheralgwithDOMDataError. Thecrvcheck is unchanged.src/workerd/api/tests/crypto-extras-test.js: the test covers both acceptedalgvalues for public and private keys and the rejection case.src/wpt/WebCryptoAPI-test.ts:190-191: the comment now explains that the failing cases expectalg: "Ed25519"on export, while workerd exports"EdDSA".
⚡ Performance: ✅ LGTM
No performance impact.
📝 Documentation: ✅ LGTM
No documentation issues.
Reviewed commit: ded43784
|
The generated output of |
Web Crypto now allows an Ed25519 JWK to carry either "Ed25519" or "EdDSA" as its `alg` (w3c/webcrypto#401). workerd accepted only "EdDSA", so importing a JWK with `alg: "Ed25519"` threw a DataError. In this patch the Ed25519 JWK import accepts both values; any other `alg` is still rejected. An error turning into a success is additive, so this ships without a compatibility flag. Export still emits "EdDSA", which is why the WPT `okp_importKey_Ed25519` alg cases stay expected failures; their comment now says so. The new `ed25519JwkImportAlg` case in crypto-extras-test fails without the fix.
ded4378 to
1d06190
Compare
There was a problem hiding this comment.
Superseded by the review of
94d259a8.
This review, of 1d06190b
✅ Approved — The fix is correct and narrowly scoped, and it has a regression test. The one earlier note, about the WPT expectation comment, is resolved and there are no new findings.
The decision is advisory: this review is a comment and never approves, blocks or requests changes on the pull request.
✅ All checks passed
🔒 Security: ✅ LGTM
Import still rejects any alg other than the two the spec allows, and the crv check is unchanged.
📖 AGENTS.md: ✅ LGTM
The change follows the repository's conventions, and the commit message records the compatibility decision.
📋 Code Quality: ✅ LGTM
src/workerd/api/crypto/ec.c++:573-580: the check only applies toNID_ED25519. It acceptsEd25519andEdDSAand rejects every otheralgwithDOMDataError. Thecrvcheck is unchanged.src/workerd/api/tests/crypto-extras-test.js: the test covers both acceptedalgvalues for public and private keys and the rejection case.src/wpt/WebCryptoAPI-test.ts:190-191: the comment now explains that the failing cases expectalg: "Ed25519"on export, while workerd exports"EdDSA".
⚡ Performance: ✅ LGTM
No performance impact.
📝 Documentation: ✅ LGTM
No documentation issues.
Reviewed commit: 1d06190b — same changes as ded43784, so this is that commit's review (no new review was run; line numbers are as of ded43784)
There was a problem hiding this comment.
✅ Approved — The fix is correct and narrowly scoped, and it has a regression test. The one earlier note, about the WPT expectation comment, is resolved and there are no new findings.
The decision is advisory: this review is a comment and never approves, blocks or requests changes on the pull request.
✅ All checks passed
🔒 Security: ✅ LGTM
Import still rejects any alg other than the two the spec allows, and the crv check is unchanged.
📖 AGENTS.md: ✅ LGTM
The change follows the repository's conventions, and the commit message records the compatibility decision.
📋 Code Quality: ✅ LGTM
src/workerd/api/crypto/ec.c++:573-580: the check only applies toNID_ED25519. It acceptsEd25519andEdDSAand rejects every otheralgwithDOMDataError. Thecrvcheck is unchanged.src/workerd/api/tests/crypto-extras-test.js: the test covers both acceptedalgvalues for public and private keys and the rejection case.src/wpt/WebCryptoAPI-test.ts:190-191: the comment now explains that the failing cases expectalg: "Ed25519"on export, while workerd exports"EdDSA".
⚡ Performance: ✅ LGTM
No performance impact.
📝 Documentation: ✅ LGTM
No documentation issues.
Reviewed commit: 94d259a8 — same changes as ded43784, so this is that commit's review (no new review was run; line numbers are as of ded43784)
Web Crypto now allows an Ed25519 JWK to carry either "Ed25519" or "EdDSA" as its
alg(w3c/webcrypto#401). workerd accepted only "EdDSA", so importing a JWK withalg: "Ed25519"threw a DataError.In this patch the Ed25519 JWK import accepts both values; any other
algis still rejected. An error turning into a success is additive, so this ships without a compatibility flag. Export still emits "EdDSA", which is why the WPTokp_importKey_Ed25519alg cases stay expected failures; their comment now says so. The newed25519JwkImportAlgcase in crypto-extras-test fails without the fix.