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