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/chromeos/login/supervised/supervised_user_authenticatio
n.h" | 5 #include "chrome/browser/chromeos/login/supervised/supervised_user_authenticatio
n.h" |
6 | 6 |
7 #include "base/base64.h" | 7 #include "base/base64.h" |
8 #include "base/json/json_file_value_serializer.h" | 8 #include "base/json/json_file_value_serializer.h" |
9 #include "base/macros.h" | 9 #include "base/macros.h" |
10 #include "base/metrics/histogram.h" | 10 #include "base/metrics/histogram.h" |
(...skipping 269 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
280 | 280 |
281 void SupervisedUserAuthentication::LoadPasswordUpdateData( | 281 void SupervisedUserAuthentication::LoadPasswordUpdateData( |
282 const std::string& user_id, | 282 const std::string& user_id, |
283 const PasswordDataCallback& success_callback, | 283 const PasswordDataCallback& success_callback, |
284 const base::Closure& failure_callback) { | 284 const base::Closure& failure_callback) { |
285 const user_manager::User* user = | 285 const user_manager::User* user = |
286 user_manager::UserManager::Get()->FindUser(user_id); | 286 user_manager::UserManager::Get()->FindUser(user_id); |
287 base::FilePath profile_path = | 287 base::FilePath profile_path = |
288 ProfileHelper::GetProfilePathByUserIdHash(user->username_hash()); | 288 ProfileHelper::GetProfilePathByUserIdHash(user->username_hash()); |
289 PostTaskAndReplyWithResult( | 289 PostTaskAndReplyWithResult( |
290 content::BrowserThread::GetBlockingPool(), | 290 content::BrowserThread::GetBlockingPool() |
291 FROM_HERE, | 291 ->GetTaskRunnerWithShutdownBehavior( |
292 base::Bind(&LoadPasswordData, profile_path), | 292 base::SequencedWorkerPool::CONTINUE_ON_SHUTDOWN) |
| 293 .get(), |
| 294 FROM_HERE, base::Bind(&LoadPasswordData, profile_path), |
293 base::Bind(&OnPasswordDataLoaded, success_callback, failure_callback)); | 295 base::Bind(&OnPasswordDataLoaded, success_callback, failure_callback)); |
294 } | 296 } |
295 | 297 |
296 std::string SupervisedUserAuthentication::BuildPasswordSignature( | 298 std::string SupervisedUserAuthentication::BuildPasswordSignature( |
297 const std::string& password, | 299 const std::string& password, |
298 int revision, | 300 int revision, |
299 const std::string& base64_signature_key) { | 301 const std::string& base64_signature_key) { |
300 ac::chrome::managedaccounts::account::Secret secret; | 302 ac::chrome::managedaccounts::account::Secret secret; |
301 secret.set_revision(revision); | 303 secret.set_revision(revision); |
302 secret.set_secret(password); | 304 secret.set_secret(password); |
(...skipping 12 matching lines...) Expand all Loading... |
315 LOG(FATAL) << "HMAC::Sign failed"; | 317 LOG(FATAL) << "HMAC::Sign failed"; |
316 | 318 |
317 std::string raw_result(out_bytes, out_bytes + sizeof(out_bytes)); | 319 std::string raw_result(out_bytes, out_bytes + sizeof(out_bytes)); |
318 | 320 |
319 std::string result; | 321 std::string result; |
320 base::Base64Encode(raw_result, &result); | 322 base::Base64Encode(raw_result, &result); |
321 return result; | 323 return result; |
322 } | 324 } |
323 | 325 |
324 } // namespace chromeos | 326 } // namespace chromeos |
OLD | NEW |