summaryrefslogtreecommitdiff
path: root/apt-pkg/acquire-worker.cc
diff options
context:
space:
mode:
authorDavid Kalnischkies <david@kalnischkies.de>2015-09-01 13:58:00 +0200
committerDavid Kalnischkies <david@kalnischkies.de>2015-09-01 14:19:44 +0200
commit63d609985eb7eefa5f2332bfe4fab96f017760a1 (patch)
treead38d0beb698f3bb35bfcedc145c1f7f85a38989 /apt-pkg/acquire-worker.cc
parent55ae7a516126f9f064d8353bf962256b7307590a (diff)
use unusable-for-security hashes for integrity checks
We want to declare some hashes as not enough for security, so that a user will need --allow-unauthenticated or similar to get data secured only by those hashes, but we can still us these hashes for integrity checks if we got them.
Diffstat (limited to 'apt-pkg/acquire-worker.cc')
-rw-r--r--apt-pkg/acquire-worker.cc6
1 files changed, 6 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);