=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/ssh/ssh-keygen.c,v retrieving revision 1.54 retrieving revision 1.58 diff -u -r1.54 -r1.58 --- src/usr.bin/ssh/ssh-keygen.c 2001/04/03 13:56:11 1.54 +++ src/usr.bin/ssh/ssh-keygen.c 2001/04/22 13:41:02 1.58 @@ -12,7 +12,7 @@ */ #include "includes.h" -RCSID("$OpenBSD: ssh-keygen.c,v 1.54 2001/04/03 13:56:11 stevesk Exp $"); +RCSID("$OpenBSD: ssh-keygen.c,v 1.58 2001/04/22 13:41:02 markus Exp $"); #include #include @@ -114,7 +114,7 @@ char *pass; Key *prv; - prv = key_load_private(filename, "", NULL); + prv = key_load_private(filename, "", NULL); if (prv == NULL) { pass = read_passphrase("Enter passphrase: ", 1); prv = key_load_private(filename, pass, NULL); @@ -508,8 +508,7 @@ /* Save the file using the new passphrase. */ if (!key_save_private(private, identity_file, passphrase1, comment)) { - printf("Saving the key failed: %s: %s.\n", - identity_file, strerror(errno)); + printf("Saving the key failed: %s.\n", identity_file); memset(passphrase1, 0, strlen(passphrase1)); xfree(passphrase1); key_free(private); @@ -587,8 +586,7 @@ /* Save the file using the new passphrase. */ if (!key_save_private(private, identity_file, passphrase, new_comment)) { - printf("Saving the key failed: %s: %s.\n", - identity_file, strerror(errno)); + printf("Saving the key failed: %s.\n", identity_file); memset(passphrase, 0, strlen(passphrase)); xfree(passphrase); key_free(private); @@ -626,7 +624,7 @@ void usage(void) { - printf("Usage: %s [-lBpqxXyc] [-t type] [-b bits] [-f file] [-C comment] " + printf("Usage: %s [-ceilpqyB] [-t type] [-b bits] [-f file] [-C comment] " "[-N new-pass] [-P pass]\n", __progname); exit(1); } @@ -660,7 +658,7 @@ exit(1); } - while ((opt = getopt(ac, av, "dqpclBRxXyb:f:t:P:N:C:")) != -1) { + while ((opt = getopt(ac, av, "deiqpclBRxXyb:f:t:P:N:C:")) != -1) { switch (opt) { case 'b': bits = atoi(optarg); @@ -712,11 +710,15 @@ exit(0); break; + case 'e': case 'x': + /* export key */ convert_to_ssh2 = 1; break; + case 'i': case 'X': + /* import key */ convert_from_ssh2 = 1; break; @@ -830,8 +832,7 @@ /* Save the key with the given passphrase and comment. */ if (!key_save_private(private, identity_file, passphrase1, comment)) { - printf("Saving the key failed: %s: %s.\n", - identity_file, strerror(errno)); + printf("Saving the key failed: %s.\n", identity_file); memset(passphrase1, 0, strlen(passphrase1)); xfree(passphrase1); exit(1);