summaryrefslogtreecommitdiff
path: root/apt-pkg/deb/deblistparser.cc
diff options
context:
space:
mode:
authorJulian Andres Klode <julian.klode@canonical.com>2020-01-07 20:36:53 +0100
committerJulian Andres Klode <julian.klode@canonical.com>2020-01-14 13:10:36 +0100
commit79de3008ebfc6b4a5dd32e9de1d19788da0b885d (patch)
tree277129f384746a11c25a08d1b0b879c41fe207ad /apt-pkg/deb/deblistparser.cc
parentb350560e34a369ef7610f9fceeffb00660209390 (diff)
Convert users of {MD5,SHA1,SHA256,SHA512}Summation to use Hashes
This makes use of the a function GetHashString() that returns the specific hash string. We also need to implement another overload of Add() for signed chars with sizes, so the existing users do not require reinterpret_cast everywhere.
Diffstat (limited to 'apt-pkg/deb/deblistparser.cc')
-rw-r--r--apt-pkg/deb/deblistparser.cc6
1 files changed, 3 insertions, 3 deletions
diff --git a/apt-pkg/deb/deblistparser.cc b/apt-pkg/deb/deblistparser.cc
index 88b41ad30..21d1736e4 100644
--- a/apt-pkg/deb/deblistparser.cc
+++ b/apt-pkg/deb/deblistparser.cc
@@ -17,8 +17,8 @@
#include <apt-pkg/crc-16.h>
#include <apt-pkg/deblistparser.h>
#include <apt-pkg/error.h>
+#include <apt-pkg/hashes.h>
#include <apt-pkg/macros.h>
-#include <apt-pkg/md5.h>
#include <apt-pkg/pkgcache.h>
#include <apt-pkg/strutl.h>
#include <apt-pkg/tagfile-keys.h>
@@ -298,10 +298,10 @@ APT::StringView debListParser::Description_md5()
if (desc == "\n")
return StringView();
- MD5Summation md5;
+ Hashes md5(Hashes::MD5SUM);
md5.Add(desc.data(), desc.size());
md5.Add("\n");
- MD5Buffer = md5.Result();
+ MD5Buffer = md5.GetHashString(Hashes::MD5SUM).HashValue();
return StringView(MD5Buffer);
}
else if (likely(value.size() == 32))