From 1ecd64ed9305f91f54982abbf7f5eec989575f19 Mon Sep 17 00:00:00 2001 From: s Date: Fri, 23 Oct 2009 18:16:59 +0000 Subject: [PATCH] fix: compile with openssl-1.0 beta3 http://www.opensc-project.org/pipermail/opensc-devel/2009-October/012702.html Thanks to Kalev Lember git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3791 c6295689-39f2-0310-b995-f0e70906c6a9 --- src/pkcs11/openssl.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/pkcs11/openssl.c b/src/pkcs11/openssl.c index e84e9b3e..786329d6 100644 --- a/src/pkcs11/openssl.c +++ b/src/pkcs11/openssl.c @@ -14,8 +14,11 @@ #include #include #if OPENSSL_VERSION_NUMBER >= 0x10000000L -#include #include +#include /* for OPENSSL_NO_EC */ +#ifndef OPENSSL_NO_EC +#include +#endif /* OPENSSL_NO_EC */ #endif /* OPENSSL_VERSION_NUMBER >= 0x10000000L */ static CK_RV sc_pkcs11_openssl_md_init(sc_pkcs11_operation_t *); @@ -248,7 +251,7 @@ sc_pkcs11_gen_keypair_soft(CK_KEY_TYPE keytype, CK_ULONG keybits, return CKR_OK; } -#if OPENSSL_VERSION_NUMBER >= 0x10000000L +#if OPENSSL_VERSION_NUMBER >= 0x10000000L && !defined(OPENSSL_NO_EC) static void reverse(unsigned char *buf, size_t len) { @@ -328,7 +331,7 @@ static CK_RV gostr3410_verify_data(const unsigned char *pubkey, int pubkey_len, return CKR_GENERAL_ERROR; return ret_vrf == 1 ? CKR_OK : CKR_SIGNATURE_INVALID; } -#endif /* OPENSSL_VERSION_NUMBER >= 0x10000000L */ +#endif /* OPENSSL_VERSION_NUMBER >= 0x10000000L && !defined(OPENSSL_NO_EC) */ /* If no hash function was used, finish with RSA_public_decrypt(). * If a hash function was used, we can make a big shortcut by @@ -346,11 +349,12 @@ CK_RV sc_pkcs11_verify_data(const unsigned char *pubkey, int pubkey_len, if (mech == CKM_GOSTR3410) { -#if OPENSSL_VERSION_NUMBER >= 0x10000000L +#if OPENSSL_VERSION_NUMBER >= 0x10000000L && !defined(OPENSSL_NO_EC) return gostr3410_verify_data(pubkey, pubkey_len, pubkey_params, pubkey_params_len, data, data_len, signat, signat_len); #else + (void)pubkey_params, (void)pubkey_params_len; /* no warning */ return CKR_FUNCTION_NOT_SUPPORTED; #endif }