Mercurial > 510Connectbot
comparison src/ch/ethz/ssh2/packets/PacketUserauthBanner.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 |
---|---|
31 return message; | 31 return message; |
32 } | 32 } |
33 | 33 |
34 public PacketUserauthBanner(byte payload[]) throws IOException { | 34 public PacketUserauthBanner(byte payload[]) throws IOException { |
35 this.payload = payload; | 35 this.payload = payload; |
36 | |
37 TypesReader tr = new TypesReader(payload); | 36 TypesReader tr = new TypesReader(payload); |
38 | |
39 int packet_type = tr.readByte(); | 37 int packet_type = tr.readByte(); |
40 | 38 |
41 if(packet_type != Packets.SSH_MSG_USERAUTH_BANNER) { | 39 if (packet_type != Packets.SSH_MSG_USERAUTH_BANNER) { |
42 throw new PacketTypeException(packet_type); | 40 throw new PacketTypeException(packet_type); |
43 } | 41 } |
42 | |
44 message = tr.readString("UTF-8"); | 43 message = tr.readString("UTF-8"); |
45 String language = tr.readString(); | 44 String language = tr.readString(); |
46 | 45 |
47 if(tr.remain() != 0) { | 46 if (tr.remain() != 0) { |
48 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))); |
49 } | 48 } |
50 } | 49 } |
51 | 50 |
52 public byte[] getPayload() { | 51 public byte[] getPayload() { |