diff options
author | Markus Friedl <markus@cvs.openbsd.org> | 2001-05-25 14:37:33 +0000 |
---|---|---|
committer | Markus Friedl <markus@cvs.openbsd.org> | 2001-05-25 14:37:33 +0000 |
commit | 1f0f3c8ec980e1771e50735e9d00a0f4058824fe (patch) | |
tree | 38815b1c32521a1d4de8caaa10d2a354f9f54f25 /usr.bin/ssh/ssh-keygen.c | |
parent | ae074e82c4873560f239b9315441d8417b0e244d (diff) |
use -P for -e and -y, too.
Diffstat (limited to 'usr.bin/ssh/ssh-keygen.c')
-rw-r--r-- | usr.bin/ssh/ssh-keygen.c | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/usr.bin/ssh/ssh-keygen.c b/usr.bin/ssh/ssh-keygen.c index 90d5ffa4023..2083e872ac3 100644 --- a/usr.bin/ssh/ssh-keygen.c +++ b/usr.bin/ssh/ssh-keygen.c @@ -12,7 +12,7 @@ */ #include "includes.h" -RCSID("$OpenBSD: ssh-keygen.c,v 1.60 2001/04/23 22:14:13 markus Exp $"); +RCSID("$OpenBSD: ssh-keygen.c,v 1.61 2001/05/25 14:37:32 markus Exp $"); #include <openssl/evp.h> #include <openssl/pem.h> @@ -109,14 +109,17 @@ ask_filename(struct passwd *pw, const char *prompt) } Key * -try_load_pem_key(char *filename) +load_identity(char *filename) { char *pass; Key *prv; prv = key_load_private(filename, "", NULL); if (prv == NULL) { - pass = read_passphrase("Enter passphrase: ", 1); + if (identity_passphrase) + pass = xstrdup(identity_passphrase); + else + pass = read_passphrase("Enter passphrase: ", 1); prv = key_load_private(filename, pass, NULL); memset(pass, 0, strlen(pass)); xfree(pass); @@ -144,7 +147,7 @@ do_convert_to_ssh2(struct passwd *pw) exit(1); } if ((k = key_load_public(identity_file, NULL)) == NULL) { - if ((k = try_load_pem_key(identity_file)) == NULL) { + if ((k = load_identity(identity_file)) == NULL) { fprintf(stderr, "load failed\n"); exit(1); } @@ -344,7 +347,7 @@ do_print_public(struct passwd *pw) perror(identity_file); exit(1); } - prv = try_load_pem_key(identity_file); + prv = load_identity(identity_file); if (prv == NULL) { fprintf(stderr, "load failed\n"); exit(1); |