diff options
author | Ben Lindstrom <mouring@eviladmin.org> | 2002-04-02 20:26:26 +0000 |
---|---|---|
committer | Ben Lindstrom <mouring@eviladmin.org> | 2002-04-02 20:26:26 +0000 |
commit | 155b981494967883796473c09cce5060fa26abbd (patch) | |
tree | 1076b2c9d5bf135fac04282c4388febc0f278226 /ssh-keygen.c | |
parent | cdb66e0e82a3c5d80f8445a3074ee77f356dbda8 (diff) |
- markus@cvs.openbsd.org 2002/03/27 22:21:45
[ssh-keygen.c]
try to import keys with extra trailing === (seen with ssh.com < 2.0.12)
Diffstat (limited to 'ssh-keygen.c')
-rw-r--r-- | ssh-keygen.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/ssh-keygen.c b/ssh-keygen.c index 1a8a73129..250e53e14 100644 --- a/ssh-keygen.c +++ b/ssh-keygen.c | |||
@@ -12,7 +12,7 @@ | |||
12 | */ | 12 | */ |
13 | 13 | ||
14 | #include "includes.h" | 14 | #include "includes.h" |
15 | RCSID("$OpenBSD: ssh-keygen.c,v 1.97 2002/03/25 17:34:27 markus Exp $"); | 15 | RCSID("$OpenBSD: ssh-keygen.c,v 1.98 2002/03/27 22:21:45 markus Exp $"); |
16 | 16 | ||
17 | #include <openssl/evp.h> | 17 | #include <openssl/evp.h> |
18 | #include <openssl/pem.h> | 18 | #include <openssl/pem.h> |
@@ -290,6 +290,7 @@ do_convert_from_ssh2(struct passwd *pw) | |||
290 | { | 290 | { |
291 | Key *k; | 291 | Key *k; |
292 | int blen; | 292 | int blen; |
293 | u_int len; | ||
293 | char line[1024], *p; | 294 | char line[1024], *p; |
294 | u_char blob[8096]; | 295 | u_char blob[8096]; |
295 | char encoded[8096]; | 296 | char encoded[8096]; |
@@ -334,6 +335,12 @@ do_convert_from_ssh2(struct passwd *pw) | |||
334 | *p = '\0'; | 335 | *p = '\0'; |
335 | strlcat(encoded, line, sizeof(encoded)); | 336 | strlcat(encoded, line, sizeof(encoded)); |
336 | } | 337 | } |
338 | len = strlen(encoded); | ||
339 | if (((len % 4) == 3) && | ||
340 | (encoded[len-1] == '=') && | ||
341 | (encoded[len-2] == '=') && | ||
342 | (encoded[len-3] == '=')) | ||
343 | encoded[len-3] = '\0'; | ||
337 | blen = uudecode(encoded, blob, sizeof(blob)); | 344 | blen = uudecode(encoded, blob, sizeof(blob)); |
338 | if (blen < 0) { | 345 | if (blen < 0) { |
339 | fprintf(stderr, "uudecode failed.\n"); | 346 | fprintf(stderr, "uudecode failed.\n"); |