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_local_account_policy_store.h" | 5 #include "chrome/browser/chromeos/policy/device_local_account_policy_store.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/callback.h" | 8 #include "base/callback.h" |
9 #include "chrome/browser/browser_process.h" | 9 #include "chrome/browser/browser_process.h" |
10 #include "chrome/browser/chromeos/policy/browser_policy_connector_chromeos.h" | 10 #include "chrome/browser/chromeos/policy/browser_policy_connector_chromeos.h" |
11 #include "chrome/browser/chromeos/settings/owner_key_util.h" | |
12 #include "chromeos/dbus/session_manager_client.h" | 11 #include "chromeos/dbus/session_manager_client.h" |
| 12 #include "components/ownership/owner_key_util.h" |
13 #include "components/policy/core/common/cloud/device_management_service.h" | 13 #include "components/policy/core/common/cloud/device_management_service.h" |
14 #include "components/policy/core/common/external_data_fetcher.h" | 14 #include "components/policy/core/common/external_data_fetcher.h" |
15 #include "components/policy/core/common/policy_map.h" | 15 #include "components/policy/core/common/policy_map.h" |
16 #include "components/policy/core/common/policy_types.h" | 16 #include "components/policy/core/common/policy_types.h" |
17 #include "policy/proto/cloud_policy.pb.h" | 17 #include "policy/proto/cloud_policy.pb.h" |
18 #include "policy/proto/device_management_backend.pb.h" | 18 #include "policy/proto/device_management_backend.pb.h" |
19 | 19 |
20 namespace em = enterprise_management; | 20 namespace em = enterprise_management; |
21 | 21 |
22 namespace policy { | 22 namespace policy { |
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
132 | 132 |
133 void DeviceLocalAccountPolicyStore::Validate( | 133 void DeviceLocalAccountPolicyStore::Validate( |
134 bool valid_timestamp_required, | 134 bool valid_timestamp_required, |
135 scoped_ptr<em::PolicyFetchResponse> policy_response, | 135 scoped_ptr<em::PolicyFetchResponse> policy_response, |
136 const UserCloudPolicyValidator::CompletionCallback& callback, | 136 const UserCloudPolicyValidator::CompletionCallback& callback, |
137 chromeos::DeviceSettingsService::OwnershipStatus ownership_status) { | 137 chromeos::DeviceSettingsService::OwnershipStatus ownership_status) { |
138 DCHECK_NE(chromeos::DeviceSettingsService::OWNERSHIP_UNKNOWN, | 138 DCHECK_NE(chromeos::DeviceSettingsService::OWNERSHIP_UNKNOWN, |
139 ownership_status); | 139 ownership_status); |
140 const em::PolicyData* device_policy_data = | 140 const em::PolicyData* device_policy_data = |
141 device_settings_service_->policy_data(); | 141 device_settings_service_->policy_data(); |
142 scoped_refptr<chromeos::PublicKey> key = | 142 scoped_refptr<ownership::PublicKey> key = |
143 device_settings_service_->GetPublicKey(); | 143 device_settings_service_->GetPublicKey(); |
144 if (!key || !key->is_loaded() || !device_policy_data) { | 144 if (!key || !key->is_loaded() || !device_policy_data) { |
145 status_ = CloudPolicyStore::STATUS_BAD_STATE; | 145 status_ = CloudPolicyStore::STATUS_BAD_STATE; |
146 NotifyStoreLoaded(); | 146 NotifyStoreLoaded(); |
147 return; | 147 return; |
148 } | 148 } |
149 | 149 |
150 scoped_ptr<UserCloudPolicyValidator> validator( | 150 scoped_ptr<UserCloudPolicyValidator> validator( |
151 UserCloudPolicyValidator::Create(policy_response.Pass(), | 151 UserCloudPolicyValidator::Create(policy_response.Pass(), |
152 background_task_runner())); | 152 background_task_runner())); |
(...skipping 17 matching lines...) Expand all Loading... |
170 policy::BrowserPolicyConnectorChromeOS* connector = | 170 policy::BrowserPolicyConnectorChromeOS* connector = |
171 g_browser_process->platform_part()->browser_policy_connector_chromeos(); | 171 g_browser_process->platform_part()->browser_policy_connector_chromeos(); |
172 validator->ValidateSignature(key->as_string(), | 172 validator->ValidateSignature(key->as_string(), |
173 GetPolicyVerificationKey(), | 173 GetPolicyVerificationKey(), |
174 connector->GetEnterpriseDomain(), | 174 connector->GetEnterpriseDomain(), |
175 false); | 175 false); |
176 validator.release()->StartValidation(callback); | 176 validator.release()->StartValidation(callback); |
177 } | 177 } |
178 | 178 |
179 } // namespace policy | 179 } // namespace policy |
OLD | NEW |