aboutsummaryrefslogtreecommitdiffstats
path: root/src/org
diff options
context:
space:
mode:
authorKenny Root <kenny@the-b.org>2009-12-23 17:01:58 +0000
committerKenny Root <kenny@the-b.org>2009-12-23 17:01:58 +0000
commitf66eef982d9c576059f2c466bca82225be813aea (patch)
tree7df2bfdd644ddead81c7002f0c232d2912535bf8 /src/org
parent80c39c679690b1a536ad10e5421323c46ba780ba (diff)
downloadconnectbot-f66eef982d9c576059f2c466bca82225be813aea.tar.gz
connectbot-f66eef982d9c576059f2c466bca82225be813aea.tar.bz2
connectbot-f66eef982d9c576059f2c466bca82225be813aea.zip
Detect servers that lie about keyboard-interactive
git-svn-id: https://connectbot.googlecode.com/svn/trunk/connectbot@458 df292f66-193f-0410-a5fc-6d59da041ff2
Diffstat (limited to 'src/org')
-rw-r--r--src/org/connectbot/transport/SSH.java6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/org/connectbot/transport/SSH.java b/src/org/connectbot/transport/SSH.java
index fa1d248..7dd101c 100644
--- a/src/org/connectbot/transport/SSH.java
+++ b/src/org/connectbot/transport/SSH.java
@@ -108,6 +108,7 @@ public class SSH extends AbsTransport implements ConnectionMonitor, InteractiveC
private volatile boolean sessionOpen = false;
private boolean pubkeysExhausted = false;
+ private boolean interactiveCanContinue = true;
private Connection connection;
private Session session;
@@ -252,10 +253,12 @@ public class SSH extends AbsTransport implements ConnectionMonitor, InteractiveC
}
pubkeysExhausted = true;
- } else if(connection.isAuthMethodAvailable(host.getUsername(), AUTH_KEYBOARDINTERACTIVE)) {
+ } else if (interactiveCanContinue &&
+ connection.isAuthMethodAvailable(host.getUsername(), AUTH_KEYBOARDINTERACTIVE)) {
// this auth method will talk with us using InteractiveCallback interface
// it blocks until authentication finishes
bridge.outputLine(manager.res.getString(R.string.terminal_auth_ki));
+ interactiveCanContinue = false;
if(connection.authenticateWithKeyboardInteractive(host.getUsername(), this)) {
finishConnection();
} else {
@@ -790,6 +793,7 @@ public class SSH extends AbsTransport implements ConnectionMonitor, InteractiveC
* Handle challenges from keyboard-interactive authentication mode.
*/
public String[] replyToChallenge(String name, String instruction, int numPrompts, String[] prompt, boolean[] echo) {
+ interactiveCanContinue = true;
String[] responses = new String[numPrompts];
for(int i = 0; i < numPrompts; i++) {
// request response from user for each prompt