comparison src/ch/ethz/ssh2/packets/PacketUserauthRequestNone.java @ 307:071eccdff8ea ganymed

fix java formatting
author Carl Byington <carl@five-ten-sg.com>
date Wed, 30 Jul 2014 14:16:58 -0700
parents 91a31873c42a
children
comparison
equal deleted inserted replaced
305:d2b303406d63 307:071eccdff8ea
26 payload = tw.getBytes(); 26 payload = tw.getBytes();
27 } 27 }
28 28
29 public PacketUserauthRequestNone(byte payload[]) throws IOException { 29 public PacketUserauthRequestNone(byte payload[]) throws IOException {
30 this.payload = payload; 30 this.payload = payload;
31
32 TypesReader tr = new TypesReader(payload); 31 TypesReader tr = new TypesReader(payload);
33
34 int packet_type = tr.readByte(); 32 int packet_type = tr.readByte();
35 33
36 if(packet_type != Packets.SSH_MSG_USERAUTH_REQUEST) { 34 if (packet_type != Packets.SSH_MSG_USERAUTH_REQUEST) {
37 throw new PacketTypeException(packet_type); 35 throw new PacketTypeException(packet_type);
38 } 36 }
37
39 String userName = tr.readString(); 38 String userName = tr.readString();
40 String serviceName = tr.readString(); 39 String serviceName = tr.readString();
41
42 String method = tr.readString(); 40 String method = tr.readString();
43 41
44 if(!method.equals("none")) { 42 if (!method.equals("none")) {
45 throw new IOException(String.format("Unexpected method %s", method)); 43 throw new IOException(String.format("Unexpected method %s", method));
46 } 44 }
47 if(tr.remain() != 0) { 45
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() {