| Index: components/policy/core/common/cloud/component_cloud_policy_store.cc
|
| diff --git a/components/policy/core/common/cloud/component_cloud_policy_store.cc b/components/policy/core/common/cloud/component_cloud_policy_store.cc
|
| index 29c8dd418b8fc9c4f12b11ca9cfc628cb8f134f6..b6a62ea75b728021e9821835d589c7cb11796bdc 100644
|
| --- a/components/policy/core/common/cloud/component_cloud_policy_store.cc
|
| +++ b/components/policy/core/common/cloud/component_cloud_policy_store.cc
|
| @@ -300,23 +300,18 @@ bool ComponentCloudPolicyStore::ValidatePolicy(
|
| return false;
|
| }
|
|
|
| - // Calculate the bounds for the timestamp validation: a valid policy should be
|
| - // not older than the currently stored policy, and also the timestamp should
|
| - // not point too far in the future. This allows to prevent the rollback of the
|
| - // policy, together with some protection against incorrectly large timestamps
|
| - // that could be generated by the server due to some bug.
|
| + // A valid policy should be not older than the currently stored policy, which
|
| + // allows to prevent the rollback of the policy.
|
| base::Time time_not_before;
|
| const auto stored_policy_times_iter = stored_policy_times_.find(ns);
|
| if (stored_policy_times_iter != stored_policy_times_.end())
|
| time_not_before = stored_policy_times_iter->second;
|
| - const base::Time time_not_after = base::Time::NowFromSystemTime();
|
|
|
| std::unique_ptr<ComponentCloudPolicyValidator> validator(
|
| ComponentCloudPolicyValidator::Create(
|
| std::move(proto), scoped_refptr<base::SequencedTaskRunner>()));
|
| - validator->ValidateTimestamp(
|
| - time_not_before, time_not_after,
|
| - CloudPolicyValidatorBase::TIMESTAMP_FULLY_VALIDATED);
|
| + validator->ValidateTimestamp(time_not_before,
|
| + CloudPolicyValidatorBase::TIMESTAMP_VALIDATED);
|
| validator->ValidateUsername(username_, true);
|
| validator->ValidateDMToken(dm_token_,
|
| ComponentCloudPolicyValidator::DM_TOKEN_REQUIRED);
|
|
|