View Ticket
Ticket Hash: 14befce25ea1041cce8430113ef3399242598bf6
Title: Compile error with openssl1.1.1.c and GCC
Status: Closed Type: Build Problem
Severity: Severe Priority: Immediate
Subsystem: Resolution: Fixed
Last Modified: 2024-06-29 01:15:58
Version Found In: 1.7.18
User Comments:
anonymous added on 2019-07-30 07:01:05:
While compiling against openssl-1.1.1c I get the following error when compiling tls.c 

In file included from tls.c:83:0:
dh_params.h: In function 'get_dhParams':
dh_params.h:33:4: error: dereferencing pointer to incomplete type 'DH {aka struct dh_st}'
  dh->p=BN_bin2bn(dh2048_p,sizeof(dh2048_p),NULL);
    ^

I have searched the net and saw this problem mentioned elsewhere:

https://issues.apache.org/jira/browse/PROTON-1381

I have tried with different GCC versions - all show the same problem.
OPENSSL_NO_DH is undefined!

anonymous added on 2019-08-02 08:12:45:
As a workaround I just added -DOPENSSL_NO_DH to the makefile.

anonymous (claiming to be R. J. Mathar) added on 2019-09-26 13:20:29:
The core problem seems to be that include/openssl/bn.h of defines BIGNUM as a typedef of struct bignum_st, but does not define that structure anywhere.

The declarations of the header of openssl 1.0.2 are still including such a definition; but the openssl 1.1 distributed with openSUSE 15.1 does no longer define the structure, and it's found nowhere in /usr/include, so the compiler has no chance to know whether 'p' and/or 'g' are members of that structure.

So the first approach here might be that the code in tlsInt.h does not define TCLTLS_OPENSSL_PRE_1_1_API for e.g. OPENSSL_VERSION_NUMBER == 0x1010009fL as defined in opensslv.h .

bohagan added on 2024-06-29 01:15:58:
This issue has been fixed in commit [d3d16ea77fa810d8] with the change to auto set the DH parameters.