Verified Commit 9519e3b2 authored by Andre Heinecke's avatar Andre Heinecke
Browse files

Disable empty passphrase for S/MIME CSRs

GnuPG and GPGME currently don't support to set a passphrase
callback for S/MIME. So we hide it to avoid an "not implemented"
error.
parent c343a62e
Pipeline #45620 passed with stage
in 19 minutes and 11 seconds
......@@ -816,6 +816,11 @@ public:
const auto entry = conf->entry(QStringLiteral("gpg-agent"),
QStringLiteral("Passphrase policy"),
QStringLiteral("enforce-passphrase-constraints"));
if (!pgp()) {
// GnuPG / GPGME as of 2.2.27 do not support
// pinentry mode and passphrase setting for S/MIME
ui.withPassCB->setVisible(false);
}
if (entry && entry->boolValue()) {
qCDebug(KLEOPATRA_LOG) << "Disabling passphrace cb because of agent config.";
ui.withPassCB->setEnabled(false);
......@@ -892,7 +897,7 @@ private:
if (!j) {
return;
}
if (!protectedKey ()) {
if (!protectedKey() && pgp()) {
auto ctx = QGpgME::Job::context(j);
ctx->setPassphraseProvider(&mEmptyPWProvider);
ctx->setPinentryMode(Context::PinentryLoopback);
......
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