summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSandro Knauß <sknauss@kde.org>2016-12-03 10:47:18 (GMT)
committerSandro Knauß <sknauss@kde.org>2016-12-03 10:49:31 (GMT)
commit38761d68c5ff35e6388c9239784e3bb827966b98 (patch)
treeeef80e0f008e8861b0cb0a04fa9ce562b8975924
parente978f4d266846c74200424149214b968789f0485 (diff)
Detect passphrase errors robustly
-rw-r--r--mimetreeparser/src/viewer/messagepart.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/mimetreeparser/src/viewer/messagepart.cpp b/mimetreeparser/src/viewer/messagepart.cpp
index 6e68e4c..b24fdb5 100644
--- a/mimetreeparser/src/viewer/messagepart.cpp
+++ b/mimetreeparser/src/viewer/messagepart.cpp
@@ -1213,6 +1213,9 @@ bool EncryptedMessagePart::okDecryptMIME(KMime::Content &data)
foreach (const GpgME::DecryptionResult::Recipient &recipient, decryptResult.recipients()) {
mNoSecKey &= (recipient.status().code() == GPG_ERR_NO_SECKEY);
}
+ if (!mPassphraseError && !mNoSecKey) { // GpgME do not detect passphrase error correctly
+ mPassphraseError = true;
+ }
}
}
}