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

KeyStoreException: User authentication required #502

Closed
hvge opened this issue Nov 21, 2022 · 0 comments
Closed

KeyStoreException: User authentication required #502

hvge opened this issue Nov 21, 2022 · 0 comments

Comments

@hvge
Copy link
Member

hvge commented Nov 21, 2022

This is a report from the customer from their developer console:

Exception java.security.ProviderException: Failed to generate key pair 
  at android.security.keystore.AndroidKeyStoreKeyPairGeneratorSpi.generateKeystoreKeyPair (AndroidKeyStoreKeyPairGeneratorSpi.java:514) 
  at android.security.keystore.AndroidKeyStoreKeyPairGeneratorSpi.generateKeyPair (AndroidKeyStoreKeyPairGeneratorSpi.java:470) 
  at java.security.KeyPairGenerator$Delegate.generateKeyPair (KeyPairGenerator.java:727) 
  at io.getlime.security.powerauth.biometry.impl.BiometricKeyEncryptorRsa.createRsaEncryptor (BiometricKeyEncryptorRsa.java:9) 
  at io.getlime.security.powerauth.biometry.impl.BiometricKeystore.createBiometricKeyEncryptor (BiometricKeystore.java:3) 
  at io.getlime.security.powerauth.biometry.impl.DefaultBiometricKeyEncryptorProvider.getBiometricKeyEncryptor (DefaultBiometricKeyEncryptorProvider.java:3) 
  at io.getlime.security.powerauth.biometry.BiometricAuthentication$2.run (BiometricAuthentication.java:1)
  at java.util.concurrent.ThreadPoolExecutor.runWorker (ThreadPoolExecutor.java:1167) 
  at java.util.concurrent.ThreadPoolExecutor$Worker.run (ThreadPoolExecutor.java:641) 
  at java.lang.Thread.run (Thread.java:919) 
Caused by android.security.KeyStoreException: User authentication required
  at android.security.KeyStore.getKeyStoreException (KeyStore.java:1275)

Device: Xiaomi Redmi Note 8Pro, Android 10


It looks like the user has no PIN/pattern set to unlock the phone, so attempt to create the key protected with the biometry fails. I guess that we can improve this and detect such situation before we try to create such key with the KeyStore.

@hvge hvge self-assigned this Nov 21, 2022
@hvge hvge changed the title android.security.KeyStoreException: User authentication required KeyStoreException: User authentication required Nov 21, 2022
hvge added a commit that referenced this issue Nov 25, 2022
@hvge hvge closed this as completed in 7d24295 Nov 27, 2022
hvge added a commit that referenced this issue Nov 28, 2022
* Android: Fix #502: Take KeyguardManager into account while evaluating biometry use
* Android: Fix #503: Patch localhost to 10.0.2.2 in tests.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant