summaryrefslogtreecommitdiff
path: root/ftparchive
diff options
context:
space:
mode:
Diffstat (limited to 'ftparchive')
-rw-r--r--ftparchive/writer.cc11
-rw-r--r--ftparchive/writer.h1
2 files changed, 8 insertions, 4 deletions
diff --git a/ftparchive/writer.cc b/ftparchive/writer.cc
index eb8938b95..c43e8f4b4 100644
--- a/ftparchive/writer.cc
+++ b/ftparchive/writer.cc
@@ -64,6 +64,7 @@ FTWScanner::FTWScanner(string const &Arch): Arch(Arch)
DoMD5 = _config->FindB("APT::FTPArchive::MD5",true);
DoSHA1 = _config->FindB("APT::FTPArchive::SHA1",true);
DoSHA256 = _config->FindB("APT::FTPArchive::SHA256",true);
+ DoSHA512 = _config->FindB("APT::FTPArchive::SHA512",true);
}
/*}}}*/
// FTWScanner::Scanner - FTW Scanner /*{{{*/
@@ -1060,10 +1061,12 @@ bool ReleaseWriter::DoPackage(string FileName)
CheckSums[NewFileName].SHA256 = SHA256.Result();
}
- SHA256Summation SHA512;
- SHA256.AddFD(fd.Fd(), fd.Size());
- CheckSums[NewFileName].SHA512 = SHA512.Result();
-
+ if (DoSHA512 == true)
+ {
+ SHA512Summation SHA512;
+ SHA512.AddFD(fd.Fd(), fd.Size());
+ CheckSums[NewFileName].SHA512 = SHA512.Result();
+ }
fd.Close();
return true;
diff --git a/ftparchive/writer.h b/ftparchive/writer.h
index b8747decd..c6026e954 100644
--- a/ftparchive/writer.h
+++ b/ftparchive/writer.h
@@ -63,6 +63,7 @@ class FTWScanner
bool DoMD5;
bool DoSHA1;
bool DoSHA256;
+ bool DoSHA512;
unsigned long DeLinkLimit;
string InternalPrefix;