OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 #ifndef CRYPTO_MOCK_KEYCHAIN_MAC_H_ | 5 #ifndef CRYPTO_MOCK_KEYCHAIN_MAC_H_ |
6 #define CRYPTO_MOCK_KEYCHAIN_MAC_H_ | 6 #define CRYPTO_MOCK_KEYCHAIN_MAC_H_ |
7 | 7 |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include <map> | 10 #include <map> |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
44 void* data) const override; | 44 void* data) const override; |
45 OSStatus AddGenericPassword(SecKeychainRef keychain, | 45 OSStatus AddGenericPassword(SecKeychainRef keychain, |
46 UInt32 serviceNameLength, | 46 UInt32 serviceNameLength, |
47 const char* serviceName, | 47 const char* serviceName, |
48 UInt32 accountNameLength, | 48 UInt32 accountNameLength, |
49 const char* accountName, | 49 const char* accountName, |
50 UInt32 passwordLength, | 50 UInt32 passwordLength, |
51 const void* passwordData, | 51 const void* passwordData, |
52 SecKeychainItemRef* itemRef) const override; | 52 SecKeychainItemRef* itemRef) const override; |
53 | 53 |
| 54 // Returns the password that OSCrypt uses to generate its encryption key. |
| 55 std::string GetEncryptionPassword() const; |
| 56 |
54 #if !defined(OS_IOS) | 57 #if !defined(OS_IOS) |
55 OSStatus ItemCopyAttributesAndData(SecKeychainItemRef itemRef, | 58 OSStatus ItemCopyAttributesAndData(SecKeychainItemRef itemRef, |
56 SecKeychainAttributeInfo* info, | 59 SecKeychainAttributeInfo* info, |
57 SecItemClass* itemClass, | 60 SecItemClass* itemClass, |
58 SecKeychainAttributeList** attrList, | 61 SecKeychainAttributeList** attrList, |
59 UInt32* length, | 62 UInt32* length, |
60 void** outData) const override; | 63 void** outData) const override; |
61 // Pass "fail_me" as the data to get errSecAuthFailed. | 64 // Pass "fail_me" as the data to get errSecAuthFailed. |
62 OSStatus ItemModifyAttributesAndData(SecKeychainItemRef itemRef, | 65 OSStatus ItemModifyAttributesAndData(SecKeychainItemRef itemRef, |
63 const SecKeychainAttributeList* attrList, | 66 const SecKeychainAttributeList* attrList, |
(...skipping 174 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
238 // and |ItemFreeContent|. | 241 // and |ItemFreeContent|. |
239 mutable int password_data_count_; | 242 mutable int password_data_count_; |
240 | 243 |
241 // Records the password being set when |AddGenericPassword()| gets called. | 244 // Records the password being set when |AddGenericPassword()| gets called. |
242 mutable std::string add_generic_password_; | 245 mutable std::string add_generic_password_; |
243 }; | 246 }; |
244 | 247 |
245 } // namespace crypto | 248 } // namespace crypto |
246 | 249 |
247 #endif // CRYPTO_MOCK_KEYCHAIN_MAC_H_ | 250 #endif // CRYPTO_MOCK_KEYCHAIN_MAC_H_ |
OLD | NEW |