summaryrefslogtreecommitdiff
path: root/apt-pkg/acquire-item.cc
diff options
context:
space:
mode:
authorMichael Vogt <mvo@ubuntu.com>2014-10-01 11:20:08 +0200
committerMichael Vogt <mvo@ubuntu.com>2014-10-01 11:20:08 +0200
commit8d266656767f6c7c3946700c7052d0b8b6212742 (patch)
tree7d11308df88db78f11bc4823cc2d8bd67ae91bcb /apt-pkg/acquire-item.cc
parentfa3a96a1051d65e5aa8cd9e9e0bb854ccc67a4b6 (diff)
add verify for the .diff/Index download and add FIXME for pkgAcqIndexDiffs/pkgAcqMergeDiffs
Diffstat (limited to 'apt-pkg/acquire-item.cc')
-rw-r--r--apt-pkg/acquire-item.cc19
1 files changed, 19 insertions, 0 deletions
diff --git a/apt-pkg/acquire-item.cc b/apt-pkg/acquire-item.cc
index 5beb7e190..4a684f40c 100644
--- a/apt-pkg/acquire-item.cc
+++ b/apt-pkg/acquire-item.cc
@@ -527,6 +527,21 @@ void pkgAcqDiffIndex::Done(string Message,unsigned long long Size,HashStringList
Item::Done(Message, Size, Hashes, Cnf);
+ // verify the index target
+ if(Target && Target->MetaKey != "" && MetaIndexParser && Hashes.size() > 0)
+ {
+ std::string IndexMetaKey = Target->MetaKey + ".diff/Index";
+ indexRecords::checkSum *Record = MetaIndexParser->Lookup(IndexMetaKey);
+ if(Record && Record->Hashes.usable() && Hashes != Record->Hashes)
+ {
+ RenameOnError(HashSumMismatch);
+ printHashSumComparision(RealURI, Record->Hashes, Hashes);
+ Failed(Message, Cnf);
+ return;
+ }
+
+ }
+
string FinalFile;
FinalFile = _config->FindDir("Dir::State::lists")+URItoFileName(RealURI);
@@ -715,6 +730,8 @@ void pkgAcqIndexDiffs::Done(string Message,unsigned long long Size, HashStringLi
Item::Done(Message, Size, Hashes, Cnf);
+ // FIXME: verify this download too before feeding it to rred
+
string FinalFile;
FinalFile = _config->FindDir("Dir::State::lists")+"partial/"+URItoFileName(RealURI);
@@ -836,6 +853,8 @@ void pkgAcqIndexMergeDiffs::Done(string Message,unsigned long long Size,HashStri
Item::Done(Message,Size,Hashes,Cnf);
+ // FIXME: verify download before feeding it to rred
+
string const FinalFile = _config->FindDir("Dir::State::lists") + "partial/" + URItoFileName(RealURI);
if (State == StateFetchDiff)