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

Show an error message when signing/encrypting with non-compliant GnuPG

If GnuPG is configured to enforce de-vs compliance, but isn't de-vs
compliant, then tell the users that signing/encrypting is not possible
when they try to sign/encrypt something.

GnuPG-bug-id: 5362, 5653
parent b823dc58
...@@ -217,6 +217,14 @@ public: ...@@ -217,6 +217,14 @@ public:
bool validatePage() override bool validatePage() override
{ {
if (Kleo::gnupgUsesDeVsCompliance() && !Kleo::gnupgIsDeVsCompliant()) {
KMessageBox::sorry(topLevelWidget(),
xi18nc("@info %1 is a placeholder for the name of a compliance mode. E.g. NATO RESTRICTED compliant or VS-NfD compliant",
"<para>Sorry! You cannot use Kleopatra for signing or encrypting files "
"because the <application>GnuPG</application> system used by Kleopatra is not %1.</para>",
Formatting::deVsString()));
return false;
}
bool sign = !mWidget->signKey().isNull(); bool sign = !mWidget->signKey().isNull();
bool encrypt = !mWidget->selfKey().isNull() || !mWidget->recipients().empty(); bool encrypt = !mWidget->selfKey().isNull() || !mWidget->recipients().empty();
if (!mWidget->validate()) { if (!mWidget->validate()) {
......
...@@ -367,6 +367,15 @@ public: ...@@ -367,6 +367,15 @@ public:
void doEncryptSign() void doEncryptSign()
{ {
if (Kleo::gnupgUsesDeVsCompliance() && !Kleo::gnupgIsDeVsCompliant()) {
KMessageBox::sorry(q->topLevelWidget(),
xi18nc("@info %1 is a placeholder for the name of a compliance mode. E.g. NATO RESTRICTED compliant or VS-NfD compliant",
"<para>Sorry! You cannot use Kleopatra for signing or encryption "
"because the <application>GnuPG</application> system used by Kleopatra is not %1.</para>",
Formatting::deVsString()));
return;
}
doCryptoCommon(); doCryptoCommon();
mProgressLabel->setText(mSigEncWidget->currentOp() + QStringLiteral("...")); mProgressLabel->setText(mSigEncWidget->currentOp() + QStringLiteral("..."));
auto input = Input::createFromByteArray(&mInputData, i18n("Notepad")); auto input = Input::createFromByteArray(&mInputData, i18n("Notepad"));
......
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