MicrochipTech / cryptoauth-openssl-engine

DEPRECATED: Use https://github.com/MicrochipTech/cryptoauthlib/wiki/PKCS11-Linux-Setup
Other
76 stars 49 forks source link

Compile errors with openssl-1.0.2n #15

Open vgottardi opened 6 years ago

vgottardi commented 6 years ago

Building the engine against openssl-1.0.2n (or 1.0.2m) generates errors. Latest commit in evp.h on 1.0.2 branch seems to be the culprit - https://github.com/openssl/openssl/commits/OpenSSL_1_0_2-stable/crypto/evp/evp.h

/home/debian/cryptoauth-openssl-engine-github/cryptoauthlib/lib/openssl/eccx08_eckey_meth.c:815:13: error: static declaration of ‘EVP_PKEY_meth_get_init’ follows non-static declaration
 static void EVP_PKEY_meth_get_init(EVP_PKEY_METHOD *pmeth,
             ^~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/local/ssl/include/openssl/x509.h:73:0,
                 from /usr/local/ssl/include/openssl/engine.h:99,
                 from /home/debian/cryptoauth-openssl-engine-github/cryptoauthlib/lib/openssl/eccx08_engine.h:41,
                 from /home/debian/cryptoauth-openssl-engine-github/cryptoauthlib/lib/openssl/eccx08_eckey_meth.c:39:
/usr/local/ssl/include/openssl/evp.h:1366:6: note: previous declaration of ‘EVP_PKEY_meth_get_init’ was here
 void EVP_PKEY_meth_get_init(EVP_PKEY_METHOD *pmeth,
      ^~~~~~~~~~~~~~~~~~~~~~
bryan-hunt commented 6 years ago

Looks like they're backporting functions from 1.1 that they overlooked in 1.0.2.

Does a #if OPENSSL_VERSION_NUMBER < 0x100020d0 block around those functions work?

vgottardi commented 6 years ago

Yes, thanks. That seems to work fine.