aboutsummaryrefslogtreecommitdiffstats
path: root/agent/command-ssh.c
diff options
context:
space:
mode:
authorWerner Koch <[email protected]>2006-11-20 16:49:41 +0000
committerWerner Koch <[email protected]>2006-11-20 16:49:41 +0000
commit5885142c83823b153689acd272103403127a3cd3 (patch)
tree514e8325f9201775785b3249b176e9ac051776ff /agent/command-ssh.c
parentNo need for thsi script. Use ./autogen.sh --build-w32 instead. (diff)
downloadgnupg-5885142c83823b153689acd272103403127a3cd3.tar.gz
gnupg-5885142c83823b153689acd272103403127a3cd3.zip
Made some PIN pads work.
Some cleanups for 64 bit CPUs.
Diffstat (limited to 'agent/command-ssh.c')
-rw-r--r--agent/command-ssh.c40
1 files changed, 15 insertions, 25 deletions
diff --git a/agent/command-ssh.c b/agent/command-ssh.c
index 1adf8ba94..b44dc2140 100644
--- a/agent/command-ssh.c
+++ b/agent/command-ssh.c
@@ -2329,7 +2329,7 @@ ssh_identity_register (ctrl_t ctrl, gcry_sexp_t key, int ttl)
unsigned char key_grip_raw[20];
char key_grip[41];
unsigned char *buffer = NULL;
- unsigned int buffer_n;
+ size_t buffer_n;
char *description = NULL;
char *comment = NULL;
unsigned int i;
@@ -2821,32 +2821,28 @@ ssh_request_process (ctrl_t ctrl, estream_t stream_sock)
/* Start serving client on SOCK_CLIENT. */
void
-start_command_handler_ssh (int sock_client)
+start_command_handler_ssh (ctrl_t ctrl, int sock_client)
{
- struct server_control_s ctrl;
estream_t stream_sock;
gpg_error_t err;
int ret;
/* Setup control structure. */
-
- memset (&ctrl, 0, sizeof (ctrl));
- agent_init_default_ctrl (&ctrl);
- ctrl.connection_fd = sock_client;
+ ctrl->connection_fd = sock_client;
/* Because the ssh protocol does not send us information about the
the current TTY setting, we resort here to use those from startup
or those explictly set. */
- if (!ctrl.display && opt.startup_display)
- ctrl.display = strdup (opt.startup_display);
- if (!ctrl.ttyname && opt.startup_ttyname)
- ctrl.ttyname = strdup (opt.startup_ttyname);
- if (!ctrl.ttytype && opt.startup_ttytype)
- ctrl.ttytype = strdup (opt.startup_ttytype);
- if (!ctrl.lc_ctype && opt.startup_lc_ctype)
- ctrl.lc_ctype = strdup (opt.startup_lc_ctype);
- if (!ctrl.lc_messages && opt.startup_lc_messages)
- ctrl.lc_messages = strdup (opt.startup_lc_messages);
+ if (!ctrl->display && opt.startup_display)
+ ctrl->display = strdup (opt.startup_display);
+ if (!ctrl->ttyname && opt.startup_ttyname)
+ ctrl->ttyname = strdup (opt.startup_ttyname);
+ if (!ctrl->ttytype && opt.startup_ttytype)
+ ctrl->ttytype = strdup (opt.startup_ttytype);
+ if (!ctrl->lc_ctype && opt.startup_lc_ctype)
+ ctrl->lc_ctype = strdup (opt.startup_lc_ctype);
+ if (!ctrl->lc_messages && opt.startup_lc_messages)
+ ctrl->lc_messages = strdup (opt.startup_lc_messages);
/* Create stream from socket. */
@@ -2870,20 +2866,14 @@ start_command_handler_ssh (int sock_client)
}
/* Main processing loop. */
- while ( !ssh_request_process (&ctrl, stream_sock) )
+ while ( !ssh_request_process (ctrl, stream_sock) )
;
/* Reset the SCD in case it has been used. */
- agent_reset_scd (&ctrl);
+ agent_reset_scd (ctrl);
out:
if (stream_sock)
es_fclose (stream_sock);
-
- free (ctrl.display);
- free (ctrl.ttyname);
- free (ctrl.ttytype);
- free (ctrl.lc_ctype);
- free (ctrl.lc_messages);
}