Changeset 64

Show
Ignore:
Timestamp:
11/17/05 09:54:12 (3 years ago)
Author:
bart
Message:

Merged tim's branch with the trunk.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/Controller.m

    r63 r64  
    366366        CFStringRef enteredPassphrase; 
    367367 
    368         NSString *passphrase, *firstQuestion
     368        NSString *passphrase, *firstQuestion, *secondQuestion
    369369        NSMutableDictionary *dict; 
     370        BOOL consultKeychain = NO; 
    370371 
    371372        ProcessSerialNumber focusSerialNumber; 
     
    384385 
    385386        firstQuestion = @"Enter passphrase for "; 
     387        secondQuestion = @"'s password: "; 
    386388 
    387389        if([question hasPrefix:firstQuestion]) 
    388390        { 
     391                consultKeychain = YES; 
    389392                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        { 
    391429                serviceName = "SSHKeychain"; 
    392430 
     
    410448                if(!interaction) 
    411449                { 
    412                         NSLog(@"NO INTERACTION); 
    413450                        SecKeychainSetUserInteractionAllowed(NO); 
    414451                        status = SecKeychainFindGenericPassword(nil, strlen(serviceName), serviceName, strlen(accountName), accountName, &passwordLength, (void **)&kcPassword, nil); 
     
    447484                [dict setObject:question forKey:(NSString *)kCFUserNotificationAlertMessageKey]; 
    448485 
    449                 if([question hasPrefix:firstQuestion]
     486                if(consultKeychain
    450487                { 
    451488                        [dict setObject:local(@"AddPassphraseToAppleKeychain") forKey:(NSString *)kCFUserNotificationCheckBoxTitlesKey]; 
     
    497534                        CFRelease(notification); 
    498535                         
    499                         if(([question hasPrefix:firstQuestion]) && (response & CFUserNotificationCheckBoxChecked(0))) 
     536                        if(consultKeychain && (response & CFUserNotificationCheckBoxChecked(0))) 
    500537                        { 
    501                                 accountName = [[[[question substringFromIndex:[firstQuestion length]] componentsSeparatedByString:@": "] objectAtIndex:0] cString]; 
    502538                                serviceName = "SSHKeychain"; 
    503539                                 
  • trunk/English.lproj/Localizable.strings

    r1 r64  
    110110"SSH Keys" = "SSH Keys"; 
    111111"Tunnels" = "Tunnels"; 
     112 
     113"UnknownHostKey" = "Unknown Host Key"; 
  • trunk/English.lproj/Preferences.nib/classes.nib

    r35 r64  
    8787            LANGUAGE = ObjC;  
    8888            OUTLETS = { 
     89                addInteractivePasswordsToKeychain = id;  
    8990                addKeysOnConnection = id;  
    9091                askForConfirmation = id;  
  • trunk/English.lproj/Preferences.nib/info.nib

    r35 r64  
    1010                <string>304 452 416 112 0 0 1024 746 </string> 
    1111                <key>640</key> 
    12                 <string>75 34 495 343 0 0 1024 746 </string> 
     12                <string>264 325 495 360 0 0 1024 746 </string> 
    1313                <key>722</key> 
    1414                <string>446 468 495 234 0 0 1440 878 </string> 
     
    2626                <string>446 468 495 234 0 0 1440 878 </string> 
    2727                <key>909</key> 
    28                 <string>264 391 495 234 0 0 1024 746 </string> 
     28                <string>264 396 495 234 0 0 1024 746 </string> 
    2929        </dict> 
    3030        <key>IBFramework Version</key> 
     
    3232        <key>IBOpenObjects</key> 
    3333        <array> 
     34                <integer>640</integer> 
    3435                <integer>909</integer> 
    35                 <integer>640</integer> 
    3636        </array> 
    3737        <key>IBSystem Version</key> 
    38         <string>7U16</string> 
     38        <string>7W98</string> 
    3939</dict> 
    4040</plist> 
  • trunk/Libs/SSHTunnel.m

    r61 r64  
    254254                [arguments addObject:@"-g"]; 
    255255        } 
     256         
     257        [arguments addObject:@"-o"]; 
     258        [arguments addObject:@"PreferredAuthentications=hostbased,publickey,password,keyboard-interactive"]; 
    256259         
    257260        if((tunnelUser) && (![tunnelUser isEqualToString:@""])) 
  • trunk/PreferenceController.h

    r41 r64  
    1919extern NSString *CheckScreensaverIntervalString; 
    2020extern NSString *KeyTimeoutString; 
     21extern NSString *AddInteractivePasswordString; 
    2122 
    2223@interface PreferenceController : NSObject  
  • trunk/PreferenceController.m

    r41 r64  
    1717NSString *CheckScreensaverIntervalString = @"Check Screensaver Interval"; 
    1818NSString *KeyTimeoutString = @"Key Timeout"; 
     19NSString *AddInteractivePasswordString = @"Add Interactive Passwords to Keychain"; 
    1920 
    2021PreferenceController *sharedPreferenceController = nil; 
  • trunk/PreferenceViews/SecurityView.h

    r35 r64  
    77 
    88        /* Custom Security Settings View. */ 
    9         IBOutlet id addKeysOnConnection, askForConfirmation, followKeychain, onScreensaver, onSleep; 
     9        IBOutlet id addInteractivePasswordsToKeychain, addKeysOnConnection, askForConfirmation, followKeychain, onScreensaver, onSleep; 
    1010        IBOutlet id minutesOfSleep, minutesOfSleepTextfield, checkScreensaverInterval, checkScreensaverIntervalTextfield; 
    1111        IBOutlet id keyTimeout, keyTimeoutTextfield; 
  • trunk/PreferenceViews/SecurityView.m

    r41 r64  
    1717        [addKeysOnConnection setState:[[NSUserDefaults standardUserDefaults] boolForKey:AddKeysOnConnectionString]]; 
    1818        [askForConfirmation setState:[[NSUserDefaults standardUserDefaults] boolForKey:AskForConfirmationString]]; 
     19        [addInteractivePasswordsToKeychain setState:[[NSUserDefaults standardUserDefaults] boolForKey:AddInteractivePasswordString]]; 
    1920 
    2021        [onSleep selectItemAtIndex:[onSleep indexOfItemWithTag:[prefs integerForKey:OnSleepString]]]; 
     
    7677                [prefs setBool:[addKeysOnConnection state] forKey:AddKeysOnConnectionString]; 
    7778                [prefs setBool:[askForConfirmation state] forKey:AskForConfirmationString]; 
     79                [prefs setBool:[addInteractivePasswordsToKeychain state] forKey:AddInteractivePasswordString]; 
    7880 
    7981                [prefs setInteger:[[onSleep selectedItem] tag] forKey:OnSleepString]; 
     
    9193                [prefs setBool:YES forKey:AddKeysOnConnectionString]; 
    9294                [prefs setBool:NO forKey:AskForConfirmationString]; 
     95                [prefs setBool:NO forKey:AddInteractivePasswordString]; 
    9396 
    9497                [prefs setInteger:1 forKey:OnSleepString]; 
     
    144147                [prefs setBool:YES forKey:AddKeysOnConnectionString]; 
    145148                [prefs setBool:NO forKey:AskForConfirmationString]; 
     149                [prefs setBool:NO forKey:AddInteractivePasswordString]; 
    146150 
    147151                [prefs setInteger:1 forKey:OnSleepString]; 
     
    156160                [addKeysOnConnection setState:[prefs boolForKey:AddKeysOnConnectionString]]; 
    157161                [askForConfirmation setState:[prefs boolForKey:AskForConfirmationString]]; 
     162                [addInteractivePasswordsToKeychain setState:[prefs boolForKey:AddInteractivePasswordString]]; 
    158163 
    159164                [onSleep selectItemAtIndex:[onSleep indexOfItemWithTag:[prefs integerForKey:OnSleepString]]];