aboutsummaryrefslogtreecommitdiff
path: root/app/src/main/java
diff options
context:
space:
mode:
authorFabian Henneke <FabianHenneke@users.noreply.github.com>2020-07-27 08:05:35 +0200
committerGitHub <noreply@github.com>2020-07-27 11:35:35 +0530
commitc9a34623724f1dce9acf902ca5bde1dba6cafb02 (patch)
treeffdc19c8e570e6f78b7f1ed53322e68c71302e0c /app/src/main/java
parent2b1f101685472452ecb30d8a84bcc6b88167bd1c (diff)
Add specific warning for short key IDs in .gpg-id (#974)
Diffstat (limited to 'app/src/main/java')
-rw-r--r--app/src/main/java/com/zeapo/pwdstore/crypto/PasswordCreationActivity.kt6
1 files changed, 5 insertions, 1 deletions
diff --git a/app/src/main/java/com/zeapo/pwdstore/crypto/PasswordCreationActivity.kt b/app/src/main/java/com/zeapo/pwdstore/crypto/PasswordCreationActivity.kt
index 3c1757f1..45bde491 100644
--- a/app/src/main/java/com/zeapo/pwdstore/crypto/PasswordCreationActivity.kt
+++ b/app/src/main/java/com/zeapo/pwdstore/crypto/PasswordCreationActivity.kt
@@ -316,7 +316,11 @@ class PasswordCreationActivity : BasePgpActivity(), OpenPgpServiceConnection.OnB
.filter { it.isNotBlank() }
.map { line ->
parseGpgIdentifier(line) ?: run {
- snackbar(message = resources.getString(R.string.invalid_gpg_id))
+ if (line.removePrefix("0x").matches("[a-fA-F0-9]{8}".toRegex())) {
+ snackbar(message = resources.getString(R.string.short_key_ids_unsupported))
+ } else {
+ snackbar(message = resources.getString(R.string.invalid_gpg_id))
+ }
return@with
}
}