Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Does not build with OpenSSL 1.x #75

Closed
barsnick opened this issue May 21, 2024 · 4 comments · Fixed by #76
Closed

Does not build with OpenSSL 1.x #75

barsnick opened this issue May 21, 2024 · 4 comments · Fixed by #76
Assignees

Comments

@barsnick
Copy link

Describe the bug

libevse-security no longer builds with the Docker build script in everest-utils, which uses Debian 11 with OpenSSL 1.x.

In commit acc12fe, a dependency to OpenSSL 3 was reintroduced, through the use of (among others) X509_add_cert().

To Reproduce

In everest-utils:

./build.sh --name everest-core-test-01 --conf /path/to/some-config.yaml

Anything else?

See also the recent issues
EVerest/everest-utils#112
and
#31

So I assume OpenSSL 1.x compatibility is still desired.

224.6 [ 31%] Building CXX object _deps/sqlite_cpp-build/CMakeFiles/SQLiteCpp.dir/src/Database.cpp.o
224.7 /workspace/everest/cpm_source_cache/libevse-security/f4c722882414e8cb77a2f572b45fde98e2647f8d/libevse-security/lib/evse_security/crypto/openssl/openssl_supplier.cpp: In function 'bool evse_security::s_generate_key(const evse_security::KeyGenerationInfo&, evse_security::KeyHandle_ptr&, evse_security::EVP_PKEY_CTX_ptr&)':
224.7 /workspace/everest/cpm_source_cache/libevse-security/f4c722882414e8cb77a2f572b45fde98e2647f8d/libevse-security/lib/evse_security/crypto/openssl/openssl_supplier.cpp:259:75: warning: 'RSA* RSA_generate_key(int, long unsigned int, void (*)(int, int, void*), void*)' is deprecated [-Wdeprecated-declarations]
224.7   259 |         RSA_ptr rsa_key(RSA_generate_key(bits, RSA_PRIME, nullptr, nullptr));
224.7       |                                                                           ^
224.7 In file included from /usr/include/openssl/e_os2.h:13,
224.7                  from /usr/include/openssl/bio.h:13,
224.7                  from /usr/include/openssl/x509v3.h:13,
224.7                  from /workspace/everest/cpm_source_cache/libevse-security/f4c722882414e8cb77a2f572b45fde98e2647f8d/libevse-security/include/evse_security/detail/openssl/openssl_types.hpp:6,
224.7                  from /workspace/everest/cpm_source_cache/libevse-security/f4c722882414e8cb77a2f572b45fde98e2647f8d/libevse-security/lib/evse_security/crypto/openssl/openssl_supplier.cpp:5:
224.7 /usr/include/openssl/rsa.h:235:1: note: declared here
224.7   235 | DEPRECATEDIN_0_9_8(RSA *RSA_generate_key(int bits, unsigned long e, void
224.7       | ^~~~~~~~~~~~~~~~~~
224.7 /workspace/everest/cpm_source_cache/libevse-security/f4c722882414e8cb77a2f572b45fde98e2647f8d/libevse-security/lib/evse_security/crypto/openssl/openssl_supplier.cpp: In static member function 'static evse_security::CertificateValidationResult evse_security::OpenSSLSupplier::x509_verify_certificate_chain(evse_security::X509Handle*, const std::vector<evse_security::X509Handle*>&, const std::vector<evse_security::X509Handle*>&, bool, std::optional<std::filesystem::__cxx11::path>, std::optional<std::filesystem::__cxx11::path>)':
224.7 /workspace/everest/cpm_source_cache/libevse-security/f4c722882414e8cb77a2f572b45fde98e2647f8d/libevse-security/lib/evse_security/crypto/openssl/openssl_supplier.cpp:599:21: error: 'X509_ADD_FLAG_NO_DUP' was not declared in this scope; did you mean 'X509_FLAG_NO_AUX'?
224.7   599 |         int flags = X509_ADD_FLAG_NO_DUP | X509_ADD_FLAG_NO_SS;
224.7       |                     ^~~~~~~~~~~~~~~~~~~~
224.7       |                     X509_FLAG_NO_AUX
224.8 /workspace/everest/cpm_source_cache/libevse-security/f4c722882414e8cb77a2f572b45fde98e2647f8d/libevse-security/lib/evse_security/crypto/openssl/openssl_supplier.cpp:599:44: error: 'X509_ADD_FLAG_NO_SS' was not declared in this scope; did you mean 'X509_FLAG_NO_IDS'?
224.8   599 |         int flags = X509_ADD_FLAG_NO_DUP | X509_ADD_FLAG_NO_SS;
224.8       |                                            ^~~~~~~~~~~~~~~~~~~
224.8       |                                            X509_FLAG_NO_IDS
224.8 /workspace/everest/cpm_source_cache/libevse-security/f4c722882414e8cb77a2f572b45fde98e2647f8d/libevse-security/lib/evse_security/crypto/openssl/openssl_supplier.cpp:602:22: error: 'X509_add_cert' was not declared in this scope; did you mean 'X509_add_ext'?
224.8   602 |             if (1 != X509_add_cert(untrusted.get(), get(untrusted_cert), flags)) {
224.8       |                      ^~~~~~~~~~~~~
224.8       |                      X509_add_ext
225.0 make[2]: *** [_deps/libevse-security-build/lib/evse_security/CMakeFiles/evse_security.dir/build.make:186: _deps/libevse-security-build/lib/evse_security/CMakeFiles/evse_security.dir/crypto/openssl/openssl_supplier.cpp.o] Error 1
225.0 make[1]: *** [CMakeFiles/Makefile2:4449: _deps/libevse-security-build/lib/evse_security/CMakeFiles/evse_security.dir/all] Error 2
@AssemblyJohn
Copy link
Collaborator

The openssl 1.1 compat usually causes many issues, including sometimes runtime issues, so I think we should bring up if we want to still support this lib that has been deprecated for almost 1 year.

@barsnick
Copy link
Author

I just wanted to point it out.

That's fine by me, if we still manage to support enough platforms. Specifically, Ubuntu 20 will need to be dropped, unless there's a PPA for that somewhere. Debian 11 obviously doesn't work anymore either. (I can open a bug on everest-utils for that.)

@barsnick
Copy link
Author

This line:

find_package(OpenSSL REQUIRED)

should probably state version 3:

find_package(OpenSSL 3 REQUIRED)

@AssemblyJohn AssemblyJohn self-assigned this May 23, 2024
@AssemblyJohn AssemblyJohn linked a pull request May 23, 2024 that will close this issue
3 tasks
@AssemblyJohn
Copy link
Collaborator

Closes with: #76

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants