<div dir="ltr"><div><div>Thanks for suggestion, don't understand why the compiler didn't complain about the first argument. Unfortunately, that just brings out other problem....<br></div>code:<br><font size="1">bool DHWrapper::CopyPublicKey(uint8_t *pDst, int32_t dstLength) {<br> if (_pDH == NULL) {<br> FATAL("DHWrapper not initialized");<br> return false;<br> }<br> BIGNUM *_keyPublic, *_keyPrivate;<br> _keyPublic = BN_new();<br> _keyPrivate = BN_new();<br> DH_get0_key( _pDH, &_keyPublic, &_keyPrivate );<br> CopyKey(_keyPublic, pDst, dstLength);<br> return true;<br>}<br></font></div><font size="1"><font size="2">Still fails compilation with:<br><font size="1">/build/crtmpserver/src/crtmpserver/sources/common/src/utils/misc/crypto.cpp: In member function ‘bool DHWrapper::CopyPublicKey(uint8_t*, int32_t)’:<br>/build/crtmpserver/src/crtmpserver/sources/common/src/utils/misc/crypto.cpp:92:21: error: invalid conversion from ‘BIGNUM** {aka bignum_st**}’ to ‘const BIGNUM** {aka const bignum_st**}’ [-fpermissive]<br> DH_get0_key( _pDH, &_keyPublic, &_keyPrivate );<br> ^~~~~~~~~~~<br>In file included from /build/crtmpserver/src/crtmpserver/sources/common/include/utils/misc/crypto.h:26:0,<br> from /build/crtmpserver/src/crtmpserver/sources/common/include/utils/buffering/iobuffer.h:27,<br> from /build/crtmpserver/src/crtmpserver/sources/common/include/utils/buffering/buffering.h:23,<br> from /build/crtmpserver/src/crtmpserver/sources/common/include/utils/utils.h:23,<br> from /build/crtmpserver/src/crtmpserver/sources/common/include/common.h:25:<br>/usr/include/openssl/dh.h:183:6: note: initializing argument 2 of ‘void DH_get0_key(const DH*, const BIGNUM**, const BIGNUM**)’<br> void DH_get0_key(const DH *dh,<br> ^~~~~~~~~~~<br>/build/crtmpserver/src/crtmpserver/sources/common/src/utils/misc/crypto.cpp:92:34: error: invalid conversion from ‘BIGNUM** {aka bignum_st**}’ to ‘const BIGNUM** {aka const bignum_st**}’ [-fpermissive]<br> DH_get0_key( _pDH, &_keyPublic, &_keyPrivate );<br> ^~~~~~~~~~~~<br>In file included from /build/crtmpserver/src/crtmpserver/sources/common/include/utils/misc/crypto.h:26:0,<br> from /build/crtmpserver/src/crtmpserver/sources/common/include/utils/buffering/iobuffer.h:27,<br> from /build/crtmpserver/src/crtmpserver/sources/common/include/utils/buffering/buffering.h:23,<br> from /build/crtmpserver/src/crtmpserver/sources/common/include/utils/utils.h:23,<br> from /build/crtmpserver/src/crtmpserver/sources/common/include/common.h:25:<br>/usr/include/openssl/dh.h:183:6: note: initializing argument 3 of ‘void DH_get0_key(const DH*, const BIGNUM**, const BIGNUM**)’<br> void DH_get0_key(const DH *dh,<br> ^~~~~~~~~~~<br>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<br>make[1]: *** [CMakeFiles/Makefile2:231: common/CMakeFiles/common.dir/all] Error 2<br>make: *** [Makefile:130: all] Error 2<br></font><br></font></font><div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Feb 21, 2018 at 8:20 AM, Benjamin Kaduk <span dir="ltr"><<a href="mailto:bkaduk@akamai.com" target="_blank">bkaduk@akamai.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div text="#000000" bgcolor="#FFFFFF"><span class="">
On 02/21/2018 10:16 AM, Robert Watson wrote:<br>
<blockquote type="cite">
<div dir="ltr">
<div>
<div>
<div>
<div>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.<br>
<br>
</div>
Here's the code snippet:<br>
<font size="1">bool DHWrapper::CopyPublicKey(<wbr>uint8_t
*pDst, int32_t dstLength) {<br>
if (_pDH == NULL) {<br>
FATAL("DHWrapper not initialized");<br>
return false;<br>
}<br>
BIGNUM *_keyPublic,*_keyPrivate;<br>
_keyPublic = BN_new();<br>
_keyPrivate = BN_new();<br>
DH_get0_key( _pDH, *_keyPublic, *_keyPrivate );<br>
</font></div>
</div>
</div>
</div>
</blockquote>
<br></span>
Use '&' instead of '*'<br>
<br>
-Ben<span class=""><br>
<br>
<blockquote type="cite">
<div dir="ltr">
<div>
<div>
<div><font size="1"> CopyKey(_keyPublic, pDst,
dstLength);<br>
return true;<br>
}<br>
<br>
</font></div>
<font size="1"><font size="2">Here's the compilation error:<br>
<font size="1">/build/crtmpserver/src/<wbr>crtmpserver/sources/common/<wbr>src/utils/misc/crypto.cpp:
In member function ‘bool
DHWrapper::CopyPublicKey(<wbr>uint8_t*, int32_t)’:<br>
/build/crtmpserver/src/<wbr>crtmpserver/sources/common/<wbr>src/utils/misc/crypto.cpp:92:<wbr>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**)’<br>
DH_get0_key( _pDH, *_keyPublic, *_keyPrivate );<br>
<wbr> ^<br>
make[2]: ***
[common/CMakeFiles/common.dir/<wbr>build.make:591:
common/CMakeFiles/common.dir/<wbr>build/crtmpserver/src/<wbr>crtmpserver/sources/common/<wbr>src/utils/misc/crypto.cpp.o]
Error 1<br>
make[1]: *** [CMakeFiles/Makefile2:231:
common/CMakeFiles/common.dir/<wbr>all] Error 2<br>
make: *** [Makefile:130: all] Error 2<br>
<br>
</font></font></font></div>
<font size="1"><font size="2"><font size="1"><font size="2">What
am I doing wrong? Thanks,<br>
</font></font></font></font></div>
<font size="1"><font size="2"><font size="1"><font size="2">Robert<br>
</font></font></font></font>
<div>
<div><font size="1"><font size="2"><br>
</font></font></div>
</div>
</div>
<br>
<fieldset class="m_-2579466001835046661mimeAttachmentHeader"></fieldset>
<br>
</blockquote>
<br>
</span></div>
</blockquote></div><br></div>