Giter Site home page Giter Site logo

build error with OpenSSL 1.0.2d about libp11 HOT 4 CLOSED

opensc avatar opensc commented on August 17, 2024
build error with OpenSSL 1.0.2d

from libp11.

Comments (4)

dengert avatar dengert commented on August 17, 2024

What is the configure command?

BUILD_WITH_ECS_LOCL_H is not needed with OpenSSL-1.0.2

40 /* To build this mode,
41 * OpenSSL has ECDSA_METHOD defined in internal header file ecs_locl.h
42 * Until this is resolved use something like:
43 * CPPFLAGS="-DBUILD_WITH_ECS_LOCL_H -I/path.to.openssl-1.0.1e/src/crypto/ec dsa"
44 * See OpenSSL bug report #2459 02/23/2011
45 * Once OpenSSL addresses the issues this code will be changed.
46 *
47 * OpenSSL mods were submitted 09/2013 that will set ECDSA_F_ECDSA_METHOD_NE W
48 * and define the ECDSA_METHOD_new and friends functions
49 * These mods are in OpenSSL-1.0.2-beta
50 * We will try both methods.
51 */

Note line 49

On 11/2/2015 1:47 AM, Ivan Wallis wrote:

Hi,

Getting an error when attempting to build libp11 0.3.0 against openssl-1.0.2d:

make all-recursive
make[1]: Entering directory |/root/libp11-master'
Making all in src
make[2]: Entering directory|/root/libp11-master/src'
CC libp11_la-p11_ec.lo
p11_ec.c:54:7: warning: #warning "Both BUILD_WITH_ECS_LOCL_H and ECDSA_F_ECDSA_METHOD_NEW defined" [-Wcpp]
#warning "Both BUILD_WITH_ECS_LOCL_H and ECDSA_F_ECDSA_METHOD_NEW defined"
^
p11_ec.c:55:7: warning: #warning "Consider not using BUILD_WITH_ECS_LOCL_H" [-Wcpp]
#warning "Consider not using BUILD_WITH_ECS_LOCL_H"
^
p11_ec.c:59:6: warning: #warning "Consider not using BUILD_WITH_ECS_LOCL_H" [-Wcpp]
#warning "Consider not using BUILD_WITH_ECS_LOCL_H"
^
p11_ec.c:60:6: warning: #warning "newer version of OpenSSL >-1.0.2 does not need BUILD_WITH_ECS_LOCL_H" [-Wcpp]
#warning "newer version of OpenSSL >-1.0.2 does not need BUILD_WITH_ECS_LOCL_H"
^
p11_ec.c:61:26: fatal error: ecs_locl.h: No such file or directory
#include "ecs_locl.h"
^
compilation terminated.
make[2]: *** [libp11_la-p11_ec.lo] Error 1
make[2]: Leaving directory |/root/libp11-master/src'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory|/root/libp11-master'
make: *** [all] Error 2

β€”
Reply to this email directly or view it on GitHub #32.

Douglas E. Engert [email protected]

from libp11.

zosocanuck avatar zosocanuck commented on August 17, 2024

For OpenSSL:

/Configure linux-x86_64 --prefix=/opt/openssl-1.0.2d shared

for libp11:

./configure OPENSSL_CFLAGS="-I/opt/openssl-1.0.2d/include" OPENSSL_LIBS="-L/opt/openssl-1.0.2d/lib -lcrypt"

from libp11.

dengert avatar dengert commented on August 17, 2024

Something in your source or build process is defining BUILD_WITH_ECS_LOCL_H.
That was a temporary fix to allow the ECDSA to work with older versions of OpenSSL.
(It took OpenSSL 5 years to add ECDSA_F_ECDSA_METHOD_NEW).

Try grep for BUILD_WITH_ECS_LOCL_H.

Also try changing src/Makefile:
AM_DEFAULT_VERBOSITY = 0
to
AM_DEFAULT_VERBOSITY = 1

Then in the src directory, do a
make clean
make
This should then show what is getting pased.

On Ubuntu using the gitbub source from today, I get:
/bin/bash ../libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I../../src/src -I.. -I/opt/smartcard/include -g -MT libp11_la-p11_ec.lo -MD -MP -MF .deps/libp11_la-p11_ec.Tpo -c -o libp11_la-p11_ec.lo test -f 'p11_ec.c' || echo '../../src/src/'p11_ec.c
libtool: compile: gcc -DHAVE_CONFIG_H -I. -I../../src/src -I.. -I/opt/smartcard/include -g -MT libp11_la-p11_ec.lo -MD -MP -MF .deps/libp11_la-p11_ec.Tpo -c ../../src/src/p11_ec.c -fPIC -DPIC -o .libs/libp11_la-p11_ec.o
../../src/src/p11_ec.c: In function 'PKCS11_get_ecdsa_method':
../../src/src/p11_ec.c:265:2: warning: passing argument 1 of 'ECDSA_METHOD_new' discards 'const' qualifier from pointer target type [enabled by default]
ops = ECDSA_METHOD_new(ECDSA_OpenSSL());
^
In file included from ../../src/src/p11_ec.c:38:0:
/opt/smartcard/include/openssl/ecdsa.h:236:15: note: expected 'struct ECDSA_METHOD *' but argument is of type 'const struct ECDSA_METHOD *'
ECDSA_METHOD *ECDSA_METHOD_new(ECDSA_METHOD *ecdsa_method);
^

from libp11.

zosocanuck avatar zosocanuck commented on August 17, 2024

ok, cleaned the build environment and its selecting the METHOD_NEW, however it fails upon attempting to build the examples:

Making all in examples
make[2]: Entering directory /root/libp11-master/examples' CCLD auth auth.o: In functionmain':
/root/libp11-master/examples/auth.c:49: undefined reference to ERR_get_error' /root/libp11-master/examples/auth.c:49: undefined reference toERR_reason_error_string'
/root/libp11-master/examples/auth.c:215: undefined reference to ERR_print_errors_fp' /root/libp11-master/examples/auth.c:181: undefined reference toX509_get_pubkey'
/root/libp11-master/examples/auth.c:188: undefined reference to RSA_verify' /root/libp11-master/examples/auth.c:196: undefined reference toEVP_PKEY_free'
/root/libp11-master/examples/auth.c:207: undefined reference to CRYPTO_cleanup_all_ex_data' /root/libp11-master/examples/auth.c:208: undefined reference toERR_free_strings'
../src/.libs/libp11.so: undefined reference to o2i_ECPublicKey' ../src/.libs/libp11.so: undefined reference toBIO_new_fp'
../src/.libs/libp11.so: undefined reference to CRYPTO_free' ../src/.libs/libp11.so: undefined reference toECDSA_METHOD_free'
../src/.libs/libp11.so: undefined reference to ECDSA_METHOD_set_sign_setup' ../src/.libs/libp11.so: undefined reference toECDSA_OpenSSL'
../src/.libs/libp11.so: undefined reference to i2d_X509' ../src/.libs/libp11.so: undefined reference toRSA_get_ex_data'
../src/.libs/libp11.so: undefined reference to CRYPTO_malloc' ../src/.libs/libp11.so: undefined reference toBN_new'
../src/.libs/libp11.so: undefined reference to i2d_X509_SIG' ../src/.libs/libp11.so: undefined reference tod2i_ASN1_OCTET_STRING'
../src/.libs/libp11.so: undefined reference to RSA_set_ex_data' ../src/.libs/libp11.so: undefined reference toOBJ_nid2obj'
../src/.libs/libp11.so: undefined reference to BN_num_bits' ../src/.libs/libp11.so: undefined reference toECDSA_METHOD_set_sign'
../src/.libs/libp11.so: undefined reference to BN_bin2bn' ../src/.libs/libp11.so: undefined reference toRSA_free'
../src/.libs/libp11.so: undefined reference to RSA_set_method' ../src/.libs/libp11.so: undefined reference toASN1_STRING_free'
../src/.libs/libp11.so: undefined reference to EVP_PKEY_get1_EC_KEY' ../src/.libs/libp11.so: undefined reference toRSA_get_default_method'
../src/.libs/libp11.so: undefined reference to ECDSA_set_ex_data' ../src/.libs/libp11.so: undefined reference toOPENSSL_cleanse'
../src/.libs/libp11.so: undefined reference to BN_free' ../src/.libs/libp11.so: undefined reference toECDSA_SIG_new'
../src/.libs/libp11.so: undefined reference to ECDSA_get_ex_data' ../src/.libs/libp11.so: undefined reference toERR_clear_error'
../src/.libs/libp11.so: undefined reference to d2i_ECParameters' ../src/.libs/libp11.so: undefined reference toEVP_PKEY_get1_RSA'
../src/.libs/libp11.so: undefined reference to ERR_load_strings' ../src/.libs/libp11.so: undefined reference toBIO_free'
../src/.libs/libp11.so: undefined reference to BN_bn2bin' ../src/.libs/libp11.so: undefined reference toRSA_new'
../src/.libs/libp11.so: undefined reference to EVP_PKEY_new' ../src/.libs/libp11.so: undefined reference toEC_KEY_free'
../src/.libs/libp11.so: undefined reference to EVP_PKEY_assign' ../src/.libs/libp11.so: undefined reference toX509_free'
../src/.libs/libp11.so: undefined reference to BN_cmp' ../src/.libs/libp11.so: undefined reference tod2i_X509'
../src/.libs/libp11.so: undefined reference to EC_KEY_new' ../src/.libs/libp11.so: undefined reference toBUF_strdup'
../src/.libs/libp11.so: undefined reference to ECDSA_METHOD_new' ../src/.libs/libp11.so: undefined reference toCRYPTO_realloc'
../src/.libs/libp11.so: undefined reference to EVP_PKEY_set1_EC_KEY' ../src/.libs/libp11.so: undefined reference toBN_clear_free'
../src/.libs/libp11.so: undefined reference to RSA_generate_key' ../src/.libs/libp11.so: undefined reference toERR_put_error'
../src/.libs/libp11.so: undefined reference to EVP_PKEY_set1_RSA' collect2: error: ld returned 1 exit status make[2]: *** [auth] Error 1 make[2]: Leaving directory/root/libp11-master/examples'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/root/libp11-master'
make: *** [all] Error 2

Any way to disable building examples besides hacking the makefile?

from libp11.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.