=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/ssh/ssh-keygen.c,v retrieving revision 1.22 retrieving revision 1.26 diff -u -r1.22 -r1.26 --- src/usr.bin/ssh/ssh-keygen.c 2000/05/01 08:20:56 1.22 +++ src/usr.bin/ssh/ssh-keygen.c 2000/05/30 17:32:06 1.26 @@ -7,7 +7,7 @@ */ #include "includes.h" -RCSID("$Id: ssh-keygen.c,v 1.22 2000/05/01 08:20:56 hugh Exp $"); +RCSID("$Id: ssh-keygen.c,v 1.26 2000/05/30 17:32:06 markus Exp $"); #include #include @@ -72,7 +72,8 @@ { char buf[1024]; snprintf(identity_file, sizeof(identity_file), "%s/%s", - pw->pw_dir, SSH_CLIENT_IDENTITY); + pw->pw_dir, + dsa_mode ? SSH_CLIENT_ID_DSA: SSH_CLIENT_IDENTITY); printf("%s (%s): ", prompt, identity_file); fflush(stdout); if (fgets(buf, sizeof(buf), stdin) == NULL) @@ -143,6 +144,7 @@ char blob[8096]; char encoded[8096]; struct stat st; + int escaped = 0; FILE *fp; if (!have_identity) @@ -158,14 +160,21 @@ } encoded[0] = '\0'; while (fgets(line, sizeof(line), fp)) { + if (!(p = strchr(line, '\n'))) { + fprintf(stderr, "input line too long.\n"); + exit(1); + } + if (p > line && p[-1] == '\\') + escaped++; if (strncmp(line, "----", 4) == 0 || strstr(line, ": ") != NULL) { fprintf(stderr, "ignore: %s", line); continue; } - if (!(p = strchr(line, '\n'))) { - fprintf(stderr, "input line too long.\n"); - exit(1); + if (escaped) { + escaped--; + fprintf(stderr, "escaped: %s", line); + continue; } *p = '\0'; strlcat(encoded, line, sizeof(encoded)); @@ -487,8 +496,7 @@ void usage(void) { - printf("ssh-keygen version %s\n", SSH_VERSION); - printf("Usage: %s [-b bits] [-c] [-d] [-f file] [-l] [-p] [-q] [-x] [-y] [-C comment] [-N new-pass] [-P pass] [-X]\n", __progname); + printf("Usage: %s [-lpqxXydc] [-b bits] [-f file] [-C comment] [-N new-pass] [-P pass]\n", __progname); exit(1); } @@ -508,7 +516,7 @@ extern int optind; extern char *optarg; - OpenSSL_add_all_algorithms(); + SSLeay_add_all_algorithms(); /* we need this for the home * directory. */ pw = getpwuid(getuid());