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

feat(runtime): support RSA-PSS, RSASSA-PKCS1-v1_5 & ECDSA for SubtleCrypto#sign & SubtleCrypto#verify #861

Merged
merged 11 commits into from
May 14, 2023

Conversation

akitaSummer
Copy link
Contributor

@akitaSummer akitaSummer commented May 13, 2023

Hello

I have implemented sign and verify functions for RSASSA-PKCS1-v1_5, RSA-PSS, and ECDSA, but only the test for ECDSA is passing. I suspect it may be due to the large size of Rust's vec, causing errors when converting to V8's ArrayBuffer. I suggest trying to find a solution to this issue, or perhaps using serde_v8's ZeroCopyBuf to refactor the project.
I have refactored the generateKey method to support all algorithms required by W3C, but I have not handled the extractable and keyUsages parameters. I hope you can address these when you have time.
I reviewed your importKey method and found that it does not comply with W3C standards. I suggest that you consider modifying it when you have the time.

Closes #408
Closes #407

@changeset-bot
Copy link

changeset-bot bot commented May 13, 2023

🦋 Changeset detected

Latest commit: f310fab

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 5 packages
Name Type
@lagon/cli Patch
@lagon/runtime Patch
@lagon/serverless Patch
@lagon/docs Patch
@lagon/js-runtime Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@vercel
Copy link

vercel bot commented May 13, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
storybook ✅ Ready (Inspect) Visit Preview 💬 Add feedback May 14, 2023 1:32pm

@vercel
Copy link

vercel bot commented May 13, 2023

@akitaSummer is attempting to deploy a commit to the Lagon Team on Vercel.

A member of the Team first needs to authorize it.

@QuiiBz
Copy link
Member

QuiiBz commented May 14, 2023

Thanks for the PR!

I suspect it may be due to the large size of Rust's vec
I'll have a deeper look today, but that seems strange.

importKey was definitely wrong, I actually made #860 a few hours ago but looks like it's now timeouting the CI. keyUsages & extractable will be supported later.

@QuiiBz
Copy link
Member

QuiiBz commented May 14, 2023

I pushed some fix (most notably #862), we now only have a single test failing (due to a timeout): crypto_rsa_pss_sign_verify

Screenshot 2023-05-14 at 10 25 20

@QuiiBz QuiiBz changed the title feat(runtime): support ECDSA for SubtleCrypto#sign & SubtleCrypto#verify feat(runtime): support RSA-PSS, RSASSA-PKCS1-v1_5 & ECDSA for SubtleCrypto#sign & SubtleCrypto#verify May 14, 2023
Copy link
Member

@QuiiBz QuiiBz left a comment

Choose a reason for hiding this comment

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

LGTM, thank you so much!

@QuiiBz QuiiBz enabled auto-merge (squash) May 14, 2023 13:36
@QuiiBz QuiiBz merged commit 22f5cc1 into lagonapp:main May 14, 2023
@QuiiBz QuiiBz mentioned this pull request May 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

RSA-PSS for SubtleCrypto#sign  & SubtleCrypto#verify ECDSA for SubtleCrypto#sign  & SubtleCrypto#verify
2 participants