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

fix NotSupportedError when using NODE-ED25519 #311

Merged
merged 2 commits into from
Aug 19, 2022
Merged

fix NotSupportedError when using NODE-ED25519 #311

merged 2 commits into from
Aug 19, 2022

Conversation

yusefnapora
Copy link
Contributor

This closes #310 by adding a helper function that converts NODE-ED25519 to Ed25519.

I didn't add a check for just the string form (without the namedCurve), since I wasn't sure if that's supported in the real CF worker env. But it would be super easy to add it to the helper.

Copy link
Contributor

@mrbbot mrbbot left a comment

Choose a reason for hiding this comment

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

Hey! 👋 Apologies for the delayed response. I've recently returned from a long holiday and am just starting to catch up on issues and PRs now.

I've added some comments. Let me know if you have any questions. 🙂

packages/core/src/standards/crypto.ts Outdated Show resolved Hide resolved
packages/core/src/standards/crypto.ts Outdated Show resolved Hide resolved
packages/core/src/standards/crypto.ts Outdated Show resolved Hide resolved
packages/core/src/standards/crypto.ts Show resolved Hide resolved
packages/core/src/standards/crypto.ts Outdated Show resolved Hide resolved
- Require `namedCurve` to be `NODE-ED25519`
- Gate `Ed25519` usage behind feature detect
- Use `Ed25519` algorithm object instead of string
- Override `sign`, `verify` methods too
- Do not require `importKey` to be within `RequestContext`
- Automatically add `public: true` when importing `NODE-ED25519` keys
- Upgrade `@types/node` for improved `webcrypto` types
- Add tests for other algorithms using modified methods
@mrbbot
Copy link
Contributor

mrbbot commented Aug 19, 2022

Hey! 👋 I'm planning to get a release out today and would like to include this, so I've gone ahead and implemented the suggested fixes. 👍

@mrbbot mrbbot merged commit adb8171 into cloudflare:master Aug 19, 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.

NotSupportedError when using NODE-ED25519 keys
2 participants