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 "chromeos/login/auth/cryptohome_authenticator.h" | 5 #include "chromeos/login/auth/cryptohome_authenticator.h" |
6 | 6 |
| 7 #include <stdint.h> |
| 8 |
7 #include <vector> | 9 #include <vector> |
8 | 10 |
9 #include "base/basictypes.h" | |
10 #include "base/bind.h" | 11 #include "base/bind.h" |
11 #include "base/files/file_path.h" | 12 #include "base/files/file_path.h" |
12 #include "base/location.h" | 13 #include "base/location.h" |
13 #include "base/logging.h" | 14 #include "base/logging.h" |
14 #include "base/memory/weak_ptr.h" | 15 #include "base/memory/weak_ptr.h" |
15 #include "chromeos/cryptohome/async_method_caller.h" | 16 #include "chromeos/cryptohome/async_method_caller.h" |
16 #include "chromeos/cryptohome/cryptohome_parameters.h" | 17 #include "chromeos/cryptohome/cryptohome_parameters.h" |
17 #include "chromeos/cryptohome/homedir_methods.h" | 18 #include "chromeos/cryptohome/homedir_methods.h" |
18 #include "chromeos/cryptohome/system_salt_getter.h" | 19 #include "chromeos/cryptohome/system_salt_getter.h" |
19 #include "chromeos/dbus/cryptohome_client.h" | 20 #include "chromeos/dbus/cryptohome_client.h" |
(...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
187 bool create_if_nonexistent, | 188 bool create_if_nonexistent, |
188 bool success, | 189 bool success, |
189 cryptohome::MountError return_code, | 190 cryptohome::MountError return_code, |
190 const std::vector<cryptohome::KeyDefinition>& key_definitions) { | 191 const std::vector<cryptohome::KeyDefinition>& key_definitions) { |
191 if (success) { | 192 if (success) { |
192 if (key_definitions.size() == 1) { | 193 if (key_definitions.size() == 1) { |
193 const cryptohome::KeyDefinition& key_definition = key_definitions.front(); | 194 const cryptohome::KeyDefinition& key_definition = key_definitions.front(); |
194 DCHECK_EQ(kCryptohomeGAIAKeyLabel, key_definition.label); | 195 DCHECK_EQ(kCryptohomeGAIAKeyLabel, key_definition.label); |
195 | 196 |
196 // Extract the key type and salt from |key_definition|, if present. | 197 // Extract the key type and salt from |key_definition|, if present. |
197 scoped_ptr<int64> type; | 198 scoped_ptr<int64_t> type; |
198 scoped_ptr<std::string> salt; | 199 scoped_ptr<std::string> salt; |
199 for (std::vector<cryptohome::KeyDefinition::ProviderData>:: | 200 for (std::vector<cryptohome::KeyDefinition::ProviderData>:: |
200 const_iterator it = key_definition.provider_data.begin(); | 201 const_iterator it = key_definition.provider_data.begin(); |
201 it != key_definition.provider_data.end(); ++it) { | 202 it != key_definition.provider_data.end(); ++it) { |
202 if (it->name == kKeyProviderDataTypeName) { | 203 if (it->name == kKeyProviderDataTypeName) { |
203 if (it->number) | 204 if (it->number) |
204 type.reset(new int64(*it->number)); | 205 type.reset(new int64_t(*it->number)); |
205 else | 206 else |
206 NOTREACHED(); | 207 NOTREACHED(); |
207 } else if (it->name == kKeyProviderDataSaltName) { | 208 } else if (it->name == kKeyProviderDataSaltName) { |
208 if (it->bytes) | 209 if (it->bytes) |
209 salt.reset(new std::string(*it->bytes)); | 210 salt.reset(new std::string(*it->bytes)); |
210 else | 211 else |
211 NOTREACHED(); | 212 NOTREACHED(); |
212 } | 213 } |
213 } | 214 } |
214 | 215 |
(...skipping 657 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
872 Resolve(); | 873 Resolve(); |
873 } | 874 } |
874 | 875 |
875 void CryptohomeAuthenticator::SetOwnerState(bool owner_check_finished, | 876 void CryptohomeAuthenticator::SetOwnerState(bool owner_check_finished, |
876 bool check_result) { | 877 bool check_result) { |
877 owner_is_verified_ = owner_check_finished; | 878 owner_is_verified_ = owner_check_finished; |
878 user_can_login_ = check_result; | 879 user_can_login_ = check_result; |
879 } | 880 } |
880 | 881 |
881 } // namespace chromeos | 882 } // namespace chromeos |
OLD | NEW |