diff options
Diffstat (limited to 'ssh-add.c')
-rw-r--r-- | ssh-add.c | 24 |
1 files changed, 10 insertions, 14 deletions
@@ -35,7 +35,7 @@ | |||
35 | */ | 35 | */ |
36 | 36 | ||
37 | #include "includes.h" | 37 | #include "includes.h" |
38 | RCSID("$OpenBSD: ssh-add.c,v 1.59 2002/06/15 00:07:38 markus Exp $"); | 38 | RCSID("$OpenBSD: ssh-add.c,v 1.60 2002/06/15 01:27:48 markus Exp $"); |
39 | 39 | ||
40 | #include <openssl/evp.h> | 40 | #include <openssl/evp.h> |
41 | 41 | ||
@@ -164,22 +164,18 @@ add_file(AuthenticationConnection *ac, const char *filename) | |||
164 | strlcpy(msg, "Bad passphrase, try again: ", sizeof msg); | 164 | strlcpy(msg, "Bad passphrase, try again: ", sizeof msg); |
165 | } | 165 | } |
166 | } | 166 | } |
167 | if (ssh_add_identity(ac, private, comment)) { | 167 | |
168 | if (ssh_add_identity_constrained(ac, private, comment, lifetime)) { | ||
168 | fprintf(stderr, "Identity added: %s (%s)\n", filename, comment); | 169 | fprintf(stderr, "Identity added: %s (%s)\n", filename, comment); |
169 | ret = 0; | 170 | ret = 0; |
170 | } else | 171 | if (lifetime != 0) |
172 | fprintf(stderr, | ||
173 | "Lifetime set to %d seconds\n", lifetime); | ||
174 | } else if (ssh_add_identity(ac, private, comment)) { | ||
175 | fprintf(stderr, "Identity added: %s (%s)\n", filename, comment); | ||
176 | ret = 0; | ||
177 | } else { | ||
171 | fprintf(stderr, "Could not add identity: %s\n", filename); | 178 | fprintf(stderr, "Could not add identity: %s\n", filename); |
172 | |||
173 | if (ret == 0 && lifetime != 0) { | ||
174 | if (ssh_constrain_identity(ac, private, lifetime)) { | ||
175 | fprintf(stderr, | ||
176 | "Lifetime set to %d seconds for: %s (%s)\n", | ||
177 | lifetime, filename, comment); | ||
178 | } else { | ||
179 | fprintf(stderr, | ||
180 | "Could not set lifetime for identity: %s\n", | ||
181 | filename); | ||
182 | } | ||
183 | } | 179 | } |
184 | 180 | ||
185 | xfree(comment); | 181 | xfree(comment); |