Uploaded image for project: 'OpenSAML - C++'
  1. OpenSAML - C++
  2. CPPOST-93

Source build fails to link properly against OpenSSL

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 2.5.5
    • Fix Version/s: 2.6.0
    • Component/s: Build
    • Labels:
      None
    • Environment:

      CentOS 7 x64

    • Operating System:
      Linux
    • CPU Type:
      Multiple
    • C/C++ Compiler:
      GCC 4.x
    • Web Server:
      Multiple

      Description

      Building opensaml from source fails at the ./configure stage due to a failure to link against the OpenSSL libraries during the "checking XML-Security version" step in configure.ac:

      Regardless of whether you specify the OpenSSL path using --with-openssl or whether you let pkg-config find it, the ./configure invocation fails with the following error.

      Example:

      ./configure --prefix=/home/vmuser/build/install/opensaml --with-xmltooling=/home/vmuser/build/install/xmltooling --with-xmlsec=/home/vmuser/build/install/xmlsecurityc --with-log4cpp=/usr
      {{...
      checking xercesc/dom/DOM.hpp usability... yes
      checking xercesc/dom/DOM.hpp presence... yes
      checking for xercesc/dom/DOM.hpp... yes
      checking Xerces version... OK
      checking whether Xerces XMLString::release(XMLByte**) exists... no
      checking xsec/utils/XSECPlatformUtils.hpp usability... yes
      checking xsec/utils/XSECPlatformUtils.hpp presence... yes
      checking for xsec/utils/XSECPlatformUtils.hpp... yes
      checking XML-Security version... OK
      configure: error: unable to link with XML-Security
      

      The contents of config.log show that this happens because the "checking XML-Security version" step tries to link a program against xml-security-c, which requires OpenSSL to be linked in, but the configure.ac scripts never adds them to the LIBS variable, it only adds SSLFLAGS.

      configure:20198: checking for xsec/utils/XSECPlatformUtils.hpp
      configure:20198: result: yes
      configure:20206: checking XML-Security version
      configure:20223: g++ -E -I/home/vmuser/build/opensaml-2.5.5/../install/xmlsecurityc/include -pthread -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic     conftest.cpp
      configure:20223: $? = 0
      configure:20224: result: OK
      configure:20244: g++ -o conftest -pthread  -Wall -O2 -DNDEBUG -I/home/vmuser/build/opensaml-2.5.5/../install/xmlsecurityc/include -pthread -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic      conftest.cpp -L/home/vmuser/build/opensaml-2.5.5/../install/xmlsecurityc/lib -lxml-security-c -lxerces-c -L/usr/lib64 -llog4cpp -lnsl -lz   >&5
      In file included from /home/vmuser/build/opensaml-2.5.5/../install/xmlsecurityc/include/xsec/enc/XSECCryptoProvider.hpp:42:0,
                       from /home/vmuser/build/opensaml-2.5.5/../install/xmlsecurityc/include/xsec/utils/XSECPlatformUtils.hpp:39,
                       from conftest.cpp:42:
      /home/vmuser/build/opensaml-2.5.5/../install/xmlsecurityc/include/xsec/enc/XSECCryptoSymmetricKey.hpp:188:52: warning: converting to non-pointer type 'unsigned int' from NULL [-Wconversion-null]
                                    unsigned int taglen = NULL) = 0;
                                                          ^
      /usr/bin/ld: warning: libcrypto.so.1.0.0, needed by /home/vmuser/build/opensaml-2.5.5/../install/xmlsecurityc/lib/libxml-security-c.so, not found (try using -rpath or -rpath-link)
      /usr/bin/ld: warning: libssl.so.1.0.0, needed by /home/vmuser/build/opensaml-2.5.5/../install/xmlsecurityc/lib/libxml-security-c.so, not found (try using -rpath or -rpath-link)
      /home/vmuser/build/opensaml-2.5.5/../install/xmlsecurityc/lib/libxml-security-c.so: undefined reference to `EC_KEY_free'
      /home/vmuser/build/opensaml-2.5.5/../install/xmlsecurityc/lib/libxml-security-c.so: undefined reference to `PKCS1_MGF1'
      ...
      ...
      

      Updating configure.ac to correctly update LIBS either with a path from --with-openssl or with the output of pkg-config --libs openssl solves the issue.

        Attachments

          Activity

            People

            Assignee:
            cantor.2@osu.edu Scott Cantor
            Reporter:
            vtsji2@idp.protectnetwork.org vtsji2@idp.protectnetwork.org
            Watchers:
            1 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:

                Time Tracking

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 15 minutes
                15m