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

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

Issue 24041002: Turn off future-timestamp cloud policy checks on desktop (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Changed enum name to TIMESTAMP_NOT_BEFORE Created 7 years, 3 months 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
Index: chrome/browser/policy/cloud/cloud_policy_validator.h
diff --git a/chrome/browser/policy/cloud/cloud_policy_validator.h b/chrome/browser/policy/cloud/cloud_policy_validator.h
index d53a0c6f91327664d10a157818a61085a7a542e0..2635e4a29ac90241ba66ecae5cc3670aaffe20ff 100644
--- a/chrome/browser/policy/cloud/cloud_policy_validator.h
+++ b/chrome/browser/policy/cloud/cloud_policy_validator.h
@@ -79,9 +79,16 @@ class CloudPolicyValidatorBase {
};
enum ValidateTimestampOption {
- // The policy must have a timestamp field.
+ // The policy must have a timestamp field and it should be checked against
+ // both the start and end times.
TIMESTAMP_REQUIRED,
+ // The timestamp should only be compared vs the |not_before| value (this
+ // is appropriate for platforms with unreliable system times, where we want
+ // to ensure that fresh policy is newer than existing policy, but we can't
+ // do any other validation).
+ TIMESTAMP_NOT_BEFORE,
+
// No timestamp field is required.
TIMESTAMP_NOT_REQUIRED,
};
@@ -102,11 +109,11 @@ class CloudPolicyValidatorBase {
}
// Instructs the validator to check that the policy timestamp is not before
- // |not_before| and not after |now| + grace interval. If
+ // |not_before| and not after |not_after| + grace interval. If
// |timestamp_option| is set to TIMESTAMP_REQUIRED, then the policy will fail
// validation if it does not have a timestamp field.
void ValidateTimestamp(base::Time not_before,
- base::Time now,
+ base::Time not_after,
ValidateTimestampOption timestamp_option);
// Validates the username in the policy blob matches |expected_user|.

Powered by Google App Engine
This is Rietveld 408576698