From ce424cd4464ce46706046d581e05fbf292a54881 Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Fri, 6 Jan 2006 00:02:14 +0000 Subject: * support multiple signatures --- apt-pkg/acquire-item.cc | 22 +++++++++++++++++++--- apt-pkg/acquire-item.h | 5 +++-- 2 files changed, 22 insertions(+), 5 deletions(-) (limited to 'apt-pkg') diff --git a/apt-pkg/acquire-item.cc b/apt-pkg/acquire-item.cc index b9fc74456..11a449e91 100644 --- a/apt-pkg/acquire-item.cc +++ b/apt-pkg/acquire-item.cc @@ -554,7 +554,7 @@ void pkgAcqMetaIndex::AuthDone(string Message) return; } - if (!VerifyVendor()) + if (!VerifyVendor(Message)) { return; } @@ -612,7 +612,7 @@ void pkgAcqMetaIndex::QueueIndexes(bool verify) } } -bool pkgAcqMetaIndex::VerifyVendor() +bool pkgAcqMetaIndex::VerifyVendor(string Message) { // // Maybe this should be made available from above so we don't have // // to read and parse it every time? @@ -637,6 +637,22 @@ bool pkgAcqMetaIndex::VerifyVendor() // break; // } // } + string::size_type pos; + + // check for missing sigs (that where not fatal because otherwise we had + // bombed earlier) + string missingkeys; + string msg = _("There was no public key available for the " + "following key IDs:\n"); + pos = Message.find("NO_PUBKEY "); + if (pos != std::string::npos) + { + string::size_type start = pos+strlen("NO_PUBKEY "); + string Fingerprint = Message.substr(start, Message.find("\n")-start); + missingkeys += (Fingerprint); + } + if(!missingkeys.empty()) + _error->Warning("%s", string(msg+missingkeys).c_str()); string Transformed = MetaIndexParser->GetExpectedDist(); @@ -645,7 +661,7 @@ bool pkgAcqMetaIndex::VerifyVendor() Transformed = "experimental"; } - string::size_type pos = Transformed.rfind('/'); + pos = Transformed.rfind('/'); if (pos != string::npos) { Transformed = Transformed.substr(0, pos); diff --git a/apt-pkg/acquire-item.h b/apt-pkg/acquire-item.h index e6fc7fc47..da1bea801 100644 --- a/apt-pkg/acquire-item.h +++ b/apt-pkg/acquire-item.h @@ -151,9 +151,10 @@ class pkgAcqMetaIndex : public pkgAcquire::Item const vector* IndexTargets; indexRecords* MetaIndexParser; bool AuthPass; - bool IMSHit; // required to fail gracefully on failures + // required to deal gracefully with problems caused by incorrect ims hits + bool IMSHit; - bool VerifyVendor(); + bool VerifyVendor(string Message); void RetrievalDone(string Message); void AuthDone(string Message); void QueueIndexes(bool verify); -- cgit v1.2.3