Changeset 64
- Timestamp:
- 11/17/05 09:54:12 (3 years ago)
- Files:
-
- trunk/Controller.m (modified) (5 diffs)
- trunk/English.lproj/Localizable.strings (modified) (1 diff)
- trunk/English.lproj/Preferences.nib/classes.nib (modified) (1 diff)
- trunk/English.lproj/Preferences.nib/info.nib (modified) (3 diffs)
- trunk/English.lproj/Preferences.nib/keyedobjects.nib (modified) (previous)
- trunk/English.lproj/Preferences.nib/objects.nib (modified) (previous)
- trunk/Libs/SSHTunnel.m (modified) (1 diff)
- trunk/PreferenceController.h (modified) (1 diff)
- trunk/PreferenceController.m (modified) (1 diff)
- trunk/PreferenceViews/SecurityView.h (modified) (1 diff)
- trunk/PreferenceViews/SecurityView.m (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/Controller.m
r63 r64 366 366 CFStringRef enteredPassphrase; 367 367 368 NSString *passphrase, *firstQuestion ;368 NSString *passphrase, *firstQuestion, *secondQuestion; 369 369 NSMutableDictionary *dict; 370 BOOL consultKeychain = NO; 370 371 371 372 ProcessSerialNumber focusSerialNumber; … … 384 385 385 386 firstQuestion = @"Enter passphrase for "; 387 secondQuestion = @"'s password: "; 386 388 387 389 if([question hasPrefix:firstQuestion]) 388 390 { 391 consultKeychain = YES; 389 392 accountName = [[[[question substringFromIndex:[firstQuestion length]] 390 componentsSeparatedByString:@": "] objectAtIndex:0] cString]; 393 componentsSeparatedByString:@": "] objectAtIndex:0] cString]; 394 } 395 else 396 { 397 if ([question hasSuffix:secondQuestion]) 398 { 399 consultKeychain = [[NSUserDefaults standardUserDefaults] boolForKey:AddInteractivePasswordString]; 400 accountName = [[[question componentsSeparatedByString:@"'s"] objectAtIndex:0] cString]; 401 } 402 else 403 { 404 if ([question hasPrefix:@"The authenticity of host"]) 405 { 406 [passphraseIsRequestedLock lock]; 407 passphraseIsRequested = NO; 408 [passphraseIsRequestedLock unlock]; 409 if (interaction) 410 { 411 int r = NSRunAlertPanel(local(@"UnknownHostKey"), 412 question, 413 local(@"No"), 414 local(@"Yes"), 415 nil); 416 NSString *response = ( r == NSAlertAlternateReturn) ? @"yes" : @"no"; 417 return response; 418 } 419 else 420 { 421 return @"no"; 422 } 423 } 424 } 425 } 426 427 if(consultKeychain) 428 { 391 429 serviceName = "SSHKeychain"; 392 430 … … 410 448 if(!interaction) 411 449 { 412 NSLog(@"NO INTERACTION);413 450 SecKeychainSetUserInteractionAllowed(NO); 414 451 status = SecKeychainFindGenericPassword(nil, strlen(serviceName), serviceName, strlen(accountName), accountName, &passwordLength, (void **)&kcPassword, nil); … … 447 484 [dict setObject:question forKey:(NSString *)kCFUserNotificationAlertMessageKey]; 448 485 449 if( [question hasPrefix:firstQuestion])486 if(consultKeychain) 450 487 { 451 488 [dict setObject:local(@"AddPassphraseToAppleKeychain") forKey:(NSString *)kCFUserNotificationCheckBoxTitlesKey]; … … 497 534 CFRelease(notification); 498 535 499 if( ([question hasPrefix:firstQuestion])&& (response & CFUserNotificationCheckBoxChecked(0)))536 if(consultKeychain && (response & CFUserNotificationCheckBoxChecked(0))) 500 537 { 501 accountName = [[[[question substringFromIndex:[firstQuestion length]] componentsSeparatedByString:@": "] objectAtIndex:0] cString];502 538 serviceName = "SSHKeychain"; 503 539 trunk/English.lproj/Localizable.strings
r1 r64 110 110 "SSH Keys" = "SSH Keys"; 111 111 "Tunnels" = "Tunnels"; 112 113 "UnknownHostKey" = "Unknown Host Key"; trunk/English.lproj/Preferences.nib/classes.nib
r35 r64 87 87 LANGUAGE = ObjC; 88 88 OUTLETS = { 89 addInteractivePasswordsToKeychain = id; 89 90 addKeysOnConnection = id; 90 91 askForConfirmation = id; trunk/English.lproj/Preferences.nib/info.nib
r35 r64 10 10 <string>304 452 416 112 0 0 1024 746 </string> 11 11 <key>640</key> 12 <string> 75 34 495 3430 0 1024 746 </string>12 <string>264 325 495 360 0 0 1024 746 </string> 13 13 <key>722</key> 14 14 <string>446 468 495 234 0 0 1440 878 </string> … … 26 26 <string>446 468 495 234 0 0 1440 878 </string> 27 27 <key>909</key> 28 <string>264 39 1495 234 0 0 1024 746 </string>28 <string>264 396 495 234 0 0 1024 746 </string> 29 29 </dict> 30 30 <key>IBFramework Version</key> … … 32 32 <key>IBOpenObjects</key> 33 33 <array> 34 <integer>640</integer> 34 35 <integer>909</integer> 35 <integer>640</integer>36 36 </array> 37 37 <key>IBSystem Version</key> 38 <string>7 U16</string>38 <string>7W98</string> 39 39 </dict> 40 40 </plist> trunk/Libs/SSHTunnel.m
r61 r64 254 254 [arguments addObject:@"-g"]; 255 255 } 256 257 [arguments addObject:@"-o"]; 258 [arguments addObject:@"PreferredAuthentications=hostbased,publickey,password,keyboard-interactive"]; 256 259 257 260 if((tunnelUser) && (![tunnelUser isEqualToString:@""])) trunk/PreferenceController.h
r41 r64 19 19 extern NSString *CheckScreensaverIntervalString; 20 20 extern NSString *KeyTimeoutString; 21 extern NSString *AddInteractivePasswordString; 21 22 22 23 @interface PreferenceController : NSObject trunk/PreferenceController.m
r41 r64 17 17 NSString *CheckScreensaverIntervalString = @"Check Screensaver Interval"; 18 18 NSString *KeyTimeoutString = @"Key Timeout"; 19 NSString *AddInteractivePasswordString = @"Add Interactive Passwords to Keychain"; 19 20 20 21 PreferenceController *sharedPreferenceController = nil; trunk/PreferenceViews/SecurityView.h
r35 r64 7 7 8 8 /* Custom Security Settings View. */ 9 IBOutlet id add KeysOnConnection, askForConfirmation, followKeychain, onScreensaver, onSleep;9 IBOutlet id addInteractivePasswordsToKeychain, addKeysOnConnection, askForConfirmation, followKeychain, onScreensaver, onSleep; 10 10 IBOutlet id minutesOfSleep, minutesOfSleepTextfield, checkScreensaverInterval, checkScreensaverIntervalTextfield; 11 11 IBOutlet id keyTimeout, keyTimeoutTextfield; trunk/PreferenceViews/SecurityView.m
r41 r64 17 17 [addKeysOnConnection setState:[[NSUserDefaults standardUserDefaults] boolForKey:AddKeysOnConnectionString]]; 18 18 [askForConfirmation setState:[[NSUserDefaults standardUserDefaults] boolForKey:AskForConfirmationString]]; 19 [addInteractivePasswordsToKeychain setState:[[NSUserDefaults standardUserDefaults] boolForKey:AddInteractivePasswordString]]; 19 20 20 21 [onSleep selectItemAtIndex:[onSleep indexOfItemWithTag:[prefs integerForKey:OnSleepString]]]; … … 76 77 [prefs setBool:[addKeysOnConnection state] forKey:AddKeysOnConnectionString]; 77 78 [prefs setBool:[askForConfirmation state] forKey:AskForConfirmationString]; 79 [prefs setBool:[addInteractivePasswordsToKeychain state] forKey:AddInteractivePasswordString]; 78 80 79 81 [prefs setInteger:[[onSleep selectedItem] tag] forKey:OnSleepString]; … … 91 93 [prefs setBool:YES forKey:AddKeysOnConnectionString]; 92 94 [prefs setBool:NO forKey:AskForConfirmationString]; 95 [prefs setBool:NO forKey:AddInteractivePasswordString]; 93 96 94 97 [prefs setInteger:1 forKey:OnSleepString]; … … 144 147 [prefs setBool:YES forKey:AddKeysOnConnectionString]; 145 148 [prefs setBool:NO forKey:AskForConfirmationString]; 149 [prefs setBool:NO forKey:AddInteractivePasswordString]; 146 150 147 151 [prefs setInteger:1 forKey:OnSleepString]; … … 156 160 [addKeysOnConnection setState:[prefs boolForKey:AddKeysOnConnectionString]]; 157 161 [askForConfirmation setState:[prefs boolForKey:AskForConfirmationString]]; 162 [addInteractivePasswordsToKeychain setState:[prefs boolForKey:AddInteractivePasswordString]]; 158 163 159 164 [onSleep selectItemAtIndex:[onSleep indexOfItemWithTag:[prefs integerForKey:OnSleepString]]];
