=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/ssh/ssh-keygen.c,v retrieving revision 1.59 retrieving revision 1.61 diff -u -r1.59 -r1.61 --- src/usr.bin/ssh/ssh-keygen.c 2001/04/23 21:57:07 1.59 +++ src/usr.bin/ssh/ssh-keygen.c 2001/05/25 14:37:32 1.61 @@ -12,7 +12,7 @@ */ #include "includes.h" -RCSID("$OpenBSD: ssh-keygen.c,v 1.59 2001/04/23 21:57:07 markus Exp $"); +RCSID("$OpenBSD: ssh-keygen.c,v 1.61 2001/05/25 14:37:32 markus Exp $"); #include #include @@ -109,14 +109,17 @@ } 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 @@ 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); } @@ -294,12 +297,12 @@ strstr(line, ": ") != NULL) { if (strstr(line, SSH_COM_PRIVATE_BEGIN) != NULL) private = 1; - fprintf(stderr, "ignore: %s", line); + /* fprintf(stderr, "ignore: %s", line); */ continue; } if (escaped) { escaped--; - fprintf(stderr, "escaped: %s", line); + /* fprintf(stderr, "escaped: %s", line); */ continue; } *p = '\0'; @@ -344,7 +347,7 @@ 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);