|
Lines 1-4
Link Here
|
| 1 |
/* $OpenBSD: ssh-add.c,v 1.152 2020/02/06 22:30:54 naddy Exp $ */ |
1 |
/* $OpenBSD: ssh-add.c,v 1.153 2020/02/18 08:58:33 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 |
|
Lines 83-89
static char *default_files[] = {
Link Here
|
| 83 |
static int fingerprint_hash = SSH_FP_HASH_DEFAULT; |
83 |
static int fingerprint_hash = SSH_FP_HASH_DEFAULT; |
| 84 |
|
84 |
|
| 85 |
/* Default lifetime (0 == forever) */ |
85 |
/* Default lifetime (0 == forever) */ |
| 86 |
static int lifetime = 0; |
86 |
static long lifetime = 0; |
| 87 |
|
87 |
|
| 88 |
/* User has to confirm key use */ |
88 |
/* User has to confirm key use */ |
| 89 |
static int confirm = 0; |
89 |
static int confirm = 0; |
|
Lines 321-327
add_file(int agent_fd, const char *filen
Link Here
|
| 321 |
filename, comment); |
321 |
filename, comment); |
| 322 |
if (lifetime != 0) { |
322 |
if (lifetime != 0) { |
| 323 |
fprintf(stderr, |
323 |
fprintf(stderr, |
| 324 |
"Lifetime set to %d seconds\n", lifetime); |
324 |
"Lifetime set to %ld seconds\n", lifetime); |
| 325 |
} |
325 |
} |
| 326 |
if (confirm != 0) { |
326 |
if (confirm != 0) { |
| 327 |
fprintf(stderr, "The user must confirm " |
327 |
fprintf(stderr, "The user must confirm " |
|
Lines 377-383
add_file(int agent_fd, const char *filen
Link Here
|
| 377 |
fprintf(stderr, "Certificate added: %s (%s)\n", certpath, |
377 |
fprintf(stderr, "Certificate added: %s (%s)\n", certpath, |
| 378 |
private->cert->key_id); |
378 |
private->cert->key_id); |
| 379 |
if (lifetime != 0) { |
379 |
if (lifetime != 0) { |
| 380 |
fprintf(stderr, "Lifetime set to %d seconds\n", |
380 |
fprintf(stderr, "Lifetime set to %ld seconds\n", |
| 381 |
lifetime); |
381 |
lifetime); |
| 382 |
} |
382 |
} |
| 383 |
if (confirm != 0) { |
383 |
if (confirm != 0) { |
|
Lines 564-570
load_resident_keys(int agent_fd, const c
Link Here
|
| 564 |
sshkey_type(keys[i]), fp); |
564 |
sshkey_type(keys[i]), fp); |
| 565 |
if (lifetime != 0) { |
565 |
if (lifetime != 0) { |
| 566 |
fprintf(stderr, |
566 |
fprintf(stderr, |
| 567 |
"Lifetime set to %d seconds\n", lifetime); |
567 |
"Lifetime set to %ld seconds\n", lifetime); |
| 568 |
} |
568 |
} |
| 569 |
if (confirm != 0) { |
569 |
if (confirm != 0) { |
| 570 |
fprintf(stderr, "The user must confirm " |
570 |
fprintf(stderr, "The user must confirm " |
|
Lines 713-719
main(int argc, char **argv)
Link Here
|
| 713 |
pkcs11provider = optarg; |
713 |
pkcs11provider = optarg; |
| 714 |
break; |
714 |
break; |
| 715 |
case 't': |
715 |
case 't': |
| 716 |
if ((lifetime = convtime(optarg)) == -1) { |
716 |
if ((lifetime = convtime(optarg)) == -1 || |
|
|
717 |
lifetime < 0 || lifetime > UINT32_MAX) { |
| 717 |
fprintf(stderr, "Invalid lifetime\n"); |
718 |
fprintf(stderr, "Invalid lifetime\n"); |
| 718 |
ret = 1; |
719 |
ret = 1; |
| 719 |
goto done; |
720 |
goto done; |