| 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/signin/local_auth.h" | 5 #include "chrome/browser/signin/local_auth.h" | 
| 6 | 6 | 
| 7 #include "base/base64.h" | 7 #include "base/base64.h" | 
| 8 #include "base/logging.h" | 8 #include "base/logging.h" | 
| 9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" | 
| 10 #include "base/metrics/histogram.h" | 10 #include "base/metrics/histogram.h" | 
| 11 #include "base/prefs/pref_service.h" |  | 
| 12 #include "base/strings/string_util.h" | 11 #include "base/strings/string_util.h" | 
| 13 #include "chrome/browser/browser_process.h" | 12 #include "chrome/browser/browser_process.h" | 
| 14 #include "chrome/browser/profiles/profile.h" | 13 #include "chrome/browser/profiles/profile.h" | 
| 15 #include "chrome/browser/profiles/profile_manager.h" | 14 #include "chrome/browser/profiles/profile_manager.h" | 
| 16 #include "chrome/common/pref_names.h" | 15 #include "chrome/common/pref_names.h" | 
| 17 #include "components/os_crypt/os_crypt.h" | 16 #include "components/os_crypt/os_crypt.h" | 
| 18 #include "components/pref_registry/pref_registry_syncable.h" | 17 #include "components/pref_registry/pref_registry_syncable.h" | 
|  | 18 #include "components/prefs/pref_service.h" | 
| 19 #include "crypto/random.h" | 19 #include "crypto/random.h" | 
| 20 #include "crypto/secure_util.h" | 20 #include "crypto/secure_util.h" | 
| 21 #include "crypto/symmetric_key.h" | 21 #include "crypto/symmetric_key.h" | 
| 22 | 22 | 
| 23 namespace { | 23 namespace { | 
| 24 | 24 | 
| 25 struct HashEncoding { | 25 struct HashEncoding { | 
| 26   char version; | 26   char version; | 
| 27   unsigned hash_bits; | 27   unsigned hash_bits; | 
| 28   unsigned hash_bytes; | 28   unsigned hash_bytes; | 
| (...skipping 239 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 268   if (passwords_match && (hash_encoding->version - '0') != NUM_HASH_ENCODINGS) | 268   if (passwords_match && (hash_encoding->version - '0') != NUM_HASH_ENCODINGS) | 
| 269     SetLocalAuthCredentials(info_index, password); | 269     SetLocalAuthCredentials(info_index, password); | 
| 270   return passwords_match; | 270   return passwords_match; | 
| 271 } | 271 } | 
| 272 | 272 | 
| 273 bool LocalAuth::ValidateLocalAuthCredentials(const Profile* profile, | 273 bool LocalAuth::ValidateLocalAuthCredentials(const Profile* profile, | 
| 274                                              const std::string& password) { | 274                                              const std::string& password) { | 
| 275   return ValidateLocalAuthCredentials(GetProfileInfoIndexOfProfile(profile), | 275   return ValidateLocalAuthCredentials(GetProfileInfoIndexOfProfile(profile), | 
| 276                                       password); | 276                                       password); | 
| 277 } | 277 } | 
| OLD | NEW | 
|---|