summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBen Lindstrom <mouring@eviladmin.org>2002-06-11 15:51:54 +0000
committerBen Lindstrom <mouring@eviladmin.org>2002-06-11 15:51:54 +0000
commit1775c9c97af0559f7b6df766ce79d66a1e883379 (patch)
treeb4edba4e1b14b37dd429237688f08b1309bc472d
parent11d470de348beb5e9f6a2dcc27fdeb1ad8257acd (diff)
- stevesk@cvs.openbsd.org 2002/06/10 17:36:23
[ssh-add.1 ssh-add.c] use convtime() to parse and validate key lifetime. can now use '-t 2h' etc. ok markus@ provos@
-rw-r--r--ChangeLog6
-rw-r--r--ssh-add.16
-rw-r--r--ssh-add.c11
3 files changed, 17 insertions, 6 deletions
diff --git a/ChangeLog b/ChangeLog
index f3a802f7b..ff2b77155 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -13,6 +13,10 @@
13 - stevesk@cvs.openbsd.org 2002/06/10 16:56:30 13 - stevesk@cvs.openbsd.org 2002/06/10 16:56:30
14 [ssh-keysign.8] 14 [ssh-keysign.8]
15 merge in stuff from my man page; ok markus@ 15 merge in stuff from my man page; ok markus@
16 - stevesk@cvs.openbsd.org 2002/06/10 17:36:23
17 [ssh-add.1 ssh-add.c]
18 use convtime() to parse and validate key lifetime. can now
19 use '-t 2h' etc. ok markus@ provos@
16 20
1720020609 2120020609
18 - (bal) OpenBSD CVS Sync 22 - (bal) OpenBSD CVS Sync
@@ -878,4 +882,4 @@
878 - (stevesk) entropy.c: typo in debug message 882 - (stevesk) entropy.c: typo in debug message
879 - (djm) ssh-keygen -i needs seeded RNG; report from markus@ 883 - (djm) ssh-keygen -i needs seeded RNG; report from markus@
880 884
881$Id: ChangeLog,v 1.2203 2002/06/11 15:50:13 mouring Exp $ 885$Id: ChangeLog,v 1.2204 2002/06/11 15:51:54 mouring Exp $
diff --git a/ssh-add.1 b/ssh-add.1
index 350d1031d..bbf34203d 100644
--- a/ssh-add.1
+++ b/ssh-add.1
@@ -1,4 +1,4 @@
1.\" $OpenBSD: ssh-add.1,v 1.33 2002/06/05 21:55:44 markus Exp $ 1.\" $OpenBSD: ssh-add.1,v 1.34 2002/06/10 17:36:22 stevesk Exp $
2.\" 2.\"
3.\" -*- nroff -*- 3.\" -*- nroff -*-
4.\" 4.\"
@@ -90,7 +90,9 @@ Lock the agent with a password.
90Unlock the agent. 90Unlock the agent.
91.It Fl t Ar life 91.It Fl t Ar life
92Set a maximum lifetime when adding identities to an agent. 92Set a maximum lifetime when adding identities to an agent.
93The lifetime is specified in seconds. 93The lifetime may be specified in seconds or in a time format
94specified in
95.Xr sshd 8 .
94.It Fl s Ar reader 96.It Fl s Ar reader
95Add key in smartcard 97Add key in smartcard
96.Ar reader . 98.Ar reader .
diff --git a/ssh-add.c b/ssh-add.c
index e4aa8a522..30d635400 100644
--- a/ssh-add.c
+++ b/ssh-add.c
@@ -35,7 +35,7 @@
35 */ 35 */
36 36
37#include "includes.h" 37#include "includes.h"
38RCSID("$OpenBSD: ssh-add.c,v 1.56 2002/06/05 21:55:44 markus Exp $"); 38RCSID("$OpenBSD: ssh-add.c,v 1.57 2002/06/10 17:36:23 stevesk Exp $");
39 39
40#include <openssl/evp.h> 40#include <openssl/evp.h>
41 41
@@ -48,6 +48,7 @@ RCSID("$OpenBSD: ssh-add.c,v 1.56 2002/06/05 21:55:44 markus Exp $");
48#include "authfile.h" 48#include "authfile.h"
49#include "pathnames.h" 49#include "pathnames.h"
50#include "readpass.h" 50#include "readpass.h"
51#include "misc.h"
51 52
52#ifdef HAVE___PROGNAME 53#ifdef HAVE___PROGNAME
53extern char *__progname; 54extern char *__progname;
@@ -67,7 +68,7 @@ static char *default_files[] = {
67}; 68};
68 69
69/* Default lifetime (0 == forever) */ 70/* Default lifetime (0 == forever) */
70static u_int lifetime = 0; 71static int lifetime = 0;
71 72
72/* we keep a cache of one passphrases */ 73/* we keep a cache of one passphrases */
73static char *pass = NULL; 74static char *pass = NULL;
@@ -352,7 +353,11 @@ main(int argc, char **argv)
352 sc_reader_id = optarg; 353 sc_reader_id = optarg;
353 break; 354 break;
354 case 't': 355 case 't':
355 lifetime = atoi(optarg); 356 if ((lifetime = convtime(optarg)) == -1) {
357 fprintf(stderr, "Invalid lifetime\n");
358 ret = 1;
359 goto done;
360 }
356 break; 361 break;
357 default: 362 default:
358 usage(); 363 usage();