[pkg-opensc-commit] [libp11] 180/239: Fix using older OpenSSL without adding the libp11 ECDSA code

Eric Dorland eric at moszumanska.debian.org
Sat Oct 17 06:21:31 UTC 2015


This is an automated email from the git hooks/post-receive script.

eric pushed a commit to branch master
in repository libp11.

commit 11d644b3a4abf00ba3c21d47e55921457f9e530f
Author: Doug Engert <deengert at gmail.com>
Date:   Sun Jan 4 19:16:46 2015 -0600

    Fix using older OpenSSL without adding the libp11 ECDSA code
---
 src/libp11-int.h | 2 +-
 src/p11_ec.c     | 6 +++++-
 src/p11_key.c    | 5 ++++-
 3 files changed, 10 insertions(+), 3 deletions(-)

diff --git a/src/libp11-int.h b/src/libp11-int.h
index 1ebf01e..5b0ccea 100644
--- a/src/libp11-int.h
+++ b/src/libp11-int.h
@@ -158,6 +158,6 @@ extern void pkcs11_zap_attrs(CK_ATTRIBUTE_PTR, unsigned int);
 extern void *memdup(const void *, size_t);
 
 extern PKCS11_KEY_ops pkcs11_rsa_ops;
-extern PKCS11_KEY_ops pkcs11_ec_ops;
+extern PKCS11_KEY_ops *pkcs11_ec_ops;
 
 #endif
diff --git a/src/p11_ec.c b/src/p11_ec.c
index 05b50dc..c5bad4e 100644
--- a/src/p11_ec.c
+++ b/src/p11_ec.c
@@ -296,13 +296,17 @@ void PKCS11_ecdsa_method_free(void)
 }
 #endif
 
-PKCS11_KEY_ops pkcs11_ec_ops = {
+PKCS11_KEY_ops pkcs11_ec_ops_s = {
 	EVP_PKEY_EC,
 	pkcs11_get_ec_public,
 	pkcs11_get_ec_private
 };
+PKCS11_KEY_ops  *pkcs11_ec_ops = {&pkcs11_ec_ops_s};
 
 #else /* LIBP11_BUILD_WITHOUT_ECDSA */
+
+void *pkcs11_ec_ops = {NULL};
+
 /* if not built with EC or OpenSSL does not support ECDSA
  * add these routines so engine_pkcs11 can be built now and not
  * require further changes */
diff --git a/src/p11_key.c b/src/p11_key.c
index 0efd862..d338253 100644
--- a/src/p11_key.c
+++ b/src/p11_key.c
@@ -290,8 +290,11 @@ static int pkcs11_init_key(PKCS11_CTX * ctx, PKCS11_TOKEN * token,
 	case CKK_RSA:
 		ops = &pkcs11_rsa_ops;
 		break;
+
 	case CKK_EC:
-		ops = &pkcs11_ec_ops;
+		ops = pkcs11_ec_ops;
+		if (ops == NULL)
+		    return 0; /* not supported */
 		break;
 	default:
 		/* Ignore any keys we don't understand */

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-opensc/libp11.git



More information about the pkg-opensc-commit mailing list