wernerd / ZRTPCPP

C++ Implementation of ZRTP protocol - GNU ZRTP C++
Other
116 stars 50 forks source link

Undefined symbols #18

Closed thrasibule closed 10 years ago

thrasibule commented 10 years ago

I'm getting undefined symbols in the shared library if I compile with -DCRYPTO_STANDALONE=no and -DSDES=yes, cause the sdes code depends on the standalone functions. See error below (I passed -Wl,--no-undefined to the linker). Is SDES needed with zrtp at all?

Linking CXX shared library libzrtpcppcore.so
cd /var/tmp/portage/net-libs/libzrtpcpp-4.2.4/work/libzrtpcpp-4.2.4_build/clients/no_client && /usr/bin/cmake -E cmake_link_script CMakeFiles/zrtpcppcore.dir/link.txt --verbose=1
/usr/lib/ccache/bin/i686-pc-linux-gnu-g++  -fPIC -march=native -O2 -pipe -fomit-frame-pointer  -Wall -pedantic -std=c++11  -Wl,-O1 -Wl,--as-needed -Wl,--no-undefined -shared -Wl,-soname,libzrtpcppcore.so.4 -o libzrtpcppcore.so.4.2.4 CMakeFiles/zrtpcppcore.dir/__/__/zrtp/ZrtpCallbackWrapper.cpp.o CMakeFiles/zrtpcppcore.dir/__/__/zrtp/ZRtp.cpp.o CMakeFiles/zrtpcppcore.dir/__/__/zrtp/ZrtpCrc32.cpp.o CMakeFiles/zrtpcppcore.dir/__/__/zrtp/ZrtpPacketCommit.cpp.o CMakeFiles/zrtpcppcore.dir/__/__/zrtp/ZrtpPacketConf2Ack.cpp.o CMakeFiles/zrtpcppcore.dir/__/__/zrtp/ZrtpPacketConfirm.cpp.o CMakeFiles/zrtpcppcore.dir/__/__/zrtp/ZrtpPacketDHPart.cpp.o CMakeFiles/zrtpcppcore.dir/__/__/zrtp/ZrtpPacketGoClear.cpp.o CMakeFiles/zrtpcppcore.dir/__/__/zrtp/ZrtpPacketClearAck.cpp.o CMakeFiles/zrtpcppcore.dir/__/__/zrtp/ZrtpPacketHelloAck.cpp.o CMakeFiles/zrtpcppcore.dir/__/__/zrtp/ZrtpPacketHello.cpp.o CMakeFiles/zrtpcppcore.dir/__/__/zrtp/ZrtpPacketError.cpp.o CMakeFiles/zrtpcppcore.dir/__/__/zrtp/ZrtpPacketErrorAck.cpp.o CMakeFiles/zrtpcppcore.dir/__/__/zrtp/ZrtpPacketPingAck.cpp.o CMakeFiles/zrtpcppcore.dir/__/__/zrtp/ZrtpPacketPing.cpp.o CMakeFiles/zrtpcppcore.dir/__/__/zrtp/ZrtpPacketSASrelay.cpp.o CMakeFiles/zrtpcppcore.dir/__/__/zrtp/ZrtpPacketRelayAck.cpp.o CMakeFiles/zrtpcppcore.dir/__/__/zrtp/ZrtpStateClass.cpp.o CMakeFiles/zrtpcppcore.dir/__/__/zrtp/ZrtpTextData.cpp.o CMakeFiles/zrtpcppcore.dir/__/__/zrtp/ZrtpConfigure.cpp.o CMakeFiles/zrtpcppcore.dir/__/__/zrtp/ZrtpCWrapper.cpp.o CMakeFiles/zrtpcppcore.dir/__/__/zrtp/Base32.cpp.o CMakeFiles/zrtpcppcore.dir/__/__/zrtp/zrtpB64Encode.c.o CMakeFiles/zrtpcppcore.dir/__/__/zrtp/zrtpB64Decode.c.o CMakeFiles/zrtpcppcore.dir/__/__/common/osSpecifics.c.o CMakeFiles/zrtpcppcore.dir/__/__/zrtp/ZrtpSdesStream.cpp.o CMakeFiles/zrtpcppcore.dir/__/__/zrtp/ZIDCacheFile.cpp.o CMakeFiles/zrtpcppcore.dir/__/__/zrtp/ZIDRecordFile.cpp.o CMakeFiles/zrtpcppcore.dir/__/__/zrtp/crypto/openssl/zrtpDH.cpp.o CMakeFiles/zrtpcppcore.dir/__/__/zrtp/crypto/openssl/hmac256.cpp.o CMakeFiles/zrtpcppcore.dir/__/__/zrtp/crypto/openssl/sha256.cpp.o CMakeFiles/zrtpcppcore.dir/__/__/zrtp/crypto/openssl/hmac384.cpp.o CMakeFiles/zrtpcppcore.dir/__/__/zrtp/crypto/openssl/sha384.cpp.o CMakeFiles/zrtpcppcore.dir/__/__/zrtp/crypto/openssl/aesCFB.cpp.o CMakeFiles/zrtpcppcore.dir/__/__/zrtp/crypto/openssl/InitializeOpenSSL.cpp.o CMakeFiles/zrtpcppcore.dir/__/__/zrtp/crypto/twoCFB.cpp.o CMakeFiles/zrtpcppcore.dir/__/__/cryptcommon/macSkein.cpp.o CMakeFiles/zrtpcppcore.dir/__/__/cryptcommon/skein.c.o CMakeFiles/zrtpcppcore.dir/__/__/cryptcommon/skein_block.c.o CMakeFiles/zrtpcppcore.dir/__/__/cryptcommon/skeinApi.c.o CMakeFiles/zrtpcppcore.dir/__/__/cryptcommon/twofish.c.o CMakeFiles/zrtpcppcore.dir/__/__/cryptcommon/twofish_cfb.c.o CMakeFiles/zrtpcppcore.dir/__/__/zrtp/crypto/skeinMac256.cpp.o CMakeFiles/zrtpcppcore.dir/__/__/zrtp/crypto/skein256.cpp.o CMakeFiles/zrtpcppcore.dir/__/__/zrtp/crypto/skeinMac384.cpp.o CMakeFiles/zrtpcppcore.dir/__/__/zrtp/crypto/skein384.cpp.o CMakeFiles/zrtpcppcore.dir/__/__/srtp/CryptoContext.cpp.o CMakeFiles/zrtpcppcore.dir/__/__/srtp/CryptoContextCtrl.cpp.o CMakeFiles/zrtpcppcore.dir/__/__/srtp/SrtpHandler.cpp.o CMakeFiles/zrtpcppcore.dir/__/__/srtp/crypto/sha1.c.o CMakeFiles/zrtpcppcore.dir/__/__/srtp/crypto/hmac.cpp.o CMakeFiles/zrtpcppcore.dir/__/__/srtp/crypto/SrtpSymCrypto.cpp.o -lcrypto -lpthread 
CMakeFiles/zrtpcppcore.dir/__/__/srtp/crypto/SrtpSymCrypto.cpp.o: In function `SrtpSymCrypto::setNewKey(unsigned char const*, int)':
/var/tmp/portage/net-libs/libzrtpcpp-4.2.4/work/ZRTPCPP-4.2.4/cryptcommon/aescpp.h:34: undefined reference to `aes_init_zrtp'
CMakeFiles/zrtpcppcore.dir/__/__/srtp/crypto/SrtpSymCrypto.cpp.o: In function `AESencrypt::key256(unsigned char const*)':
/var/tmp/portage/net-libs/libzrtpcpp-4.2.4/work/ZRTPCPP-4.2.4/cryptcommon/aescpp.h:47: undefined reference to `aes_encrypt_key256'
CMakeFiles/zrtpcppcore.dir/__/__/srtp/crypto/SrtpSymCrypto.cpp.o: In function `AESencrypt::key128(unsigned char const*)':
/var/tmp/portage/net-libs/libzrtpcpp-4.2.4/work/ZRTPCPP-4.2.4/cryptcommon/aescpp.h:39: undefined reference to `aes_encrypt_key128'
CMakeFiles/zrtpcppcore.dir/__/__/srtp/crypto/SrtpSymCrypto.cpp.o: In function `AESencrypt::encrypt(unsigned char const*, unsigned char*) const':
/var/tmp/portage/net-libs/libzrtpcpp-4.2.4/work/ZRTPCPP-4.2.4/cryptcommon/aescpp.h:54: undefined reference to `aes_encrypt'
CMakeFiles/zrtpcppcore.dir/__/__/zrtp/ZrtpSdesStream.cpp.o: In function `expand':
/var/tmp/portage/net-libs/libzrtpcpp-4.2.4/work/ZRTPCPP-4.2.4/zrtp/ZrtpSdesStream.cpp:446: undefined reference to `createSha384HmacContext(unsigned char*, int)'
/var/tmp/portage/net-libs/libzrtpcpp-4.2.4/work/ZRTPCPP-4.2.4/zrtp/ZrtpSdesStream.cpp:467: undefined reference to `hmacSha384Ctx(void*, unsigned char const**, unsigned int*, unsigned char*, int*)'
/var/tmp/portage/net-libs/libzrtpcpp-4.2.4/work/ZRTPCPP-4.2.4/zrtp/ZrtpSdesStream.cpp:474: undefined reference to `freeSha384HmacContext(void*)'
CMakeFiles/zrtpcppcore.dir/__/__/zrtp/ZrtpSdesStream.cpp.o: In function `_random':
/var/tmp/portage/net-libs/libzrtpcpp-4.2.4/work/ZRTPCPP-4.2.4/zrtp/ZrtpSdesStream.cpp:394: undefined reference to `ZrtpRandom::getRandomData(unsigned char*, unsigned int)'
collect2: error: ld returned 1 exit status
clients/no_client/CMakeFiles/zrtpcppcore.dir/build.make:1360: recipe for target 'clients/no_client/libzrtpcppcore.so.4.2.4' failed
make[2]: *** [clients/no_client/libzrtpcppcore.so.4.2.4] Error 1
make[2]: Leaving directory '/var/tmp/portage/net-libs/libzrtpcpp-4.2.4/work/libzrtpcpp-4.2.4_build'
CMakeFiles/Makefile2:203: recipe for target 'clients/no_client/CMakeFiles/zrtpcppcore.dir/all' failed
make[1]: *** [clients/no_client/CMakeFiles/zrtpcppcore.dir/all] Error 2
make[1]: Leaving directory '/var/tmp/portage/net-libs/libzrtpcpp-4.2.4/work/libzrtpcpp-4.2.4_build'
Makefile:137: recipe for target 'all' failed

and this is the ldd output:

ldd -r /usr/lib/libzrtpcppcore.so
        linux-gate.so.1 (0xb77d9000)
        libcrypto.so.1.0.0 => /usr/lib/libcrypto.so.1.0.0 (0xb75a2000)
        libpthread.so.0 => /lib/libpthread.so.0 (0xb7587000)
        libstdc++.so.6 => /usr/lib/gcc/i686-pc-linux-gnu/4.8.3/libstdc++.so.6 (0xb749e000)
        libgcc_s.so.1 => /usr/lib/gcc/i686-pc-linux-gnu/4.8.3/libgcc_s.so.1 (0xb7483000)
        libc.so.6 => /lib/libc.so.6 (0xb72db000)
        libdl.so.2 => /lib/libdl.so.2 (0xb72d6000)
        libz.so.1 => /lib/libz.so.1 (0xb72bf000)
        /lib/ld-linux.so.2 (0xb77dc000)
        libm.so.6 => /lib/libm.so.6 (0xb727a000)
undefined symbol: aes_encrypt_key128    (/usr/lib/libzrtpcppcore.so)
undefined symbol: _Z21freeSha384HmacContextPv   (/usr/lib/libzrtpcppcore.so)
undefined symbol: _Z23createSha384HmacContextPhi        (/usr/lib/libzrtpcppcore.so)
undefined symbol: aes_init_zrtp (/usr/lib/libzrtpcppcore.so)
undefined symbol: aes_encrypt_key256    (/usr/lib/libzrtpcppcore.so)
undefined symbol: _ZN10ZrtpRandom13getRandomDataEPhj    (/usr/lib/libzrtpcppcore.so)
undefined symbol: _Z13hmacSha384CtxPvPPKhPjPhPi (/usr/lib/libzrtpcppcore.so)
undefined symbol: aes_encrypt   (/usr/lib/libzrtpcppcore.so)
wernerd commented 10 years ago

No - it'S not needed for ZRTP. SDES is a single module that I did to have some SDES functions for a specific client. Please disable SDES.

Werner

Am 05.10.2014 um 17:19 schrieb Thrasibule:

I'm getting undefined symbols in the shared library if I compile with -DCRYPTO_STANDALONE=no and -DSDES=yes, cause the sdes code depends on the standalone functions. See error below (I passed -Wl,--no-undefined to the linker). Is SDES needed with zrtp at all?

Linking CXX shared library libzrtpcppcore.so cd /var/tmp/portage/net-libs/libzrtpcpp-4.2.4/work/libzrtpcpp-4.2.4_build/clients/no_client && /usr/bin/cmake -E cmake_link_script CMakeFiles/zrtpcppcore.dir/link.txt --verbose=1 /usr/lib/ccache/bin/i686-pc-linux-gnu-g++ -fPIC -march=native -O2 -pipe -fomit-frame-pointer -Wall -pedantic -std=c++11 -Wl,-O1 -Wl,--as-needed -Wl,--no-undefined -shared -Wl,-soname,libzrtpcppcore.so.4 -o libzrtpcppcore.so.4.2.4 CMakeFiles/zrtpcppcore.dir///zrtp/ZrtpCallbackWrapper.cpp.o CMakeFiles/zrtpcppcore.dir///zrtp/ZRtp.cpp.o CMakeFiles/zrtpcppcore.dir///zrtp/ZrtpCrc32.cpp.o CMakeFiles/zrtpcppcore.dir///zrtp/ZrtpPacketCommit.cpp.o CMakeFiles/zrtpcppcore.dir///zrtp/ZrtpPacketConf2Ack.cpp.o CMakeFiles/zrtpcppcore.dir///zrtp/ZrtpPacketConfirm.cpp.o CMakeFiles/zrtpcppcore.dir///zrtp/ZrtpPacketDHPart.cpp.o CMakeFiles/zrtpcppcore.dir///zrtp/ZrtpPacketGoClear.cpp.o CMakeFiles/zrtpcppcore.dir///zrtp/ZrtpPacketClearAck.cpp.o CMakeFiles/zrtpcppcore.dir///zrtp/ZrtpPacketHelloAck.cpp.o CMakeFiles/zrtpcppcore.dir///zrtp/ZrtpPacketHello.cpp.o CMakeFiles/zrtpcppcore.dir///zrtp/ZrtpPacketError.cpp.o CMakeFiles/zrtpcppcore.dir///zrtp/Zrt p P acketErrorAck.cpp.o CMakeFiles/zrtpcppcore.dir///zrtp/ZrtpPacketPingAck.cpp.o CMakeFiles/zrtpcppcore.dir///zrtp/ZrtpPacketPing.cpp.o CMakeFiles/zrtpcppcore.dir///zrtp/ZrtpPacketSASrelay.cpp.o CMakeFiles/zrtpcppcore.dir///zrtp/ZrtpPacketRelayAck.cpp.o CMakeFiles/zrtpcppcore.dir///zrtp/ZrtpStateClass.cpp.o CMakeFiles/zrtpcppcore.dir///zrtp/ZrtpTextData.cpp.o CMakeFiles/zrtpcppcore.dir///zrtp/ZrtpConfigure.cpp.o CMakeFiles/zrtpcppcore.dir///zrtp/ZrtpCWrapper.cpp.o CMakeFiles/zrtpcppcore.dir///zrtp/Base32.cpp.o CMakeFiles/zrtpcppcore.dir///zrtp/zrtpB64Encode.c.o CMakeFiles/zrtpcppcore.dir///zrtp/zrtpB64Decode.c.o CMakeFiles/zrtpcppcore.dir///common/osSpecifics.c.o CMakeFiles/zrtpcppcore.dir///zrtp/ZrtpSdesStream.cpp.o CMakeFiles/zrtpcppcore.dir///zrtp/ZIDCacheFile.cpp.o CMakeFiles/zrtpcppcore.dir///zrtp/ZIDRecordFile.cpp.o CMakeFiles/zrtpcppcore.dir///zrtp/crypto/openssl/zrtpDH.cpp.o CMakeFiles/zrtpcppcore.dir///zrtp/ c r ypto/openssl/hmac256.cpp.o CMakeFiles/zrtpcppcore.dir///zrtp/crypto/openssl/sha256.cpp.o CMakeFiles/zrtpcppcore.dir///zrtp/crypto/openssl/hmac384.cpp.o CMakeFiles/zrtpcppcore.dir///zrtp/crypto/openssl/sha384.cpp.o CMakeFiles/zrtpcppcore.dir///zrtp/crypto/openssl/aesCFB.cpp.o CMakeFiles/zrtpcppcore.dir///zrtp/crypto/openssl/InitializeOpenSSL.cpp.o CMakeFiles/zrtpcppcore.dir///zrtp/crypto/twoCFB.cpp.o CMakeFiles/zrtpcppcore.dir///cryptcommon/macSkein.cpp.o CMakeFiles/zrtpcppcore.dir///cryptcommon/skein.c.o CMakeFiles/zrtpcppcore.dir///cryptcommon/skein_block.c.o CMakeFiles/zrtpcppcore.dir///cryptcommon/skeinApi.c.o CMakeFiles/zrtpcppcore.dir///cryptcommon/twofish.c.o CMakeFiles/zrtpcppcore.dir///cryptcommon/twofishcfb.c.o CMakeFiles/zrtpcppcore.dir///zrtp/crypto/skeinMac256.cpp.o CMakeFiles/zrtpcppcore.dir///zrtp/crypto/skein256.cpp.o CMakeFiles/zrtpcppcore.dir///zrtp/crypto/skeinMac384.cpp.o CMakeFiles/zrtpcppcore.dir/**/ _ /zrtp/crypto/skein384.cpp.o CMakeFiles/zrtpcppcore.dir///srtp/CryptoContext.cpp.o CMakeFiles/zrtpcppcore.dir///srtp/CryptoContextCtrl.cpp.o CMakeFiles/zrtpcppcore.dir///srtp/SrtpHandler.cpp.o CMakeFiles/zrtpcppcore.dir///srtp/crypto/sha1.c.o CMakeFiles/zrtpcppcore.dir///srtp/crypto/hmac.cpp.o CMakeFiles/zrtpcppcore.dir///srtp/crypto/SrtpSymCrypto.cpp.o -lcrypto -lpthread CMakeFiles/zrtpcppcore.dir///srtp/crypto/SrtpSymCrypto.cpp.o: In function SrtpSymCrypto::setNewKey(unsigned char const*, int)': /var/tmp/portage/net-libs/libzrtpcpp-4.2.4/work/ZRTPCPP-4.2.4/cryptcommon/aescpp.h:34: undefined reference toaes_init_zrtp' CMakeFiles/zrtpcppcore.dir///srtp/crypto/SrtpSymCrypto.cpp.o: In function AESencrypt::key256(unsigned char const*)': /var/tmp/portage/net-libs/libzrtpcpp-4.2.4/work/ZRTPCPP-4.2.4/cryptcommon/aescpp.h:47: undefined reference toaes_encrypt_key256' CMakeFiles/zrtpcppcore.dir///srtp/crypto/SrtpSymCrypto.cpp.o: In function AESencrypt::key128(unsigned char const*)': /var/tmp/portage/net-libs/libzrtpcpp-4.2.4/work/ZRTPCPP-4.2.4/cryptcommon/aescpp.h:39: undefined reference toaes_encrypt_key128' CMakeFiles/zrtpcppcore.dir///srtp/crypto/SrtpSymCrypto.cpp.o: In function AESencrypt::encrypt(unsigned char const*, unsigned char*) const': /var/tmp/portage/net-libs/libzrtpcpp-4.2.4/work/ZRTPCPP-4.2.4/cryptcommon/aescpp.h:54: undefined reference toaesencrypt' CMakeFiles/zrtpcppcore.dir///zrtp/ZrtpSdesStream.cpp.o: In function expand': /var/tmp/portage/net-libs/libzrtpcpp-4.2.4/work/ZRTPCPP-4.2.4/zrtp/ZrtpSdesStream.cpp:446: undefined reference tocreateSha384HmacContext(unsigned char, int)' /var/tmp/portage/net-libs/libzrtpcpp-4.2.4/work/ZRTPCPP-4.2.4/zrtp/ZrtpSdesStream.cpp:467: undefined reference to hmacSha384Ctx(void_, unsigned char const*_, unsigned int_, unsigned char_, int_)' /var/tmp/portage/net-libs/libzrtpcpp-4.2.4/work/ZRTPCPP-4.2.4/zrtp/ZrtpSdesStream.cpp:474: undefined reference tofreeSha384HmacContext(void*)' CMakeFiles/zrtpcppcore.dir//__/zrtp/ZrtpSdesStream.cpp.o: In function _random': /var/tmp/portage/net-libs/libzrtpcpp-4.2.4/work/ZRTPCPP-4.2.4/zrtp/ZrtpSdesStream.cpp:394: undefined reference toZrtpRandom::getRandomData(unsigned char_, unsigned int)' collect2: error: ld returned 1 exit status clients/no_client/CMakeFiles/zrtpcppcore.dir/build.make:1360: recipe for target 'clients/noclient/libzrtpcppcore.so.4.2.4' failed make[2]: ** [clients/no_client/libzrtpcppcore.so.4.2.4] Error 1 make[2]: Leaving directory '/var/tmp/portage/net-libs/libzrtpcpp-4.2.4/work/libzrtpcpp-4.2.4_build' CMakeFiles/Makefile2:203: recipe for target 'clients/no_client/CMakeFiles/zrtpcppcore.dir/all' failed make[1]: * [clients/no_client/CMakeFiles/zrtpcppcore.dir/all] Error 2 make[1]: Leaving directory '/var/tmp/portage/net-libs/libzrtpcpp-4.2.4/work/libzrtpcpp-4.2.4_build' Makefile:137: recipe for target 'all' failed

and this is the ldd output:

ldd -r /usr/lib/libzrtpcppcore.so linux-gate.so.1 (0xb77d9000) libcrypto.so.1.0.0 => /usr/lib/libcrypto.so.1.0.0 (0xb75a2000) libpthread.so.0 => /lib/libpthread.so.0 (0xb7587000) libstdc++.so.6 => /usr/lib/gcc/i686-pc-linux-gnu/4.8.3/libstdc++.so.6 (0xb749e000) libgcc_s.so.1 => /usr/lib/gcc/i686-pc-linux-gnu/4.8.3/libgcc_s.so.1 (0xb7483000) libc.so.6 => /lib/libc.so.6 (0xb72db000) libdl.so.2 => /lib/libdl.so.2 (0xb72d6000) libz.so.1 => /lib/libz.so.1 (0xb72bf000) /lib/ld-linux.so.2 (0xb77dc000) libm.so.6 => /lib/libm.so.6 (0xb727a000) undefined symbol: aes_encrypt_key128 (/usr/lib/libzrtpcppcore.so) undefined symbol: _Z21freeSha384HmacContextPv (/usr/lib/libzrtpcppcore.so) undefined symbol: _Z23createSha384HmacContextPhi (/usr/lib/libzrtpcppcore.so) undefined symbol: aes_init_zrtp (/usr/lib/libzrtpcppcore.so) undefined symbol: aes_encrypt_key256 (/usr/lib/libzrtpcppcore.so) undefined symbol: _ZN10ZrtpRandom13getRandomDataEPhj (/usr/lib/libzrtpcppcore.so) undefined symbol: _Z13hmacSha384CtxPvPPKhPjPhPi (/usr/lib/libzrtpcppcore.so) undefined symbol: aes_encrypt (/usr/lib/libzrtpcppcore.so)

— Reply to this email directly or view it on GitHub https://github.com/wernerd/ZRTPCPP/issues/18.

Werner Dittmann email: Werner.Dittmann@t-online.de cell: +49 173 44 37 659 PGP key: 82EF5E8B

thrasibule commented 10 years ago

Thanks for clarifying this, I'll close the issue then.