diff options
-rw-r--r-- | ChangeLog | 3 | ||||
-rw-r--r-- | ssh-agent.c | 21 |
2 files changed, 15 insertions, 9 deletions
@@ -35,6 +35,9 @@ | |||
35 | Pushing all logging onto a single line simplifies log analysis as it is | 35 | Pushing all logging onto a single line simplifies log analysis as it is |
36 | no longer necessary to relate information scattered across multiple log | 36 | no longer necessary to relate information scattered across multiple log |
37 | entries. "I like it" markus@ | 37 | entries. "I like it" markus@ |
38 | - dtucker@cvs.openbsd.org 2013/05/31 12:28:10 | ||
39 | [ssh-agent.c] | ||
40 | Use time_t where appropriate. ok djm | ||
38 | 41 | ||
39 | 20130529 | 42 | 20130529 |
40 | - (dtucker) [configure.ac openbsd-compat/bsd-misc.h] bz#2087: Add a null | 43 | - (dtucker) [configure.ac openbsd-compat/bsd-misc.h] bz#2087: Add a null |
diff --git a/ssh-agent.c b/ssh-agent.c index 3f94851eb..0fd9e0bb7 100644 --- a/ssh-agent.c +++ b/ssh-agent.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: ssh-agent.c,v 1.173 2013/05/17 00:13:14 djm Exp $ */ | 1 | /* $OpenBSD: ssh-agent.c,v 1.174 2013/05/31 12:28:10 dtucker Exp $ */ |
2 | /* | 2 | /* |
3 | * Author: Tatu Ylonen <ylo@cs.hut.fi> | 3 | * Author: Tatu Ylonen <ylo@cs.hut.fi> |
4 | * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland | 4 | * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland |
@@ -106,7 +106,7 @@ typedef struct identity { | |||
106 | Key *key; | 106 | Key *key; |
107 | char *comment; | 107 | char *comment; |
108 | char *provider; | 108 | char *provider; |
109 | u_int death; | 109 | time_t death; |
110 | u_int confirm; | 110 | u_int confirm; |
111 | } Identity; | 111 | } Identity; |
112 | 112 | ||
@@ -134,8 +134,8 @@ char *lock_passwd = NULL; | |||
134 | 134 | ||
135 | extern char *__progname; | 135 | extern char *__progname; |
136 | 136 | ||
137 | /* Default lifetime (0 == forever) */ | 137 | /* Default lifetime in seconds (0 == forever) */ |
138 | static int lifetime = 0; | 138 | static long lifetime = 0; |
139 | 139 | ||
140 | static void | 140 | static void |
141 | close_socket(SocketEntry *e) | 141 | close_socket(SocketEntry *e) |
@@ -428,10 +428,10 @@ process_remove_all_identities(SocketEntry *e, int version) | |||
428 | } | 428 | } |
429 | 429 | ||
430 | /* removes expired keys and returns number of seconds until the next expiry */ | 430 | /* removes expired keys and returns number of seconds until the next expiry */ |
431 | static u_int | 431 | static time_t |
432 | reaper(void) | 432 | reaper(void) |
433 | { | 433 | { |
434 | u_int deadline = 0, now = time(NULL); | 434 | time_t deadline = 0, now = time(NULL); |
435 | Identity *id, *nxt; | 435 | Identity *id, *nxt; |
436 | int version; | 436 | int version; |
437 | Idtab *tab; | 437 | Idtab *tab; |
@@ -463,8 +463,9 @@ process_add_identity(SocketEntry *e, int version) | |||
463 | { | 463 | { |
464 | Idtab *tab = idtab_lookup(version); | 464 | Idtab *tab = idtab_lookup(version); |
465 | Identity *id; | 465 | Identity *id; |
466 | int type, success = 0, death = 0, confirm = 0; | 466 | int type, success = 0, confirm = 0; |
467 | char *type_name, *comment; | 467 | char *type_name, *comment; |
468 | time_t death = 0; | ||
468 | Key *k = NULL; | 469 | Key *k = NULL; |
469 | #ifdef OPENSSL_HAS_ECC | 470 | #ifdef OPENSSL_HAS_ECC |
470 | BIGNUM *exponent; | 471 | BIGNUM *exponent; |
@@ -699,7 +700,8 @@ static void | |||
699 | process_add_smartcard_key(SocketEntry *e) | 700 | process_add_smartcard_key(SocketEntry *e) |
700 | { | 701 | { |
701 | char *provider = NULL, *pin; | 702 | char *provider = NULL, *pin; |
702 | int i, type, version, count = 0, success = 0, death = 0, confirm = 0; | 703 | int i, type, version, count = 0, success = 0, confirm = 0; |
704 | time_t death = 0; | ||
703 | Key **keys = NULL, *k; | 705 | Key **keys = NULL, *k; |
704 | Identity *id; | 706 | Identity *id; |
705 | Idtab *tab; | 707 | Idtab *tab; |
@@ -926,9 +928,10 @@ static int | |||
926 | prepare_select(fd_set **fdrp, fd_set **fdwp, int *fdl, u_int *nallocp, | 928 | prepare_select(fd_set **fdrp, fd_set **fdwp, int *fdl, u_int *nallocp, |
927 | struct timeval **tvpp) | 929 | struct timeval **tvpp) |
928 | { | 930 | { |
929 | u_int i, sz, deadline; | 931 | u_int i, sz; |
930 | int n = 0; | 932 | int n = 0; |
931 | static struct timeval tv; | 933 | static struct timeval tv; |
934 | time_t deadline; | ||
932 | 935 | ||
933 | for (i = 0; i < sockets_alloc; i++) { | 936 | for (i = 0; i < sockets_alloc; i++) { |
934 | switch (sockets[i].type) { | 937 | switch (sockets[i].type) { |