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

Unified Diff: chrome/browser/chromeos/settings/session_manager_operation.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
Index: chrome/browser/chromeos/settings/session_manager_operation.cc
diff --git a/chrome/browser/chromeos/settings/session_manager_operation.cc b/chrome/browser/chromeos/settings/session_manager_operation.cc
index c4fc8d132051ae0c9f17b39f5d03c3f8f14bc4db..e3718f969a1039959d358ffe87b2bfa5a96a5340 100644
--- a/chrome/browser/chromeos/settings/session_manager_operation.cc
+++ b/chrome/browser/chromeos/settings/session_manager_operation.cc
@@ -162,15 +162,23 @@ void SessionManagerOperation::ValidateDeviceSettings(
policy::DeviceCloudPolicyValidator::Create(policy.Pass(),
background_task_runner);
- // Policy auto-generated by session manager doesn't include a timestamp, so we
- // need to allow missing timestamps.
- const bool require_timestamp =
- policy_data_.get() && policy_data_->has_request_token();
+
+ // Policy auto-generated by session manager doesn't include a timestamp, so
+ // the timestamp shouldn't be verified in that case.
+ //
+ // Additionally, offline devices can get their clock set backwards in time
+ // under some hardware conditions; checking the timestamp now could likely
+ // find a value in the future, and prevent the user from signing-in or
+ // starting guest mode. Tlsdate will eventually fix the clock when the device
+ // is back online, but the network configuration may come from device ONC.
+ //
+ // To prevent all of these issues the timestamp is just not verified when
+ // loading the device policy from the cache. Note that the timestamp is still
+ // verified during enrollment and when a new policy is fetched from the
+ // server.
validator->ValidateAgainstCurrentPolicy(
policy_data_.get(),
- require_timestamp ?
- policy::CloudPolicyValidatorBase::TIMESTAMP_REQUIRED :
- policy::CloudPolicyValidatorBase::TIMESTAMP_NOT_REQUIRED,
+ policy::CloudPolicyValidatorBase::TIMESTAMP_NOT_REQUIRED,
policy::CloudPolicyValidatorBase::DM_TOKEN_NOT_REQUIRED);
validator->ValidatePolicyType(policy::dm_protocol::kChromeDevicePolicyType);
validator->ValidatePayload();

Powered by Google App Engine
This is Rietveld 408576698