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.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 Loading... |
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 |
OLD | NEW |