Android-Password-Store icon indicating copy to clipboard operation
Android-Password-Store copied to clipboard

[BUG] Passphrase prompt should not be shown for keys that have none

Open durka opened this issue 1 year ago • 4 comments
trafficstars

Describe the bug

When I go to decrypt a password, Password Store asks me for a password. It's not clear, but I'm assuming it wants the passphrase for my PGP key, but there isn't one.

I can enter anything, or nothing, and click OK and it still decrypts the password.

Steps to reproduce

Steps to reproduce the behavior:

  1. Import a key with no passphrase
  2. Select a password from the store
  3. Enter something in the password prompt, or don't
  4. Click OK

Expected behavior

Just decrypt the password.

Screenshots

No response

Device information

  • Device: Pixel 7
  • OS: Android 14
  • App version: 2.0.0-SNAPSHOT (broken biometric authentication workaround)

Additional context

No response

durka avatar Dec 25 '23 03:12 durka

The underlying PGP library accepts the passphrase as part of a separate SecretKeyProtector object which I assume just completely gets ignored when the key doesn't have any passphrase. I'll have to check if there's a way for us to detect the same from outside without having to resolve to attempt decryption twice.

msfjarvis avatar Dec 25 '23 07:12 msfjarvis

I've pushed a change that inspects the encrypted message and skips asking for a passphrase if it's not needed, please test out the new snapshot build once it's available and let me know how it goes.

msfjarvis avatar Dec 25 '23 10:12 msfjarvis

It's not quite working. It avoids asking me for a passphrase and reaches the password display screen, but the password is never displayed.

Note: if I enable the "passphrase cache", then it successfully decrypts and displays the password. This is a perfectly fine state of affairs for me personally, because it means even with the biometric auth disabled due to #2802, then there is still a biometric layer before the password comes up.

Attached is a logcat from trying to decrypt a password with the passphrase cache disabled: aps-logcat.txt

durka avatar Dec 25 '23 23:12 durka

Thanks for checking it out, I'll give it another go sometime today.

msfjarvis avatar Dec 26 '23 05:12 msfjarvis

Finally managed to find enough time and motivation to take another look at this, once #3069 is merged this should be resolved.

msfjarvis avatar May 27 '24 15:05 msfjarvis