]> git.saurik.com Git - apt.git/commitdiff
ensure filesize of deb is included in the hashes list
authorDavid Kalnischkies <david@kalnischkies.de>
Sat, 18 Jun 2016 14:27:04 +0000 (16:27 +0200)
committerDavid Kalnischkies <david@kalnischkies.de>
Wed, 22 Jun 2016 12:05:01 +0000 (14:05 +0200)
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.

apt-pkg/deb/debrecords.cc

index beaa83bd9e279647dbdadbd4394ff2785ec80038..a132f34a6d95182879830e7c5b0712c64b890a32 100644 (file)
@@ -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;
 }
                                                                        /*}}}*/