Liftric / KVault

Secure key-value storage for Kotlin Multiplatform projects.
MIT License
238 stars 20 forks source link

KVault initialization requires file name to change to avoid EncryptedSharedPreferences crash #53

Open cristhianescobar opened 9 months ago

cristhianescobar commented 9 months ago

Keep running into this error that gets fix after I change the file name: so I basically have a counter that I have to update in order to fix it, do you know why this could be happening?

single { KVault(get(), fileName = "fileName:1") }
0: system/security/keystore2/src/operation.rs:426: Finish failed.
                                                                                                        1: Error::Km(r#VERIFICATION_FAILED)) (public error code: 10 internal Keystore code: -30)
                                                                                                        at android.security.KeyStore2.getKeyStoreException(KeyStore2.java:386)
                                                                                                        at android.security.KeyStoreOperation.handleExceptions(KeyStoreOperation.java:78)
                                                                                                        at android.security.KeyStoreOperation.finish(KeyStoreOperation.java:128)
                                                                                                        at android.security.keystore2.KeyStoreCryptoOperationChunkedStreamer$MainDataStream.finish(KeyStoreCryptoOperationChunkedStreamer.java:228)
                                                                                                        at android.security.keystore2.KeyStoreCryptoOperationChunkedStreamer.doFinal(KeyStoreCryptoOperationChunkedStreamer.java:181)
                                                                                                        at android.security.keystore2.AndroidKeyStoreAuthenticatedAESCipherSpi$BufferAllOutputUntilDoFinalStreamer.doFinal(AndroidKeyStoreAuthenticatedAESCipherSpi.java:396)
                                                                                                        at android.security.keystore2.AndroidKeyStoreCipherSpiBase.engineDoFinal(AndroidKeyStoreCipherSpiBase.java:618)
RaphaelFavero commented 1 month ago

Any update on that issue ? I encountered the same crash.