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

Required version of OpenSSL? #101

Closed
thierry-FreeBSD opened this issue Sep 30, 2022 · 8 comments
Closed

Required version of OpenSSL? #101

thierry-FreeBSD opened this issue Sep 30, 2022 · 8 comments
Labels

Comments

@thierry-FreeBSD
Copy link
Contributor

Hello,
In cbang 1.7.0, the configuration script checks that openssl is at least 1.1.0:

Checking for openssl version >= 1.1.0...yes

But src/cbang/openssl/KeyPair.cpp includes openssl/core_names.h which is only available in the devel version of OpenSSL, and also src/cbang/openssl/KeyContext.cpp uses EVP_PKEY_CTX_set1_rsa_keygen_pubexp which is not available in the OpenSSL stable (1.1.1q).

I would rather avoid using the devel version, because it would introduce conflicts with other applications.

@jcoffland
Copy link
Member

openssl/core_names.h and EVP_PKEY_CTX_set1_rsa_keygen_pubexp are only required if OpenSSL is >= 3.0. Please post the build errors you are seeing.

I'm not sure what you mean by the development version of openssl. What OS and distribution are you referring to?

@jcoffland
Copy link
Member

To answer your original question, C! is supposed build with OpenSSL >= 1.1.0. However, I have not tested it with all possible OpenSSL releases >= 1.1.0.

@thierry-FreeBSD
Copy link
Contributor Author

On FreeBSD, with SSL in base (this is OpenSSL 1.1.1p-freebsd 21 Jun 2022), configuration is OK, but compilation fails with these errors:

c++ -o build/cbang/os/CPUInfo.os -c -faligned-new -std=c++17 -fsigned-char -O2 -pipe -fstack-protector-strong -isystem /usr/local/include -fno-strict-aliasing -isystem /usr/local/include -funroll-loops -fno-pie -O2 -pipe -fstack-protector-strong -isystem /usr/local/include -fno-strict-aliasing -fPIC -fPIC -DNDEBUG -D_REENTRANT -DUSING_CBANG -Iinclude -Isrc -Isrc/boost src/cbang/os/CPUInfo.cpp
src/cbang/openssl/KeyContext.cpp:124:7: error: use of undeclared identifier 'EVP_PKEY_CTX_set1_rsa_keygen_pubexp'
  if (EVP_PKEY_CTX_set1_rsa_keygen_pubexp(ctx, num.get()) <= 0)
      ^
1 error generated.
scons: *** [build/cbang/openssl/KeyContext.o] Error 1
src/cbang/openssl/KeyPair.cpp:57:10: fatal error: 'openssl/core_names.h' file not found
#include <openssl/core_names.h>
         ^~~~~~~~~~~~~~~~~~~~~~
1 error generated.
scons: *** [build/cbang/openssl/KeyPair.o] Error 1
scons: building terminated because of errors.

Remark: when using openssl-3.0.5 (this is what we name "devel"), cbang just builds without error.

@jcoffland
Copy link
Member

Are you using the latest C!? An intermediate commit did not support OpenSSL 1.1.1 correctly.

@thierry-FreeBSD
Copy link
Contributor Author

No, I get this with the version tagged 1.7.0.

@jcoffland
Copy link
Member

Try the latest.

@thierry-FreeBSD
Copy link
Contributor Author

This is OK with files from your commit ba780e4
Maybe it would be interesting to tag a new 1.7.1 ?

@jcoffland
Copy link
Member

Tagged

netgate-git-updates pushed a commit to pfsense/FreeBSD-ports that referenced this issue Oct 1, 2022
This includes the patches related to OpenSSL: see
<CauldronDevelopmentLLC/cbang#101 (comment)>

Also bump compiler to c++17-lang as noticed by diizzy@.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants