Skip to content
This repository has been archived by the owner on Nov 8, 2024. It is now read-only.

credentials.response.getPublicKey() inconsistent behaviour across different platforms #30

Open
dushebaa opened this issue Oct 8, 2024 · 0 comments

Comments

@dushebaa
Copy link

dushebaa commented Oct 8, 2024

When creating a new credential, parseCredentialPublicKey is called with a Uint8Array value of credential.response.getPublicKey(). On iOS and macOS systems (idk about linux), the byte length returned by getPublicKey() is 91 bytes. Your tests also make use of a 91-byte public key (credential.test.ts:14).

The problem is, on windows systems, byte array that is returned by credential.response.getPublicKey() is 294 bytes long (tested on Windows 10 22H2 19045.4529, edge, firefox and brave, all have the same issue). It leads to crypto failing to import key in bytesToCryptoKey function, throwing DataError, which leads to createCredential function failing.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant