googlearchive / android-FingerprintDialog

Migrated:
https://github.com/android/security
Apache License 2.0
1.38k stars 477 forks source link

KeyPermanentlyInvalidatedException not thrown all the time after enrolling new fingerprint #21

Closed TheNephilim88 closed 5 years ago

TheNephilim88 commented 8 years ago

The initCipher()-method checks if lockscreen has been disabled or new fingerprints have been enrolled. For this it checks if a KeyPermanentlyInvalidatedException will be thrown or not. If it wil lbe thrown, any of above reasons apply.

But this does not seem to trigger all the time. It only triggers randomly on my device (Nexus 5X) after adding new fingerprints. Most of the time I get normal fingerprint-authentication dialog and it works as nothing has been changed. Only very few times I get "A new fingerprint was added to this device"-message to reauthenticate.

Can anyone tell me why this is not triggering all the time when new fingerprints have been enrolled? Is this a bug or a feature? :D

Is it possible to check for fingerprint-changes in another way?

thagikura commented 8 years ago

Hi,

Detecting a new fingerprint is not triggered randomly. One thing I'm guessing is that you may have created a new key after new fingerprints were added.

This sample creates a new key in onCreate, so if you launch the sample app after you add a new fingerprint, KeyPermanentlyInvalidatedException is not thrown because at the time the key is created, a set of fingerprints include the new created one.

If you want to test that KeyPermanentlyInvalidatedException, please try to add a new fingerprint while keeping the app open.

tajchert commented 7 years ago

Also this is a case for me - I get (API 26 both emulator and Nexus 5x) IllegalBlockSizeException instead of KeyPermanentlyInvalidatedException after adding new imprint.

tajchert commented 7 years ago

I believe this is the reason of this issue: https://issuetracker.google.com/issues/65578763

codingjeremy commented 5 years ago

I am closing this issue/PR, as it has been migrated to the new repo linked above in the comments. Thank you!