Uploaded image for project: 'Thrift'
  1. Thrift
  2. THRIFT-5706

C++ SecurityTest/SecurityFromBufferTest won't build with OpenSSL v1

Attach filesAttach ScreenshotAdd voteVotersWatch issueWatchersCreate sub-taskLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Major
    • Resolution: Unresolved
    • 0.19.0
    • None
    • C++ - Library
    • None

    Description

      C++ SecurityTest / SecurityFromBufferTest hit this error when trying to build:

      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
      

      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:

      /*-
       * 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

      Attachments

        Activity

          This comment will be Viewable by All Users Viewable by All Users
          Cancel

          People

            Unassigned Unassigned
            joemcdonnell Joe McDonnell

            Dates

              Created:
              Updated:

              Time Tracking

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0h
                0h
                Logged:
                Time Spent - 1h 10m
                1h 10m

                Slack

                  Issue deployment