summaryrefslogtreecommitdiff
path: root/apt-pkg
diff options
context:
space:
mode:
Diffstat (limited to 'apt-pkg')
-rw-r--r--apt-pkg/acquire-worker.cc6
-rw-r--r--apt-pkg/contrib/hashes.cc1
2 files changed, 7 insertions, 0 deletions
diff --git a/apt-pkg/acquire-worker.cc b/apt-pkg/acquire-worker.cc
index 176772dde..889768030 100644
--- a/apt-pkg/acquire-worker.cc
+++ b/apt-pkg/acquire-worker.cc
@@ -407,7 +407,13 @@ bool pkgAcquire::Worker::RunMessages()
else if (Owner->HashesRequired() == true)
consideredOkay = false;
else
+ {
consideredOkay = true;
+ // even if the hashes aren't usable to declare something secure
+ // we can at least use them to declare it an integrity failure
+ if (ExpectedHashes.empty() == false && ReceivedHashes != ExpectedHashes && _config->Find("Acquire::ForceHash").empty())
+ consideredOkay = false;
+ }
if (consideredOkay == true)
consideredOkay = Owner->VerifyDone(Message, Config);
diff --git a/apt-pkg/contrib/hashes.cc b/apt-pkg/contrib/hashes.cc
index 41a0037cd..5c0023dc7 100644
--- a/apt-pkg/contrib/hashes.cc
+++ b/apt-pkg/contrib/hashes.cc
@@ -136,6 +136,7 @@ APT_PURE bool HashString::usable() const /*{{{*/
(Type != "MD5Sum")
);
}
+ /*}}}*/
std::string HashString::toStr() const /*{{{*/
{
return Type + ":" + Hash;