openca / libpki

Easy-to-use high-level library for PKI-enabled applications
Other
52 stars 34 forks source link

Compilation on Arch Linux fails with "openssl_hsm_pkey.c:193:5: error: ‘EVP_PKEY_get1_RSA’ is deprecated: Since OpenSSL 3.0 [-Werror=deprecated-declarations]" #89

Open schaiba opened 5 months ago

schaiba commented 5 months ago

Hey,

Arch Linux up-to-date amd64, gcc version 14.1.1, and the complete error is this :

libtool: compile:  gcc -I. -I../../../src/libpki -I../.. -DENABLE_ECDSA=1 -D__LIB_BUILD__ -g -O2 -maccumulate-outgoing-args -Wno-deprecated -Wall -Wmissing-field-initializers -Wmissing-parameter-type -Wtype-limits -Wuninitialized -Wconversion -Wfatal-errors -Wunused-variable -Werror -Wno-switch -DENABLE_ECDSA=1 -DENABLE_COMPOSITE=1 -I/usr/include/libxml2 -I/usr/include/mysql -I/usr/include/mysql/mysql -I/usr/include -DLINUX -g -O2 -maccumulate-outgoing-args -Wno-deprecated -Wall -Wmissing-field-initializers -Wmissing-parameter-type -Wtype-limits -Wuninitialized -Wconversion -Wfatal-errors -Wunused-variable -Werror -MT libpki_token_openssl_la-openssl_hsm_pkey.lo -MD -MP -MF .deps/libpki_token_openssl_la-openssl_hsm_pkey.Tpo -c openssl_hsm_pkey.c  -fPIC -DPIC -o .libs/libpki_token_openssl_la-openssl_hsm_pkey.o
openssl_hsm_pkey.c: In function ‘_pki_rsakey_new’:
openssl_hsm_pkey.c:193:5: error: ‘EVP_PKEY_get1_RSA’ is deprecated: Since OpenSSL 3.0 [-Werror=deprecated-declarations]
  193 |     rsa = EVP_PKEY_get1_RSA(pkey);
      |     ^~~
compilation terminated due to -Wfatal-errors.
cc1: all warnings being treated as errors
ruomad commented 5 months ago

You must remove -Wfatal-errors, there are a lot of warnings of deprecated functions after openssl 3

e64462 commented 3 months ago

I'm on Ubuntu 22.04. I was drawn here by a similar error, so I ran ./configure CFLAGS='-w' to suppress the warnings. The build process got further, before terminating with:

libtool: compile:  gcc -I. -I../../src/libpki -I.. -DENABLE_ECDSA=1 -D__LIB_BUILD__ -I/usr/include -w -maccumulate-outgoing-args -Werror -Wfatal-errors -Wunused-variable -Wno-switch -DENABLE_ECDSA=1 -I/usr/include/libxml2 -I/usr/include/mysql -DLINUX -w -maccumulate-outgoing-args -Werror -Wfatal-errors -Wunused-variable -MT libpki_openssl_la-pki_id.lo -MD -MP -MF .deps/libpki_openssl_la-pki_id.Tpo -c pki_id.c  -fPIC -DPIC -o .libs/libpki_openssl_la-pki_id.o
pki_id.c: In function ‘PKI_ID_is_composite’:
pki_id.c:86:25: error: ‘OPENCA_ALG_PKEY_EXP_COMP_NAME’ undeclared (first use in this function)
   86 |         if (OBJ_txt2nid(OPENCA_ALG_PKEY_EXP_COMP_NAME) == id) {
      |                         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated due to -Wfatal-errors.

If there was a bertter way to "remove -Wfatal-errors" I would be happy to try it. Please just provide those instructions

e64462 commented 3 months ago

I'm on Ubuntu 22.04. I was drawn here by a similar error, so I ran ./configure CFLAGS='-w' to suppress the warnings. The build process got further, before terminating with:

libtool: compile:  gcc -I. -I../../src/libpki -I.. -DENABLE_ECDSA=1 -D__LIB_BUILD__ -I/usr/include -w -maccumulate-outgoing-args -Werror -Wfatal-errors -Wunused-variable -Wno-switch -DENABLE_ECDSA=1 -I/usr/include/libxml2 -I/usr/include/mysql -DLINUX -w -maccumulate-outgoing-args -Werror -Wfatal-errors -Wunused-variable -MT libpki_openssl_la-pki_id.lo -MD -MP -MF .deps/libpki_openssl_la-pki_id.Tpo -c pki_id.c  -fPIC -DPIC -o .libs/libpki_openssl_la-pki_id.o
pki_id.c: In function ‘PKI_ID_is_composite’:
pki_id.c:86:25: error: ‘OPENCA_ALG_PKEY_EXP_COMP_NAME’ undeclared (first use in this function)
   86 |         if (OBJ_txt2nid(OPENCA_ALG_PKEY_EXP_COMP_NAME) == id) {
      |                         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated due to -Wfatal-errors.

If there was a bertter way to "remove -Wfatal-errors" I would be happy to try it. Please just provide those instructions

resolved with

./configure CFLAGS='-w' --enable-extra-checks --enable-composite
make