Skip to content

Better wrong password handling #4353

@r0wan

Description

@r0wan

Describe the bug
New phone. Old Amaze Smb connection copies without password / left empty. Connection attempt crashed Amaze.

To Reproduce
Steps to reproduce the behavior:

  1. Create a working SMB connection.
  2. Sync apps and settings to a new phone.
  3. Connect to SMB will crash because password did not copy over
  4. See error

Expected behavior
If password is empty or incorrect, do not crash but print an error message that does not fade away in a bubble.

Screenshots

Smartphone (please complete the following information):
Google Pixel 9, fully updated.

Additional context

Issue explanation (write below this line)

Exception

  • App Name: Amaze File Manager
  • Package: com.amaze.filemanager
  • Version: 3.10
  • User Action: UI Error
  • Request: Application crash
  • OS: Linux Android 15 - 35
  • Device: tokay
  • Model: Pixel 9
  • Product: tokay
Crash log

java.lang.RuntimeException: An error occurred while executing doInBackground()
	at android.os.AsyncTask$4.done(AsyncTask.java:415)
	at java.util.concurrent.FutureTask.finishCompletion(FutureTask.java:381)
	at java.util.concurrent.FutureTask.setException(FutureTask.java:250)
	at java.util.concurrent.FutureTask.run(FutureTask.java:269)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:644)
	at java.lang.Thread.run(Thread.java:1012)
Caused by: javax.crypto.AEADBadTagException
	at android.security.keystore2.AndroidKeyStoreCipherSpiBase.engineDoFinal(AndroidKeyStoreCipherSpiBase.java:632)
	at javax.crypto.Cipher.doFinal(Cipher.java:2074)
	at com.amaze.filemanager.utils.PasswordUtil.aesDecryptPassword(PasswordUtil.kt:65)
	at com.amaze.filemanager.utils.PasswordUtil.decryptPassword(PasswordUtil.kt:124)
	at com.amaze.filemanager.utils.PasswordUtil.decryptPassword$default(PasswordUtil.kt:118)
	at com.amaze.filemanager.utils.smb.SmbUtil$getSmbDecryptedPath$1.invoke(SmbUtil.kt:60)
	at com.amaze.filemanager.utils.smb.SmbUtil$getSmbDecryptedPath$1.invoke(SmbUtil.kt:59)
	at com.amaze.filemanager.utils.smb.SmbUtil.buildPath(SmbUtil.kt:85)
	at com.amaze.filemanager.utils.smb.SmbUtil.getSmbDecryptedPath(SmbUtil.kt:59)
	at com.amaze.filemanager.utils.smb.SmbUtil.create(SmbUtil.kt:105)
	at com.amaze.filemanager.filesystem.HybridFile.getSmbFile(HybridFile.java:510)
	at com.amaze.filemanager.asynchronous.asynctasks.LoadFilesListTask.listSmb(LoadFilesListTask.java:683)
	at com.amaze.filemanager.asynchronous.asynctasks.LoadFilesListTask.doInBackground(LoadFilesListTask.java:162)
	at com.amaze.filemanager.asynchronous.asynctasks.LoadFilesListTask.doInBackground(LoadFilesListTask.java:91)
	at android.os.AsyncTask$3.call(AsyncTask.java:394)
	at java.util.concurrent.FutureTask.run(FutureTask.java:264)
	... 3 more
Caused by: android.security.KeyStoreException: Signature/MAC verification failed (internal Keystore code: -30 message: system/security/keystore2/src/operation.rs:848: KeystoreOperation::finish

Caused by:
    0: system/security/keystore2/src/operation.rs:429: Finish failed.
    1: Error::Km(r#VERIFICATION_FAILED)) (public error code: 10 internal Keystore code: -30)
	at android.security.KeyStore2.getKeyStoreException(KeyStore2.java:416)
	at android.security.KeyStoreOperation.handleExceptions(KeyStoreOperation.java:79)
	at android.security.KeyStoreOperation.finish(KeyStoreOperation.java:132)
	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:624)
	... 18 more


Metadata

Metadata

Assignees

No one assigned

    Labels

    Area-SMBRelated to SMB connections.Issue-BugRelated unexpected behavior or something worth investigating.Issue-Easy (good first issue)Beginners welcome! Issues with relative low difficulty.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions