Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-73322

Include "openssl/ocsp.h" results in a build error

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P1: Critical
    • 5.13.0
    • 5.13
    • Network: SSL
    • None
    • Windows
    • 71a1c66ab9ae48f575b80290e1d5e3624fd81704 da4ab444ffac37514435364d4d3f0ad59d4f9bc3 (qt/qtbase/dev)

    Description

      Due to some problem coming from openssl's headers, we have a build failure on Windows 10 64 bit. Something along the lines:

       

      c:\openssl110\include\openssl/ocsp.h(178): error C2065: 'bs': undeclared identifier (compiling source file ssl\qsslcontext_openssl.cpp)
      c:\openssl110\include\openssl/ocsp.h(178): error C2275: 'OCSP_BASICRESP': illegal use of this type as an expression (compiling source file ssl\qsslcontext_openssl.cpp)
      c:\openssl110\include\openssl/ocsp.h(109): note: see declaration of 'OCSP_BASICRESP' (compiling source file ssl\qsslcontext_openssl.cpp)
      c:\openssl110\include\openssl/ocsp.h(179): error C2059: syntax error: '(' (compiling source file ssl\qsslcontext_openssl.cpp)
      c:\openssl110\include\openssl/ocsp.h(179): error C2143: syntax error: missing ',' before '*' (compiling source file ssl\qsslcontext_openssl.cpp)
      c:\openssl110\include\openssl/ocsp.h(179): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int (compiling source file ssl\qsslcontext_openssl.cpp)
      c:\openssl110\include\openssl/ocsp.h(179): error C2086: 'int *req': redefinition (compiling source file ssl\qsslcontext_openssl.cpp)
      c:\openssl110\include\openssl/ocsp.h(148): note: see declaration of 'req' (compiling source file ssl\qsslcontext_openssl.cpp)
      c:\openssl110\include\openssl/ocsp.h(179): error C2143: syntax error: missing ';' before ')' (compiling source file ssl\qsslcontext_openssl.cpp)
      c:\openssl110\include\openssl/ocsp.h(179): error C2059: syntax error: ')' (compiling source file ssl\qsslcontext_openssl.cpp)
      c:\openssl110\include\openssl/ocsp.h(181): error C2296: '*': illegal, left operand has type 'LPCSTR' (compiling source file ssl\qsslcontext_openssl.cpp)
      c:\openssl110\include\openssl/ocsp.h(181): error C2297: '*': illegal, right operand has type 'int *' (compiling source file ssl\qsslcontext_openssl.cpp)
      c:\openssl110\include\openssl/ocsp.h(181): error C2065: 'nm': undeclared identifier (compiling source file ssl\qsslcontext_openssl.cpp)
      c:\openssl110\include\openssl/ocsp.h(181): error C2275: 'X509_NAME': illegal use of this type as an expression (compiling source file ssl\qsslcontext_openssl.cpp)
      c:\openssl110\include\openssl/ossl_typ.h(124): note: see declaration of 'X509_NAME' (compiling source file ssl\qsslcontext_openssl.cpp)
      c:\openssl110\include\openssl/ocsp.h(182): error C2296: '*': illegal, left operand has type 'LPCSTR' (compiling source file ssl\qsslcontext_openssl.cpp)
      c:\openssl110\include\openssl/ocsp.h(182): error C2297: '*': illegal, right operand has type 'int *' (compiling source file ssl\qsslcontext_openssl.cpp)
      c:\openssl110\include\openssl/ocsp.h(182): error C2065: 'cert': undeclared identifier (compiling source file ssl\qsslcontext_openssl.cpp)
      c:\openssl110\include\openssl/ocsp.h(182): error C2275: 'X509': illegal use of this type as an expression (compiling source file ssl\qsslcontext_openssl.cpp)
      c:\openssl110\include\openssl/ossl_typ.h(119): note: see declaration of 'X509' (compiling source file ssl\qsslcontext_openssl.cpp)
      c:\openssl110\include\openssl/ocsp.h(184): error C2296: '*': illegal, left operand has type 'LPCSTR' (compiling source file ssl\qsslcontext_openssl.cpp)
      c:\openssl110\include\openssl/ocsp.h(184): error C2297: '*': illegal, right operand has type 'int *' (compiling source file ssl\qsslcontext_openssl.cpp)
      c:\openssl110\include\openssl/ocsp.h(185): error C2065: 'signer': undeclared identifier (compiling source file ssl\qsslcontext_openssl.cpp)
      c:\openssl110\include\openssl/ocsp.h(185): error C2275: 'X509': illegal use of this type as an expression (compiling source file ssl\qsslcontext_openssl.cpp)
      c:\openssl110\include\openssl/ossl_typ.h(119): note: see declaration of 'X509' (compiling source file ssl\qsslcontext_openssl.cpp)
      c:\openssl110\include\openssl/ocsp.h(186): error C2065: 'key': undeclared identifier (compiling source file ssl\qsslcontext_openssl.cpp)
      c:\openssl110\include\openssl/ocsp.h(186): error C2275: 'EVP_PKEY': illegal use of this type as an expression (compiling source file ssl\qsslcontext_openssl.cpp)
      c:\openssl110\include\openssl/ossl_typ.h(93): note: see declaration of 'EVP_PKEY' (compiling source file ssl\qsslcontext_openssl.cpp)

      Undef-ing several macros before including ocsp.h somewhat fixes problem, but a proper solution should be more robust.
      Update: also seems to be reproducible on x86 (probably, 1.1.1-specific) - so now we do not limit the fix with Q_OS_WIN64, but Q_OS_WIN

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            tpochep Timur Pocheptsov
            tpochep Timur Pocheptsov
            Votes:
            1 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes