]> andersk Git - openssh.git/blobdiff - scard.c
- (dtucker) [openbsd-compat/openssl-compat.c] Bug #1707: Call OPENSSL_config()
[openssh.git] / scard.c
diff --git a/scard.c b/scard.c
index a2d28cba18789137e2962bf52c9f7ac14f93aacf..9fd3ca1b4ee3bf009e12c7f8b2a4bda83c6a5980 100644 (file)
--- a/scard.c
+++ b/scard.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: scard.c,v 1.35 2006/08/03 03:34:42 deraadt Exp $ */
+/* $OpenBSD: scard.c,v 1.36 2006/11/06 21:25:28 markus Exp $ */
 /*
  * Copyright (c) 2001 Markus Friedl.  All rights reserved.
  *
@@ -29,6 +29,7 @@
 #include <sys/types.h>
 
 #include <sectok.h>
+#include <stdarg.h>
 #include <string.h>
 
 #include <openssl/evp.h>
@@ -390,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.481936 seconds and 4 git commands to generate.