I have a codebase that was moved from openssl 1.0.1 to 1.1.0. One Project in it is producing errors when compiling. Some parts do compile without error but I stumbled upon forward declaration errors:
Foo/BarDH.cpp:37:28: error: member access into incomplete type 'dh_st'
nRes = BN_bn2bin( key->pub_key, &keyout[0] );
^
/usr/local/sysroot/usr/local/include/openssl/ossl_typ.h:104:16: note: forward declaration of 'dh_st'
typedef struct dh_st DH;
This is how files are included:
BarDH.cpp:
#include BarDH.hpp
[...]
BarDH.hpp:
#include <openssl/bn.h>
#include <openssl/dh.h>
#include <openssl/ec.h>
[...]
class BarDH{
BarDH(void);
virtual ~BarDH(void);
enum
{
MAX_PUBKEY_SIZE = 2048 / 8
};
DH* key;
};
Did anything change in how one is supposed to include files form openssl 1.0.1 to 1.1.0 or can anyone see what's going on here? Thank you!
DH_get0_pub_key(key)
to get hold of the pub_key value instead ofkey->pub_key
on line 37 of BarDH.cpp – Matt Caswell