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

Unified Diff: components/policy/core/common/cloud/cloud_policy_validator.h

Issue 2820063005: Remove the "not_after" validation of policy timestamps (Closed)
Patch Set: Fix test Created 3 years, 8 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: components/policy/core/common/cloud/cloud_policy_validator.h
diff --git a/components/policy/core/common/cloud/cloud_policy_validator.h b/components/policy/core/common/cloud/cloud_policy_validator.h
index b56af8959d3b82b3d0eac20894493dc92fd7f267..683155b311adae21836fce08a2c4ec078cf1c32a 100644
--- a/components/policy/core/common/cloud/cloud_policy_validator.h
+++ b/components/policy/core/common/cloud/cloud_policy_validator.h
@@ -69,7 +69,7 @@ class POLICY_EXPORT CloudPolicyValidatorBase {
VALIDATION_WRONG_POLICY_TYPE,
// Unexpected settings entity id.
VALIDATION_WRONG_SETTINGS_ENTITY_ID,
- // Time stamp outside expected range.
+ // Timestamp is missing or is older than expected.
VALIDATION_BAD_TIMESTAMP,
// DM token is empty or doesn't match.
VALIDATION_BAD_DM_TOKEN,
@@ -109,14 +109,8 @@ class POLICY_EXPORT CloudPolicyValidatorBase {
enum ValidateTimestampOption {
// The policy must have a timestamp field and the timestamp is checked
- // against both start and end times.
- TIMESTAMP_FULLY_VALIDATED,
-
- // The timestamp is only checked against 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,
+ // against the |not_before| value.
+ TIMESTAMP_VALIDATED,
// The timestamp is not validated.
TIMESTAMP_NOT_VALIDATED,
@@ -138,10 +132,9 @@ class POLICY_EXPORT CloudPolicyValidatorBase {
}
// Instruct the validator to check that the policy timestamp is not before
- // |not_before| and not after |not_after| + grace interval. Depending on
- // |timestamp_option|, some or all of the checks may be waived.
+ // |not_before| if |timestamp_option| is TIMESTAMP_VALIDATED, or to not check
+ // the policy timestamp if |timestamp_option| is TIMESTAMP_NOT_VALIDATED.
void ValidateTimestamp(base::Time not_before,
- base::Time not_after,
ValidateTimestampOption timestamp_option);
// Instruct the validator to check that the username in the policy blob
@@ -317,7 +310,6 @@ class POLICY_EXPORT CloudPolicyValidatorBase {
int validation_flags_;
int64_t timestamp_not_before_;
- int64_t timestamp_not_after_;
ValidateTimestampOption timestamp_option_;
ValidateDMTokenOption dm_token_option_;
ValidateDeviceIdOption device_id_option_;

Powered by Google App Engine
This is Rietveld 408576698