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/settings/session_manager_operation.h" | 5 #include "chrome/browser/chromeos/settings/session_manager_operation.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/bind_helpers.h" | 8 #include "base/bind_helpers.h" |
9 #include "base/files/file_path.h" | 9 #include "base/files/file_path.h" |
10 #include "base/message_loop/message_loop.h" | 10 #include "base/message_loop/message_loop.h" |
(...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
175 // To prevent all of these issues the timestamp is just not verified when | 175 // To prevent all of these issues the timestamp is just not verified when |
176 // loading the device policy from the cache. Note that the timestamp is still | 176 // loading the device policy from the cache. Note that the timestamp is still |
177 // verified during enrollment and when a new policy is fetched from the | 177 // verified during enrollment and when a new policy is fetched from the |
178 // server. | 178 // server. |
179 validator->ValidateAgainstCurrentPolicy( | 179 validator->ValidateAgainstCurrentPolicy( |
180 policy_data_.get(), | 180 policy_data_.get(), |
181 policy::CloudPolicyValidatorBase::TIMESTAMP_NOT_REQUIRED, | 181 policy::CloudPolicyValidatorBase::TIMESTAMP_NOT_REQUIRED, |
182 policy::CloudPolicyValidatorBase::DM_TOKEN_NOT_REQUIRED); | 182 policy::CloudPolicyValidatorBase::DM_TOKEN_NOT_REQUIRED); |
183 validator->ValidatePolicyType(policy::dm_protocol::kChromeDevicePolicyType); | 183 validator->ValidatePolicyType(policy::dm_protocol::kChromeDevicePolicyType); |
184 validator->ValidatePayload(); | 184 validator->ValidatePayload(); |
185 validator->ValidateSignature(*owner_key_->public_key(), false); | 185 validator->ValidateSignature(owner_key_->public_key_as_string(), |
| 186 policy::GetPolicyVerificationKey(), |
| 187 std::string(), |
| 188 false); |
186 validator->StartValidation( | 189 validator->StartValidation( |
187 base::Bind(&SessionManagerOperation::ReportValidatorStatus, | 190 base::Bind(&SessionManagerOperation::ReportValidatorStatus, |
188 weak_factory_.GetWeakPtr())); | 191 weak_factory_.GetWeakPtr())); |
189 } | 192 } |
190 | 193 |
191 void SessionManagerOperation::ReportValidatorStatus( | 194 void SessionManagerOperation::ReportValidatorStatus( |
192 policy::DeviceCloudPolicyValidator* validator) { | 195 policy::DeviceCloudPolicyValidator* validator) { |
193 DeviceSettingsService::Status status = | 196 DeviceSettingsService::Status status = |
194 DeviceSettingsService::STORE_VALIDATION_ERROR; | 197 DeviceSettingsService::STORE_VALIDATION_ERROR; |
195 if (validator->success()) { | 198 if (validator->success()) { |
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
325 } | 328 } |
326 | 329 |
327 void SignAndStoreSettingsOperation::HandleStoreResult(bool success) { | 330 void SignAndStoreSettingsOperation::HandleStoreResult(bool success) { |
328 if (!success) | 331 if (!success) |
329 ReportResult(DeviceSettingsService::STORE_OPERATION_FAILED); | 332 ReportResult(DeviceSettingsService::STORE_OPERATION_FAILED); |
330 else | 333 else |
331 StartLoading(); | 334 StartLoading(); |
332 } | 335 } |
333 | 336 |
334 } // namespace chromeos | 337 } // namespace chromeos |
OLD | NEW |