comparison src/ch/ethz/ssh2/packets/PacketUserauthRequestPublicKey.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
31 payload = tw.getBytes(); 31 payload = tw.getBytes();
32 } 32 }
33 33
34 public PacketUserauthRequestPublicKey(byte payload[]) throws IOException { 34 public PacketUserauthRequestPublicKey(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_REQUEST) { 39 if (packet_type != Packets.SSH_MSG_USERAUTH_REQUEST) {
42 throw new PacketTypeException(packet_type); 40 throw new PacketTypeException(packet_type);
43 } 41 }
42
44 String userName = tr.readString(); 43 String userName = tr.readString();
45 String serviceName = tr.readString(); 44 String serviceName = tr.readString();
46
47 String method = tr.readString(); 45 String method = tr.readString();
48 46
49 if(!method.equals("publickey")) { 47 if (!method.equals("publickey")) {
50 throw new IOException(String.format("Unexpected method %s", method)); 48 throw new IOException(String.format("Unexpected method %s", method));
51 } 49 }
52 if(tr.remain() != 0) { 50
51 if (tr.remain() != 0) {
53 throw new PacketFormatException(String.format("Padding in %s", Packets.getMessageName(packet_type))); 52 throw new PacketFormatException(String.format("Padding in %s", Packets.getMessageName(packet_type)));
54 } 53 }
55 } 54 }
56 55
57 public byte[] getPayload() { 56 public byte[] getPayload() {