| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 "components/os_crypt/os_crypt.h" | 5 #include "components/os_crypt/os_crypt.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include <algorithm> | 9 #include <algorithm> |
| 10 #include <iterator> | 10 #include <iterator> |
| 11 #include <memory> | 11 #include <memory> |
| 12 | 12 |
| 13 #include "base/lazy_instance.h" | 13 #include "base/lazy_instance.h" |
| 14 #include "base/logging.h" | 14 #include "base/logging.h" |
| 15 #include "base/single_thread_task_runner.h" |
| 15 #include "base/strings/string_util.h" | 16 #include "base/strings/string_util.h" |
| 16 #include "base/strings/utf_string_conversions.h" | 17 #include "base/strings/utf_string_conversions.h" |
| 17 #include "base/synchronization/lock.h" | 18 #include "base/synchronization/lock.h" |
| 18 #include "components/os_crypt/key_storage_linux.h" | 19 #include "components/os_crypt/key_storage_linux.h" |
| 19 #include "crypto/encryptor.h" | 20 #include "crypto/encryptor.h" |
| 20 #include "crypto/symmetric_key.h" | 21 #include "crypto/symmetric_key.h" |
| 21 | 22 |
| 22 namespace { | 23 namespace { |
| 23 | 24 |
| 24 // Salt for Symmetric key derivation. | 25 // Salt for Symmetric key derivation. |
| (...skipping 255 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 280 // |KeyStorage| instance can be created. Enable V11 by returning the mock. | 281 // |KeyStorage| instance can be created. Enable V11 by returning the mock. |
| 281 if (get_key_storage_mock) | 282 if (get_key_storage_mock) |
| 282 g_key_storage_provider = get_key_storage_mock; | 283 g_key_storage_provider = get_key_storage_mock; |
| 283 } else { | 284 } else { |
| 284 // Restore real implementation | 285 // Restore real implementation |
| 285 std::copy(std::begin(get_password_save), std::end(get_password_save), | 286 std::copy(std::begin(get_password_save), std::end(get_password_save), |
| 286 std::begin(g_get_password)); | 287 std::begin(g_get_password)); |
| 287 g_key_storage_provider = &GetKeyStorage; | 288 g_key_storage_provider = &GetKeyStorage; |
| 288 } | 289 } |
| 289 } | 290 } |
| OLD | NEW |