]> andersk Git - openssh.git/commitdiff
- markus@cvs.openbsd.org 2001/06/23 17:05:22
authormouring <mouring>
Mon, 25 Jun 2001 05:04:58 +0000 (05:04 +0000)
committermouring <mouring>
Mon, 25 Jun 2001 05:04:58 +0000 (05:04 +0000)
     [ssh-keygen.c]
     fix import for (broken?) ssh.com/f-secure private keys
     (i tested > 1000 RSA keys)

ChangeLog
ssh-keygen.c

index 5efe7fcf6b91c72918972c939ff0d977af5710cd..f6d32dabe1c35813abac5b58a86604e92e84efae 100644 (file)
--- 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
      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.
index 22946587f7c09b5ee9300c315a08e02f5cf03e65..51b0034057367d3aba88a2ec96c8d05213a45daf 100644 (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;
+       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;
                }
This page took 0.307079 seconds and 5 git commands to generate.