8000 Fix keychain biometric prompts on Android by janicduplessis · Pull Request #6631 · rainbow-me/rainbow · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Fix keychain biometric prompts on Android #6631

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

Merged
merged 2 commits into from
May 19, 2025
Merged

Conversation

janicduplessis
Copy link
Contributor
@janicduplessis janicduplessis commented May 15, 2025

Fixes APP-2622

What changed (plus any additional context for devs)

When upgrading react-native-keychain to v9 it now uses instead BLOCK_MODE_GCM of BLOCK_MODE_ECB which supports biometrics authentication. This means that it will prompt for biometrics when trying to encrypt or decrypt values.

The issue is that when restoring multiple wallets from a backup it executes many operations requiring encryption in a row and it seems like pixel device rate limit how often the prompt can be shown and the encryption key generated is only valid for 5 seconds because of the config in react-native-keychain. This means that sometimes the generated key is expired, but the system will not allow showing a biometrics prompt yet.

To fix this we can increase the validity of the key to 5 minutes to reduce the number of prompts, and I think this still keeps good safety, while avoiding to spam the user.

Another alternative would be to force using an encryption method without biometrics prompt, but this is better in my opinion.

Screen recordings / screenshots

Tested by @ibrahimtaveras00 on Pixel device where the issue happened.

screen-20250514-181209.mp4

What to test

Restore a wallet from backup as described in the notion document.

Copy link
linear bot commented May 15, 2025

@derHowie derHowie added the release for release blockers and release candidate branches label May 15, 2025
@ibrahimtaveras00 ibrahimtaveras00 self-requested a review May 15, 2025 16:00
Copy link
Contributor
@ibrahimtaveras00 ibrahimtaveras00 left a comment

Choose a reason for hiding this comment

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

Not ideal behavior discussed in this thread

Test case results can be found here

8000
@janicduplessis
Copy link
Contributor Author

Updated with our latest solution

Copy link
Contributor
@ibrahimtaveras00 ibrahimtaveras00 left a comment

Choose a reason for hiding this comment

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

Looks good 👍🏽

Copy link
Member
@jinchung jinchung left a comment

Choose a reason for hiding this comment

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

🌮

@jinchung jinchung merged commit 8970584 into develop May 19, 2025
7 of 8 checks passed
@jinchung jinchung deleted the @janic/fix-keychain branch May 19, 2025 15:27
ibrahimtaveras00 pushed a commit that referenced this pull request May 19, 2025
* Use storage type RSA

* Log supported biometry result
BrodyHughes pushed a commit that referenced this pull request May 21, 2025
* Use storage type RSA

* Log supported biometry result
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release for release blockers and release candidate branches
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants
0