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

🐛 Error: Unknown EC import format: spki #473

Open
4 tasks done
compojoom opened this issue Oct 15, 2024 · 1 comment
Open
4 tasks done

🐛 Error: Unknown EC import format: spki #473

compojoom opened this issue Oct 15, 2024 · 1 comment

Comments

@compojoom
Copy link

What's happening?

I'm trying to work with passkeys. I'm generating a passkey with "react-native-passkeys" https://github.com/peterferguson/react-native-passkeys, then trying to extract the coordinates and rawId with the @safe-global/protocol-kit library:
https://github.com/safe-global/safe-core-sdk/blob/main/packages/protocol-kit/src/utils/passkeys/extractPasskeyData.ts#L12

Then the code fails on this line:
https://github.com/safe-global/safe-core-sdk/blob/main/packages/protocol-kit/src/utils/passkeys/extractPasskeyData.ts#L47
with "Unknown EC import format: spki"

I can see in the source code that that spki import case has been disabled:
https://github.com/margelo/react-native-quick-crypto/blob/0.x/src/ec.ts#L146

Why?

grafik

Reproducible Code

const key = await crypto.subtle.importKey('spki', publicKey, algorithm, true, ['verify'])

Relevant log output

Error: Unknown EC import format: spki

Device

simulator iPhone Pro 16 (ios 18)

QuickCrypto Version

0.7.5

Can you reproduce this issue in the QuickCrypto Example app?

I didn't try (⚠️ your issue might get ignored & closed if you don't try this)

Additional information

@boorad
Copy link
Collaborator

boorad commented Oct 17, 2024

@compojoom hey, thanks for the ticket!

This was commented out a while ago, and doesn't show as implemented here. However, I think it's a case of implementing importKey() before generateKey() which prevented the tests from being activated here.

If you want to try to uncomment everything, and make sure a test covers your use case (or add one), and submit a PR, that would be 👌 . If not, I can get to it soon.

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

No branches or pull requests

2 participants