Index: SshCache.java =================================================================== --- SshCache.java (revision 601711) +++ SshCache.java (working copy) @@ -36,6 +36,7 @@ import com.jcraft.jsch.JSchException; import com.jcraft.jsch.Session; import com.jcraft.jsch.UserInfo; +import com.jcraft.jsch.UIKeyboardInteractive; /** * a class to cache SSH Connections and Channel for the SSH Repository each session is defined by @@ -341,7 +342,7 @@ /** * feeds in password silently into JSch */ - private static class CfUserInfo implements UserInfo { + private static class CfUserInfo implements UserInfo, UIKeyboardInteractive { private String userPassword; @@ -404,5 +405,28 @@ } return pemPassword; } + /** + * Implementation of UIKeyboardInteractive#promptKeyboardInteractive. + * @param destination not used. + * @param name not used. + * @param instruction not used. + * @param prompt the method checks if this is one in length. + * @param echo the method checks if the first element is false. + * @return the password in an size one array if there is a password + * and if the prompt and echo checks pass. + */ + public String[] promptKeyboardInteractive(String destination, + String name, + String instruction, + String[] prompt, + boolean[] echo) { + if (prompt.length != 1 || echo[0] || this.userPassword == null) { + return null; + } + String[] response = new String[1]; + response[0] = this.userPassword; + + return response; + } } }