aboutsummaryrefslogtreecommitdiffstats
path: root/src/com/trilead/ssh2/packets/PacketChannelAuthAgentReq.java
blob: 95fa3960be6543c38193af8d167f9eb01a9ba6a4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
package com.trilead.ssh2.packets;

/**
 * PacketGlobalAuthAgent.
 *
 * @author Kenny Root, kenny@the-b.org
 * @version $Id$
 */
public class PacketChannelAuthAgentReq
{
	byte[] payload;

	public int recipientChannelID;

	public PacketChannelAuthAgentReq(int recipientChannelID)
	{
		this.recipientChannelID = recipientChannelID;
	}

	public byte[] getPayload()
	{
		if (payload == null)
		{
			TypesWriter tw = new TypesWriter();
			tw.writeByte(Packets.SSH_MSG_CHANNEL_REQUEST);
			tw.writeUINT32(recipientChannelID);
			tw.writeString("auth-agent-req@openssh.com");
			tw.writeBoolean(true); // want reply
			payload = tw.getBytes();
		}
		return payload;
	}
}