From 23397c9d7d4d455461176600bb45c81185493504 Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Thu, 23 Oct 2014 16:54:00 +0200 Subject: promote filesize to a hashstring It is a very simple hashstring, which is why it isn't contributing to the usability of a list of them, but it is also trivial to check and calculate, so it doesn't hurt checking it either as it can combined even with the simplest other hashes greatly complicate attacks on them as you suddenly need a same-size hash collision, which is usually a lot harder to achieve. --- ftparchive/writer.cc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'ftparchive/writer.cc') diff --git a/ftparchive/writer.cc b/ftparchive/writer.cc index db617e92a..ded8715f8 100644 --- a/ftparchive/writer.cc +++ b/ftparchive/writer.cc @@ -471,6 +471,8 @@ bool PackagesWriter::DoPackage(string FileName) { if (hs->HashType() == "MD5Sum") Changes.push_back(SetTFRewriteData("MD5sum", hs->HashValue().c_str())); + else if (hs->HashType() == "Checksum-FileSize") + continue; else Changes.push_back(SetTFRewriteData(hs->HashType().c_str(), hs->HashValue().c_str())); } @@ -785,7 +787,7 @@ bool SourcesWriter::DoPackage(string FileName) for (HashStringList::const_iterator hs = Db.HashesList.begin(); hs != Db.HashesList.end(); ++hs) { - if (hs->HashType() == "MD5Sum") + if (hs->HashType() == "MD5Sum" || hs->HashType() == "Checksum-FileSize") continue; char const * fieldname; std::ostream * out; -- cgit v1.2.3