From b1d22ab0eaf73b6c1cd73faabee4e592e6731814 Mon Sep 17 00:00:00 2001 From: jakob Date: Sat, 20 Mar 2010 16:13:02 +0000 Subject: Allow arbitrary questions from SSH. This is necessary to support the keyboard-interactive authentication method, as used by eg. RSA SecurID --- Source/SequelProTunnelAssistant.m | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) 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; } -- cgit v1.2.3