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

Move decryptBiometricKey() to background thread #677

Open
hvge opened this issue Feb 24, 2025 · 1 comment
Open

Move decryptBiometricKey() to background thread #677

hvge opened this issue Feb 24, 2025 · 1 comment
Assignees

Comments

@hvge
Copy link
Member

hvge commented Feb 24, 2025

Affected product(s) and version(s)

  • 1.4.x - 1.9.x

Environment

  • client's production

Steps to reproduce, current result, expected result

It seems that if RSA is used for biometric key encryption, then the actual key decryption may take a significant amount of time and cause the application to be killed by OS. We should avoid this and move the actual key decryption to the background thread.

Log output

Callstack with crash:

"main" tid=1 Native
  #00  pc 0x00000000000c12ec  /apex/com.android.runtime/lib64/bionic/libc.so (__ioctl+12)
  #01  pc 0x00000000000686a8  /apex/com.android.runtime/lib64/bionic/libc.so (ioctl+156)
  #02  pc 0x000000000004bec0  /system/lib64/libbinder.so (android::IPCThreadState::talkWithDriver+244)
  #03  pc 0x000000000004d200  /system/lib64/libbinder.so (android::IPCThreadState::waitForResponse+76)
  #04  pc 0x000000000004cf48  /system/lib64/libbinder.so (android::IPCThreadState::transact+188)
  #05  pc 0x0000000000061ef4  /system/lib64/libbinder.so (android::BpBinder::transact+172)
  #06  pc 0x00000000001a3894  /system/lib64/libandroid_runtime.so (android_os_BinderProxy_transact+156)
  at android.os.BinderProxy.transactNative (Native method)
  at android.os.BinderProxy.transact (BinderProxy.java:586)
  at android.system.keystore2.IKeystoreOperation$Stub$Proxy.update (IKeystoreOperation.java:227)
  at android.security.KeyStoreOperation.lambda$update$1 (KeyStoreOperation.java:118)
  at android.security.KeyStoreOperation.$r8$lambda$Zq48mSFIXpCsoYDZ2jJFfuYJxZo (unavailable)
  at android.security.KeyStoreOperation$$ExternalSyntheticLambda2.execute (D8$$SyntheticClass)
  at android.security.KeyStoreOperation.handleExceptions (KeyStoreOperation.java:70)
  at android.security.KeyStoreOperation.update (KeyStoreOperation.java:118)
  at android.security.keystore2.KeyStoreCryptoOperationChunkedStreamer$MainDataStream.update (KeyStoreCryptoOperationChunkedStreamer.java:222)
  at android.security.keystore2.KeyStoreCryptoOperationChunkedStreamer.update (KeyStoreCryptoOperationChunkedStreamer.java:156)
  at android.security.keystore2.KeyStoreCryptoOperationChunkedStreamer.doFinal (KeyStoreCryptoOperationChunkedStreamer.java:179)
  at android.security.keystore2.AndroidKeyStoreCipherSpiBase.engineDoFinal (AndroidKeyStoreCipherSpiBase.java:624)
  at javax.crypto.Cipher.doFinal (Cipher.java:2074)
  at io.getlime.security.powerauth.biometry.impl.BiometricKeyEncryptorRsa.decryptBiometricKey (BiometricKeyEncryptorRsa.java:198)
  at io.getlime.security.powerauth.biometry.impl.BiometricAuthenticator.encryptOrDecryptRawKeyData (BiometricAuthenticator.java:346)
  at io.getlime.security.powerauth.biometry.impl.BiometricAuthenticator.-$$Nest$mencryptOrDecryptRawKeyData (unavailable)
  at io.getlime.security.powerauth.biometry.impl.BiometricAuthenticator$1.onAuthenticationSucceeded (BiometricAuthenticator.java:253)
  at androidx.biometric.BiometricFragment$9.run (BiometricFragment.java:907)
@hvge
Copy link
Member Author

hvge commented Feb 24, 2025

For now, I scheduled this for 1.10.0 release. We may back-port this to older SDK releases, if the frequency of incidents will be significant.

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