diff options
author | jakob <jakob@eggerapps.at> | 2010-03-20 16:13:02 +0000 |
---|---|---|
committer | jakob <jakob@eggerapps.at> | 2010-03-20 16:13:02 +0000 |
commit | b1d22ab0eaf73b6c1cd73faabee4e592e6731814 (patch) | |
tree | 287cb009dea432c694a3ceaa1664b670a4a3650d /Source | |
parent | 098f89f05c461a4d99d10c29d766752f7bf7cdcb (diff) | |
download | sequelpro-b1d22ab0eaf73b6c1cd73faabee4e592e6731814.tar.gz sequelpro-b1d22ab0eaf73b6c1cd73faabee4e592e6731814.tar.bz2 sequelpro-b1d22ab0eaf73b6c1cd73faabee4e592e6731814.zip |
Allow arbitrary questions from SSH. This is necessary to support the keyboard-interactive authentication method, as used by eg. RSA SecurID
Diffstat (limited to 'Source')
-rw-r--r-- | Source/SequelProTunnelAssistant.m | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/Source/SequelProTunnelAssistant.m b/Source/SequelProTunnelAssistant.m index 0805df8c..b8d96ec5 100644 --- a/Source/SequelProTunnelAssistant.m +++ b/Source/SequelProTunnelAssistant.m @@ -165,7 +165,36 @@ int main(int argc, const char *argv[]) [pool release]; return 0; } + + // SSH has some other question. Show that directly to the user. This is an attempt to support RSA SecurID + if (argument) { + NSString *passphrase; + + if (!verificationHash) { + NSLog(@"SSH Tunnel: key passphrase authentication required but insufficient details supplied to connect to GUI"); + [pool release]; + return 1; + } + + sequelProTunnel = (SPSSHTunnel *)[NSConnection rootProxyForConnectionWithRegisteredName:connectionName host:nil]; + if (!sequelProTunnel) { + NSLog(@"SSH Tunnel: unable to connect to Sequel Pro to show SSH question"); + [pool release]; + return 1; + } + + passphrase = [sequelProTunnel getPasswordForQuery:argument verificationHash:verificationHash]; + if (!passphrase) { + [pool release]; + return 1; + } + + printf("%s\n", [passphrase UTF8String]); + [pool release]; + return 0; + } + [pool release]; return 1; } |