summaryrefslogtreecommitdiffstats
path: root/framework/src/domain/mime/mailcrypto.cpp
diff options
context:
space:
mode:
authorMinijackson <minijackson@riseup.net>2018-03-07 17:41:23 +0100
committerMinijackson <minijackson@riseup.net>2018-03-08 16:30:52 +0100
commit1112e1530587d71b1bc21f9e19b4ed95fbe30fa2 (patch)
treefbaa8735509fafff103bf73a5c73fe6b980e0c44 /framework/src/domain/mime/mailcrypto.cpp
parent7ab399ce3b4b33439fe2607cf38e3f27a7d6008e (diff)
downloadkube-1112e1530587d71b1bc21f9e19b4ed95fbe30fa2.tar.gz
kube-1112e1530587d71b1bc21f9e19b4ed95fbe30fa2.zip
Remove protocol differentiation since we only use OpenPGP
Diffstat (limited to 'framework/src/domain/mime/mailcrypto.cpp')
-rw-r--r--framework/src/domain/mime/mailcrypto.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/framework/src/domain/mime/mailcrypto.cpp b/framework/src/domain/mime/mailcrypto.cpp
index f25c75fe..83ce293a 100644
--- a/framework/src/domain/mime/mailcrypto.cpp
+++ b/framework/src/domain/mime/mailcrypto.cpp
@@ -400,7 +400,7 @@ Expected<GpgME::Error, KMime::Content *> createSignedEmail(KMime::Content *conte
400 400
401KMime::Content *MailCrypto::processCrypto(KMime::Content *content, 401KMime::Content *MailCrypto::processCrypto(KMime::Content *content,
402 const std::vector<GpgME::Key> &signingKeys, const std::vector<GpgME::Key> &encryptionKeys, 402 const std::vector<GpgME::Key> &signingKeys, const std::vector<GpgME::Key> &encryptionKeys,
403 const GpgME::Key &attachedKey, MailCrypto::Protocol protocol) 403 const GpgME::Key &attachedKey)
404{ 404{
405 405
406 qDebug() << "Attaching key:" << attachedKey.shortKeyID() << "from processCrypto"; 406 qDebug() << "Attaching key:" << attachedKey.shortKeyID() << "from processCrypto";
@@ -425,7 +425,7 @@ void MailCrypto::importKeys(const std::vector<GpgME::Key> &keys)
425 job->exec(keys); 425 job->exec(keys);
426} 426}
427 427
428static GpgME::KeyListResult listKeys(GpgME::Protocol protocol, const QStringList &patterns, bool secretOnly, int keyListMode, std::vector<GpgME::Key> &keys) 428static GpgME::KeyListResult listKeys(const QStringList &patterns, bool secretOnly, int keyListMode, std::vector<GpgME::Key> &keys)
429{ 429{
430 QByteArrayList list; 430 QByteArrayList list;
431 std::transform(patterns.constBegin(), patterns.constEnd(), std::back_inserter(list), [] (const QString &s) { return s.toUtf8(); }); 431 std::transform(patterns.constBegin(), patterns.constEnd(), std::back_inserter(list), [] (const QString &s) { return s.toUtf8(); });
@@ -434,7 +434,7 @@ static GpgME::KeyListResult listKeys(GpgME::Protocol protocol, const QStringList
434 pattern.push_back(0); 434 pattern.push_back(0);
435 435
436 GpgME::initializeLibrary(); 436 GpgME::initializeLibrary();
437 auto ctx = QSharedPointer<GpgME::Context>{GpgME::Context::createForProtocol(protocol)}; 437 auto ctx = QSharedPointer<GpgME::Context>{GpgME::Context::createForProtocol(GpgME::OpenPGP)};
438 ctx->setKeyListMode(keyListMode); 438 ctx->setKeyListMode(keyListMode);
439 if (const GpgME::Error err = ctx->startKeyListing(pattern.data(), secretOnly)) { 439 if (const GpgME::Error err = ctx->startKeyListing(pattern.data(), secretOnly)) {
440 return GpgME::KeyListResult(0, err); 440 return GpgME::KeyListResult(0, err);
@@ -452,10 +452,10 @@ static GpgME::KeyListResult listKeys(GpgME::Protocol protocol, const QStringList
452 return result; 452 return result;
453} 453}
454 454
455std::vector<GpgME::Key> MailCrypto::findKeys(const QStringList &filter, bool findPrivate, bool remote, Protocol protocol) 455std::vector<GpgME::Key> MailCrypto::findKeys(const QStringList &filter, bool findPrivate, bool remote)
456{ 456{
457 std::vector<GpgME::Key> keys; 457 std::vector<GpgME::Key> keys;
458 GpgME::KeyListResult res = listKeys(protocol == SMIME ? GpgME::CMS : GpgME::OpenPGP, filter, findPrivate, remote ? GpgME::Extern : GpgME::Local, keys); 458 GpgME::KeyListResult res = listKeys(filter, findPrivate, remote ? GpgME::Extern : GpgME::Local, keys);
459 if (res.error()) { 459 if (res.error()) {
460 qWarning() << "Failed to lookup keys: " << res.error().asString(); 460 qWarning() << "Failed to lookup keys: " << res.error().asString();
461 return keys; 461 return keys;