]> andersk Git - openssh.git/blobdiff - scard.c
- dtucker@cvs.openbsd.org 2010/01/12 01:31:05
[openssh.git] / scard.c
diff --git a/scard.c b/scard.c
index e22da596fc0c23f9a190879b79f28e048883d8de..9fd3ca1b4ee3bf009e12c7f8b2a4bda83c6a5980 100644 (file)
--- a/scard.c
+++ b/scard.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: scard.c,v 1.34 2006/08/01 23:36:12 stevesk Exp $ */
+/* $OpenBSD: scard.c,v 1.36 2006/11/06 21:25:28 markus Exp $ */
 /*
  * Copyright (c) 2001 Markus Friedl.  All rights reserved.
  *
 #include "includes.h"
 #if defined(SMARTCARD) && defined(USE_SECTOK)
 
-#include <openssl/evp.h>
+#include <sys/types.h>
 
 #include <sectok.h>
+#include <stdarg.h>
 #include <string.h>
 
+#include <openssl/evp.h>
+
+#include "xmalloc.h"
 #include "key.h"
 #include "log.h"
-#include "xmalloc.h"
 #include "misc.h"
 #include "scard.h"
 
@@ -388,15 +391,17 @@ sc_get_keys(const char *id, const char *pin)
        keys = xcalloc((nkeys+1), sizeof(Key *));
 
        n = key_new(KEY_RSA1);
-       BN_copy(n->rsa->n, k->rsa->n);
-       BN_copy(n->rsa->e, k->rsa->e);
+       if ((BN_copy(n->rsa->n, k->rsa->n) == NULL) ||
+           (BN_copy(n->rsa->e, k->rsa->e) == NULL))
+               fatal("sc_get_keys: BN_copy failed");
        RSA_set_method(n->rsa, sc_get_rsa());
        n->flags |= KEY_FLAG_EXT;
        keys[0] = n;
 
        n = key_new(KEY_RSA);
-       BN_copy(n->rsa->n, k->rsa->n);
-       BN_copy(n->rsa->e, k->rsa->e);
+       if ((BN_copy(n->rsa->n, k->rsa->n) == NULL) ||
+           (BN_copy(n->rsa->e, k->rsa->e) == NULL))
+               fatal("sc_get_keys: BN_copy failed");
        RSA_set_method(n->rsa, sc_get_rsa());
        n->flags |= KEY_FLAG_EXT;
        keys[1] = n;
This page took 0.236794 seconds and 4 git commands to generate.