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

Crash - KeyStoreCrypto.ensureKey - RuntimeException #6769

Closed
ouchadam opened this issue Aug 8, 2022 · 0 comments · Fixed by #6780
Closed

Crash - KeyStoreCrypto.ensureKey - RuntimeException #6769

ouchadam opened this issue Aug 8, 2022 · 0 comments · Fixed by #6780
Assignees
Labels
A-Pin code O-Uncommon Most users are unlikely to come across this or unexpected workflow S-Major Severely degrades major functionality or product features, with no satisfactory workaround T-Defect Something isn't working: bugs, crashes, hangs and other reported problems Z-Crash

Comments

@ouchadam
Copy link
Contributor

ouchadam commented Aug 8, 2022

Exception java.lang.RuntimeException
Exception java.lang.RuntimeException: java.lang.reflect.InvocationTargetException
  at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run (RuntimeInit.java:666)
  at com.android.internal.os.ZygoteInit.main (ZygoteInit.java:967)
Caused by java.lang.reflect.InvocationTargetException:
  at java.lang.reflect.Method.invoke
  at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run (RuntimeInit.java:656)
Caused by java.lang.reflect.InvocationTargetException:
  at java.lang.reflect.Method.invoke
  at com.airbnb.mvrx.MavericksFactory.create (MavericksFactory.kt:12)
  at androidx.lifecycle.ViewModelProvider$Factory$-CC.$default$create (ViewModelProvider.kt:2)
  at com.airbnb.mvrx.MavericksViewModelProvider.get$default (MavericksViewModelProvider.kt:39)
  at im.vector.app.features.pin.lockscreen.ui.LockScreenFragment$special$$inlined$fragmentViewModel$default$1.invoke (MavericksExtensions.kt:10)
  at im.vector.app.features.pin.lockscreen.ui.LockScreenFragment$special$$inlined$fragmentViewModel$default$1.invoke (MavericksExtensions.kt:1)
  at com.airbnb.mvrx.DefaultViewModelDelegateFactory$createLazyViewModel$1.invoke (ViewModelDelegateProvider.kt:2)
  at com.airbnb.mvrx.DefaultViewModelDelegateFactory$createLazyViewModel$1.invoke (ViewModelDelegateProvider.kt:1)
  at com.airbnb.mvrx.lifecycleAwareLazy.getValue (lifecycleAwareLazy.kt:5)
  at com.airbnb.mvrx.lifecycleAwareLazy$initializeWhenCreated$1.onCreate (lifecycleAwareLazy.kt:1)
  at androidx.lifecycle.FullLifecycleObserverAdapter.onStateChanged (FullLifecycleObserverAdapter.java:8)
  at androidx.lifecycle.LifecycleRegistry$ObserverWithState.dispatchEvent (LifecycleRegistry.java:3)
  at androidx.lifecycle.LifecycleRegistry.sync (LifecycleRegistry.java:45)
  at androidx.lifecycle.LifecycleRegistry.moveToState (LifecycleRegistry.java:7)
  at androidx.lifecycle.LifecycleRegistry.handleLifecycleEvent (LifecycleRegistry.java:2)
  at androidx.fragment.app.Fragment.performCreate (Fragment.java:9)
  at androidx.fragment.app.FragmentStateManager.create (FragmentStateManager.java:5)
  at androidx.fragment.app.FragmentStateManager.moveToExpectedState (FragmentStateManager.java:28)
  at androidx.fragment.app.FragmentManager.executeOpsTogether (FragmentManager.java:122)
  at androidx.fragment.app.FragmentManager.removeRedundantOperationsAndExecute (FragmentManager.java:9)
  at androidx.fragment.app.FragmentManager.execPendingActions (FragmentManager.java:14)
  at androidx.fragment.app.FragmentManager.dispatchStateChange (FragmentManager.java:10)
  at androidx.fragment.app.FragmentActivity.onStart (FragmentActivity.java:12)
  at androidx.appcompat.app.AppCompatActivity.onStart (AppCompatActivity.java:1)
  at android.app.Instrumentation.callActivityOnStart (Instrumentation.java:1436)
  at android.app.Activity.performStart (Activity.java:8188)
  at android.app.ActivityThread.handleStartActivity (ActivityThread.java:3547)
  at android.app.servertransaction.TransactionExecutor.performLifecycleSequence (TransactionExecutor.java:221)
  at android.app.servertransaction.TransactionExecutor.cycleToPath (TransactionExecutor.java:201)
  at android.app.servertransaction.TransactionExecutor.executeLifecycleState (TransactionExecutor.java:173)
  at android.app.servertransaction.TransactionExecutor.execute (TransactionExecutor.java:97)
  at android.app.ActivityThread$H.handleMessage (ActivityThread.java:2135)
  at android.os.Handler.dispatchMessage (Handler.java:106)
  at android.os.Looper.loop (Looper.java:236)
  at android.app.ActivityThread.main (ActivityThread.java:8059)
Caused by java.security.InvalidAlgorithmParameterException: java.lang.IllegalStateException: At least one biometric must be enrolled to create keys requiring user authentication for every use
  at android.security.keystore.AndroidKeyStoreKeyGeneratorSpi.engineInit (AndroidKeyStoreKeyGeneratorSpi.java:252)
  at android.security.keystore.AndroidKeyStoreKeyGeneratorSpi$AES.engineInit (AndroidKeyStoreKeyGeneratorSpi.java:53)
  at javax.crypto.KeyGenerator.init (KeyGenerator.java:519)
  at javax.crypto.KeyGenerator.init (KeyGenerator.java:502)
  at org.matrix.android.sdk.api.securestorage.SecretStoringUtils.getOrGenerateSymmetricKeyForAliasM (SecretStoringUtils.kt:13)
  at org.matrix.android.sdk.api.securestorage.SecretStoringUtils.ensureKey (SecretStoringUtils.kt:1)
  at im.vector.app.features.pin.lockscreen.crypto.KeyStoreCrypto.ensureKey (KeyStoreCrypto.kt:1)
  at im.vector.app.features.pin.lockscreen.crypto.migrations.SystemKeyV1Migrator.migrate (SystemKeyV1Migrator.kt:3)
  at im.vector.app.features.pin.lockscreen.crypto.LockScreenKeysMigrator.migrateIfNeeded (LockScreenKeysMigrator.kt:9)
  at im.vector.app.features.pin.lockscreen.ui.LockScreenViewModel$1.invokeSuspend (LockScreenViewModel.kt:2)
  at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith (ContinuationImpl.kt:3)
  at kotlinx.coroutines.DispatchedTask.run (DispatchedTask.kt:18)
  at kotlinx.coroutines.EventLoopImplBase.processNextEvent (EventLoop.common.kt:21)
  at kotlinx.coroutines.BuildersKt.runBlocking
  at kotlinx.coroutines.BuildersKt.runBlocking$default
  at im.vector.app.features.pin.lockscreen.ui.LockScreenViewModel.<init> (LockScreenViewModel.kt:8)
  at im.vector.app.DaggerVectorApplication_HiltComponents_SingletonC$MavericksViewModelCImpl$SwitchingProvider$1.create (DaggerVectorApplication_HiltComponents_SingletonC.java:14)
  at im.vector.app.core.di.HiltMavericksViewModelFactory.create (HiltMavericksViewModelFactory.kt:6)
  at im.vector.app.features.pin.lockscreen.ui.LockScreenViewModel$Companion.create
  at im.vector.app.features.pin.lockscreen.ui.LockScreenViewModel$Companion.create (LockScreenViewModel.kt:1)
Caused by java.lang.IllegalStateException: At least one biometric must be enrolled to create keys requiring user authentication for every use
  at android.security.keystore.KeymasterUtils.addSids (KeymasterUtils.java:110)
  at android.security.keystore.KeymasterUtils.addUserAuthArgs (KeymasterUtils.java:174)
  at android.security.keystore.AndroidKeyStoreKeyGeneratorSpi.engineInit (AndroidKeyStoreKeyGeneratorSpi.java:250)

Occurrences (30 days) Total Occurrences Impacted users (lifetime)
22 22 22

https://play.google.com/console/u/0/developers/{redacted}/app/{redacted}/vitals/crashes/0913c94c4eebbda4e0ff631ad29dabe6/details?installedFrom=PLAY_STORE&days=30&clustering=NEW&versionCode=40104312%2C40104311

@ouchadam ouchadam added T-Defect Something isn't working: bugs, crashes, hangs and other reported problems Z-Crash A-Pin code S-Major Severely degrades major functionality or product features, with no satisfactory workaround O-Uncommon Most users are unlikely to come across this or unexpected workflow labels Aug 8, 2022
@jmartinesp jmartinesp self-assigned this Aug 9, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-Pin code O-Uncommon Most users are unlikely to come across this or unexpected workflow S-Major Severely degrades major functionality or product features, with no satisfactory workaround T-Defect Something isn't working: bugs, crashes, hangs and other reported problems Z-Crash
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants