comparison src/ch/ethz/ssh2/packets/PacketNewKeys.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
22 payload = tw.getBytes(); 22 payload = tw.getBytes();
23 } 23 }
24 24
25 public PacketNewKeys(byte payload[]) throws IOException { 25 public PacketNewKeys(byte payload[]) throws IOException {
26 this.payload = payload; 26 this.payload = payload;
27
28 TypesReader tr = new TypesReader(payload); 27 TypesReader tr = new TypesReader(payload);
29
30 int packet_type = tr.readByte(); 28 int packet_type = tr.readByte();
31 29
32 if(packet_type != Packets.SSH_MSG_NEWKEYS) { 30 if (packet_type != Packets.SSH_MSG_NEWKEYS) {
33 throw new PacketTypeException(packet_type); 31 throw new PacketTypeException(packet_type);
34 } 32 }
35 if(tr.remain() != 0) { 33
34 if (tr.remain() != 0) {
36 throw new PacketFormatException(String.format("Padding in %s", Packets.getMessageName(packet_type))); 35 throw new PacketFormatException(String.format("Padding in %s", Packets.getMessageName(packet_type)));
37 } 36 }
38 } 37 }
39 38
40 public byte[] getPayload() { 39 public byte[] getPayload() {