comparison src/com/trilead/ssh2/packets/PacketKexDhGexRequest.java @ 0:0ce5cc452d02

initial version
author Carl Byington <carl@five-ten-sg.com>
date Thu, 22 May 2014 10:41:19 -0700
parents
children
comparison
equal deleted inserted replaced
-1:000000000000 0:0ce5cc452d02
1 package com.trilead.ssh2.packets;
2
3 import com.trilead.ssh2.DHGexParameters;
4
5 /**
6 * PacketKexDhGexRequest.
7 *
8 * @author Christian Plattner, plattner@trilead.com
9 * @version $Id: PacketKexDhGexRequest.java,v 1.1 2007/10/15 12:49:55 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
34 return payload;
35 }
36 }