aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorrowanbeentje <rowan@beent.je>2009-06-13 16:57:56 +0000
committerrowanbeentje <rowan@beent.je>2009-06-13 16:57:56 +0000
commita37764926965179f38e2434b4232cd0c0524a2fa (patch)
tree9bfedfa918cf0ff06065aa533c46b1a41da55d3e
parenta343ff6aa7e5789cd0d35a28caace8e39959e777 (diff)
downloadsequelpro-a37764926965179f38e2434b4232cd0c0524a2fa.tar.gz
sequelpro-a37764926965179f38e2434b4232cd0c0524a2fa.tar.bz2
sequelpro-a37764926965179f38e2434b4232cd0c0524a2fa.zip
- Correct ability to look up passwords for connection names, user names, or databases containing non-alphanumeric characters. Resolves Issue #292.
-rw-r--r--Source/KeyChain.m12
1 files changed, 6 insertions, 6 deletions
diff --git a/Source/KeyChain.m b/Source/KeyChain.m
index ad0251f7..94270cd6 100644
--- a/Source/KeyChain.m
+++ b/Source/KeyChain.m
@@ -111,9 +111,9 @@
status = SecKeychainFindGenericPassword(
NULL, // default keychain
- strlen([name UTF8String]), // length of service name
+ strlen([name UTF8String]), // length of service name (bytes)
[name UTF8String], // service name
- strlen([account UTF8String]), // length of account name
+ strlen([account UTF8String]), // length of account name (bytes)
[account UTF8String], // account name
&passwordLength, // length of password
&passwordData, // pointer to password data
@@ -178,12 +178,12 @@
SecKeychainAttribute attributes[2];
attributes[0].tag = kSecAccountItemAttr;
- attributes[0].data = (void *)[account UTF8String];
- attributes[0].length = [account length];
+ attributes[0].data = (void *)[account UTF8String]; // Account name
+ attributes[0].length = strlen([account UTF8String]); // Length of account name (bytes)
attributes[1].tag = kSecServiceItemAttr;
- attributes[1].data = (void *)[name UTF8String];
- attributes[1].length = [name length];
+ attributes[1].data = (void *)[name UTF8String]; // Service name
+ attributes[1].length = strlen([name UTF8String]); // Length of service name (bytes)
list.count = 2;
list.attr = attributes;