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/encryptor/keychain_password_mac.h" | 5 #include "components/os_crypt/keychain_password_mac.h" |
6 | 6 |
7 #import <Security/Security.h> | 7 #import <Security/Security.h> |
8 | 8 |
9 #include "base/base64.h" | 9 #include "base/base64.h" |
10 #include "base/mac/mac_logging.h" | 10 #include "base/mac/mac_logging.h" |
11 #include "base/rand_util.h" | 11 #include "base/rand_util.h" |
12 #include "crypto/apple_keychain.h" | 12 #include "crypto/apple_keychain.h" |
13 | 13 |
14 using crypto::AppleKeychain; | 14 using crypto::AppleKeychain; |
15 | 15 |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
70 std::string(static_cast<char*>(password_data), password_length); | 70 std::string(static_cast<char*>(password_data), password_length); |
71 keychain_.ItemFreeContent(NULL, password_data); | 71 keychain_.ItemFreeContent(NULL, password_data); |
72 return password; | 72 return password; |
73 } else if (error == errSecItemNotFound) { | 73 } else if (error == errSecItemNotFound) { |
74 return AddRandomPasswordToKeychain(keychain_, service_name, account_name); | 74 return AddRandomPasswordToKeychain(keychain_, service_name, account_name); |
75 } else { | 75 } else { |
76 OSSTATUS_DLOG(ERROR, error) << "Keychain lookup failed"; | 76 OSSTATUS_DLOG(ERROR, error) << "Keychain lookup failed"; |
77 return std::string(); | 77 return std::string(); |
78 } | 78 } |
79 } | 79 } |
OLD | NEW |