comparison src/ch/ethz/ssh2/InteractiveCallback.java @ 308:42b15aaa7ac7 ganymed

merge
author Carl Byington <carl@five-ten-sg.com>
date Wed, 30 Jul 2014 14:21:50 -0700
parents 071eccdff8ea
children
comparison
equal deleted inserted replaced
306:90e47d99ea54 308:42b15aaa7ac7
5 package ch.ethz.ssh2; 5 package ch.ethz.ssh2;
6 6
7 /** 7 /**
8 * An <code>InteractiveCallback</code> is used to respond to challenges sent 8 * An <code>InteractiveCallback</code> is used to respond to challenges sent
9 * by the server if authentication mode "keyboard-interactive" is selected. 9 * by the server if authentication mode "keyboard-interactive" is selected.
10 * 10 *
11 * @see Connection#authenticateWithKeyboardInteractive(String, 11 * @see Connection#authenticateWithKeyboardInteractive(String,
12 * String[], InteractiveCallback) 12 * String[], InteractiveCallback)
13 * 13 *
14 * @author Christian Plattner 14 * @author Christian Plattner
15 * @version 2.50, 03/15/10 15 * @version 2.50, 03/15/10
16 */ 16 */
17 17
18 public interface InteractiveCallback 18 public interface InteractiveCallback {
19 { 19 /**
20 /** 20 * This callback interface is used during a "keyboard-interactive"
21 * This callback interface is used during a "keyboard-interactive" 21 * authentication. Every time the server sends a set of challenges (however,
22 * authentication. Every time the server sends a set of challenges (however, 22 * most often just one challenge at a time), this callback function will be
23 * most often just one challenge at a time), this callback function will be 23 * called to give your application a chance to talk to the user and to
24 * called to give your application a chance to talk to the user and to 24 * determine the response(s).
25 * determine the response(s). 25 * <p>
26 * <p> 26 * Some copy-paste information from the standard: a command line interface
27 * Some copy-paste information from the standard: a command line interface 27 * (CLI) client SHOULD print the name and instruction (if non-empty), adding
28 * (CLI) client SHOULD print the name and instruction (if non-empty), adding 28 * newlines. Then for each prompt in turn, the client SHOULD display the
29 * newlines. Then for each prompt in turn, the client SHOULD display the 29 * prompt and read the user input. The name and instruction fields MAY be
30 * prompt and read the user input. The name and instruction fields MAY be 30 * empty strings, the client MUST be prepared to handle this correctly. The
31 * empty strings, the client MUST be prepared to handle this correctly. The 31 * prompt field(s) MUST NOT be empty strings.
32 * prompt field(s) MUST NOT be empty strings. 32 * <p>
33 * <p> 33 * Please refer to draft-ietf-secsh-auth-kbdinteract-XX.txt for the details.
34 * Please refer to draft-ietf-secsh-auth-kbdinteract-XX.txt for the details. 34 * <p>
35 * <p> 35 * Note: clients SHOULD use control character filtering as discussed in
36 * Note: clients SHOULD use control character filtering as discussed in 36 * RFC4251 to avoid attacks by including
37 * RFC4251 to avoid attacks by including 37 * terminal control characters in the fields to be displayed.
38 * terminal control characters in the fields to be displayed. 38 *
39 * 39 * @param name
40 * @param name 40 * the name String sent by the server.
41 * the name String sent by the server. 41 * @param instruction
42 * @param instruction 42 * the instruction String sent by the server.
43 * the instruction String sent by the server. 43 * @param numPrompts
44 * @param numPrompts 44 * number of prompts - may be zero (in this case, you should just
45 * number of prompts - may be zero (in this case, you should just 45 * return a String array of length zero).
46 * return a String array of length zero). 46 * @param prompt
47 * @param prompt 47 * an array (length <code>numPrompts</code>) of Strings
48 * an array (length <code>numPrompts</code>) of Strings 48 * @param echo
49 * @param echo 49 * an array (length <code>numPrompts</code>) of booleans. For
50 * an array (length <code>numPrompts</code>) of booleans. For 50 * each prompt, the corresponding echo field indicates whether or
51 * each prompt, the corresponding echo field indicates whether or 51 * not the user input should be echoed as characters are typed.
52 * not the user input should be echoed as characters are typed. 52 * @return an array of reponses - the array size must match the parameter
53 * @return an array of reponses - the array size must match the parameter 53 * <code>numPrompts</code>.
54 * <code>numPrompts</code>. 54 */
55 */ 55 public String[] replyToChallenge(String name, String instruction, int numPrompts, String[] prompt, boolean[] echo)
56 public String[] replyToChallenge(String name, String instruction, int numPrompts, String[] prompt, boolean[] echo) 56 throws Exception;
57 throws Exception;
58 } 57 }