summaryrefslogtreecommitdiffstats
path: root/ssh-keygen.c
diff options
context:
space:
mode:
authorDamien Miller <djm@mindrot.org>2000-05-09 03:02:59 +0200
committerDamien Miller <djm@mindrot.org>2000-05-09 03:02:59 +0200
commit30c3d429306bb4afe71c18db92816b981f7b6d9d (patch)
treea65f45e0073cb55ad42957a36b4636ff21405108 /ssh-keygen.c
parent - Configure caching and cleanup patch from Andre Lucas' (diff)
downloadopenssh-30c3d429306bb4afe71c18db92816b981f7b6d9d.tar.xz
openssh-30c3d429306bb4afe71c18db92816b981f7b6d9d.zip
- OpenBSD CVS update
- markus@cvs.openbsd.org [cipher.h myproposal.h readconf.c readconf.h servconf.c ssh.1 ssh.c] [ssh.h sshconnect1.c sshconnect2.c sshd.8] - complain about invalid ciphers in SSH1 (e.g. arcfour is SSH2 only) - hugh@cvs.openbsd.org [ssh.1] - zap typo [ssh-keygen.1] - One last nit fix. (markus approved) [sshd.8] - some markus certified spelling adjustments - markus@cvs.openbsd.org [auth2.c channels.c clientloop.c compat compat.h dsa.c kex.c] [sshconnect2.c ] - bug compat w/ ssh-2.0.13 x11, split out bugs [nchan.c] - no drain if ibuf_empty, fixes x11fwd problems; tests by fries@ [ssh-keygen.c] - handle escapes in real and original key format, ok millert@ [version.h] - OpenSSH-2.1
Diffstat (limited to 'ssh-keygen.c')
-rw-r--r--ssh-keygen.c16
1 files changed, 12 insertions, 4 deletions
diff --git a/ssh-keygen.c b/ssh-keygen.c
index a2599dab9..351036dd4 100644
--- a/ssh-keygen.c
+++ b/ssh-keygen.c
@@ -7,7 +7,7 @@
*/
#include "includes.h"
-RCSID("$Id: ssh-keygen.c,v 1.17 2000/05/07 02:03:19 damien Exp $");
+RCSID("$Id: ssh-keygen.c,v 1.18 2000/05/09 01:03:02 damien Exp $");
#include <openssl/evp.h>
#include <openssl/pem.h>
@@ -148,6 +148,7 @@ do_convert_from_ssh2(struct passwd *pw)
char blob[8096];
char encoded[8096];
struct stat st;
+ int escaped = 0;
FILE *fp;
if (!have_identity)
@@ -163,14 +164,21 @@ do_convert_from_ssh2(struct passwd *pw)
}
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));