Bug 111429 - Loolwsd build fails with OpenSSL 1.1.0
Summary: Loolwsd build fails with OpenSSL 1.1.0
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice Online
Classification: Unclassified
Component: LibreOffice (show other bugs)
Version:
(earliest affected)
unspecified
Hardware: All All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-08-07 07:48 UTC by Christian Glombek
Modified: 2017-09-25 13:09 UTC (History)
2 users (show)

See Also:
Crash report or crash signature:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Christian Glombek 2017-08-07 07:48:01 UTC
Building with OpenSSL 1.1.0 fails. This is due to the DH struct now being opague and having a new API.

From my build log:

...
env BUILDING_FROM_RPMBUILD=yes make 'CCFLAGS=-O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -m64 -mtune=generic -Wno-error' 'CFLAGS=-O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -m64 -mtune=generic -Wno-error' 'CXXFLAGS=-O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -m64 -mtune=generic -Wno-error' -j6
make  all-recursive
make[1]: Entering directory '/builddir/build/BUILD/online-libreoffice-5.4.0.2'
Making all in .
make[2]: Entering directory '/builddir/build/BUILD/online-libreoffice-5.4.0.2'
  CXX      common/loolstress-Protocol.o
  CXX      common/loolstress-Log.o
  CXX      net/clientnb.o
  CXX      wsd/loolwsd_fuzzer-Admin.o
  CXX      common/loolstress-Util.o
  CXX      wsd/loolwsd_fuzzer-AdminModel.o
  CXX      wsd/loolwsd_fuzzer-Auth.o
  CXX      wsd/loolwsd_fuzzer-DocumentBroker.o
  CXX      wsd/loolwsd_fuzzer-LOOLWSD.o
  CXX      wsd/loolwsd_fuzzer-ClientSession.o
  CXX      wsd/loolwsd_fuzzer-FileServer.o
  CXX      wsd/loolwsd_fuzzer-Storage.o
  CXX      wsd/loolwsd_fuzzer-TileCache.o
  CXX      kit/loolwsd_fuzzer-ChildSession.o
  CXX      kit/loolwsd_fuzzer-ForKit.o
  CXX      kit/loolwsd_fuzzer-Kit.o
kit/Kit.cpp:1688:13: warning: In the GNU C Library, "makedev" is defined
 by <sys/sysmacros.h>. For historical compatibility, it is
 currently defined by <sys/types.h> as well, but we plan to
 remove this soon. To use "makedev", include <sys/sysmacros.h>
 directly. If you did not intend to use a system-defined macro
 "makedev", you should undefine it after including <sys/types.h>.
                       makedev(1, 8)) != 0)
             ^         ~~~~~~~~~~~~~~~~~~~~                                                                                                                                                                                                                                                                                                                                                
kit/Kit.cpp:1695:13: warning: In the GNU C Library, "makedev" is defined
 by <sys/sysmacros.h>. For historical compatibility, it is
 currently defined by <sys/types.h> as well, but we plan to
 remove this soon. To use "makedev", include <sys/sysmacros.h>
 directly. If you did not intend to use a system-defined macro
 "makedev", you should undefine it after including <sys/types.h>.
                       makedev(1, 9)) != 0)
             ^         ~~~~~~~~~~~~~~~~~~~~                                                                                                                                                                                                                                                                                                                                                
  CXX      common/loolwsd_fuzzer-FileUtil.o
  CXX      common/loolwsd_fuzzer-IoUtil.o
  CXX      common/loolwsd_fuzzer-Log.o
  CXX      common/loolwsd_fuzzer-Protocol.o
  CXX      common/loolwsd_fuzzer-Session.o
  CXX      common/loolwsd_fuzzer-Seccomp.o
  CXX      common/loolwsd_fuzzer-MessageQueue.o
  CXX      common/loolwsd_fuzzer-SigUtil.o
  CXX      common/loolwsd_fuzzer-SpookyV2.o
  CXX      common/loolwsd_fuzzer-Unit.o
  CXX      common/loolwsd_fuzzer-UnitHTTP.o
  CXX      common/loolwsd_fuzzer-Util.o
  CXX      net/loolwsd_fuzzer-DelaySocket.o
  CXX      net/loolwsd_fuzzer-Socket.o
  CXX      net/loolwsd_fuzzer-Ssl.o
  CXX      kit/loolwsd_fuzzer-DummyLibreOfficeKit.o
net/Ssl.cpp: In constructor 'SslContext::SslContext(const string&, const string&, const string&)':
net/Ssl.cpp:46:27: warning: 'void OPENSSL_config(const char*)' is deprecated [-Wdeprecated-declarations]
     OPENSSL_config(nullptr);
                           ^
In file included from /usr/include/openssl/opensslconf.h:42:0,
                 from /usr/include/openssl/ct.h:13,
                 from /usr/include/openssl/ssl.h:61,
                 from net/Ssl.hpp:19,
                 from net/Ssl.cpp:13:
/usr/include/openssl/conf.h:92:1: note: declared here
 DEPRECATEDIN_1_1_0(void OPENSSL_config(const char *config_name))
 ^
net/Ssl.cpp: In member function 'void SslContext::initDH()':
net/Ssl.cpp:236:7: error: invalid use of incomplete type 'DH {aka struct dh_st}'
     dh->p = BN_bin2bn(dh1024_p, sizeof(dh1024_p), 0);
       ^~
In file included from /usr/include/openssl/crypto.h:31:0,
                 from /usr/include/openssl/comp.h:16,
                 from /usr/include/openssl/ssl.h:47,
                 from net/Ssl.hpp:19,
                 from net/Ssl.cpp:13:
/usr/include/openssl/ossl_typ.h:104:16: note: forward declaration of 'DH {aka struct dh_st}'
 typedef struct dh_st DH;
                ^~~~~
net/Ssl.cpp:236:9: error: invalid use of incomplete type 'DH {aka struct dh_st}'
     dh->p = BN_bin2bn(dh1024_p, sizeof(dh1024_p), 0);
         ^
In file included from /usr/include/openssl/crypto.h:31:0,
                 from /usr/include/openssl/comp.h:16,
                 from /usr/include/openssl/ssl.h:47,
                 from net/Ssl.hpp:19,
                 from net/Ssl.cpp:13:
/usr/include/openssl/ossl_typ.h:104:16: note: forward declaration of 'DH {aka struct dh_st}'
 typedef struct dh_st DH;
                ^~~~~
net/Ssl.cpp:237:7: error: invalid use of incomplete type 'DH {aka struct dh_st}'
     dh->g = BN_bin2bn(dh1024_g, sizeof(dh1024_g), 0);
       ^~
In file included from /usr/include/openssl/crypto.h:31:0,
                 from /usr/include/openssl/comp.h:16,
                 from /usr/include/openssl/ssl.h:47,
                 from net/Ssl.hpp:19,
                 from net/Ssl.cpp:13:
/usr/include/openssl/ossl_typ.h:104:16: note: forward declaration of 'DH {aka struct dh_st}'
 typedef struct dh_st DH;
                ^~~~~
net/Ssl.cpp:237:9: error: invalid use of incomplete type 'DH {aka struct dh_st}'
     dh->g = BN_bin2bn(dh1024_g, sizeof(dh1024_g), 0);
         ^
In file included from /usr/include/openssl/crypto.h:31:0,
                 from /usr/include/openssl/comp.h:16,
                 from /usr/include/openssl/ssl.h:47,
                 from net/Ssl.hpp:19,
                 from net/Ssl.cpp:13:
/usr/include/openssl/ossl_typ.h:104:16: note: forward declaration of 'DH {aka struct dh_st}'
 typedef struct dh_st DH;
                ^~~~~
net/Ssl.cpp:238:7: error: invalid use of incomplete type 'DH {aka struct dh_st}'
     dh->length = 160;
       ^~
In file included from /usr/include/openssl/crypto.h:31:0,
                 from /usr/include/openssl/comp.h:16,
                 from /usr/include/openssl/ssl.h:47,
                 from net/Ssl.hpp:19,
                 from net/Ssl.cpp:13:
/usr/include/openssl/ossl_typ.h:104:16: note: forward declaration of 'DH {aka struct dh_st}'
 typedef struct dh_st DH;
                ^~~~~
net/Ssl.cpp:238:9: error: invalid use of incomplete type 'DH {aka struct dh_st}'
     dh->length = 160;
         ^~~~~~
In file included from /usr/include/openssl/crypto.h:31:0,
                 from /usr/include/openssl/comp.h:16,
                 from /usr/include/openssl/ssl.h:47,
                 from net/Ssl.hpp:19,
                 from net/Ssl.cpp:13:
/usr/include/openssl/ossl_typ.h:104:16: note: forward declaration of 'DH {aka struct dh_st}'
 typedef struct dh_st DH;
                ^~~~~
net/Ssl.cpp:239:13: error: invalid use of incomplete type 'DH {aka struct dh_st}'
     if ((!dh->p) || (!dh->g))
             ^~
In file included from /usr/include/openssl/crypto.h:31:0,
                 from /usr/include/openssl/comp.h:16,
                 from /usr/include/openssl/ssl.h:47,
                 from net/Ssl.hpp:19,
                 from net/Ssl.cpp:13:
/usr/include/openssl/ossl_typ.h:104:16: note: forward declaration of 'DH {aka struct dh_st}'
 typedef struct dh_st DH;
                ^~~~~
net/Ssl.cpp:239:15: error: invalid use of incomplete type 'DH {aka struct dh_st}'
     if ((!dh->p) || (!dh->g))
               ^
In file included from /usr/include/openssl/crypto.h:31:0,
                 from /usr/include/openssl/comp.h:16,
                 from /usr/include/openssl/ssl.h:47,
                 from net/Ssl.hpp:19,
                 from net/Ssl.cpp:13:
/usr/include/openssl/ossl_typ.h:104:16: note: forward declaration of 'DH {aka struct dh_st}'
 typedef struct dh_st DH;
                ^~~~~
net/Ssl.cpp:239:25: error: invalid use of incomplete type 'DH {aka struct dh_st}'
     if ((!dh->p) || (!dh->g))
                         ^~
In file included from /usr/include/openssl/crypto.h:31:0,
                 from /usr/include/openssl/comp.h:16,
                 from /usr/include/openssl/ssl.h:47,
                 from net/Ssl.hpp:19,
                 from net/Ssl.cpp:13:
/usr/include/openssl/ossl_typ.h:104:16: note: forward declaration of 'DH {aka struct dh_st}'
 typedef struct dh_st DH;
                ^~~~~
net/Ssl.cpp:239:27: error: invalid use of incomplete type 'DH {aka struct dh_st}'
     if ((!dh->p) || (!dh->g))
                           ^
In file included from /usr/include/openssl/crypto.h:31:0,
                 from /usr/include/openssl/comp.h:16,
                 from /usr/include/openssl/ssl.h:47,
                 from net/Ssl.hpp:19,
                 from net/Ssl.cpp:13:
/usr/include/openssl/ossl_typ.h:104:16: note: forward declaration of 'DH {aka struct dh_st}'
 typedef struct dh_st DH;
                ^~~~~
make[2]: *** [Makefile:1612: net/loolwsd_fuzzer-Ssl.o] Error 1
make[2]: *** Waiting for unfinished jobs....
make[2]: Leaving directory '/builddir/build/BUILD/online-libreoffice-5.4.0.2'
make[1]: Leaving directory '/builddir/build/BUILD/online-libreoffice-5.4.0.2'
make[1]: *** [Makefile:1714: all-recursive] Error 1
make: *** [Makefile:734: all] Error 2
Comment 1 Aron Budea 2017-08-08 22:28:50 UTC
Confirmed.
Comment 2 Aron Budea 2017-09-25 13:09:29 UTC
I believe this is fixed by the following commit:
https://cgit.freedesktop.org/libreoffice/online/commit/?id=702bbdd5d8dd31eda8a2dfdb726be3c6cd978ec2
author		Christian Glombek <christian.glombek@rwth-aachen.de>	2017-09-16 06:38:01 (GMT)
committer	Thorsten Behrens <Thorsten.Behrens@CIB.de>	2017-09-20 01:48:08 (GMT)

Add Support for OpenSSL 1.1.0

Thanks for the patch, Christian!