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

Side by Side Diff: chrome/browser/supervised_user/chromeos/manager_password_service.cc

Issue 526353002: Merge cryptohome::RetrievedKeyData with cryptohome::KeyDefinition (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@d_2_367847_add_get_key_data_ex_to_mount_flow
Patch Set: Rebased. Created 6 years, 3 months 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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/supervised_user/chromeos/manager_password_service.h" 5 #include "chrome/browser/supervised_user/chromeos/manager_password_service.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/logging.h" 8 #include "base/logging.h"
9 #include "base/metrics/histogram.h" 9 #include "base/metrics/histogram.h"
10 #include "base/values.h" 10 #include "base/values.h"
(...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after
157 SupervisedUserAuthentication::PASSWORD_CHANGE_FAILED_NO_PASSWORD_DATA, 157 SupervisedUserAuthentication::PASSWORD_CHANGE_FAILED_NO_PASSWORD_DATA,
158 SupervisedUserAuthentication::PASSWORD_CHANGE_RESULT_MAX_VALUE); 158 SupervisedUserAuthentication::PASSWORD_CHANGE_RESULT_MAX_VALUE);
159 return; 159 return;
160 } 160 }
161 161
162 cryptohome::KeyDefinition new_key_definition( 162 cryptohome::KeyDefinition new_key_definition(
163 new_key, 163 new_key,
164 kCryptohomeSupervisedUserKeyLabel, 164 kCryptohomeSupervisedUserKeyLabel,
165 cryptohome::PRIV_AUTHORIZED_UPDATE || cryptohome::PRIV_MOUNT); 165 cryptohome::PRIV_AUTHORIZED_UPDATE || cryptohome::PRIV_MOUNT);
166 new_key_definition.revision = revision; 166 new_key_definition.revision = revision;
167 167 new_key_definition.authorization_data.push_back(
168 new_key_definition.encryption_key = encryption_key; 168 cryptohome::KeyDefinition::AuthorizationData(true /* encrypt */,
169 new_key_definition.signature_key = signature_key; 169 false /* sign */,
170 encryption_key));
171 new_key_definition.authorization_data.push_back(
172 cryptohome::KeyDefinition::AuthorizationData(false /* encrypt */,
173 true /* sign */,
174 signature_key));
170 175
171 authenticator_->AddKey(manager_key, 176 authenticator_->AddKey(manager_key,
172 new_key_definition, 177 new_key_definition,
173 true /* replace existing */, 178 true /* replace existing */,
174 base::Bind(&ManagerPasswordService::OnAddKeySuccess, 179 base::Bind(&ManagerPasswordService::OnAddKeySuccess,
175 weak_ptr_factory_.GetWeakPtr(), 180 weak_ptr_factory_.GetWeakPtr(),
176 manager_key, 181 manager_key,
177 user_id, 182 user_id,
178 Passed(&password_data))); 183 Passed(&password_data)));
179 } 184 }
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after
263 void ManagerPasswordService::OnOldManagerKeyDeleted( 268 void ManagerPasswordService::OnOldManagerKeyDeleted(
264 const UserContext& master_key_context) { 269 const UserContext& master_key_context) {
265 VLOG(1) << "Removed old master key for " << master_key_context.GetUserID(); 270 VLOG(1) << "Removed old master key for " << master_key_context.GetUserID();
266 } 271 }
267 272
268 void ManagerPasswordService::Shutdown() { 273 void ManagerPasswordService::Shutdown() {
269 settings_service_subscription_.reset(); 274 settings_service_subscription_.reset();
270 } 275 }
271 276
272 } // namespace chromeos 277 } // namespace chromeos
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698