summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJulian Andres Klode <julian.klode@canonical.com>2023-10-04 14:17:16 +0200
committerJulian Andres Klode <julian.klode@canonical.com>2023-10-04 14:17:16 +0200
commitb24d6a1f3aff12f32f6a7024aac6961089f99719 (patch)
treea1a8c33a083790d282ceb04f571fed08ba2da1ac
parenta79b29f32141b17cf8f923e1f2bc377749c555d8 (diff)
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.
-rw-r--r--apt-pkg/deb/deblistparser.cc20
1 files changed, 1 insertions, 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<std::string> 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 /*{{{*/