biometric_storage icon indicating copy to clipboard operation
biometric_storage copied to clipboard

IllegalBlockSizeException

Open Samin-youki opened this issue 2 years ago • 5 comments

Hey, i'm using this great library for months now, and i wanted to thank the owner for always updating and fixing problems :)

i upgrade to version 4.1.3 and since on, randomly i got this error after authentication:

I/BiometricPrompt(16583): onAuthenticationSucceeded: 2 [log] FINEST: 2022-07-04 14:19:03.009818: Error during plugin operation (details: javax.crypto.IllegalBlockSizeException javax.crypto.IllegalBlockSizeException at android.security.keystore.AndroidKeyStoreCipherSpiBase.engineDoFinal(AndroidKeyStoreCipherSpiBase.java:519) at android.security.keystore.AndroidKeyStoreCipherSpiBase.engineDoFinal(AndroidKeyStoreCipherSpiBase.java:531) at javax.crypto.Cipher.doFinal(Cipher.java:2267) at design.codeux.biometric_storage.CryptographyManagerImpl.encryptData(CryptographyManager.kt:120) at design.codeux.biometric_storage.BiometricStorageFile.writeFile(BiometricStorageFile.kt:118) at design.codeux.biometric_storage.BiometricStoragePlugin$onMethodCall$5$1.invoke(BiometricStoragePlugin.kt:266) at design.codeux.biometric_storage.BiometricStoragePlugin$onMethodCall$5$1.invoke(BiometricStoragePlugin.kt:265) at design.codeux.biometric_storage.BiometricStoragePlugin$onMethodCall$withAuth$2.invoke(BiometricStoragePlugin.kt:203) at design.codeux.biometric_storage.BiometricStoragePlugin$onMethodCall$withAuth$2.invoke(BiometricStoragePlugin.kt:202) at design.codeux.biometric_storage.BiometricStoragePlugin$authenticate$prompt$1$onAuthenticationSucceeded$$inlined$worker$1.run(BiometricStoragePlugin.kt:445) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:462) at java.util.concurrent.FutureTask.run(FutureTask.java:266) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641) at java.lang.Thread.run(Thread.java:923) Caused by: android.security.KeyStoreException: Key user not authenticated at android.security.KeyStore.getKeyStoreException(KeyStore.java:1461) at android.security.keystore.KeyStoreCryptoOperationChunkedStreamer.update(KeyStoreCryptoOperationChunkedStreamer.java:140) at android.security.keystore.KeyStoreCryptoOperationChunkedStreamer.doFinal(KeyStoreCryptoOperationChunkedStreamer.java:169) at android.security.keystore.AndroidKeyStoreCipherSpiBase.engineDoFinal(AndroidKeyStoreCipherSpiBase.java:506) ... 14 more )

Samin-youki avatar Jul 04 '22 12:07 Samin-youki

when exactly is this happening? Only for existing installations, or also for new installations? What do you mean with randomly 😅

hpoul avatar Jul 04 '22 19:07 hpoul

@hpoul thanks for answering, no installation is fine, when its running, some times the auth is not completed(means the figner print is requesting, and i get the success code 2, but auth process face a error) and i see this error on the logs, but sometimes it is working fine.

Samin-youki avatar Jul 05 '22 07:07 Samin-youki

I'm facing this with Android 13, with the version 4.1.3

RafaRuiz avatar Aug 31 '22 10:08 RafaRuiz

I'm facing the issue with android 13 precisely when writing something over 44 char. A 45 char length crash.

hatch01 avatar Aug 16 '23 09:08 hatch01

I'm facing this issue with the version 5.0.0+4

its working fine when the first run.. i can read or write data.. But once the app is killed and restarts. im getting this exception. Is there any workaround? In my case this is happening on read after the app is killed and restarts

IllegalBlockSizeException

Febinjohnson96 avatar Nov 21 '23 14:11 Febinjohnson96