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

Update helpers.js to fix Software Keys #51

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

resba
Copy link

@resba resba commented Jan 22, 2025

Cast Uint8Array objects to base64url encoding when preparing the payload so fido2 knows how to process it.

In newer versions of the credential creation function, some software passkeys will return Uint8Array objects where hardware tokens would pass base64 objects for elements like response.clientDataJSON and response.attestationObject.

This would result in those elements being casted as objects which would then fail out when running AuthenticationResponse.from_dict(response) in any of the views trying to process it due to a type where we pass it dict instead of the expected bytes.

Cast Uint8Array objects to base64url encoding when preparing the payload so fido2 knows how to process it
@mkalioby
Copy link
Owner

Thanks for your contribution.

What type of keys can this be tested against?

@resba
Copy link
Author

resba commented Jan 22, 2025

Thanks for your contribution.

What type of keys can this be tested against?

I tested against key generation from Bitwarden and iOS Face ID authenticators using an OSX machine. I would test with Chrome latest.

@mkalioby
Copy link
Owner

Does this mean the current library shouldn't work with Apple Passkeys on Mac OSX?

@resba
Copy link
Author

resba commented Jan 23, 2025

Does this mean the current library shouldn't work with Apple Passkeys on Mac OSX?

AFAIK, when using the library (latest pypi) it attempts to save the passkey then Errors out with a bytes-to-dict TypeError

@mkalioby
Copy link
Owner

Thanks, I'll take the patch for a spin and will let you know.

@mkalioby
Copy link
Owner

Hello @resba,

I tested the current version of the libray (without Patch) on Mac OS X (Sequoia) with Safari (Version 18.2 (20620.1.16.11.8) and it worked as expected, Also, I tried Chrome and it worked fine, Can you please give me more specific version or can you deploy the version anywhere so we can check it together.

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.

2 participants