summaryrefslogtreecommitdiff
path: root/methods/gpgv.cc
diff options
context:
space:
mode:
authorJulian Andres Klode <jak@debian.org>2016-09-02 22:38:34 +0200
committerJulian Andres Klode <jak@debian.org>2016-09-02 22:38:34 +0200
commit969d33307ae0cc1b433a0462ef1561580ea6ddbc (patch)
tree0322cf6e3a82a1536c4516e8729993ce68af57af /methods/gpgv.cc
parentf6c10fb46d1193b8181b5846538e2cf7c15ff216 (diff)
parent54dd6baaf16e92c83f63bdb3633df6e603ac19f3 (diff)
Merge tag '1.3_rc4' into ubuntu/master
apt Debian release 1.3~rc4
Diffstat (limited to 'methods/gpgv.cc')
-rw-r--r--methods/gpgv.cc24
1 files changed, 20 insertions, 4 deletions
diff --git a/methods/gpgv.cc b/methods/gpgv.cc
index f2ef6b76e..d073c733e 100644
--- a/methods/gpgv.cc
+++ b/methods/gpgv.cc
@@ -258,16 +258,32 @@ string GPGVMethod::VerifyGetSigners(const char *file, const char *outfile,
if (std::find(ValidSigners.begin(), ValidSigners.end(), k) == ValidSigners.end())
continue;
// we look for GOODSIG here as well as an expired sig is a valid sig as well (but not a good one)
+ std::string const goodfingerprint = "GOODSIG " + k;
std::string const goodlongkeyid = "GOODSIG " + k.substr(24, 16);
- foundGood = std::find(GoodSigners.begin(), GoodSigners.end(), goodlongkeyid) != GoodSigners.end();
+ foundGood = std::find(GoodSigners.begin(), GoodSigners.end(), goodfingerprint) != GoodSigners.end();
if (Debug == true)
- std::clog << "Key " << k << " is valid sig, is " << goodlongkeyid << " also a good one? " << (foundGood ? "yes" : "no") << std::endl;
+ std::clog << "Key " << k << " is valid sig, is " << goodfingerprint << " also a good one? " << (foundGood ? "yes" : "no") << std::endl;
+ std::string goodsig;
+ if (foundGood == false)
+ {
+ foundGood = std::find(GoodSigners.begin(), GoodSigners.end(), goodlongkeyid) != GoodSigners.end();
+ if (Debug == true)
+ std::clog << "Key " << k << " is valid sig, is " << goodlongkeyid << " also a good one? " << (foundGood ? "yes" : "no") << std::endl;
+ goodsig = goodlongkeyid;
+ }
+ else
+ goodsig = goodfingerprint;
if (foundGood == false)
continue;
std::copy(GoodSigners.begin(), GoodSigners.end(), std::back_insert_iterator<std::vector<std::string> >(NoPubKeySigners));
GoodSigners.clear();
- GoodSigners.push_back(goodlongkeyid);
- NoPubKeySigners.erase(std::remove(NoPubKeySigners.begin(), NoPubKeySigners.end(), goodlongkeyid), NoPubKeySigners.end());
+ GoodSigners.push_back(goodsig);
+ NoPubKeySigners.erase(
+ std::remove(NoPubKeySigners.begin(),
+ std::remove(NoPubKeySigners.begin(), NoPubKeySigners.end(), goodfingerprint),
+ goodlongkeyid),
+ NoPubKeySigners.end()
+ );
break;
}
if (foundGood == false)