diff options
| author | Danilo M. <danix@danix.xyz> | 2026-11-02 18:27:09 +0100 |
|---|---|---|
| committer | Danilo M. <danix@danix.xyz> | 2026-11-02 18:27:09 +0100 |
| commit | 931eb40e8e4deb41edcb1c725e74586ff9f918b2 (patch) | |
| tree | 3cb0348a771e8bf5a96be5b7c87d860ea5c8e61b /app/src/main/res/values/strings.xml | |
| parent | f5ca80dfd68d915ee100bd79f4e9e2cc34362b1b (diff) | |
| download | HardenedPass-931eb40e8e4deb41edcb1c725e74586ff9f918b2.tar.gz HardenedPass-931eb40e8e4deb41edcb1c725e74586ff9f918b2.zip | |
fix(crypto): refuse to encrypt when a .gpg-id recipient key is missing
CryptoRepository.encrypt looked up every .gpg-id recipient and dropped
the ones it could not find, so an entry saved on a device that lacked
one recipient's key was encrypted to the others only. With a store
shared between a phone key and a smartcard key, entries created on the
phone could no longer be decrypted with the smartcard alone.
Fail with the lookup error instead (KeyNotFoundException names the
key), so the user imports the missing public key and saves again.
PasswordCreationActivity also ignored the Result of encrypt and wrote
the output buffer regardless: on any encryption failure it wrote an
empty .gpg file, overwriting the entry when editing, and committed it.
Show the error and leave the file untouched.
CryptoRepositoryTest covers both the missing-recipient failure and the
all-present success path, with keys generated by PGPainless (added as
an app test dependency).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Diffstat (limited to 'app/src/main/res/values/strings.xml')
| -rw-r--r-- | app/src/main/res/values/strings.xml | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 0584a1f2..61596e58 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -38,8 +38,8 @@ <string name="password_move_error_message">Failed to move %1$s to %2$s</string> <!-- git commits --> - <string name="git_commit_add_text">Add generated password for %1$s using Android Password Store.</string> - <string name="git_commit_edit_text">Edit password for %1$s using Android Password Store.</string> + <string name="git_commit_add_text">Add generated password for %1$s using HardenedPass.</string> + <string name="git_commit_edit_text">Edit password for %1$s using HardenedPass.</string> <string name="git_commit_remove_text">Remove %1$s from store.</string> <string name="git_commit_move_text">Rename %1$s to %2$s.</string> <string name="git_commit_move_multiple_text">Move multiple passwords to %1$s.</string> @@ -304,6 +304,7 @@ <!-- Password creation failure --> <string name="password_creation_file_fail_title">Error</string> + <string name="password_creation_encrypt_fail_message">Could not encrypt the password, nothing was saved: %1$s</string> <string name="password_creation_file_write_fail_message">Failed to write password file to the store, please try again.</string> <string name="password_creation_file_delete_fail_message">Failed to delete password file %1$s from the store, please delete it manually.</string> <string name="password_creation_duplicate_error">File already exists, please use a different name</string> |
