summaryrefslogtreecommitdiff
path: root/methods/gpgv.cc
diff options
context:
space:
mode:
Diffstat (limited to 'methods/gpgv.cc')
-rw-r--r--methods/gpgv.cc20
1 files changed, 9 insertions, 11 deletions
diff --git a/methods/gpgv.cc b/methods/gpgv.cc
index 04a4f6a83..660041764 100644
--- a/methods/gpgv.cc
+++ b/methods/gpgv.cc
@@ -309,18 +309,16 @@ string GPGVMethod::VerifyGetSigners(const char *file, const char *outfile,
auto const master = SubKeyMapping.find(l);
if (master == SubKeyMapping.end())
continue;
- for (auto const &sub : master->second)
- if (IsTheSameKey(sub, good))
- {
- if (std::find(Signers.Valid.cbegin(), Signers.Valid.cend(), sub) == Signers.Valid.cend())
- continue;
- found = true;
- Signers.SignedBy.push_back(l);
- Signers.SignedBy.push_back(sub + "!");
- break;
- }
- if (found)
+ auto const validsubkeysig = std::find_if(master->second.cbegin(), master->second.cend(), [&](auto const subkey) {
+ return IsTheSameKey(subkey, good) && std::find(Signers.Valid.cbegin(), Signers.Valid.cend(), subkey) != Signers.Valid.cend();
+ });
+ if (validsubkeysig != master->second.cend())
+ {
+ found = true;
+ Signers.SignedBy.push_back(l);
+ Signers.SignedBy.push_back(*validsubkeysig + "!");
break;
+ }
}
}
if (Debug)