From 524b074116fb15eae6a8433cb4f9f15b6bac937e Mon Sep 17 00:00:00 2001 From: Vincent Breitmoser Date: Sat, 29 Apr 2017 15:18:28 +0200 Subject: [PATCH] add individual state for insecure encryption --- .../fsck/k9/ui/messageview/MessageCryptoPresenter.java | 1 + .../java/com/fsck/k9/view/MessageCryptoDisplayStatus.java | 8 +++++++- k9mail/src/main/res/values/strings.xml | 1 + 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/k9mail/src/main/java/com/fsck/k9/ui/messageview/MessageCryptoPresenter.java b/k9mail/src/main/java/com/fsck/k9/ui/messageview/MessageCryptoPresenter.java index 6b96adef2..3ee983468 100644 --- a/k9mail/src/main/java/com/fsck/k9/ui/messageview/MessageCryptoPresenter.java +++ b/k9mail/src/main/java/com/fsck/k9/ui/messageview/MessageCryptoPresenter.java @@ -122,6 +122,7 @@ public class MessageCryptoPresenter implements OnCryptoClickListener { } case ENCRYPTED_ERROR: + case ENCRYPTED_INSECURE: case UNSUPPORTED_ENCRYPTED: { Drawable providerIcon = getOpenPgpApiProviderIcon(messageView.getContext()); if (messageViewInfo.cryptoResultAnnotation.hasReplacementData()) { diff --git a/k9mail/src/main/java/com/fsck/k9/view/MessageCryptoDisplayStatus.java b/k9mail/src/main/java/com/fsck/k9/view/MessageCryptoDisplayStatus.java index 0d7c7648b..0e214b06f 100644 --- a/k9mail/src/main/java/com/fsck/k9/view/MessageCryptoDisplayStatus.java +++ b/k9mail/src/main/java/com/fsck/k9/view/MessageCryptoDisplayStatus.java @@ -125,6 +125,12 @@ public enum MessageCryptoDisplayStatus { R.string.crypto_msg_encrypted_error ), + ENCRYPTED_INSECURE ( + R.attr.openpgp_red, + R.drawable.status_lock_error, + R.string.crypto_msg_encrypted_insecure + ), + INCOMPLETE_ENCRYPTED ( R.attr.openpgp_black, R.drawable.status_lock_opportunistic, @@ -254,7 +260,7 @@ public enum MessageCryptoDisplayStatus { return getStatusForPgpEncryptedResult(signatureResult); case OpenPgpDecryptionResult.RESULT_INSECURE: - return ENCRYPTED_ERROR; + return ENCRYPTED_INSECURE; } throw new AssertionError("all cases must be handled, this is a bug!"); diff --git a/k9mail/src/main/res/values/strings.xml b/k9mail/src/main/res/values/strings.xml index 0602a9c0c..6d173542a 100644 --- a/k9mail/src/main/res/values/strings.xml +++ b/k9mail/src/main/res/values/strings.xml @@ -1167,6 +1167,7 @@ Please submit bug reports, contribute new features and ask questions at Message is not encrypted Message is encrypted, but there was a decryption error. + Message is encrypted but insecure! Message is signed, but the signature could not be verified. Message is encrypted, but no crypto app is configured. Message is encrypted, but in an unsupported format.