[openssl-users] compilation error with openssl-1.1.0 and DH_get0_key

Robert Watson robert at gillecaluim.com
Wed Feb 21 16:16:05 UTC 2018


I'm trying to update a crypto library for crtmpserver to work with openssl
1.1.0.  The software is no longer actively maintained and my c++ skills are
somewhat rudimentary but I keep getting a compilation error for something
that seems trivial.

Here's the code snippet:
bool DHWrapper::CopyPublicKey(uint8_t *pDst, int32_t dstLength) {
    if (_pDH == NULL) {
        FATAL("DHWrapper not initialized");
        return false;
    }
    BIGNUM *_keyPublic,*_keyPrivate;
    _keyPublic = BN_new();
    _keyPrivate = BN_new();
    DH_get0_key( _pDH, *_keyPublic, *_keyPrivate );
    CopyKey(_keyPublic, pDst, dstLength);
    return true;
}

Here's the compilation error:
/build/crtmpserver/src/crtmpserver/sources/common/src/utils/misc/crypto.cpp:
In member function ‘bool DHWrapper::CopyPublicKey(uint8_t*, int32_t)’:
/build/crtmpserver/src/crtmpserver/sources/common/src/utils/misc/crypto.cpp:92:47:
error: cannot convert ‘BIGNUM {aka bignum_st}’ to ‘const BIGNUM** {aka
const bignum_st**}’ for argument ‘2’ to ‘void DH_get0_key(const DH*, const
BIGNUM**, const BIGNUM**)’
  DH_get0_key( _pDH, *_keyPublic, *_keyPrivate );
                                               ^
make[2]: *** [common/CMakeFiles/common.dir/build.make:591:
common/CMakeFiles/common.dir/build/crtmpserver/src/crtmpserver/sources/common/src/utils/misc/crypto.cpp.o]
Error 1
make[1]: *** [CMakeFiles/Makefile2:231: common/CMakeFiles/common.dir/all]
Error 2
make: *** [Makefile:130: all] Error 2

What am I doing wrong? Thanks,
Robert
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mta.openssl.org/pipermail/openssl-users/attachments/20180221/d9e22f10/attachment.html>


More information about the openssl-users mailing list