OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/managed/supervised_user_authentication.h
" | 5 #include "chrome/browser/chromeos/login/managed/supervised_user_authentication.h
" |
6 | 6 |
7 #include "base/base64.h" | 7 #include "base/base64.h" |
8 #include "base/command_line.h" | |
9 #include "base/json/json_file_value_serializer.h" | 8 #include "base/json/json_file_value_serializer.h" |
10 #include "base/macros.h" | 9 #include "base/macros.h" |
11 #include "base/metrics/histogram.h" | 10 #include "base/metrics/histogram.h" |
12 #include "base/strings/string_number_conversions.h" | 11 #include "base/strings/string_number_conversions.h" |
13 #include "base/strings/string_util.h" | 12 #include "base/strings/string_util.h" |
14 #include "base/threading/sequenced_worker_pool.h" | 13 #include "base/threading/sequenced_worker_pool.h" |
15 #include "chrome/browser/chromeos/login/managed/locally_managed_user_constants.h
" | 14 #include "chrome/browser/chromeos/login/managed/locally_managed_user_constants.h
" |
16 #include "chrome/browser/chromeos/login/supervised_user_manager.h" | 15 #include "chrome/browser/chromeos/login/supervised_user_manager.h" |
17 #include "chrome/browser/chromeos/login/user.h" | 16 #include "chrome/browser/chromeos/login/user.h" |
18 #include "chrome/browser/chromeos/login/user_manager.h" | 17 #include "chrome/browser/chromeos/login/user_manager.h" |
19 #include "chrome/browser/chromeos/profiles/profile_helper.h" | 18 #include "chrome/browser/chromeos/profiles/profile_helper.h" |
20 #include "chromeos/chromeos_switches.h" | |
21 #include "chromeos/cryptohome/signed_secret.pb.h" | 19 #include "chromeos/cryptohome/signed_secret.pb.h" |
22 #include "content/public/browser/browser_thread.h" | 20 #include "content/public/browser/browser_thread.h" |
23 #include "crypto/hmac.h" | 21 #include "crypto/hmac.h" |
24 #include "crypto/random.h" | 22 #include "crypto/random.h" |
25 #include "crypto/symmetric_key.h" | 23 #include "crypto/symmetric_key.h" |
26 | 24 |
27 namespace chromeos { | 25 namespace chromeos { |
28 | 26 |
29 namespace { | 27 namespace { |
30 | 28 |
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
130 } | 128 } |
131 success_callback.Run(value); | 129 success_callback.Run(value); |
132 delete value; | 130 delete value; |
133 } | 131 } |
134 | 132 |
135 } // namespace | 133 } // namespace |
136 | 134 |
137 SupervisedUserAuthentication::SupervisedUserAuthentication( | 135 SupervisedUserAuthentication::SupervisedUserAuthentication( |
138 SupervisedUserManager* owner) | 136 SupervisedUserManager* owner) |
139 : owner_(owner), | 137 : owner_(owner), |
140 stable_schema_(SCHEMA_PLAIN) { | 138 stable_schema_(SCHEMA_SALT_HASHED) { |
141 CommandLine* command_line = CommandLine::ForCurrentProcess(); | |
142 if (command_line->HasSwitch(switches::kEnableSupervisedPasswordSync)) { | |
143 stable_schema_ = SCHEMA_SALT_HASHED; | |
144 } | |
145 } | 139 } |
146 | 140 |
147 SupervisedUserAuthentication::~SupervisedUserAuthentication() {} | 141 SupervisedUserAuthentication::~SupervisedUserAuthentication() {} |
148 | 142 |
149 SupervisedUserAuthentication::Schema | 143 SupervisedUserAuthentication::Schema |
150 SupervisedUserAuthentication::GetStableSchema() { | 144 SupervisedUserAuthentication::GetStableSchema() { |
151 return stable_schema_; | 145 return stable_schema_; |
152 } | 146 } |
153 | 147 |
154 std::string SupervisedUserAuthentication::TransformPassword( | 148 std::string SupervisedUserAuthentication::TransformPassword( |
(...skipping 199 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
354 base::FilePath profile_path = | 348 base::FilePath profile_path = |
355 ProfileHelper::GetProfilePathByUserIdHash(user->username_hash()); | 349 ProfileHelper::GetProfilePathByUserIdHash(user->username_hash()); |
356 PostTaskAndReplyWithResult( | 350 PostTaskAndReplyWithResult( |
357 content::BrowserThread::GetBlockingPool(), | 351 content::BrowserThread::GetBlockingPool(), |
358 FROM_HERE, | 352 FROM_HERE, |
359 base::Bind(&LoadPasswordData, profile_path), | 353 base::Bind(&LoadPasswordData, profile_path), |
360 base::Bind(&OnPasswordDataLoaded, success_callback, failure_callback)); | 354 base::Bind(&OnPasswordDataLoaded, success_callback, failure_callback)); |
361 } | 355 } |
362 | 356 |
363 } // namespace chromeos | 357 } // namespace chromeos |
OLD | NEW |