[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
[sftp-server.c]
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]
don't overwrite argv (fixes ssh user@host in 'ps'), report by ericj@
- deraadt@cvs.openbsd.org 2001/06/23 00:16:16
@ -78,6 +78,10 @@
more strict prototypes. raise warning level in Makefile.inc.
markus ok'ed
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
- (stevesk) handle systems without pw_expire and pw_change.
@ -5762,4 +5766,4 @@
- Wrote replacements for strlcpy and mkdtemp
- 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"
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/pem.h>
@ -187,9 +187,11 @@ do_convert_private_ssh2_from_blob(char *blob, int blen)
{
Buffer b;
Key *key = NULL;
int magic, rlen, ktype, i1, i2, i3, i4;
u_long e;
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_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: "
"remaining bytes in key blob %d", rlen);
buffer_free(&b);
#ifdef DEBUG_PK
{
u_int slen;
u_char *sig, data[10] = "abcde12345";
key_sign(key, &sig, &slen, data, sizeof(data));
key_verify(key, sig, slen, data, sizeof(data));
xfree(sig);
}
#endif
/* try the key */
key_sign(key, &sig, &slen, data, sizeof(data));
key_verify(key, sig, slen, data, sizeof(data));
xfree(sig);
return key;
}
@ -312,6 +309,9 @@ do_convert_from_ssh2(struct passwd *pw)
strstr(line, ": ") != NULL) {
if (strstr(line, SSH_COM_PRIVATE_BEGIN) != NULL)
private = 1;
if (strstr(line, " END ") != NULL) {
break;
}
/* fprintf(stderr, "ignore: %s", line); */
continue;
}