summaryrefslogtreecommitdiff
path: root/ftparchive/multicompress.cc
diff options
context:
space:
mode:
authorJulian Andres Klode <jak@debian.org>2020-01-14 12:57:54 +0000
committerJulian Andres Klode <jak@debian.org>2020-01-14 12:57:54 +0000
commit5db3a38926aa820546c411dd9f49f57eea24cd9e (patch)
treeb794739c375d7c984c4190be44b9ed678e9bf0da /ftparchive/multicompress.cc
parentcfeae24843e8357c7e8d2ff3b23ee81cac330017 (diff)
parent8c1a37e12790a23f3b132899485e011f9134b483 (diff)
Merge branch 'pu/gcrypt2' into 'master'
Use Libgcrypt for hashing purposes See merge request apt-team/apt!89
Diffstat (limited to 'ftparchive/multicompress.cc')
-rw-r--r--ftparchive/multicompress.cc9
1 files changed, 4 insertions, 5 deletions
diff --git a/ftparchive/multicompress.cc b/ftparchive/multicompress.cc
index f5fe14164..cdaa7a60a 100644
--- a/ftparchive/multicompress.cc
+++ b/ftparchive/multicompress.cc
@@ -18,8 +18,7 @@
#include <apt-pkg/aptconfiguration.h>
#include <apt-pkg/error.h>
#include <apt-pkg/fileutl.h>
-#include <apt-pkg/hashsum_template.h>
-#include <apt-pkg/md5.h>
+#include <apt-pkg/hashes.h>
#include <apt-pkg/strutl.h>
#include <ctype.h>
@@ -267,7 +266,7 @@ bool MultiCompress::Child(int const &FD)
SetNonBlock(FD,false);
unsigned char Buffer[32*1024];
unsigned long long FileSize = 0;
- MD5Summation MD5;
+ Hashes MD5(Hashes::MD5SUM);
while (1)
{
WaitFd(FD,false);
@@ -315,7 +314,7 @@ bool MultiCompress::Child(int const &FD)
}
// Compute the hash
- MD5Summation OldMD5;
+ Hashes OldMD5(Hashes::MD5SUM);
unsigned long long NewFileSize = 0;
while (1)
{
@@ -330,7 +329,7 @@ bool MultiCompress::Child(int const &FD)
CompFd.Close();
// Check the hash
- if (OldMD5.Result() == MD5.Result() &&
+ if (OldMD5.GetHashString(Hashes::MD5SUM) == MD5.GetHashString(Hashes::MD5SUM) &&
FileSize == NewFileSize)
{
for (Files *I = Outputs; I != 0; I = I->Next)