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

Fix check for missing certification keys

Unfortunately, the signature status "NoPublicKey" does not really mean
that the key the signature was made with is missing locally.

GnuPG-bug-id: 5805
parent 1a17bc62
......@@ -84,13 +84,21 @@ WebOfTrustDialog::~WebOfTrustDialog()
namespace
{
bool havePublicKeyForSignature(const GpgME::UserID::Signature &signature)
{
// GnuPG returns status "NoPublicKey" for missing signing keys, but also
// for expired or revoked signing keys.
return (signature.status() != GpgME::UserID::Signature::NoPublicKey)
|| !KeyCache::instance()->findByKeyIDOrFingerprint (signature.signerKeyID()).isNull();
}
auto accumulateMissingSignerKeys(const std::vector<GpgME::UserID::Signature> &signatures)
{
return std::accumulate(
std::begin(signatures), std::end(signatures),
std::set<QString>{},
[] (auto &keyIds, const auto &signature) {
if (signature.status() == GpgME::UserID::Signature::NoPublicKey) {
if (!havePublicKeyForSignature(signature)) {
keyIds.insert(QLatin1String{signature.signerKeyID()});
}
return keyIds;
......
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