aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjakob <jakob@eggerapps.at>2010-03-20 16:13:02 +0000
committerjakob <jakob@eggerapps.at>2010-03-20 16:13:02 +0000
commitb1d22ab0eaf73b6c1cd73faabee4e592e6731814 (patch)
tree287cb009dea432c694a3ceaa1664b670a4a3650d
parent098f89f05c461a4d99d10c29d766752f7bf7cdcb (diff)
downloadsequelpro-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
-rw-r--r--Source/SequelProTunnelAssistant.m29
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;
}