[ssh-add.1 ssh-add.c]
     use convtime() to parse and validate key lifetime.  can now
     use '-t 2h' etc.  ok markus@ provos@
This commit is contained in:
Ben Lindstrom 2002-06-11 15:51:54 +00:00
parent 11d470de34
commit 1775c9c97a
3 changed files with 17 additions and 6 deletions

View File

@ -13,6 +13,10 @@
- stevesk@cvs.openbsd.org 2002/06/10 16:56:30
[ssh-keysign.8]
merge in stuff from my man page; ok markus@
- 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@
20020609
- (bal) OpenBSD CVS Sync
@ -878,4 +882,4 @@
- (stevesk) entropy.c: typo in debug message
- (djm) ssh-keygen -i needs seeded RNG; report from markus@
$Id: ChangeLog,v 1.2203 2002/06/11 15:50:13 mouring Exp $
$Id: ChangeLog,v 1.2204 2002/06/11 15:51:54 mouring Exp $

View File

@ -1,4 +1,4 @@
.\" $OpenBSD: ssh-add.1,v 1.33 2002/06/05 21:55:44 markus Exp $
.\" $OpenBSD: ssh-add.1,v 1.34 2002/06/10 17:36:22 stevesk Exp $
.\"
.\" -*- nroff -*-
.\"
@ -90,7 +90,9 @@ Lock the agent with a password.
Unlock the agent.
.It Fl t Ar life
Set a maximum lifetime when adding identities to an agent.
The lifetime is specified in seconds.
The lifetime may be specified in seconds or in a time format
specified in
.Xr sshd 8 .
.It Fl s Ar reader
Add key in smartcard
.Ar reader .

View File

@ -35,7 +35,7 @@
*/
#include "includes.h"
RCSID("$OpenBSD: ssh-add.c,v 1.56 2002/06/05 21:55:44 markus Exp $");
RCSID("$OpenBSD: ssh-add.c,v 1.57 2002/06/10 17:36:23 stevesk Exp $");
#include <openssl/evp.h>
@ -48,6 +48,7 @@ RCSID("$OpenBSD: ssh-add.c,v 1.56 2002/06/05 21:55:44 markus Exp $");
#include "authfile.h"
#include "pathnames.h"
#include "readpass.h"
#include "misc.h"
#ifdef HAVE___PROGNAME
extern char *__progname;
@ -67,7 +68,7 @@ static char *default_files[] = {
};
/* Default lifetime (0 == forever) */
static u_int lifetime = 0;
static int lifetime = 0;
/* we keep a cache of one passphrases */
static char *pass = NULL;
@ -352,7 +353,11 @@ main(int argc, char **argv)
sc_reader_id = optarg;
break;
case 't':
lifetime = atoi(optarg);
if ((lifetime = convtime(optarg)) == -1) {
fprintf(stderr, "Invalid lifetime\n");
ret = 1;
goto done;
}
break;
default:
usage();