Skip to content
This repository has been archived by the owner on Apr 16, 2021. It is now read-only.

No fingerprint enrolled crash #6

Open
matt-jt opened this issue Aug 15, 2016 · 5 comments
Open

No fingerprint enrolled crash #6

matt-jt opened this issue Aug 15, 2016 · 5 comments

Comments

@matt-jt
Copy link

matt-jt commented Aug 15, 2016

This occurs after restarting one of the default Android emulators. After rebooting the emulator, it still shows a finger print registered. Adding a new one seems to fix the problem, but there seems to be some sort of underlying issue here. We are also seeing the same issue on a few Samsung and LG phones but have been unable reproduce it locally.

FATAL EXCEPTION: RxCachedThreadScheduler-1
   Process: com.squareup.whorlwind.sample, PID: 3221
   java.lang.IllegalStateException: Exception thrown on Scheduler.Worker thread. Add `onError` handling.
       at rx.internal.schedulers.ScheduledAction.run(ScheduledAction.java:60)
       at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:423)
       at java.util.concurrent.FutureTask.run(FutureTask.java:237)
       at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:269)
       at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1113)
       at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:588)
       at java.lang.Thread.run(Thread.java:818)
    Caused by: rx.exceptions.OnErrorNotImplementedException: java.security.InvalidAlgorithmParameterException: java.lang.IllegalStateException: At least one fingerprint must be enrolled to create keys requiring user authentication for every use
       at rx.Observable$27.onError(Observable.java:8139)
       at rx.observers.SafeSubscriber._onError(SafeSubscriber.java:157)
       at rx.observers.SafeSubscriber.onError(SafeSubscriber.java:120)
       at rx.exceptions.Exceptions.throwOrReport(Exceptions.java:200)
       at rx.observers.SafeSubscriber.onNext(SafeSubscriber.java:144)
       at rx.internal.util.ScalarSynchronousObservable$ScalarAsyncProducer.call(ScalarSynchronousObservable.java:200)
       at rx.internal.util.ScalarSynchronousObservable$3$1.call(ScalarSynchronousObservable.java:128)
       at rx.internal.schedulers.ScheduledAction.run(ScheduledAction.java:55)
       at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:423) 
       at java.util.concurrent.FutureTask.run(FutureTask.java:237) 
       at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:269) 
       at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1113) 
       at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:588) 
       at java.lang.Thread.run(Thread.java:818) 
    Caused by: java.lang.RuntimeException: java.security.InvalidAlgorithmParameterException: java.lang.IllegalStateException: At least one fingerprint must be enrolled to create keys requiring user authentication for every use
       at com.squareup.whorlwind.RealWhorlwind.prepareKeyStore(RealWhorlwind.java:153)
       at com.squareup.whorlwind.RealWhorlwind.write(RealWhorlwind.java:102)
       at com.squareup.whorlwind.sample.SampleActivity.lambda$onCreate$1(SampleActivity.java:76)
       at com.squareup.whorlwind.sample.SampleActivity.access$lambda$1(SampleActivity.java)
       at com.squareup.whorlwind.sample.SampleActivity$$Lambda$5.call(Unknown Source)
       at rx.Observable$27.onNext(Observable.java:8144)
       at rx.observers.SafeSubscriber.onNext(SafeSubscriber.java:139)
       at rx.internal.util.ScalarSynchronousObservable$ScalarAsyncProducer.call(ScalarSynchronousObservable.java:200) 
       at rx.internal.util.ScalarSynchronousObservable$3$1.call(ScalarSynchronousObservable.java:128) 
       at rx.internal.schedulers.ScheduledAction.run(ScheduledAction.java:55) 
       at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:423) 
       at java.util.concurrent.FutureTask.run(FutureTask.java:237) 
       at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:269) 
       at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1113) 
       at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:588) 
       at java.lang.Thread.run(Thread.java:818) 
    Caused by: java.security.InvalidAlgorithmParameterException: java.lang.IllegalStateException: At least one fingerprint must be enrolled to create keys requiring user authentication for every use
       at android.security.keystore.AndroidKeyStoreKeyPairGeneratorSpi.initialize(AndroidKeyStoreKeyPairGeneratorSpi.java:339)
       at java.security.KeyPairGenerator$KeyPairGeneratorImpl.initialize(KeyPairGenerator.java:284)
       at java.security.KeyPairGenerator.initialize(KeyPairGenerator.java:192)
       at com.squareup.whorlwind.RealWhorlwind.prepareKeyStore(RealWhorlwind.java:144)
       at com.squareup.whorlwind.RealWhorlwind.write(RealWhorlwind.java:102) 
       at com.squareup.whorlwind.sample.SampleActivity.lambda$onCreate$1(SampleActivity.java:76) 
       at com.squareup.whorlwind.sample.SampleActivity.access$lambda$1(SampleActivity.java) 
       at com.squareup.whorlwind.sample.SampleActivity$$Lambda$5.call(Unknown Source) 
       at rx.Observable$27.onNext(Observable.java:8144) 
       at rx.observers.SafeSubscriber.onNext(SafeSubscriber.java:139) 
       at rx.internal.util.ScalarSynchronousObservable$ScalarAsyncProducer.call(ScalarSynchronousObservable.java:200) 
       at rx.internal.util.ScalarSynchronousObservable$3$1.call(ScalarSynchronousObservable.java:128) 
       at rx.internal.schedulers.ScheduledAction.run(ScheduledAction.java:55) 
       at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:423) 
       at java.util.concurrent.FutureTask.run(FutureTask.java:237) 
       at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:269) 
       at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1113) 
       at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:588) 
       at java.lang.Thread.run(Thread.java:818) 
    Caused by: java.lang.IllegalStateException: At least one fingerprint must be enrolled to create keys requiring user authentication for every use
       at android.security.keystore.KeymasterUtils.addUserAuthArgs(KeymasterUtils.java:115)
       at android.security.keystore.AndroidKeyStoreKeyPairGeneratorSpi.initialize(AndroidKeyStoreKeyPairGeneratorSpi.java:335)
       at java.security.KeyPairGenerator$KeyPairGeneratorImpl.initialize(KeyPairGenerator.java:284) 
       at java.security.KeyPairGenerator.initialize(KeyPairGenerator.java:192) 
       at com.squareup.whorlwind.RealWhorlwind.prepareKeyStore(RealWhorlwind.java:144) 
       at com.squareup.whorlwind.RealWhorlwind.write(RealWhorlwind.java:102) 
       at com.squareup.whorlwind.sample.SampleActivity.lambda$onCreate$1(SampleActivity.java:76) 
       at com.squareup.whorlwind.sample.SampleActivity.access$lambda$1(SampleActivity.java) 
       at com.squareup.whorlwind.sample.SampleActivity$$Lambda$5.call(Unknown Source) 
       at rx.Observable$27.onNext(Observable.java:8144) 
       at rx.observers.SafeSubscriber.onNext(SafeSubscriber.java:139) 
       at rx.internal.util.ScalarSynchronousObservable$ScalarAsyncProducer.call(ScalarSynchronousObservable.java:200) 
       at rx.internal.util.ScalarSynchronousObservable$3$1.call(ScalarSynchronousObservable.java:128) 
       at rx.internal.schedulers.ScheduledAction.run(ScheduledAction.java:55) 
       at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:423) 
       at java.util.concurrent.FutureTask.run(FutureTask.java:237) 
       at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:269) 
       at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1113) 
       at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:588) 
       at java.lang.Thread.run(Thread.java:818) 
@matt-jt matt-jt changed the title Crash after restarting emulator No fingerprint enrolled crash Aug 15, 2016
@mattprecious
Copy link
Contributor

I've been trying to reproduce this crash on Samsung for months... I'll try restarting the phone a bunch of times and see if it'll repro.

If this is the cause then I don't think there's anything I can do in the library to fix this. It's a major issue in the OS.

@matt-jt
Copy link
Author

matt-jt commented Aug 16, 2016

@mattprecious glad to hear I'm not the only one experiencing this. While doing some research I found the same bug in the google samples finger print dialog section with multiple people pointing to an emulator problem. From the fabric crash logs though, the same issue/crash is occurring on multiple Samsung and LG devices.

@mitchross
Copy link

Bump. Seeing this issue on LG V10. Cant repo, only seen in the crash logs on the play console.

@Kamil-Kaminski
Copy link

It's easy to reproduce this on AVD emulators. Problem is that fingerprintManager.hasEnrolledFingerprints() returns true, but calling RealWhorlwind#prepareKeyStore() throws an exception in lines

      keyGenerator.initialize(new KeyGenParameterSpec.Builder(keyAlias,
          KeyProperties.PURPOSE_ENCRYPT | KeyProperties.PURPOSE_DECRYPT) //
          .setBlockModes(KeyProperties.BLOCK_MODE_ECB) //
          .setUserAuthenticationRequired(true) //
          .setEncryptionPaddings(KeyProperties.ENCRYPTION_PADDING_RSA_PKCS1) //
          .build());

Exception:
java.lang.IllegalStateException: At least one fingerprint must be enrolled to create keys requiring user authentication for every use

Adding new fingerprint solves problem until next emulator reboot. So far I didn't experience this problem on any real device.

@vanniktech
Copy link
Contributor

I've tested the no fingerprint enrolled case just recently with a Pixel 2 and the current master (with RxJava 2 support) and it worked without any issues.

Given that this issue is quite old should we close this? In case this pops up again one can open up a new one.

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

5 participants