Mercurial > 510Connectbot
diff src/ch/ethz/ssh2/packets/PacketKexInit.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 |
line wrap: on
line diff
--- a/src/ch/ethz/ssh2/packets/PacketKexInit.java Wed Jul 30 12:09:51 2014 -0700 +++ b/src/ch/ethz/ssh2/packets/PacketKexInit.java Wed Jul 30 14:16:58 2014 -0700 @@ -24,7 +24,6 @@ public PacketKexInit(CryptoWishList cwl, SecureRandom rnd) { kp.cookie = new byte[16]; rnd.nextBytes(kp.cookie); - kp.kex_algorithms = cwl.kexAlgorithms; kp.server_host_key_algorithms = cwl.serverHostKeyAlgorithms; kp.encryption_algorithms_client_to_server = cwl.c2s_enc_algos; @@ -33,11 +32,10 @@ kp.mac_algorithms_server_to_client = cwl.s2c_mac_algos; kp.compression_algorithms_client_to_server = cwl.c2s_comp_algos; kp.compression_algorithms_server_to_client = cwl.s2c_comp_algos; - kp.languages_client_to_server = new String[]{""}; - kp.languages_server_to_client = new String[]{""}; + kp.languages_client_to_server = new String[] {""}; + kp.languages_server_to_client = new String[] {""}; kp.first_kex_packet_follows = false; kp.reserved_field1 = 0; - TypesWriter tw = new TypesWriter(); tw.writeByte(Packets.SSH_MSG_KEXINIT); tw.writeBytes(kp.cookie, 0, 16); @@ -58,14 +56,13 @@ public PacketKexInit(byte payload[]) throws IOException { this.payload = payload; - TypesReader tr = new TypesReader(payload); - int packet_type = tr.readByte(); - if(packet_type != Packets.SSH_MSG_KEXINIT) { + if (packet_type != Packets.SSH_MSG_KEXINIT) { throw new PacketTypeException(packet_type); } + kp.cookie = tr.readBytes(16); kp.kex_algorithms = tr.readNameList(); kp.server_host_key_algorithms = tr.readNameList(); @@ -80,7 +77,7 @@ kp.first_kex_packet_follows = tr.readBoolean(); kp.reserved_field1 = tr.readUINT32(); - if(tr.remain() != 0) { + if (tr.remain() != 0) { throw new PacketFormatException(String.format("Padding in %s", Packets.getMessageName(packet_type))); } }