tpm2-software / tpm2-tss-engine

OpenSSL Engine for TPM2 devices
https://tpm2-software.github.io
BSD 3-Clause "New" or "Revised" License
151 stars 100 forks source link

Issue encountered during make #174

Closed crapster-goh closed 4 years ago

crapster-goh commented 4 years ago
 CC       src/libtpm2tss_la-tpm2-tss-engine-ecc.lo
 src/tpm2-tss-engine-ecc.c: In function 'init_ecc':
 src/tpm2-tss-engine-ecc.c:576:36: error: passing argument 1 of 'ECDSA_METHOD_new' discards 'const' qualifier from pointer target type [-Werror=discarded-qualifiers]
      ecc_methods = ECDSA_METHOD_new(ecc_method_default);
                                     ^~~~~~~~~~~~~~~~~~
 In file included from ../missing_libs/openssl-1.0.2/include/openssl/engine.h:89,
                  from src/tpm2-tss-engine-ecc.c:34:
 ../missing_libs/openssl-1.0.2/include/openssl/ecdsa.h:236:15: note: expected 'ECDSA_METHOD *' {aka 'struct ecdsa_method *'} but argument is of type 'const ECDSA_METHOD *' {aka 'const struct ecdsa_method *'}
  ECDSA_METHOD *ECDSA_METHOD_new(ECDSA_METHOD *ecdsa_method);
                ^~~~~~~~~~~~~~~~
 cc1: all warnings being treated as errors
 make: *** [Makefile:1034: src/libtpm2tss_la-tpm2-tss-engine-ecc.lo] Error 1

Hi, I'm getting the above weird error when I call make.

I'm using: ./configure --host=aarch64-v8a-linux-gnu --prefix=/home/udl/test --enable-tctienvvar make

Do you have any idea why I am facing this issue?

thanks!

crapster-goh commented 4 years ago

I turned off Werror, and installed the program.

However, I end up getting the following runtime error while using the engine

./openssl rsa -engine tpm2tss -inform engine -in mykey -pubout -outform pem -out mykey.pub
engine "tpm2tss" set.
writing RSA key
double free or corruption (out)
Aborted

However, tpm2tss-genkey -a rsa -s 2048 mykey and openssl rand -engine tpm2tss -hex 10 seem to work just fine

AndreasFuchsTPM commented 4 years ago

What's your exact openssl version ? I know you are running some 1.0.2something. We need >1.0.2g.

P.S. You sould maybe upgrade to 1.1.1, since support for 1.0.2 is ending...

crapster-goh commented 4 years ago

Thanks a lot! I shall upgrade my OpenSSL version and update you again.

crapster-goh commented 4 years ago

Thanks so much! Upgrading my OpenSSL to 1.0.2u worked.