Fix client keyboard interactive Project: http://git-wip-us.apache.org/repos/asf/mina-sshd/repo Commit: http://git-wip-us.apache.org/repos/asf/mina-sshd/commit/494f2f11 Tree: http://git-wip-us.apache.org/repos/asf/mina-sshd/tree/494f2f11 Diff: http://git-wip-us.apache.org/repos/asf/mina-sshd/diff/494f2f11
Branch: refs/heads/master Commit: 494f2f110c751f40bc283aca1481a413f4ca2fbc Parents: 4e9d430 Author: Guillaume Nodet <[email protected]> Authored: Sun Jul 21 21:39:53 2013 +0200 Committer: Guillaume Nodet <[email protected]> Committed: Sun Jul 21 21:39:53 2013 +0200 ---------------------------------------------------------------------- .../org/apache/sshd/client/auth/UserAuthKeyboardInteractive.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/mina-sshd/blob/494f2f11/sshd-core/src/main/java/org/apache/sshd/client/auth/UserAuthKeyboardInteractive.java ---------------------------------------------------------------------- diff --git a/sshd-core/src/main/java/org/apache/sshd/client/auth/UserAuthKeyboardInteractive.java b/sshd-core/src/main/java/org/apache/sshd/client/auth/UserAuthKeyboardInteractive.java index f29fe21..d3fa707 100644 --- a/sshd-core/src/main/java/org/apache/sshd/client/auth/UserAuthKeyboardInteractive.java +++ b/sshd-core/src/main/java/org/apache/sshd/client/auth/UserAuthKeyboardInteractive.java @@ -72,7 +72,9 @@ public class UserAuthKeyboardInteractive extends AbstractUserAuth { log.info("Echo: {}", echo); String[] rep = null; - if (num == 1 && password != null && !echo[0] && prompt[0].toLowerCase().startsWith("password:")) { + if (num == 0) { + rep = new String[0]; + } else if (num == 1 && password != null && !echo[0] && prompt[0].toLowerCase().startsWith("password:")) { rep = new String[] { password }; } else { UserInteraction ui = session.getClientFactoryManager().getUserInteraction();
