Verified Commit 7f9aa706 authored by Andre Heinecke's avatar Andre Heinecke
Browse files

Fix compliance display in newkeyapprovaldlg

The encryptionkeys list is only filled correctly in the
accepted check. It is better to check the combos directly
here to ensure that the correct state is shown.
parent 52cb626a
Pipeline #27818 passed with stage
in 17 minutes and 53 seconds
......@@ -640,21 +640,41 @@ public:
// Handle compliance
bool de_vs = true;
for (const auto &key: q->signingKeys()) {
bool isPGP = mFormatBtns->checkedId() == 1;
bool isSMIME = mFormatBtns->checkedId() == 2;
for (const auto combo: qAsConst(mEncCombos)) {
const auto &key = combo->currentKey();
if (!combo->isVisible()) {
continue;
}
if (isSMIME && key.protocol() != GpgME::CMS) {
continue;
}
if (isPGP && key.protocol() != GpgME::OpenPGP) {
continue;
}
qCDebug(LIBKLEO_LOG) << "Checking" << key.primaryFingerprint() << Formatting::isKeyDeVs(key);
if (!Formatting::isKeyDeVs(key) || keyValidity(key) < GpgME::UserID::Validity::Full) {
de_vs = false;
break;
}
}
if (de_vs) {
for (const auto &keys: q->encryptionKeys().values()) {
for (const auto &key: keys) {
if (!Formatting::isKeyDeVs(key) || keyValidity(key) < GpgME::UserID::Validity::Full) {
de_vs = false;
break;
}
for (const auto combo: qAsConst(mSigningCombos)) {
const auto key = combo->currentKey();
if (!combo->isVisible()) {
continue;
}
if (isSMIME && key.protocol() != GpgME::CMS) {
continue;
}
if (isPGP && key.protocol() != GpgME::OpenPGP) {
continue;
}
if (!de_vs) {
if (!Formatting::isKeyDeVs(key) || keyValidity(key) < GpgME::UserID::Validity::Full) {
de_vs = false;
break;
}
}
......
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