]> andersk Git - openssh.git/blobdiff - ssh-agent.c
- djm@cvs.openbsd.org 2001/12/21 10:06:43
[openssh.git] / ssh-agent.c
index a004e32463816cbb51676c74ca4184c9d61b04a8..e8018bf3aacbecf1100924927ac42e60ffbaa81f 100644 (file)
@@ -1,4 +1,4 @@
-/*     $OpenBSD: ssh-agent.c,v 1.72 2001/08/03 10:31:30 jakob Exp $    */
+/*     $OpenBSD: ssh-agent.c,v 1.75 2001/12/19 07:18:56 deraadt Exp $  */
 
 /*
  * Author: Tatu Ylonen <ylo@cs.hut.fi>
@@ -36,7 +36,7 @@
  */
 
 #include "includes.h"
-RCSID("$OpenBSD: ssh-agent.c,v 1.72 2001/08/03 10:31:30 jakob Exp $");
+RCSID("$OpenBSD: ssh-agent.c,v 1.75 2001/12/19 07:18:56 deraadt Exp $");
 
 #include <openssl/evp.h>
 #include <openssl/md5.h>
@@ -61,11 +61,15 @@ RCSID("$OpenBSD: ssh-agent.c,v 1.72 2001/08/03 10:31:30 jakob Exp $");
 #include "scard.h"
 #endif
 
+typedef enum {
+       AUTH_UNUSED,
+       AUTH_SOCKET,
+       AUTH_CONNECTION
+} sock_type;
+
 typedef struct {
        int fd;
-       enum {
-               AUTH_UNUSED, AUTH_SOCKET, AUTH_CONNECTION
-       } type;
+       sock_type type;
        Buffer input;
        Buffer output;
 } SocketEntry;
@@ -105,7 +109,7 @@ static void
 idtab_init(void)
 {
        int i;
-       for (i = 0; i <=2; i++){
+       for (i = 0; i <=2; i++) {
                idtable[i].identities = NULL;
                idtable[i].nentries = 0;
        }
@@ -289,7 +293,7 @@ process_remove_identity(SocketEntry *e, int version)
        u_int bits;
        int success = 0;
 
-       switch(version){
+       switch (version) {
        case 1:
                key = key_new(KEY_RSA1);
                bits = buffer_get_int(&e->input);
@@ -391,7 +395,7 @@ process_add_identity(SocketEntry *e, int version)
                type_name = buffer_get_string(&e->input, NULL);
                type = key_type_from_name(type_name);
                xfree(type_name);
-               switch(type) {
+               switch (type) {
                case KEY_DSA:
                        k = key_new_private(type);
                        buffer_get_bignum2(&e->input, k->dsa->p);
@@ -453,7 +457,7 @@ process_add_smartcard_key (SocketEntry *e)
        Key *n = NULL, *k = NULL;
        char *sc_reader_id = NULL;
        int success = 0;
-       
+
        sc_reader_id = buffer_get_string(&e->input, NULL);
        k = sc_get_key(sc_reader_id);
        xfree(sc_reader_id);
@@ -611,10 +615,10 @@ process_message(SocketEntry *e)
 #ifdef SMARTCARD
        case SSH_AGENTC_ADD_SMARTCARD_KEY:
                process_add_smartcard_key(e);
-               break; 
+               break;
        case SSH_AGENTC_REMOVE_SMARTCARD_KEY:
                process_remove_smartcard_key(e);
-               break; 
+               break;
 #endif /* SMARTCARD */
        default:
                /* Unknown message.  Respond with failure. */
@@ -627,7 +631,7 @@ process_message(SocketEntry *e)
 }
 
 static void
-new_socket(int type, int fd)
+new_socket(sock_type type, int fd)
 {
        u_int i, old_alloc;
        if (fcntl(fd, F_SETFL, O_NONBLOCK) < 0)
This page took 0.278528 seconds and 4 git commands to generate.