]> andersk Git - openssh.git/commitdiff
- markus@cvs.openbsd.org 2001/06/29 07:06:34
authormouring <mouring>
Wed, 4 Jul 2001 05:06:59 +0000 (05:06 +0000)
committermouring <mouring>
Wed, 4 Jul 2001 05:06:59 +0000 (05:06 +0000)
     [ssh-keygen.c]
     new error handling for cyberflex_*

ChangeLog
ssh-keygen.c

index 15928cabbd9774a851bc32279196155b03aceac9..762e59b23b7d1a7d36be774f3d5665cc71b6485c 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -99,6 +99,9 @@
    - stevesk@cvs.openbsd.org 2001/06/28 19:57:35
      [ssh-keygen.c]
      '\0' terminated data[] is ok; ok markus@
+   - markus@cvs.openbsd.org 2001/06/29 07:06:34
+     [ssh-keygen.c]
+     new error handling for cyberflex_*
  
 20010629
  - (bal) Removed net_aton() since we don't use it any more
index 88b97efe12dac9dbded9afb11843df160dca7669..f1e6d53c79a9961788b2fc0daf5dd237937fd615 100644 (file)
@@ -12,7 +12,7 @@
  */
 
 #include "includes.h"
-RCSID("$OpenBSD: ssh-keygen.c,v 1.69 2001/06/28 19:57:35 stevesk Exp $");
+RCSID("$OpenBSD: ssh-keygen.c,v 1.70 2001/06/29 07:06:34 markus Exp $");
 
 #include <openssl/evp.h>
 #include <openssl/pem.h>
@@ -385,7 +385,7 @@ do_print_public(struct passwd *pw)
        do { \
                len = BN_num_bytes(prv->rsa->x); \
                elements[i] = xmalloc(len); \
-error("#bytes %d", len); \
+               debug("#bytes %d", len); \
                if (BN_bn2bin(prv->rsa->x, elements[i]) < 0) \
                        goto done; \
        } while(0)
@@ -403,7 +403,7 @@ do_upload(struct passwd *pw, int reader)
         u_char atr[256];
        u_char AUT0[] = {0xad, 0x9f, 0x61, 0xfe, 0xfa, 0x20, 0xce, 0x63};
        int len, status = 1, i, fd = -1, ret;
-       int cla = 0x00;
+       int r1 = 0, r2 = 0, cla = 0x00;
 
        if (!have_identity)
                ask_filename(pw, "Enter file in which the key is");
@@ -427,12 +427,12 @@ do_upload(struct passwd *pw, int reader)
        len = BN_num_bytes(prv->rsa->n);
         fd = scopen(reader, 0, NULL);
         if (fd < 0) {
-                error("scopen failed %d.", fd);
+                error("scopen failed");
                goto done;
         }
         ret = screset(fd, atr, NULL);
         if (ret <= 0) {
-                error("screset failed.");
+                error("screset failed");
                goto done;
         }
        if ((cla = cyberflex_inq_class(fd)) < 0) {
@@ -445,12 +445,22 @@ do_upload(struct passwd *pw, int reader)
        }
        key_fid[0] = 0x00;
        key_fid[1] = 0x12;
-       if (cyberflex_load_rsa_priv(fd, cla, key_fid, 5, 8*len, elements) < 0)
+       if (cyberflex_load_rsa_priv(fd, cla, key_fid, 5, 8*len, elements,
+           &r1, &r2) < 0) {
+               error("cyberflex_load_rsa_priv failed: %s", get_r1r2s(r1, r1));
+               goto done;
+       }
+       if (r1 != 0x90 && r1 != 0x61)
                goto done;
        log("cyberflex_load_rsa_priv done");
        key_fid[0] = 0x73;
        key_fid[1] = 0x68;
-       if (cyberflex_load_rsa_pub(fd, cla, key_fid, len, elements[5]) < 0)
+       if (cyberflex_load_rsa_pub(fd, cla, key_fid, len, elements[5],
+           &r1, &r2) < 0) {
+               error("cyberflex_load_rsa_pub failed: %s", get_r1r2s(r1, r1));
+               goto done;
+       }
+       if (r1 != 0x90 && r1 != 0x61)
                goto done;
        log("cyberflex_load_rsa_pub done");
        status = 0;
This page took 0.051419 seconds and 5 git commands to generate.