summaryrefslogtreecommitdiff
path: root/ssh-add.c
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 /ssh-add.c
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@
Diffstat (limited to 'ssh-add.c')
-rw-r--r--ssh-add.c11
1 files changed, 8 insertions, 3 deletions
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();