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

Issue 2820063005: Remove the "not_after" validation of policy timestamps (Closed)

Created:
3 years, 8 months ago by emaxx
Modified:
3 years, 8 months ago
Reviewers:
Thiemo Nagel
CC:
chromium-reviews, oshima+watch_chromium.org, davemoore+watch_chromium.org
Target Ref:
refs/heads/master
Project:
chromium
Visibility:
Public.

Description

Remove the "not_after" validation of policy timestamps This CL disables the validation of policy timestamps against the current device clocks, which was previously there to prevent loading policies "from the future". The disabled validation was originally intended as a protection against a potential bug on DMServer side if it started sending wrongly big timestamps. This could be a problem in theory, as after such a bug occurs on the server side and is fixed then, the clients will refuse the subsequent policy updates due to the protection on the client side against policy rollbacks. However, the decision now is made that this validation brings more drawbacks than benefits as the device's clocks are quite often wrong. BUG=701045 Review-Url: https://codereview.chromium.org/2820063005 Cr-Commit-Position: refs/heads/master@{#465964} Committed: https://chromium.googlesource.com/chromium/src/+/5a159859f7164e629c68d8212db34a711fc5245d

Patch Set 1 #

Patch Set 2 : Fix test #

Total comments: 12

Patch Set 3 : Review feedback #

Patch Set 4 : Rebase #

Unified diffs Side-by-side diffs Delta from patch set Stats (+35 lines, -96 lines) Patch
M chrome/browser/chromeos/policy/device_cloud_policy_store_chromeos.cc View 1 2 3 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/chromeos/policy/device_local_account_policy_store.cc View 1 2 3 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/chromeos/policy/enrollment_handler_chromeos.cc View 1 2 3 1 chunk +2 lines, -3 lines 0 comments Download
M chrome/browser/chromeos/policy/user_cloud_policy_store_chromeos.cc View 1 2 3 2 chunks +3 lines, -4 lines 0 comments Download
M chrome/browser/chromeos/settings/session_manager_operation.cc View 1 2 3 1 chunk +1 line, -11 lines 0 comments Download
M components/policy/core/common/cloud/cloud_policy_validator.h View 1 2 3 4 chunks +7 lines, -14 lines 0 comments Download
M components/policy/core/common/cloud/cloud_policy_validator.cc View 1 2 3 5 chunks +2 lines, -21 lines 0 comments Download
M components/policy/core/common/cloud/cloud_policy_validator_unittest.cc View 1 2 3 4 chunks +13 lines, -22 lines 0 comments Download
M components/policy/core/common/cloud/component_cloud_policy_store.cc View 1 chunk +4 lines, -9 lines 0 comments Download
M components/policy/core/common/cloud/component_cloud_policy_store_unittest.cc View 1 1 chunk +0 lines, -9 lines 0 comments Download
M components/policy/core/common/cloud/user_cloud_policy_store.cc View 1 2 3 1 chunk +1 line, -1 line 0 comments Download

Messages

Total messages: 31 (24 generated)
emaxx
Thiemo, please take a look.
3 years, 8 months ago (2017-04-18 21:05:30 UTC) #14
Thiemo Nagel
Lgtm with nits. https://codereview.chromium.org/2820063005/diff/20001/chrome/browser/chromeos/policy/enrollment_handler_chromeos.cc File chrome/browser/chromeos/policy/enrollment_handler_chromeos.cc (right): https://codereview.chromium.org/2820063005/diff/20001/chrome/browser/chromeos/policy/enrollment_handler_chromeos.cc#newcode203 chrome/browser/chromeos/policy/enrollment_handler_chromeos.cc:203: CloudPolicyValidatorBase::TIMESTAMP_VALIDATED); Nit: IIUC it would be ...
3 years, 8 months ago (2017-04-19 11:43:09 UTC) #15
emaxx
Thiemo, PTAL. https://codereview.chromium.org/2820063005/diff/20001/chrome/browser/chromeos/policy/enrollment_handler_chromeos.cc File chrome/browser/chromeos/policy/enrollment_handler_chromeos.cc (right): https://codereview.chromium.org/2820063005/diff/20001/chrome/browser/chromeos/policy/enrollment_handler_chromeos.cc#newcode203 chrome/browser/chromeos/policy/enrollment_handler_chromeos.cc:203: CloudPolicyValidatorBase::TIMESTAMP_VALIDATED); On 2017/04/19 11:43:09, Thiemo Nagel wrote: ...
3 years, 8 months ago (2017-04-19 20:48:46 UTC) #17
Thiemo Nagel
Still lgtm. https://codereview.chromium.org/2820063005/diff/20001/components/policy/core/common/cloud/cloud_policy_validator_unittest.cc File components/policy/core/common/cloud/cloud_policy_validator_unittest.cc (right): https://codereview.chromium.org/2820063005/diff/20001/components/policy/core/common/cloud/cloud_policy_validator_unittest.cc#newcode48 components/policy/core/common/cloud/cloud_policy_validator_unittest.cc:48: base::TimeDelta::FromMilliseconds(PolicyBuilder::kFakeTimestamp)), > Thanks for pointing at the ...
3 years, 8 months ago (2017-04-20 10:08:27 UTC) #25
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2820063005/60001
3 years, 8 months ago (2017-04-20 10:20:51 UTC) #27
commit-bot: I haz the power
Committed patchset #4 (id:60001) as https://chromium.googlesource.com/chromium/src/+/5a159859f7164e629c68d8212db34a711fc5245d
3 years, 8 months ago (2017-04-20 10:26:04 UTC) #30
emaxx
3 years, 8 months ago (2017-04-20 10:29:08 UTC) #31
Message was sent while issue was closed.
On 2017/04/20 10:08:27, Thiemo Nagel wrote:
> Imho that would be unnecessary overhead.  The server is Java code and by
virtue
> of that is using Java timestamps thus using Java conversion functions on the
> client to me seems exactly the right way to do it.
> 
> How about documenting the use of Java time more explicitly in the proto file,
> e.g. instead of
> 
> "[timestamp] is milliseconds since Epoch in UTC timezone."
> 
> maybe write something like
> 
> "[timestamp] is milliseconds since Epoch in UTC timezone (Java time)."
> 
> ?

Thanks, sounds reasonable. Will do in a follow-up CL.

Powered by Google App Engine
This is Rietveld 408576698