|
@@ -73,7 +73,7 @@
|
|
|
if (!key) {
|
|
if (!key) {
|
|
|
return nil;
|
|
return nil;
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
NSDictionary *query = [self queryFetchOneByKey:key message:message];
|
|
NSDictionary *query = [self queryFetchOneByKey:key message:message];
|
|
|
CFTypeRef data = nil;
|
|
CFTypeRef data = nil;
|
|
|
OSStatus status = SecItemCopyMatching((__bridge CFDictionaryRef)query, &data);
|
|
OSStatus status = SecItemCopyMatching((__bridge CFDictionaryRef)query, &data);
|
|
@@ -83,12 +83,12 @@
|
|
|
}
|
|
}
|
|
|
return nil;
|
|
return nil;
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
NSData *dataFound = [NSData dataWithData:(__bridge NSData *)data];
|
|
NSData *dataFound = [NSData dataWithData:(__bridge NSData *)data];
|
|
|
if (data) {
|
|
if (data) {
|
|
|
CFRelease(data);
|
|
CFRelease(data);
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
return dataFound;
|
|
return dataFound;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -119,9 +119,9 @@
|
|
|
if (!key) {
|
|
if (!key) {
|
|
|
return NO;
|
|
return NO;
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
NSDictionary *query = [self queryFindByKey:key message:message];
|
|
NSDictionary *query = [self queryFindByKey:key message:message];
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
// Touch ID case
|
|
// Touch ID case
|
|
|
if (self.useAccessControl && self.defaultAccessiblity == A0SimpleKeychainItemAccessibleWhenPasscodeSetThisDeviceOnly) {
|
|
if (self.useAccessControl && self.defaultAccessiblity == A0SimpleKeychainItemAccessibleWhenPasscodeSetThisDeviceOnly) {
|
|
|
// TouchId case. Doesn't support updating keychain items
|
|
// TouchId case. Doesn't support updating keychain items
|
|
@@ -134,7 +134,7 @@
|
|
|
return status == errSecSuccess;
|
|
return status == errSecSuccess;
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
// Normal case
|
|
// Normal case
|
|
|
OSStatus status = SecItemCopyMatching((__bridge CFDictionaryRef)query, NULL);
|
|
OSStatus status = SecItemCopyMatching((__bridge CFDictionaryRef)query, NULL);
|
|
|
if (status == errSecSuccess) {
|
|
if (status == errSecSuccess) {
|
|
@@ -246,7 +246,7 @@
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- (NSString*)stringForSecStatus:(OSStatus)status {
|
|
- (NSString*)stringForSecStatus:(OSStatus)status {
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
switch(status) {
|
|
switch(status) {
|
|
|
case errSecSuccess:
|
|
case errSecSuccess:
|
|
|
return NSLocalizedStringFromTable(@"errSecSuccess: No error", @"SimpleKeychain", @"Possible error from keychain. ");
|
|
return NSLocalizedStringFromTable(@"errSecSuccess: No error", @"SimpleKeychain", @"Possible error from keychain. ");
|