Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Update helpers.js to fix Software Keys #51

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

Open
resba wants to merge 1 commit into mkalioby:main
base: main
Choose a base branch
Loading
from resba:resba-patch-1

Conversation

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.

nitmir reacted with thumbs up emoji
Cast Uint8Array objects to base64url encoding when preparing the payload so fido2 knows how to process it
Copy link
Owner

Thanks for your contribution.

What type of keys can this be tested against?

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.

Copy link
Owner

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

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

Copy link
Owner

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

resba reacted with thumbs up emoji

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.

Copy link

nitmir commented Aug 10, 2025

Hi @mkalioby

I have the same issue (with bitwarden and samsung pass) but only on Firefox : Uint8Array are not base64 encoded leading to authentication failure.

I applied this patch to fix my issue.

As ArrayBuffer and Uint8Array are 2 types of binary array in javascript, I think it is safe to always base64 both of those types.

Cheers

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

No reviews

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

AltStyle によって変換されたページ (->オリジナル) /