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-pkg/contrib/cdromutl.cc | |
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-pkg/contrib/cdromutl.cc')
-rw-r--r-- | apt-pkg/contrib/cdromutl.cc | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/apt-pkg/contrib/cdromutl.cc b/apt-pkg/contrib/cdromutl.cc index 9db3980da..c0fe869d2 100644 --- a/apt-pkg/contrib/cdromutl.cc +++ b/apt-pkg/contrib/cdromutl.cc @@ -15,7 +15,7 @@ #include <apt-pkg/configuration.h> #include <apt-pkg/error.h> #include <apt-pkg/fileutl.h> -#include <apt-pkg/md5.h> +#include <apt-pkg/hashes.h> #include <apt-pkg/strutl.h> #include <iostream> @@ -181,7 +181,7 @@ bool MountCdrom(string Path, string DeviceName) from effecting the outcome. */ bool IdentCdrom(string CD,string &Res,unsigned int Version) { - MD5Summation Hash; + Hashes Hash(Hashes::MD5SUM); bool writable_media = false; int dirfd = open(CD.c_str(), O_RDONLY | O_DIRECTORY | O_CLOEXEC); @@ -254,7 +254,7 @@ bool IdentCdrom(string CD,string &Res,unsigned int Version) strprintf(S, "-%u.debug", Version); closedir(D); - Res = Hash.Result().Value().append(std::move(S)); + Res = Hash.GetHashString(Hashes::MD5SUM).HashValue().append(std::move(S)); return true; } /*}}}*/ |