01: package ch.ethz.ssh2.packets;
02:
03: import ch.ethz.ssh2.DHGexParameters;
04:
05: /**
06: * PacketKexDhGexRequest.
07: *
08: * @author Christian Plattner, plattner@inf.ethz.ch
09: * @version $Id: PacketKexDhGexRequest.java,v 1.4 2005/08/24 17:54:09 cplattne Exp $
10: */
11: public class PacketKexDhGexRequest {
12: byte[] payload;
13:
14: int min;
15: int n;
16: int max;
17:
18: public PacketKexDhGexRequest(DHGexParameters para) {
19: this .min = para.getMin_group_len();
20: this .n = para.getPref_group_len();
21: this .max = para.getMax_group_len();
22: }
23:
24: public byte[] getPayload() {
25: if (payload == null) {
26: TypesWriter tw = new TypesWriter();
27: tw.writeByte(Packets.SSH_MSG_KEX_DH_GEX_REQUEST);
28: tw.writeUINT32(min);
29: tw.writeUINT32(n);
30: tw.writeUINT32(max);
31: payload = tw.getBytes();
32: }
33: return payload;
34: }
35: }
|