summaryrefslogtreecommitdiff
path: root/apt-pkg/acquire-worker.cc
diff options
context:
space:
mode:
authorMichael Vogt <michael.vogt@ubuntu.com>2007-08-03 11:27:47 +0200
committerMichael Vogt <michael.vogt@ubuntu.com>2007-08-03 11:27:47 +0200
commitc3279b9d100fb62f412267512458b58dda40f95b (patch)
tree9af2a695fd7f789090ce8cba959d7241db07497c /apt-pkg/acquire-worker.cc
parent5aa5a030bb4f2d46a30526377c5309dc20dbe2af (diff)
parent2c941d896911dca364b3d38dc593f3bf6847f3e5 (diff)
(ABI break)
* merged apt--sha256 branch to fully support the new sha256 checksums in the Packages and Release files (ABI break)
Diffstat (limited to 'apt-pkg/acquire-worker.cc')
-rw-r--r--apt-pkg/acquire-worker.cc17
1 files changed, 16 insertions, 1 deletions
diff --git a/apt-pkg/acquire-worker.cc b/apt-pkg/acquire-worker.cc
index 25d40ef54..460f59961 100644
--- a/apt-pkg/acquire-worker.cc
+++ b/apt-pkg/acquire-worker.cc
@@ -267,8 +267,23 @@ bool pkgAcquire::Worker::RunMessages()
_error->Warning("Bizarre Error - File size is not what the server reported %s %lu",
LookupTag(Message,"Size","0").c_str(),TotalSize);
+ // see if there is a hash to verify
+ string RecivedHash;
+ HashString expectedHash(Owner->HashSum());
+ if(!expectedHash.empty())
+ {
+ string hashTag = expectedHash.HashType()+"-Hash";
+ RecivedHash = expectedHash.HashType() + ":" + LookupTag(Message, hashTag.c_str());
+ if(_config->FindB("Debug::pkgAcquire::Auth", false) == true)
+ {
+ clog << "201 URI Done: " << Owner->DescURI() << endl
+ << "RecivedHash: " << RecivedHash << endl
+ << "ExpectedHash: " << expectedHash.toStr()
+ << endl << endl;
+ }
+ }
Owner->Done(Message,atoi(LookupTag(Message,"Size","0").c_str()),
- LookupTag(Message,"MD5-Hash"),Config);
+ RecivedHash.c_str(), Config);
ItemDone();
// Log that we are done