This repository was archived by the owner on Nov 7, 2023. It is now read-only.
File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -96,15 +96,17 @@ CFStringRef getKeychainAccessibility(NSDictionary *options)
9696
9797RCT_EXPORT_METHOD (getItem:(NSString *)key withOptions:(NSDictionary *) options resolver:(RCTPromiseResolveBlock)resolve rejecter:(RCTPromiseRejectBlock)reject)
9898{
99- CFStringRef keychainAccessibility = getKeychainAccessibility (options);
10099 NSString *keychainService = getKeychainService (options);
100+ /*
101+ The unique key for kSecClassGenericPassword is composed of: kSecAttrAccount and kSecAttrService
102+ https://stackoverflow.com/a/22519700
103+ */
101104 NSDictionary * getQuery = @{
102105 (__bridge id )kSecClass : (__bridge id )kSecClassGenericPassword ,
103106 (__bridge id )kSecAttrAccount : key,
107+ (__bridge id )kSecAttrService : keychainService,
104108 (__bridge id )kSecReturnData : (__bridge id )kCFBooleanTrue ,
105- (__bridge id )kSecMatchLimit : (__bridge id )kSecMatchLimitOne ,
106- (__bridge id )kSecAttrAccessible : (__bridge id )keychainAccessibility,
107- (__bridge id )kSecAttrService : keychainService
109+ (__bridge id )kSecMatchLimit : (__bridge id )kSecMatchLimitOne
108110 };
109111
110112 CFTypeRef dataRef = NULL ;
You can’t perform that action at this time.
0 commit comments