android-password-store / Android-Password-Store

Android application compatible with ZX2C4's Pass command line application
https://passwordstore.app
GNU General Public License v3.0
2.53k stars 251 forks source link

fix blocking createPasswordUI() when OTP is displayed #3162

Closed agrahn closed 1 month ago

agrahn commented 1 month ago

If the decrypted entry in the store contains an OTP, function createPasswordUI() becomes a blocking function. In this case, startAutoDismissTimer() and onSuccess() that come after createPasswordUI() in function decryptWithPassphrase() are not reached and executed. As a consequence, passphrase caching is not carried out and the passphrase must be entered again in order to decrypt another entry in the store.

The bug can be reproduced as follows:

  1. Start APS, ensure that passphrase caching and auto-clean on screen-off are enabled.
  2. Select a store entry with an OTP, unlock the cache with the screen-lock PIN and decrypt the entry with your passphrase
  3. Select another (or the same) entry from the password list
  4. Enter the PIN --> APS asks again for your passphrase, which should not be necessary if the previously entered passphrase were cached properly.

This PR tries to fix the issue.