summaryrefslogtreecommitdiff
path: root/ssh-agent.c
diff options
context:
space:
mode:
authorBen Lindstrom <mouring@eviladmin.org>2001-06-25 05:01:22 +0000
committerBen Lindstrom <mouring@eviladmin.org>2001-06-25 05:01:22 +0000
commitbba81213b972ce15fbbaca60b9ffabb42371ce8f (patch)
treee6bd40752969f2b93d179cfb9aaae9074ca45956 /ssh-agent.c
parent34f91883a6f3123656b0a8017d68b658f7cf2403 (diff)
- itojun@cvs.openbsd.org 2001/06/23 15:12:20
[auth1.c auth2.c auth2-chall.c authfd.c authfile.c auth-rhosts.c canohost.c channels.c cipher.c clientloop.c deattack.c dh.c hostfile.c kex.c kexdh.c kexgex.c key.c nchan.c packet.c radix.c readpass.c scp.c servconf.c serverloop.c session.c sftp.c sftp-client.c sftp-glob.c sftp-int.c sftp-server.c ssh-add.c ssh-agent.c ssh.c sshconnect1.c sshconnect2.c sshconnect.c sshd.c ssh-keygen.c ssh-keyscan.c] more strict prototypes. raise warning level in Makefile.inc. markus ok'ed TODO; cleanup headers
Diffstat (limited to 'ssh-agent.c')
-rw-r--r--ssh-agent.c42
1 files changed, 20 insertions, 22 deletions
diff --git a/ssh-agent.c b/ssh-agent.c
index 07dafaa57..6d94c6c29 100644
--- a/ssh-agent.c
+++ b/ssh-agent.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: ssh-agent.c,v 1.54 2001/04/03 13:56:11 stevesk Exp $ */ 1/* $OpenBSD: ssh-agent.c,v 1.55 2001/06/23 15:12:20 itojun Exp $ */
2 2
3/* 3/*
4 * Author: Tatu Ylonen <ylo@cs.hut.fi> 4 * Author: Tatu Ylonen <ylo@cs.hut.fi>
@@ -37,7 +37,7 @@
37 */ 37 */
38 38
39#include "includes.h" 39#include "includes.h"
40RCSID("$OpenBSD: ssh-agent.c,v 1.54 2001/04/03 13:56:11 stevesk Exp $"); 40RCSID("$OpenBSD: ssh-agent.c,v 1.55 2001/06/23 15:12:20 itojun Exp $");
41 41
42#include <openssl/evp.h> 42#include <openssl/evp.h>
43#include <openssl/md5.h> 43#include <openssl/md5.h>
@@ -97,9 +97,7 @@ extern char *__progname;
97char *__progname; 97char *__progname;
98#endif 98#endif
99 99
100int prepare_select(fd_set **, fd_set **, int *); 100static void
101
102void
103idtab_init(void) 101idtab_init(void)
104{ 102{
105 int i; 103 int i;
@@ -110,7 +108,7 @@ idtab_init(void)
110} 108}
111 109
112/* return private key table for requested protocol version */ 110/* return private key table for requested protocol version */
113Idtab * 111static Idtab *
114idtab_lookup(int version) 112idtab_lookup(int version)
115{ 113{
116 if (version < 1 || version > 2) 114 if (version < 1 || version > 2)
@@ -119,7 +117,7 @@ idtab_lookup(int version)
119} 117}
120 118
121/* return matching private key for given public key */ 119/* return matching private key for given public key */
122Key * 120static Key *
123lookup_private_key(Key *key, int *idx, int version) 121lookup_private_key(Key *key, int *idx, int version)
124{ 122{
125 int i; 123 int i;
@@ -135,7 +133,7 @@ lookup_private_key(Key *key, int *idx, int version)
135} 133}
136 134
137/* send list of supported public keys to 'client' */ 135/* send list of supported public keys to 'client' */
138void 136static void
139process_request_identities(SocketEntry *e, int version) 137process_request_identities(SocketEntry *e, int version)
140{ 138{
141 Idtab *tab = idtab_lookup(version); 139 Idtab *tab = idtab_lookup(version);
@@ -167,7 +165,7 @@ process_request_identities(SocketEntry *e, int version)
167} 165}
168 166
169/* ssh1 only */ 167/* ssh1 only */
170void 168static void
171process_authentication_challenge1(SocketEntry *e) 169process_authentication_challenge1(SocketEntry *e)
172{ 170{
173 Key *key, *private; 171 Key *key, *private;
@@ -233,7 +231,7 @@ send:
233} 231}
234 232
235/* ssh2 only */ 233/* ssh2 only */
236void 234static void
237process_sign_request2(SocketEntry *e) 235process_sign_request2(SocketEntry *e)
238{ 236{
239 extern int datafellows; 237 extern int datafellows;
@@ -278,7 +276,7 @@ process_sign_request2(SocketEntry *e)
278} 276}
279 277
280/* shared */ 278/* shared */
281void 279static void
282process_remove_identity(SocketEntry *e, int version) 280process_remove_identity(SocketEntry *e, int version)
283{ 281{
284 Key *key = NULL, *private; 282 Key *key = NULL, *private;
@@ -339,7 +337,7 @@ process_remove_identity(SocketEntry *e, int version)
339 success ? SSH_AGENT_SUCCESS : SSH_AGENT_FAILURE); 337 success ? SSH_AGENT_SUCCESS : SSH_AGENT_FAILURE);
340} 338}
341 339
342void 340static void
343process_remove_all_identities(SocketEntry *e, int version) 341process_remove_all_identities(SocketEntry *e, int version)
344{ 342{
345 u_int i; 343 u_int i;
@@ -360,7 +358,7 @@ process_remove_all_identities(SocketEntry *e, int version)
360 return; 358 return;
361} 359}
362 360
363void 361static void
364process_add_identity(SocketEntry *e, int version) 362process_add_identity(SocketEntry *e, int version)
365{ 363{
366 Key *k = NULL; 364 Key *k = NULL;
@@ -444,7 +442,7 @@ send:
444 442
445/* dispatch incoming messages */ 443/* dispatch incoming messages */
446 444
447void 445static void
448process_message(SocketEntry *e) 446process_message(SocketEntry *e)
449{ 447{
450 u_int msg_len; 448 u_int msg_len;
@@ -508,7 +506,7 @@ process_message(SocketEntry *e)
508 } 506 }
509} 507}
510 508
511void 509static void
512new_socket(int type, int fd) 510new_socket(int type, int fd)
513{ 511{
514 u_int i, old_alloc; 512 u_int i, old_alloc;
@@ -540,7 +538,7 @@ new_socket(int type, int fd)
540 buffer_init(&sockets[old_alloc].output); 538 buffer_init(&sockets[old_alloc].output);
541} 539}
542 540
543int 541static int
544prepare_select(fd_set **fdrp, fd_set **fdwp, int *fdl) 542prepare_select(fd_set **fdrp, fd_set **fdwp, int *fdl)
545{ 543{
546 u_int i, sz; 544 u_int i, sz;
@@ -588,7 +586,7 @@ prepare_select(fd_set **fdrp, fd_set **fdwp, int *fdl)
588 return (1); 586 return (1);
589} 587}
590 588
591void 589static void
592after_select(fd_set *readset, fd_set *writeset) 590after_select(fd_set *readset, fd_set *writeset)
593{ 591{
594 u_int i; 592 u_int i;
@@ -660,7 +658,7 @@ after_select(fd_set *readset, fd_set *writeset)
660 } 658 }
661} 659}
662 660
663void 661static void
664check_parent_exists(int sig) 662check_parent_exists(int sig)
665{ 663{
666 int save_errno = errno; 664 int save_errno = errno;
@@ -674,7 +672,7 @@ check_parent_exists(int sig)
674 errno = save_errno; 672 errno = save_errno;
675} 673}
676 674
677void 675static void
678cleanup_socket(void) 676cleanup_socket(void)
679{ 677{
680 if (socket_name[0]) 678 if (socket_name[0])
@@ -683,21 +681,21 @@ cleanup_socket(void)
683 rmdir(socket_dir); 681 rmdir(socket_dir);
684} 682}
685 683
686void 684static void
687cleanup_exit(int i) 685cleanup_exit(int i)
688{ 686{
689 cleanup_socket(); 687 cleanup_socket();
690 exit(i); 688 exit(i);
691} 689}
692 690
693void 691static void
694cleanup_handler(int sig) 692cleanup_handler(int sig)
695{ 693{
696 cleanup_socket(); 694 cleanup_socket();
697 _exit(2); 695 _exit(2);
698} 696}
699 697
700void 698static void
701usage(void) 699usage(void)
702{ 700{
703 fprintf(stderr, "ssh-agent version %s\n", SSH_VERSION); 701 fprintf(stderr, "ssh-agent version %s\n", SSH_VERSION);