Mercurial > 510Connectbot
comparison src/ch/ethz/ssh2/packets/PacketUserauthInfoRequest.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 |
---|---|
23 private final String prompt[]; | 23 private final String prompt[]; |
24 private final boolean echo[]; | 24 private final boolean echo[]; |
25 | 25 |
26 public PacketUserauthInfoRequest(byte payload[]) throws IOException { | 26 public PacketUserauthInfoRequest(byte payload[]) throws IOException { |
27 TypesReader tr = new TypesReader(payload); | 27 TypesReader tr = new TypesReader(payload); |
28 | |
29 int packet_type = tr.readByte(); | 28 int packet_type = tr.readByte(); |
30 | 29 |
31 if(packet_type != Packets.SSH_MSG_USERAUTH_INFO_REQUEST) { | 30 if (packet_type != Packets.SSH_MSG_USERAUTH_INFO_REQUEST) { |
32 throw new PacketTypeException(packet_type); | 31 throw new PacketTypeException(packet_type); |
33 } | 32 } |
33 | |
34 name = tr.readString(); | 34 name = tr.readString(); |
35 instruction = tr.readString(); | 35 instruction = tr.readString(); |
36 languageTag = tr.readString(); | 36 languageTag = tr.readString(); |
37 | |
38 numPrompts = tr.readUINT32(); | 37 numPrompts = tr.readUINT32(); |
39 | |
40 prompt = new String[numPrompts]; | 38 prompt = new String[numPrompts]; |
41 echo = new boolean[numPrompts]; | 39 echo = new boolean[numPrompts]; |
42 | 40 |
43 for(int i = 0; i < numPrompts; i++) { | 41 for (int i = 0; i < numPrompts; i++) { |
44 prompt[i] = tr.readString(); | 42 prompt[i] = tr.readString(); |
45 echo[i] = tr.readBoolean(); | 43 echo[i] = tr.readBoolean(); |
46 } | 44 } |
47 | 45 |
48 if(tr.remain() != 0) { | 46 if (tr.remain() != 0) { |
49 throw new PacketFormatException(String.format("Padding in %s", Packets.getMessageName(packet_type))); | 47 throw new PacketFormatException(String.format("Padding in %s", Packets.getMessageName(packet_type))); |
50 } | 48 } |
51 } | 49 } |
52 | 50 |
53 public boolean[] getEcho() { | 51 public boolean[] getEcho() { |