[ssh-keygen.c]
     fix import for (broken?) ssh.com/f-secure private keys
     (i tested > 1000 RSA keys)
This commit is contained in:
Ben Lindstrom 2001-06-25 05:04:58 +00:00
parent bba81213b9
commit e586c4ce3f
2 changed files with 18 additions and 14 deletions

View File

@ -32,7 +32,7 @@
- markus@cvs.openbsd.org 2001/06/22 22:21:20 - markus@cvs.openbsd.org 2001/06/22 22:21:20
[sftp-server.c] [sftp-server.c]
allow long usernames/groups in readdir allow long usernames/groups in readdir
- markus@cvs.openbsd.org 2001/06/22 23:35:21 - markus@cvs.openbsd.org 2001/06/22 23:35:21
[ssh.c] [ssh.c]
don't overwrite argv (fixes ssh user@host in 'ps'), report by ericj@ don't overwrite argv (fixes ssh user@host in 'ps'), report by ericj@
- deraadt@cvs.openbsd.org 2001/06/23 00:16:16 - deraadt@cvs.openbsd.org 2001/06/23 00:16:16
@ -78,6 +78,10 @@
more strict prototypes. raise warning level in Makefile.inc. more strict prototypes. raise warning level in Makefile.inc.
markus ok'ed markus ok'ed
TODO; cleanup headers TODO; cleanup headers
- markus@cvs.openbsd.org 2001/06/23 17:05:22
[ssh-keygen.c]
fix import for (broken?) ssh.com/f-secure private keys
(i tested > 1000 RSA keys)
20010622 20010622
- (stevesk) handle systems without pw_expire and pw_change. - (stevesk) handle systems without pw_expire and pw_change.
@ -5762,4 +5766,4 @@
- Wrote replacements for strlcpy and mkdtemp - Wrote replacements for strlcpy and mkdtemp
- Released 1.0pre1 - Released 1.0pre1
$Id: ChangeLog,v 1.1315 2001/06/25 05:01:22 mouring Exp $ $Id: ChangeLog,v 1.1316 2001/06/25 05:04:58 mouring Exp $

View File

@ -12,7 +12,7 @@
*/ */
#include "includes.h" #include "includes.h"
RCSID("$OpenBSD: ssh-keygen.c,v 1.63 2001/06/23 15:12:20 itojun Exp $"); RCSID("$OpenBSD: ssh-keygen.c,v 1.64 2001/06/23 17:05:22 markus Exp $");
#include <openssl/evp.h> #include <openssl/evp.h>
#include <openssl/pem.h> #include <openssl/pem.h>
@ -187,9 +187,11 @@ do_convert_private_ssh2_from_blob(char *blob, int blen)
{ {
Buffer b; Buffer b;
Key *key = NULL; Key *key = NULL;
int magic, rlen, ktype, i1, i2, i3, i4;
u_long e;
char *type, *cipher; char *type, *cipher;
u_char *sig, data[10] = "abcde12345";
int magic, rlen, ktype, i1, i2, i3, i4;
u_int slen;
u_long e;
buffer_init(&b); buffer_init(&b);
buffer_append(&b, blob, blen); buffer_append(&b, blob, blen);
@ -264,16 +266,11 @@ do_convert_private_ssh2_from_blob(char *blob, int blen)
error("do_convert_private_ssh2_from_blob: " error("do_convert_private_ssh2_from_blob: "
"remaining bytes in key blob %d", rlen); "remaining bytes in key blob %d", rlen);
buffer_free(&b); buffer_free(&b);
#ifdef DEBUG_PK
{
u_int slen;
u_char *sig, data[10] = "abcde12345";
key_sign(key, &sig, &slen, data, sizeof(data)); /* try the key */
key_verify(key, sig, slen, data, sizeof(data)); key_sign(key, &sig, &slen, data, sizeof(data));
xfree(sig); key_verify(key, sig, slen, data, sizeof(data));
} xfree(sig);
#endif
return key; return key;
} }
@ -312,6 +309,9 @@ do_convert_from_ssh2(struct passwd *pw)
strstr(line, ": ") != NULL) { strstr(line, ": ") != NULL) {
if (strstr(line, SSH_COM_PRIVATE_BEGIN) != NULL) if (strstr(line, SSH_COM_PRIVATE_BEGIN) != NULL)
private = 1; private = 1;
if (strstr(line, " END ") != NULL) {
break;
}
/* fprintf(stderr, "ignore: %s", line); */ /* fprintf(stderr, "ignore: %s", line); */
continue; continue;
} }