]> andersk Git - openssh.git/commitdiff
- markus@cvs.openbsd.org 2003/09/23 20:41:11
authordtucker <dtucker>
Thu, 2 Oct 2003 06:17:00 +0000 (06:17 +0000)
committerdtucker <dtucker>
Thu, 2 Oct 2003 06:17:00 +0000 (06:17 +0000)
     [channels.c channels.h clientloop.c]
     move client only agent code to clientloop.c

ChangeLog
channels.c
channels.h
clientloop.c

index 6ecc1d0ff4963ed9c8fd8dda37d7a3e84d1f88dc..e61b6dc0df4cad29d6fe20bdc0f5178a6631f6a4 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -13,6 +13,9 @@
      [progressmeter.c]
      don't print trailing \0; bug #709; Robert.Dahlem@siemens.com
      ok millert/deraadt@
+   - markus@cvs.openbsd.org 2003/09/23 20:41:11
+     [channels.c channels.h clientloop.c]
+     move client only agent code to clientloop.c
 
 20030930
  - (bal) Fix issues in openbsd-compat/realpath.c
index af2ae18b1a829628da2934fbcb2494443468c417..060d0f5071da51549254d2956f891f30ba05703f 100644 (file)
@@ -39,7 +39,7 @@
  */
 
 #include "includes.h"
-RCSID("$OpenBSD: channels.c,v 1.196 2003/09/19 11:31:33 markus Exp $");
+RCSID("$OpenBSD: channels.c,v 1.197 2003/09/23 20:41:11 markus Exp $");
 
 #include "ssh.h"
 #include "ssh1.h"
@@ -2838,46 +2838,3 @@ auth_request_forwarding(void)
        packet_send();
        packet_write_wait();
 }
-
-/* This is called to process an SSH_SMSG_AGENT_OPEN message. */
-
-void
-auth_input_open_request(int type, u_int32_t seq, void *ctxt)
-{
-       Channel *c = NULL;
-       int remote_id, sock;
-
-       /* Read the remote channel number from the message. */
-       remote_id = packet_get_int();
-       packet_check_eom();
-
-       /*
-        * Get a connection to the local authentication agent (this may again
-        * get forwarded).
-        */
-       sock = ssh_get_authentication_socket();
-
-       /*
-        * If we could not connect the agent, send an error message back to
-        * the server. This should never happen unless the agent dies,
-        * because authentication forwarding is only enabled if we have an
-        * agent.
-        */
-       if (sock >= 0) {
-               c = channel_new("", SSH_CHANNEL_OPEN, sock, sock,
-                   -1, 0, 0, 0, "authentication agent connection", 1);
-               c->remote_id = remote_id;
-               c->force_drain = 1;
-       }
-       if (c == NULL) {
-               packet_start(SSH_MSG_CHANNEL_OPEN_FAILURE);
-               packet_put_int(remote_id);
-       } else {
-               /* Send a confirmation to the remote host. */
-               debug("Forwarding authentication connection.");
-               packet_start(SSH_MSG_CHANNEL_OPEN_CONFIRMATION);
-               packet_put_int(remote_id);
-               packet_put_int(c->self);
-       }
-       packet_send();
-}
index bd2e92589c591648f8811a1174245783f0a04288..7d981479b1c826d38254d2aaeebee30bb9f98b53 100644 (file)
@@ -1,4 +1,4 @@
-/*     $OpenBSD: channels.h,v 1.70 2002/06/24 14:33:27 markus Exp $    */
+/*     $OpenBSD: channels.h,v 1.71 2003/09/23 20:41:11 markus Exp $    */
 
 /*
  * Author: Tatu Ylonen <ylo@cs.hut.fi>
@@ -214,7 +214,6 @@ void         deny_input_open(int, u_int32_t, void *);
 /* agent forwarding */
 
 void    auth_request_forwarding(void);
-void    auth_input_open_request(int, u_int32_t, void *);
 
 /* channel close */
 
index d3a32a81ac2f4d45f11035f11bea1609971811ba..e7a7d9fa71754b9fbca8f1a811358bb7a2d20865 100644 (file)
@@ -59,7 +59,7 @@
  */
 
 #include "includes.h"
-RCSID("$OpenBSD: clientloop.c,v 1.114 2003/09/23 20:17:11 markus Exp $");
+RCSID("$OpenBSD: clientloop.c,v 1.115 2003/09/23 20:41:11 markus Exp $");
 
 #include "ssh.h"
 #include "ssh1.h"
@@ -1125,6 +1125,46 @@ client_input_exit_status(int type, u_int32_t seq, void *ctxt)
        /* Flag that we want to exit. */
        quit_pending = 1;
 }
+static void
+client_input_agent_open(int type, u_int32_t seq, void *ctxt)
+{
+       Channel *c = NULL;
+       int remote_id, sock;
+
+       /* Read the remote channel number from the message. */
+       remote_id = packet_get_int();
+       packet_check_eom();
+
+       /*
+        * Get a connection to the local authentication agent (this may again
+        * get forwarded).
+        */
+       sock = ssh_get_authentication_socket();
+
+       /*
+        * If we could not connect the agent, send an error message back to
+        * the server. This should never happen unless the agent dies,
+        * because authentication forwarding is only enabled if we have an
+        * agent.
+        */
+       if (sock >= 0) {
+               c = channel_new("", SSH_CHANNEL_OPEN, sock, sock,
+                   -1, 0, 0, 0, "authentication agent connection", 1);
+               c->remote_id = remote_id;
+               c->force_drain = 1;
+       }
+       if (c == NULL) {
+               packet_start(SSH_MSG_CHANNEL_OPEN_FAILURE);
+               packet_put_int(remote_id);
+       } else {
+               /* Send a confirmation to the remote host. */
+               debug("Forwarding authentication connection.");
+               packet_start(SSH_MSG_CHANNEL_OPEN_CONFIRMATION);
+               packet_put_int(remote_id);
+               packet_put_int(c->self);
+       }
+       packet_send();
+}
 
 static Channel *
 client_request_forwarded_tcpip(const char *request_type, int rchan)
@@ -1360,7 +1400,7 @@ client_init_dispatch_13(void)
        dispatch_set(SSH_SMSG_STDOUT_DATA, &client_input_stdout_data);
 
        dispatch_set(SSH_SMSG_AGENT_OPEN, options.forward_agent ?
-           &auth_input_open_request : &deny_input_open);
+           &client_input_agent_open : &deny_input_open);
        dispatch_set(SSH_SMSG_X11_OPEN, options.forward_x11 ?
            &x11_input_open : &deny_input_open);
 }
This page took 0.05945 seconds and 5 git commands to generate.