Verified Commit 82d51381 authored by Ingo Klöcker's avatar Ingo Klöcker Committed by Ingo Klöcker
Browse files

Short-circuit check for revoked or expired user ID

We don't need to check the signatures of the user ID if the user ID is
already marked as revoked or if the whole key has expired.

GnuPG-bug-id: 6155
parent 1545acf0
......@@ -53,6 +53,9 @@ bool Kleo::isSelfSignature(const GpgME::UserID::Signature &signature)
bool Kleo::isRevokedOrExpired(const GpgME::UserID &userId)
if (userId.isRevoked() || userId.parent().isExpired()) {
return true;
const auto sigs = userId.signatures();
std::vector<GpgME::UserID::Signature> selfSigs;
std::copy_if(std::begin(sigs), std::end(sigs), std::back_inserter(selfSigs), &Kleo::isSelfSignature);
Supports Markdown
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