Skip to content

Commit

Permalink
Link to my article on handling password strings from the keychain
Browse files Browse the repository at this point in the history
  • Loading branch information
mikeabdullah committed Jan 15, 2013
1 parent 99b03ea commit 2ab17ae
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion CK2SSHCredential.m
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ - (NSString *)password
return nil;
}

// Password data must be freed using special keychain APIs. Do so with a specially crafted CFString
// Password data must be freed using special keychain APIs. Do so with a specially crafted CFString as described in http://www.mikeabdullah.net/handling-keychain-data-with.html
CFAllocatorContext context = { 0, NULL, NULL, NULL, NULL, NULL, NULL, freeKeychainContent, NULL };
CFAllocatorRef allocator = CFAllocatorCreate(NULL, &context);
_password = CFStringCreateWithBytesNoCopy(NULL, passwordData, passwordLength, kCFStringEncodingUTF8, false, allocator);
Expand Down

0 comments on commit 2ab17ae

Please sign in to comment.