| OLD | NEW |
| 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 Loading... |
| 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.AddSymmetricKey(true /* encrypt */, |
| 168 new_key_definition.encryption_key = encryption_key; | 168 false /* sign */, |
| 169 new_key_definition.signature_key = signature_key; | 169 encryption_key); |
| 170 new_key_definition.AddSymmetricKey(false /* encrypt */, |
| 171 true /* sign */, |
| 172 signature_key); |
| 170 | 173 |
| 171 authenticator_->AddKey(manager_key, | 174 authenticator_->AddKey(manager_key, |
| 172 new_key_definition, | 175 new_key_definition, |
| 173 true /* replace existing */, | 176 true /* replace existing */, |
| 174 base::Bind(&ManagerPasswordService::OnAddKeySuccess, | 177 base::Bind(&ManagerPasswordService::OnAddKeySuccess, |
| 175 weak_ptr_factory_.GetWeakPtr(), | 178 weak_ptr_factory_.GetWeakPtr(), |
| 176 manager_key, | 179 manager_key, |
| 177 user_id, | 180 user_id, |
| 178 Passed(&password_data))); | 181 Passed(&password_data))); |
| 179 } | 182 } |
| (...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 263 void ManagerPasswordService::OnOldManagerKeyDeleted( | 266 void ManagerPasswordService::OnOldManagerKeyDeleted( |
| 264 const UserContext& master_key_context) { | 267 const UserContext& master_key_context) { |
| 265 VLOG(1) << "Removed old master key for " << master_key_context.GetUserID(); | 268 VLOG(1) << "Removed old master key for " << master_key_context.GetUserID(); |
| 266 } | 269 } |
| 267 | 270 |
| 268 void ManagerPasswordService::Shutdown() { | 271 void ManagerPasswordService::Shutdown() { |
| 269 settings_service_subscription_.reset(); | 272 settings_service_subscription_.reset(); |
| 270 } | 273 } |
| 271 | 274 |
| 272 } // namespace chromeos | 275 } // namespace chromeos |
| OLD | NEW |