EVerest / libevse-security

Apache License 2.0
7 stars 5 forks source link

Does not compile on Ubuntu 20.04.5 LTS #31

Closed SirVer closed 6 months ago

SirVer commented 6 months ago

I followed https://github.com/qwello/everest-core?tab=readme-ov-file#build--install on a fresh installation of Ubuntu 20.04.5. I see the following compile error:

[0/798] Building CXX object _deps/everest-framework-build/lib/CMakeFiles/framework.dir/config.cpp.o

[271/798] Building CXX object _deps/libevse-security-build/lib/evse_security/CMakeFiles/evse_security.dir/crypto/openssl/openssl_supplier.cpp.o
FAILED: _deps/libevse-security-build/lib/evse_security/CMakeFiles/evse_security.dir/crypto/openssl/openssl_supplier.cpp.o
/usr/bin/c++  -DBOOST_ALL_NO_LIB -DBOOST_ATOMIC_DYN_LINK -DBOOST_CHRONO_DYN_LINK -DBOOST_DATE_TIME_DYN_LINK -DBOOST_FILESYSTEM_DYN_LINK -DBOOST_LOG_DYN_LINK -DBOOST_REGEX_DYN_LINK -DBOOST_THREAD_DYN_LINK -DLIBEVSE_CRYPTO_SUPPLIER_OPENSSL -I/home/odroid/holger/everest/everest-workspace/libevse-security/include -I/home/odroid/holger/everest/everest-workspace/liblog/include -std=gnu++17 -MD -MT _deps/libevse-security-build/lib/evse_security/CMakeFiles/evse_security.dir/crypto/openssl/openssl_supplier.cpp.o -MF _deps/libevse-security-build/lib/evse_security/CMakeFiles/evse_security.dir/crypto/openssl/openssl_supplier.cpp.o.d -o _deps/libevse-security-build/lib/evse_security/CMakeFiles/evse_security.dir/crypto/openssl/openssl_supplier.cpp.o -c /home/odroid/holger/everest/everest-workspace/libevse-security/lib/evse_security/crypto/openssl/openssl_supplier.cpp
In file included from /home/odroid/holger/everest/everest-workspace/libevse-security/lib/evse_security/crypto/openssl/openssl_supplier.cpp:5:
/home/odroid/holger/everest/everest-workspace/libevse-security/include/evse_security/detail/openssl/openssl_providers.hpp:12:10: fatal error: openssl/provider.h: No such file or directory
   12 | #include <openssl/provider.h>
      |          ^~~~~~~~~~~~~~~~~~~~
compilation terminated.
ninja: build stopped: subcommand failed.

I have openssl-dev installed:

sudo apt install libssl-dev
[sudo] password for odroid:
Reading package lists... Done
Building dependency tree
Reading state information... Done
libssl-dev is already the newest version (1.1.1f-1ubuntu2.20).
0 upgraded, 0 newly installed, 0 to remove and 319 not upgraded.

What can I do to fix this?

SirVer commented 6 months ago

Pinging @hikinggrass , because I am not sure if somebody is monitoring the issues in this repo.

SirVer commented 6 months ago

dpkg -L libssl-dev also shows that provider.h is not a valid header shipped with OpenSSL. It seems to be an internal header and should probably not be included in the first place?

AssemblyJohn commented 6 months ago

Probably a openssl 1.1 version issue, the header is only usable in openssl 3+

SirVer commented 6 months ago

Well, then https://github.com/qwello/everest-core?tab=readme-ov-file#ubuntu-2004--2204 is not correct, right? It states that ubuntu 20.04 is recommended and installs libssl-dev, which is 1.1

SirVer commented 6 months ago

I reverted to 977154d1768642ee59bc367cb29af52db497cdb7, which still compiles fine. This is not a long term solution obviously.

AssemblyJohn commented 6 months ago

Well, then https://github.com/qwello/everest-core?tab=readme-ov-file#ubuntu-2004--2204 is not correct, right? It states that ubuntu 20.04 is recommended and installs libssl-dev, which is 1.1

Will be updated on our side, to keep support for openssl ver 1

AssemblyJohn commented 6 months ago

Try out: https://github.com/EVerest/libevse-security/pull/32

SirVer commented 6 months ago

It does work now, thank you very much!