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