diff options
author | Michael Vogt <mvo@debian.org> | 2014-08-01 17:13:15 +0200 |
---|---|---|
committer | Michael Vogt <mvo@debian.org> | 2014-08-01 17:13:15 +0200 |
commit | 7abcfdde365d2f1110b1f1189e3fce04abdac98c (patch) | |
tree | 144adb027eeda66e2226cbc2fdcfabbc71b23d5c /apt-pkg | |
parent | 81273628cc3022641756b05e78256d59b7bd7c51 (diff) |
check hashes of compressed files as well
Diffstat (limited to 'apt-pkg')
-rw-r--r-- | apt-pkg/acquire-item.cc | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/apt-pkg/acquire-item.cc b/apt-pkg/acquire-item.cc index 43c09e7b5..c75ef36a9 100644 --- a/apt-pkg/acquire-item.cc +++ b/apt-pkg/acquire-item.cc @@ -1178,6 +1178,20 @@ void pkgAcqIndex::Done(string Message,unsigned long long Size,HashStringList con unlink(DestFile.c_str()); #endif return; + } else { + // FIXME: use the same method to find + // check the compressed hash too + if(MetaKey != "" && Hashes.size() > 0) + { + indexRecords::checkSum *Record = MetaIndexParser->Lookup(MetaKey); + if(Record && Record->Hashes.usable() && Hashes != Record->Hashes) + { + RenameOnError(HashSumMismatch); + printHashSumComparision(RealURI, Record->Hashes, Hashes); + Failed(Message, Cfg); + return; + } + } } Erase = false; |