0
|
1
|
|
2 package com.trilead.ssh2.packets;
|
|
3
|
|
4 /**
|
|
5 * PacketUserauthRequestInteractive.
|
|
6 *
|
|
7 * @author Christian Plattner, plattner@trilead.com
|
|
8 * @version $Id: PacketUserauthRequestInteractive.java,v 1.1 2007/10/15 12:49:55 cplattne Exp $
|
|
9 */
|
|
10 public class PacketUserauthRequestInteractive {
|
|
11 byte[] payload;
|
|
12
|
|
13 String userName;
|
|
14 String serviceName;
|
|
15 String[] submethods;
|
|
16
|
|
17 public PacketUserauthRequestInteractive(String serviceName, 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 payload = tw.getBytes();
|
|
34 }
|
|
35
|
|
36 return payload;
|
|
37 }
|
|
38 }
|