From ab4d3557db6d823275b688ccb7210830f029fd5c Mon Sep 17 00:00:00 2001 From: rowanbeentje Date: Sat, 6 Jun 2009 23:25:06 +0000 Subject: 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 --- Source/KeyChain.m | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) (limited to 'Source/KeyChain.m') diff --git a/Source/KeyChain.m b/Source/KeyChain.m index ec5ee03f..ad0251f7 100644 --- a/Source/KeyChain.m +++ b/Source/KeyChain.m @@ -33,6 +33,14 @@ * Add the supplied password to the user's Keychain using the supplied name and account. */ - (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; @@ -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]; -- cgit v1.2.3