diff options
author | Julian Andres Klode <julian.klode@canonical.com> | 2020-01-07 20:36:53 +0100 |
---|---|---|
committer | Julian Andres Klode <julian.klode@canonical.com> | 2020-01-14 13:10:36 +0100 |
commit | 79de3008ebfc6b4a5dd32e9de1d19788da0b885d (patch) | |
tree | 277129f384746a11c25a08d1b0b879c41fe207ad /apt-private | |
parent | b350560e34a369ef7610f9fceeffb00660209390 (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-private')
-rw-r--r-- | apt-private/private-show.cc | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/apt-private/private-show.cc b/apt-private/private-show.cc index 9ebbe6ac0..103fa57e4 100644 --- a/apt-private/private-show.cc +++ b/apt-private/private-show.cc @@ -8,6 +8,7 @@ #include <apt-pkg/depcache.h> #include <apt-pkg/error.h> #include <apt-pkg/fileutl.h> +#include <apt-pkg/hashes.h> #include <apt-pkg/indexfile.h> #include <apt-pkg/macros.h> #include <apt-pkg/pkgcache.h> @@ -415,9 +416,9 @@ bool ShowPackage(CommandLine &CmdL) /*{{{*/ static std::string Sha1FromString(std::string const &input) /*{{{*/ { // XXX: move to hashes.h: HashString::FromString() ? - SHA1Summation sha1; + Hashes sha1(Hashes::SHA1SUM); sha1.Add(input.c_str(), input.length()); - return sha1.Result().Value(); + return sha1.GetHashString(Hashes::SHA1SUM).HashValue(); } /*}}}*/ bool ShowSrcPackage(CommandLine &CmdL) /*{{{*/ |