1 2 package ch.ethz.ssh2.packets; 3 4 import java.io.IOException ; 5 6 import java.math.BigInteger ; 7 8 14 public class PacketKexDhGexReply 15 { 16 byte[] payload; 17 18 byte[] hostKey; 19 BigInteger f; 20 byte[] signature; 21 22 public PacketKexDhGexReply(byte payload[], int off, int len) throws IOException  23 { 24 this.payload = new byte[len]; 25 System.arraycopy(payload, off, this.payload, 0, len); 26 27 TypesReader tr = new TypesReader(payload, off, len); 28 29 int packet_type = tr.readByte(); 30 31 if (packet_type != Packets.SSH_MSG_KEX_DH_GEX_REPLY) 32 throw new IOException ("This is not a SSH_MSG_KEX_DH_GEX_REPLY! (" + packet_type + ")"); 33 34 hostKey = tr.readByteString(); 35 f = tr.readMPINT(); 36 signature = tr.readByteString(); 37 38 if (tr.remain() != 0) 39 throw new IOException ("PADDING IN SSH_MSG_KEX_DH_GEX_REPLY!"); 40 } 41 42 public BigInteger getF() 43 { 44 return f; 45 } 46 47 public byte[] getHostKey() 48 { 49 return hostKey; 50 } 51 52 public byte[] getSignature() 53 { 54 return signature; 55 } 56 } 57 | Popular Tags |