You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@thrift.apache.org by "Joe McDonnell (Jira)" <ji...@apache.org> on 2023/05/10 01:08:00 UTC
[jira] [Commented] (THRIFT-5706) C++ SecurityTest/SecurityFromBufferTest won't build with OpenSSL v1
[ https://issues.apache.org/jira/browse/THRIFT-5706?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17721130#comment-17721130 ]
Joe McDonnell commented on THRIFT-5706:
---------------------------------------
OpenSSL 3 still provides OPENSSL_VERSION_NUMBER, so the following should work:
{noformat}
bool ossl1 = (OPENSSL_VERSION_NUMBER & 0xff000000L) == 0x10000000L;{noformat}
> C++ SecurityTest/SecurityFromBufferTest won't build with OpenSSL v1
> -------------------------------------------------------------------
>
> Key: THRIFT-5706
> URL: https://issues.apache.org/jira/browse/THRIFT-5706
> Project: Thrift
> Issue Type: Bug
> Components: C++ - Library
> Affects Versions: 0.19.0
> Reporter: Joe McDonnell
> Priority: Major
>
> C++ SecurityTest / SecurityFromBufferTest hit this error when trying to build:
> {noformat}
> SecurityTest.cpp: In member function ‘void SecurityTest::ssl_security_matrix::test_method()’:
> SecurityTest.cpp:224:22: error: ‘OPENSSL_VERSION_MAJOR’ was not declared in this scope; did you mean ‘OPENSSL_VERSION_NUMBER’?
> 224 | bool ossl1 = OPENSSL_VERSION_MAJOR == 1;
> | ^~~~~~~~~~~~~~~~~~~~~
> | OPENSSL_VERSION_NUMBER
> make[5]: *** [Makefile:1407: SecurityTest.o] Error 1
> {noformat}
> OPENSSL_VERSION_MAJOR is new in OpenSSL 3. Older versions of OpenSSL used OPENSSL_VERSION_NUMBER. Here is the description from my Ubuntu 20 box:
> {noformat}
> /*-
> * Numeric release version identifier:
> * MNNFFPPS: major minor fix patch status
> * The status nibble has one of the values 0 for development, 1 to e for betas
> * 1 to 14, and f for release. The patch level is exactly that.
> * For example:
> * 0.9.3-dev 0x00903000
> * 0.9.3-beta1 0x00903001
> * 0.9.3-beta2-dev 0x00903002
> * 0.9.3-beta2 0x00903002 (same as ...beta2-dev)
> * 0.9.3 0x0090300f
> * 0.9.3a 0x0090301f
> * 0.9.4 0x0090400f
> * 1.2.3z 0x102031af
> *
> * For continuity reasons (because 0.9.5 is already out, and is coded
> * 0x00905100), between 0.9.5 and 0.9.6 the coding of the patch level
> * part is slightly different, by setting the highest bit. This means
> * that 0.9.5a looks like this: 0x0090581f. At 0.9.6, we can start
> * with 0x0090600S...
> *
> * (Prior to 0.9.3-dev a different scheme was used: 0.9.2b is 0x0922.)
> * (Prior to 0.9.5a beta1, a different scheme was used: MMNNFFRBB for
> * major minor fix final patch/beta)
> */
> # define OPENSSL_VERSION_NUMBER 0x1010106fL{noformat}
--
This message was sent by Atlassian Jira
(v8.20.10#820010)