From e14417db27771ad85f45880974c8f59f05d138f1 Mon Sep 17 00:00:00 2001 From: Julian Andres Klode Date: Mon, 20 Jan 2025 12:31:55 +0100 Subject: Remove superseded warning about trusted.gpg fallback This warning has been superseded by the missing sources.list notice (which will also become a warning shortly) Adjust the sqv exit to avoid introducing a new spurious "No good signature" that we did not reach before. moo --- methods/sqv.cc | 23 +++-------------------- 1 file changed, 3 insertions(+), 20 deletions(-) (limited to 'methods/sqv.cc') diff --git a/methods/sqv.cc b/methods/sqv.cc index ce7e36657..9dbe75994 100644 --- a/methods/sqv.cc +++ b/methods/sqv.cc @@ -133,6 +133,8 @@ bool SQVMethod::VerifyGetSigners(const char *file, const char *outfile, if (keyFiles.empty()) { auto Parts = GetListOfFilesInDir(_config->FindDir("Dir::Etc::TrustedParts"), std::vector{"gpg", "asc"}, true); + if (auto trusted = _config->FindFile("Dir::Etc::Trusted"); not trusted.empty()) + Parts.push_back(trusted); for (auto &Part : Parts) { if (Debug) @@ -298,27 +300,8 @@ bool SQVMethod::URIAcquire(std::string const &Message, FetchItem *Itm) // Run sqv on file, extract contents and get the key ID of the signer VerifyGetSigners(Path.c_str(), Itm->DestFile.c_str(), keyFiles, Signers); - if (_error->PendingError()) - { - // Legacy fallback to trusted.gpg - auto trusted = _config->FindFile("Dir::Etc::Trusted"); - _error->PushToStack(); - VerifyGetSigners(Path.c_str(), Itm->DestFile.c_str(), {trusted}, Signers); - bool error = _error->PendingError(); - _error->RevertToStack(); - if (error) - return false; - - _error->Discard(); - std::string warning; - strprintf(warning, - _("Key is stored in legacy trusted.gpg keyring (%s). Use Signed-By instead. See the USER CONFIGURATION section in apt-secure(8) for details."), - trusted.c_str()); - Warning(std::move(warning)); - } - if (Signers.empty()) - return _error->Error("No good signature"); + return _error->PendingError() ? false : _error->Error("No good signature"); if (not keyFpts.empty()) { -- cgit v1.2.3-70-g09d2