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

Side by Side Diff: chrome/browser/chromeos/policy/device_local_account_policy_store.cc

Issue 2494843002: Don't pass domain and verification key to validation when not required (Closed)
Patch Set: Rebase Created 4 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 unified diff | Download patch
OLDNEW
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 <utility> 7 #include <utility>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/callback.h" 10 #include "base/callback.h"
11 #include "base/memory/ptr_util.h" 11 #include "base/memory/ptr_util.h"
12 #include "chrome/browser/browser_process.h"
13 #include "chrome/browser/chromeos/policy/browser_policy_connector_chromeos.h"
14 #include "chromeos/dbus/session_manager_client.h" 12 #include "chromeos/dbus/session_manager_client.h"
15 #include "components/ownership/owner_key_util.h" 13 #include "components/ownership/owner_key_util.h"
16 #include "components/policy/core/common/cloud/device_management_service.h" 14 #include "components/policy/core/common/cloud/device_management_service.h"
17 #include "components/policy/core/common/external_data_fetcher.h" 15 #include "components/policy/core/common/external_data_fetcher.h"
18 #include "components/policy/core/common/policy_map.h" 16 #include "components/policy/core/common/policy_map.h"
19 #include "components/policy/core/common/policy_types.h" 17 #include "components/policy/core/common/policy_types.h"
20 #include "components/policy/proto/cloud_policy.pb.h" 18 #include "components/policy/proto/cloud_policy.pb.h"
21 #include "components/policy/proto/device_management_backend.pb.h" 19 #include "components/policy/proto/device_management_backend.pb.h"
22 20
23 namespace em = enterprise_management; 21 namespace em = enterprise_management;
(...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after
168 166
169 // Validate the DMToken to match what device policy has. 167 // Validate the DMToken to match what device policy has.
170 validator->ValidateDMToken(device_policy_data->request_token(), 168 validator->ValidateDMToken(device_policy_data->request_token(),
171 CloudPolicyValidatorBase::DM_TOKEN_REQUIRED); 169 CloudPolicyValidatorBase::DM_TOKEN_REQUIRED);
172 170
173 // Validate the device id to match what device policy has. 171 // Validate the device id to match what device policy has.
174 validator->ValidateDeviceId(device_policy_data->device_id(), 172 validator->ValidateDeviceId(device_policy_data->device_id(),
175 CloudPolicyValidatorBase::DEVICE_ID_REQUIRED); 173 CloudPolicyValidatorBase::DEVICE_ID_REQUIRED);
176 174
177 validator->ValidatePayload(); 175 validator->ValidatePayload();
178 policy::BrowserPolicyConnectorChromeOS* connector = 176 validator->ValidateSignature(key->as_string());
179 g_browser_process->platform_part()->browser_policy_connector_chromeos();
180 validator->ValidateSignature(key->as_string(),
181 GetPolicyVerificationKey(),
182 connector->GetEnterpriseDomain(),
183 false);
184 validator.release()->StartValidation(callback); 177 validator.release()->StartValidation(callback);
185 } 178 }
186 179
187 } // namespace policy 180 } // namespace policy
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698