From e6fae9b0768a7e007632670c8f2ae7eb1c56fc8d Mon Sep 17 00:00:00 2001 From: M66B Date: Thu, 12 Dec 2019 14:39:55 +0100 Subject: [PATCH] Reset key alias on decryption failure --- app/src/main/java/eu/faircode/email/FragmentMessages.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/eu/faircode/email/FragmentMessages.java b/app/src/main/java/eu/faircode/email/FragmentMessages.java index 7139c3080b..2ca5caf9f9 100644 --- a/app/src/main/java/eu/faircode/email/FragmentMessages.java +++ b/app/src/main/java/eu/faircode/email/FragmentMessages.java @@ -4524,8 +4524,11 @@ public class FragmentMessages extends FragmentBase implements SharedPreferences. Log.w(ex); } - if (is == null) + if (is == null) { + if (message.identity != null) + db.identity().setIdentitySignKeyAlias(message.identity, null); throw new IllegalArgumentException(context.getString(R.string.title_invalid_key)); + } // Decode message Properties props = MessageHelper.getSessionProperties();