Commit d0d25f71 authored by Ingo Klöcker's avatar Ingo Klöcker
Browse files

Exit early if decryption failed or was canceled

In this case checking the compliance of the decryption (which didn't
happen) or showing the embedded filename (which is not available without
decryption) makes no sense.

GnuPG-bug-id: 5535
parent 6c3c904a
......@@ -530,12 +530,16 @@ static QString formatVerificationResultDetails(const VerificationResult &res, co
static QString formatDecryptionResultDetails(const DecryptionResult &res, const std::vector<Key> &recipients,
const QString &errorString, bool isSigned, const QPointer<Task> &task)
{
QString details;
if ((res.error().code() == GPG_ERR_EIO || res.error().code() == GPG_ERR_NO_DATA) && !errorString.isEmpty()) {
return i18n("Input error: %1", errorString);
}
if (res.isNull() || res.error() || res.error().isCanceled()) {
return {};
}
QString details;
if (Kleo::gpgComplianceP("de-vs")) {
details += ((IS_DE_VS(res)
? i18nc("%1 is a placeholder for the name of a compliance mode. E.g. NATO RESTRICTED compliant or VS-NfD compliant",
......@@ -557,10 +561,6 @@ static QString formatDecryptionResultDetails(const DecryptionResult &res, const
}
}
if (res.isNull() || res.error() || res.error().isCanceled()) {
return details;
}
if (!isSigned) {
details += i18n("<b>Note:</b> You cannot be sure who encrypted this message as it is not signed.")
+ QLatin1String("<br/>");
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment