From b24d6a1f3aff12f32f6a7024aac6961089f99719 Mon Sep 17 00:00:00 2001 From: Julian Andres Klode Date: Wed, 4 Oct 2023 14:17:16 +0200 Subject: Stop calculating Description-md5 if missing This avoids the rabbit hole of md5 on FIPS systems, and repositories have moved to including the value as well. Also stop validating the field, this can be an arbitrary string as far as we are concerned. --- apt-pkg/deb/deblistparser.cc | 20 +------------------- 1 file changed, 1 insertion(+), 19 deletions(-) diff --git a/apt-pkg/deb/deblistparser.cc b/apt-pkg/deb/deblistparser.cc index 6f47053a5..6b76c4d07 100644 --- a/apt-pkg/deb/deblistparser.cc +++ b/apt-pkg/deb/deblistparser.cc @@ -282,25 +282,7 @@ std::vector debListParser::AvailableDescriptionLanguages() */ APT::StringView debListParser::Description_md5() { - StringView const value = Section.Find(pkgTagSection::Key::Description_md5); - if (unlikely(value.empty() == true)) - { - StringView const desc = Section.Find(pkgTagSection::Key::Description); - if (desc == "\n") - return StringView(); - - Hashes md5(Hashes::MD5SUM); - md5.Add(desc.data(), desc.size()); - md5.Add("\n"); - MD5Buffer = md5.GetHashString(Hashes::MD5SUM).HashValue(); - return StringView(MD5Buffer); - } - else if (likely(value.size() == 32)) - { - return value; - } - _error->Error("Malformed Description-md5 line; doesn't have the required length (32 != %d) '%.*s'", (int)value.size(), (int)value.length(), value.data()); - return StringView(); + return Section.Find(pkgTagSection::Key::Description_md5); } /*}}}*/ // ListParser::UsePackage - Update a package structure /*{{{*/ -- cgit v1.2.3-70-g09d2