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_macros.h" | 10 #include "base/metrics/histogram_macros.h" |
(...skipping 271 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
282 void SupervisedUserAuthentication::LoadPasswordUpdateData( | 282 void SupervisedUserAuthentication::LoadPasswordUpdateData( |
283 const std::string& user_id, | 283 const std::string& user_id, |
284 const PasswordDataCallback& success_callback, | 284 const PasswordDataCallback& success_callback, |
285 const base::Closure& failure_callback) { | 285 const base::Closure& failure_callback) { |
286 const user_manager::User* user = user_manager::UserManager::Get()->FindUser( | 286 const user_manager::User* user = user_manager::UserManager::Get()->FindUser( |
287 AccountId::FromUserEmail(user_id)); | 287 AccountId::FromUserEmail(user_id)); |
288 base::FilePath profile_path = | 288 base::FilePath profile_path = |
289 ProfileHelper::GetProfilePathByUserIdHash(user->username_hash()); | 289 ProfileHelper::GetProfilePathByUserIdHash(user->username_hash()); |
290 PostTaskWithTraitsAndReplyWithResult( | 290 PostTaskWithTraitsAndReplyWithResult( |
291 FROM_HERE, | 291 FROM_HERE, |
292 base::TaskTraits() | 292 {base::MayBlock(), base::TaskPriority::BACKGROUND, |
293 .MayBlock() | 293 base::TaskShutdownBehavior::CONTINUE_ON_SHUTDOWN}, |
294 .WithPriority(base::TaskPriority::BACKGROUND) | |
295 .WithShutdownBehavior( | |
296 base::TaskShutdownBehavior::CONTINUE_ON_SHUTDOWN), | |
297 base::BindOnce(&LoadPasswordData, profile_path), | 294 base::BindOnce(&LoadPasswordData, profile_path), |
298 base::BindOnce(&OnPasswordDataLoaded, success_callback, | 295 base::BindOnce(&OnPasswordDataLoaded, success_callback, |
299 failure_callback)); | 296 failure_callback)); |
300 } | 297 } |
301 | 298 |
302 std::string SupervisedUserAuthentication::BuildPasswordSignature( | 299 std::string SupervisedUserAuthentication::BuildPasswordSignature( |
303 const std::string& password, | 300 const std::string& password, |
304 int revision, | 301 int revision, |
305 const std::string& base64_signature_key) { | 302 const std::string& base64_signature_key) { |
306 ac::chrome::managedaccounts::account::Secret secret; | 303 ac::chrome::managedaccounts::account::Secret secret; |
(...skipping 14 matching lines...) Expand all Loading... |
321 LOG(FATAL) << "HMAC::Sign failed"; | 318 LOG(FATAL) << "HMAC::Sign failed"; |
322 | 319 |
323 std::string raw_result(out_bytes, out_bytes + sizeof(out_bytes)); | 320 std::string raw_result(out_bytes, out_bytes + sizeof(out_bytes)); |
324 | 321 |
325 std::string result; | 322 std::string result; |
326 base::Base64Encode(raw_result, &result); | 323 base::Base64Encode(raw_result, &result); |
327 return result; | 324 return result; |
328 } | 325 } |
329 | 326 |
330 } // namespace chromeos | 327 } // namespace chromeos |
OLD | NEW |