[pkg-opensc-commit] [libp11] 19/27: src/p11_ec.c: check OPENSSL_NO_EC earlier (#164)

Eric Dorland eric at moszumanska.debian.org
Mon Aug 7 19:48:09 UTC 2017


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

eric pushed a commit to branch master
in repository libp11.

commit 60795445bb4f4e9b537c4db3e2e3b77b46e2ce83
Author: Kai <kai.7.kang at gmail.com>
Date:   Tue Jul 4 02:36:18 2017 +0800

    src/p11_ec.c: check OPENSSL_NO_EC earlier (#164)
    
    Function compute_key_fn uses types EC_POINT and EC_KEY which are defined
    in ec.h. If OPENSSL_NO_EC is defined, no header file ec.h exists and
    causes compile errors.
    
    ../../git/src/p11_ec.c:45:8: error: unknown type name 'EC_POINT'
      const EC_POINT *, const EC_KEY *,
            ^~~~~~~~
    ../../git/src/p11_ec.c:45:26: error: unknown type name 'EC_KEY'
      const EC_POINT *, const EC_KEY *,
                              ^~~~~~
    So check OPENSSL_NO_EC earlier in src/p11_ec.c.
    
    Signed-off-by: Kai Kang <kai.kang at windriver.com>
---
 src/p11_ec.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/p11_ec.c b/src/p11_ec.c
index 8647fd8..37025d4 100644
--- a/src/p11_ec.c
+++ b/src/p11_ec.c
@@ -37,6 +37,8 @@
 #include <openssl/ecdh.h>
 #endif
 
+#ifndef OPENSSL_NO_EC
+
 #if OPENSSL_VERSION_NUMBER >= 0x10100004L && !defined(LIBRESSL_VERSION_NUMBER)
 typedef int (*compute_key_fn)(unsigned char **, size_t *,
 	const EC_POINT *, const EC_KEY *);
@@ -49,8 +51,6 @@ static compute_key_fn ossl_ecdh_compute_key;
 
 static int ec_ex_index = 0;
 
-#ifndef OPENSSL_NO_EC
-
 /********** Missing ECDSA_METHOD functions for OpenSSL < 1.1.0 */
 
 typedef ECDSA_SIG *(*sign_sig_fn)(const unsigned char *, int,

-- 
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