summaryrefslogtreecommitdiff
path: root/apt-pkg/sourcelist.cc
diff options
context:
space:
mode:
authorJulian Andres Klode <julian.klode@canonical.com>2018-01-29 16:15:41 +0100
committerJulian Andres Klode <julian.klode@canonical.com>2018-02-19 16:05:01 +0100
commit9e5899cac1a6367e3769af52a724821880e538f6 (patch)
tree4c7add81aeb5f851ce764697b03e3778391f9cbc /apt-pkg/sourcelist.cc
parent38d444af2632219ab399dabadaaefaa4dcdd6ebf (diff)
Check that Date of Release file is not in the future
By restricting the Date field to be in the past, an attacker cannot just create a repository from the future that would be accepted as a valid update for a repository. This check can be disabled by Acquire::Check-Date set to false. This will also disable Check-Valid-Until and any future date related checking, if any - the option means: "my computers date cannot be trusted." Modify the tests to allow repositories to be up to 10 hours in the future, so we can keep using hours there to simulate time changes.
Diffstat (limited to 'apt-pkg/sourcelist.cc')
-rw-r--r--apt-pkg/sourcelist.cc2
1 files changed, 2 insertions, 0 deletions
diff --git a/apt-pkg/sourcelist.cc b/apt-pkg/sourcelist.cc
index fd0264ff1..1fdc92dcb 100644
--- a/apt-pkg/sourcelist.cc
+++ b/apt-pkg/sourcelist.cc
@@ -119,6 +119,8 @@ bool pkgSourceList::Type::ParseStanza(vector<metaIndex *> &List, /*{{{*/
mapping.insert(std::make_pair("Check-Valid-Until", std::make_pair("check-valid-until", false)));
mapping.insert(std::make_pair("Valid-Until-Min", std::make_pair("valid-until-min", false)));
mapping.insert(std::make_pair("Valid-Until-Max", std::make_pair("valid-until-max", false)));
+ mapping.insert(std::make_pair("Check-Date", std::make_pair("check-date", false)));
+ mapping.insert(std::make_pair("Date-Max-Future", std::make_pair("date-max-future", false)));
mapping.insert(std::make_pair("Signed-By", std::make_pair("signed-by", false)));
mapping.insert(std::make_pair("PDiffs", std::make_pair("pdiffs", false)));
mapping.insert(std::make_pair("By-Hash", std::make_pair("by-hash", false)));