From: David Kalnischkies Date: Sat, 18 Jun 2016 14:27:04 +0000 (+0200) Subject: ensure filesize of deb is included in the hashes list X-Git-Tag: 1.3_exp3~2 X-Git-Url: https://git.saurik.com/apt.git/commitdiff_plain/5da51e0e2da3f055306562d38103b06a23d81719?ds=inline ensure filesize of deb is included in the hashes list Filesize is a silly hash all by itself, but in combination with others it can be a strong opponent, so ensuring that it is in the list of hashes and hence checked by the normal course of action the acquire process takes is a good thing. --- diff --git a/apt-pkg/deb/debrecords.cc b/apt-pkg/deb/debrecords.cc index beaa83bd9..a132f34a6 100644 --- a/apt-pkg/deb/debrecords.cc +++ b/apt-pkg/deb/debrecords.cc @@ -90,6 +90,9 @@ HashStringList debRecordParserBase::Hashes() const if (hash.empty() == false) hashes.push_back(HashString(*type, hash)); } + auto const size = Section.FindULL("Size", 0); + if (size != 0) + hashes.FileSize(size); return hashes; } /*}}}*/