aboutsummaryrefslogtreecommitdiffstats
path: root/Source/KeyChain.m
diff options
context:
space:
mode:
authorrowanbeentje <rowan@beent.je>2009-06-06 23:25:06 +0000
committerrowanbeentje <rowan@beent.je>2009-06-06 23:25:06 +0000
commitab4d3557db6d823275b688ccb7210830f029fd5c (patch)
treecf0ba9733d03868c22d81904d4486ed2de350f4c /Source/KeyChain.m
parent2f5c4b9bab18b54f2d37f4b4a05afa116cfd0c44 (diff)
downloadsequelpro-ab4d3557db6d823275b688ccb7210830f029fd5c.tar.gz
sequelpro-ab4d3557db6d823275b688ccb7210830f029fd5c.tar.bz2
sequelpro-ab4d3557db6d823275b688ccb7210830f029fd5c.zip
Further SSH tunnel improvements:
- Redesigned SSH key authentication dialog - Added ability to add SSH key passphrases to keychain (sharing details with system SSH) - SSH tunnels with keys which fail are now correctly restarted, interacting with the GUI as necessary - GUI interaction now performed on the main thread for increased stability
Diffstat (limited to 'Source/KeyChain.m')
-rw-r--r--Source/KeyChain.m14
1 files changed, 11 insertions, 3 deletions
diff --git a/Source/KeyChain.m b/Source/KeyChain.m
index ec5ee03f..ad0251f7 100644
--- a/Source/KeyChain.m
+++ b/Source/KeyChain.m
@@ -34,6 +34,14 @@
*/
- (void)addPassword:(NSString *)password forName:(NSString *)name account:(NSString *)account
{
+ [self addPassword:password forName:name account:account withLabel:name];
+}
+
+/**
+ * Add the supplied password to the user's Keychain using the supplied name, account, and label.
+ */
+- (void)addPassword:(NSString *)password forName:(NSString *)name account:(NSString *)account withLabel:(NSString *)label;
+{
OSStatus status;
SecTrustedApplicationRef sequelProRef, sequelProHelperRef;
SecAccessRef passwordAccessRef;
@@ -61,8 +69,8 @@
attributes[0].data = "application password";
attributes[0].length = 20;
attributes[1].tag = kSecLabelItemAttr;
- attributes[1].data = (unichar *)[name UTF8String];
- attributes[1].length = strlen([name UTF8String]);
+ attributes[1].data = (unichar *)[label UTF8String];
+ attributes[1].length = strlen([label UTF8String]);
attributes[2].tag = kSecAccountItemAttr;
attributes[2].data = (unichar *)[account UTF8String];
attributes[2].length = strlen([account UTF8String]);
@@ -173,7 +181,7 @@
attributes[0].data = (void *)[account UTF8String];
attributes[0].length = [account length];
- attributes[1].tag = kSecLabelItemAttr;
+ attributes[1].tag = kSecServiceItemAttr;
attributes[1].data = (void *)[name UTF8String];
attributes[1].length = [name length];