| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "chrome/browser/chromeos/policy/device_cloud_policy_store_chromeos.h" | 5 #include "chrome/browser/chromeos/policy/device_cloud_policy_store_chromeos.h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/logging.h" | 10 #include "base/logging.h" |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 48 if (!install_attributes_->IsEnterpriseDevice() || | 48 if (!install_attributes_->IsEnterpriseDevice() || |
| 49 !device_settings_service_->policy_data() || !public_key.get() || | 49 !device_settings_service_->policy_data() || !public_key.get() || |
| 50 !public_key->is_loaded()) { | 50 !public_key->is_loaded()) { |
| 51 status_ = STATUS_BAD_STATE; | 51 status_ = STATUS_BAD_STATE; |
| 52 NotifyStoreError(); | 52 NotifyStoreError(); |
| 53 return; | 53 return; |
| 54 } | 54 } |
| 55 | 55 |
| 56 std::unique_ptr<DeviceCloudPolicyValidator> validator( | 56 std::unique_ptr<DeviceCloudPolicyValidator> validator( |
| 57 CreateValidator(policy)); | 57 CreateValidator(policy)); |
| 58 validator->ValidateSignature(public_key->as_string(), | 58 validator->ValidateSignatureAllowingRotation( |
| 59 GetPolicyVerificationKey(), | 59 public_key->as_string(), GetPolicyVerificationKey(), |
| 60 install_attributes_->GetDomain(), | 60 install_attributes_->GetDomain()); |
| 61 true); | |
| 62 validator->ValidateAgainstCurrentPolicy( | 61 validator->ValidateAgainstCurrentPolicy( |
| 63 device_settings_service_->policy_data(), | 62 device_settings_service_->policy_data(), |
| 64 CloudPolicyValidatorBase::TIMESTAMP_FULLY_VALIDATED, | 63 CloudPolicyValidatorBase::TIMESTAMP_FULLY_VALIDATED, |
| 65 CloudPolicyValidatorBase::DM_TOKEN_REQUIRED, | 64 CloudPolicyValidatorBase::DM_TOKEN_REQUIRED, |
| 66 CloudPolicyValidatorBase::DEVICE_ID_REQUIRED); | 65 CloudPolicyValidatorBase::DEVICE_ID_REQUIRED); |
| 67 validator.release()->StartValidation( | 66 validator.release()->StartValidation( |
| 68 base::Bind(&DeviceCloudPolicyStoreChromeOS::OnPolicyToStoreValidated, | 67 base::Bind(&DeviceCloudPolicyStoreChromeOS::OnPolicyToStoreValidated, |
| 69 weak_factory_.GetWeakPtr())); | 68 weak_factory_.GetWeakPtr())); |
| 70 } | 69 } |
| 71 | 70 |
| (...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 213 case chromeos::DeviceSettingsService::STORE_VALIDATION_ERROR: | 212 case chromeos::DeviceSettingsService::STORE_VALIDATION_ERROR: |
| 214 case chromeos::DeviceSettingsService::STORE_TEMP_VALIDATION_ERROR: | 213 case chromeos::DeviceSettingsService::STORE_TEMP_VALIDATION_ERROR: |
| 215 status_ = STATUS_LOAD_ERROR; | 214 status_ = STATUS_LOAD_ERROR; |
| 216 break; | 215 break; |
| 217 } | 216 } |
| 218 | 217 |
| 219 NotifyStoreError(); | 218 NotifyStoreError(); |
| 220 } | 219 } |
| 221 | 220 |
| 222 } // namespace policy | 221 } // namespace policy |
| OLD | NEW |