01: package ch.ethz.ssh2.packets;
02:
03: /**
04: * PacketUserauthRequestInteractive.
05: *
06: * @author Christian Plattner, plattner@inf.ethz.ch
07: * @version $Id: PacketUserauthRequestInteractive.java,v 1.3 2005/08/24 17:54:09 cplattne Exp $
08: */
09: public class PacketUserauthRequestInteractive {
10: byte[] payload;
11:
12: String userName;
13: String serviceName;
14: String[] submethods;
15:
16: public PacketUserauthRequestInteractive(String serviceName,
17: String user, String[] submethods) {
18: this .serviceName = serviceName;
19: this .userName = user;
20: this .submethods = submethods;
21: }
22:
23: public byte[] getPayload() {
24: if (payload == null) {
25: TypesWriter tw = new TypesWriter();
26: tw.writeByte(Packets.SSH_MSG_USERAUTH_REQUEST);
27: tw.writeString(userName);
28: tw.writeString(serviceName);
29: tw.writeString("keyboard-interactive");
30: tw.writeString(""); // draft-ietf-secsh-newmodes-04.txt says that
31: // the language tag should be empty.
32: tw.writeNameList(submethods);
33:
34: payload = tw.getBytes();
35: }
36: return payload;
37: }
38: }
|