| 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 "components/os_crypt/os_crypt.h" | 5 #include "components/os_crypt/os_crypt.h" |
| 6 | 6 |
| 7 #include <CommonCrypto/CommonCryptor.h> // for kCCBlockSizeAES128 | 7 #include <CommonCrypto/CommonCryptor.h> // for kCCBlockSizeAES128 |
| 8 #include <stddef.h> | 8 #include <stddef.h> |
| 9 | 9 |
| 10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
| 11 #include "base/debug/leak_annotations.h" | 11 #include "base/debug/leak_annotations.h" |
| 12 #include "base/logging.h" | 12 #include "base/logging.h" |
| 13 #include "base/memory/scoped_ptr.h" | |
| 14 #include "base/strings/utf_string_conversions.h" | 13 #include "base/strings/utf_string_conversions.h" |
| 15 #include "base/synchronization/lock.h" | 14 #include "base/synchronization/lock.h" |
| 16 #include "components/os_crypt/keychain_password_mac.h" | 15 #include "components/os_crypt/keychain_password_mac.h" |
| 17 #include "components/os_crypt/os_crypt_switches.h" | 16 #include "components/os_crypt/os_crypt_switches.h" |
| 18 #include "crypto/apple_keychain.h" | 17 #include "crypto/apple_keychain.h" |
| 19 #include "crypto/encryptor.h" | 18 #include "crypto/encryptor.h" |
| 20 #include "crypto/mock_apple_keychain.h" | 19 #include "crypto/mock_apple_keychain.h" |
| 21 #include "crypto/symmetric_key.h" | 20 #include "crypto/symmetric_key.h" |
| 22 | 21 |
| 23 using crypto::AppleKeychain; | 22 using crypto::AppleKeychain; |
| (...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 163 if (!encryptor.Decrypt(raw_ciphertext, plaintext)) | 162 if (!encryptor.Decrypt(raw_ciphertext, plaintext)) |
| 164 return false; | 163 return false; |
| 165 | 164 |
| 166 return true; | 165 return true; |
| 167 } | 166 } |
| 168 | 167 |
| 169 void OSCrypt::UseMockKeychain(bool use_mock) { | 168 void OSCrypt::UseMockKeychain(bool use_mock) { |
| 170 use_mock_keychain = use_mock; | 169 use_mock_keychain = use_mock; |
| 171 } | 170 } |
| 172 | 171 |
| OLD | NEW |