Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3756)

Unified Diff: chrome/browser/policy/cloud/cloud_policy_validator.cc

Issue 62453002: Don't verify the policy timestamp when loading from cache. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: also skip timestamp checks for public accounts policy Created 7 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/chromeos/settings/session_manager_operation.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/policy/cloud/cloud_policy_validator.cc
diff --git a/chrome/browser/policy/cloud/cloud_policy_validator.cc b/chrome/browser/policy/cloud/cloud_policy_validator.cc
index 71649cea9abd63f77c8b9bb3c917562aaad84cda..8e148e2dc2af6acdf8b82f076ebda4f7e49bd19f 100644
--- a/chrome/browser/policy/cloud/cloud_policy_validator.cc
+++ b/chrome/browser/policy/cloud/cloud_policy_validator.cc
@@ -276,11 +276,14 @@ CloudPolicyValidatorBase::Status CloudPolicyValidatorBase::CheckTimestamp() {
}
}
- if (policy_data_->timestamp() < timestamp_not_before_) {
+ if (timestamp_option_ != TIMESTAMP_NOT_REQUIRED &&
+ policy_data_->timestamp() < timestamp_not_before_) {
+ // If |timestamp_option_| is TIMESTAMP_REQUIRED or TIMESTAMP_NOT_BEFORE
+ // then this is a failure.
LOG(ERROR) << "Policy too old: " << policy_data_->timestamp();
return VALIDATION_BAD_TIMESTAMP;
}
- if (timestamp_option_ != TIMESTAMP_NOT_BEFORE &&
+ if (timestamp_option_ == TIMESTAMP_REQUIRED &&
policy_data_->timestamp() > timestamp_not_after_) {
LOG(ERROR) << "Policy from the future: " << policy_data_->timestamp();
return VALIDATION_BAD_TIMESTAMP;
« no previous file with comments | « chrome/browser/chromeos/settings/session_manager_operation.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698