summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBen Lindstrom <mouring@eviladmin.org>2001-06-25 05:04:58 +0000
committerBen Lindstrom <mouring@eviladmin.org>2001-06-25 05:04:58 +0000
commite586c4ce3f4af32ef9eed72344f0fc7f43b9e58a (patch)
treeb60af47e04600d27cbc5435839418373fe13d4ca
parentbba81213b972ce15fbbaca60b9ffabb42371ce8f (diff)
- 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)
-rw-r--r--ChangeLog8
-rw-r--r--ssh-keygen.c22
2 files changed, 17 insertions, 13 deletions
diff --git a/ChangeLog b/ChangeLog
index a7497b58..5a42d91b 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -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 $
diff --git a/ssh-keygen.c b/ssh-keygen.c
index 22946587..51b00340 100644
--- a/ssh-keygen.c
+++ b/ssh-keygen.c
@@ -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;
+ char *type, *cipher;
+ u_char *sig, data[10] = "abcde12345";
int magic, rlen, ktype, i1, i2, i3, i4;
+ u_int slen;
u_long e;
- char *type, *cipher;
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;
}