diff options
author | rowanbeentje <rowan@beent.je> | 2009-05-28 01:14:26 +0000 |
---|---|---|
committer | rowanbeentje <rowan@beent.je> | 2009-05-28 01:14:26 +0000 |
commit | 1979b7c94813e8278b4b7616aeafecd5a406f7a1 (patch) | |
tree | 108669de904ec9ee85806e5f91ec17b23cda1f7e /Source/SPSSHTunnel.h | |
parent | a316ba498cf3300d05c8c2ba3223fa2c625d1717 (diff) | |
download | sequelpro-1979b7c94813e8278b4b7616aeafecd5a406f7a1.tar.gz sequelpro-1979b7c94813e8278b4b7616aeafecd5a406f7a1.tar.bz2 sequelpro-1979b7c94813e8278b4b7616aeafecd5a406f7a1.zip |
Add support for SSH tunnels, improve password security, and tweaks:
- Implementation of a new SPSSHTunnel class, designed to closely integrate SSH tunnels within Sequel Pro.
- Integration of SPSSHTunnel - new connection methods using callbacks, and CMMCPConnection integration
- Keychain class upgrade to include the new SPSSHTunnel keychain password helper on the trusted access list for new passwords
- Keychain passwords are now held in memory/UI for only as long as necessary, increasing password security
- Updated interface to enable/add SSH tunnel functionality
- Remove old SSHTunnel class
- Addition of new target for the SSH Tunnel password assistant, addition as a dependency of the main target, and addition to build script to copy into resources directory
- Fix a keychain password deletion crash
Diffstat (limited to 'Source/SPSSHTunnel.h')
-rw-r--r-- | Source/SPSSHTunnel.h | 54 |
1 files changed, 54 insertions, 0 deletions
diff --git a/Source/SPSSHTunnel.h b/Source/SPSSHTunnel.h new file mode 100644 index 00000000..91bd08de --- /dev/null +++ b/Source/SPSSHTunnel.h @@ -0,0 +1,54 @@ +#import <Cocoa/Cocoa.h> + +enum spsshtunnel_states +{ + SPSSH_STATE_IDLE = 0, + SPSSH_STATE_CONNECTING = 1, + SPSSH_STATE_WAITING_FOR_AUTH = 2, + SPSSH_STATE_CONNECTED = 3 +}; + +enum spsshtunnel_password_modes +{ + SPSSH_PASSWORD_USES_KEYCHAIN = 0, + SPSSH_PASSWORD_ASKS_UI = 1 +}; + + +@interface SPSSHTunnel : NSObject +{ + NSTask *task; + NSPipe *standardError; + id delegate; + SEL stateChangeSelector; + NSConnection *passwordConnection; + NSString *lastError; + NSString *passwordConnectionName; + NSString *passwordConnectionVerifyHash; + NSString *sshHost; + NSString *sshLogin; + NSString *remoteHost; + NSString *password; + NSString *keychainName; + NSString *keychainAccount; + BOOL passwordInKeychain; + int sshPort; + int remotePort; + int localPort; + int connectionState; +} + +- (id) initToHost:(NSString *) theHost port:(int) thePort login:(NSString *) theLogin tunnellingToPort:(int) targetPort onHost:(NSString *) targetHost; +- (BOOL) setConnectionStateChangeSelector:(SEL)theStateChangeSelector delegate:(id)theDelegate; +- (BOOL) setPassword:(NSString *)thePassword; +- (BOOL) setPasswordKeychainName:(NSString *)theName account:(NSString *)theAccount; +- (int) state; +- (NSString *) lastError; +- (int) localPort; +- (void) connect; +- (void) launchTask:(id) dummy; +- (void)disconnect; +- (void) standardErrorHandler:(NSNotification*)aNotification; +- (NSString *) getPasswordWithVerificationHash:(NSString *)theHash; + +@end |