user not authenticated/key permanently invalidated

This commit is contained in:
Adam Velebil 2023-05-03 14:42:35 +02:00
parent 6672ff3245
commit 41c6bad62f
No known key found for this signature in database
GPG Key ID: C9B1E4A3CBBD2E10

View File

@ -95,18 +95,18 @@ class BiometricProtectionSinceM(
Log.d(TAG, "User is now verified by biometrics") Log.d(TAG, "User is now verified by biometrics")
} }
UserAuthenticationStatus.USER_NOT_AUTHENTICATED -> onAuthenticationCancelledOrFailed().also { // explanation for why both statuses trigger onKeyPermanentlyInvalidated:
Log.e(TAG, "Failed to use the authentication private key") // we are in onAuthenticationSucceeded callback of BiometricPrompt which means,
// that if the key is still not authenticated, the key is not valid anymore
UserAuthenticationStatus.KEY_PERMANENTLY_INVALIDATED,
UserAuthenticationStatus.USER_NOT_AUTHENTICATED -> onKeyPermanentlyInvalidated().also {
Log.e(TAG, "The private key is not valid for signatures anymore")
} }
UserAuthenticationStatus.SIGNATURE_FAILED -> onAuthenticationCancelledOrFailed().also { UserAuthenticationStatus.SIGNATURE_FAILED -> onAuthenticationCancelledOrFailed().also {
Log.e(TAG, "Signature with the key pair failed") Log.e(TAG, "Signature with the key pair failed")
} }
UserAuthenticationStatus.KEY_PERMANENTLY_INVALIDATED -> onKeyPermanentlyInvalidated().also {
Log.e(TAG, "The private key is not valid for signatures anymore")
}
} }
}, },
onAuthenticationFailed = { onAuthenticationFailed = {