diff cli-agentfwd.c @ 560:52d7301e46bd agent-client

Agent forwarding works
author Matt Johnston <matt@ucc.asn.au>
date Thu, 30 Jul 2009 15:14:33 +0000
parents de3653483ac0
children a900cb1c53fa
line wrap: on
line diff
--- a/cli-agentfwd.c	Wed Jul 29 02:58:33 2009 +0000
+++ b/cli-agentfwd.c	Thu Jul 30 15:14:33 2009 +0000
@@ -226,10 +226,20 @@
 	}
 }
 
+void cli_setup_agent(struct Channel *channel) {
+	if (!getenv("SSH_AUTH_SOCK")) {
+		return;
+	}
+	
+	cli_start_send_channel_request(channel, "[email protected]");
+	/* Don't want replies */
+	buf_putbyte(ses.writepayload, 0);
+	encrypt_packet();
+}
+
 /* Returned keys are prepended to ret_list, which will
    be updated. */
-void load_agent_keys(m_list *ret_list)
-{
+void cli_load_agent_keys(m_list *ret_list) {
 	/* agent_fd will be closed after successful auth */
 	cli_opts.agent_fd = connect_agent();
 	if (cli_opts.agent_fd < 0) {