BelledonneCommunications / flexisip

Linphone.org mirror for flexisip (git://git.linphone.org/flexisip.git)
http://flexisip.org
GNU Affero General Public License v3.0
144 stars 69 forks source link

ZRTP compile errors, maybe because old or mis-matched bzrtp header #39

Open aeetos opened 6 years ago

aeetos commented 6 years ago

I am attempting a clean compile on ubuntu with a lot of options enabled, specifically:

./prepare.py -c ; ./prepare.py -DENABLE_PROTOBUF=ON -DENABLE_QRCODE=ON -DENABLE_VIDEO=ON -DENABLE_TRANSCODER=ON -DENABLE_CONFERENCE=ON -DENABLE_FFMPEG=ON -DENABLE_SOCI=ON -DENABLE_JPEG=ON -DENABLE_SRTP=ON -DENABLE_MPEG4=ON -DENABLE_PRESENCE=ON -DENABLE_PROTOBUF=ON -DENABLE_OPENH264=ON -DENABLE_NON_FREE_CODECS=ON -DENABLE_LIME_X3DH=ON -DENABLE_WEBRTC_AECM=ON -DENABLE_WEBRTC_AEC=ON -DENABLE_PRESENCE=ON -DENABLE_VCARD=ON -DENABLE_LIME=ON -DENABLE_G729=ON -DENABLE_V4L=ON -DENABLE_ZRTP=ON -DENABLE_OPUS=ON

This is with commit c23a39b

The compile fails when it gets to zrtp, with a lot of errors about undeclared constants. missing struct members and implicit function declarations. I spent some time digging into it, and it seems a lot of those are declared in a recent version of the bzrtp header file located here in this project: https://github.com/BelledonneCommunications/bzrtp

That's not the same version included in the source tree, at least not that I could find. The version of the header file I did find was missing those constants and had different signatures for some structs. It looked older - I saw a copyright 2014 at the top and the code was missing features like caching.

My attempts at trying to merge the two manually failed because I really don't know what I'm doing. :) I managed to somehow get past this error only to break other things when it tried to compile EP_bzrtp. When I was deep into statemachine.c I realized it was time to back out...

This issue is blocking me from finishing the compile and getting this running, so I'd very much appreciate ideas on how to get past it.

I could skip ZRTP but the entire reason I'm compiling from scratch is because I really want that feature (and of course SRTP), and it wasn't available in the packaged version I found.

Thanks!

[ 40%] Building C object src/CMakeFiles/mediastreamer_voip.dir/crypto/zrtp.c.o
/root/build/flexisip_clean/submodules/mediastreamer2/src/crypto/zrtp.c: In function ‘bzrtp_keyAgreement_toString’:
/root/build/flexisip_clean/submodules/mediastreamer2/src/crypto/zrtp.c:71:8: error: ‘ZRTP_KEYAGREEMENT_X255’ undeclared (first use in this function)
   case(ZRTP_KEYAGREEMENT_X255): return "ECDH-255";
        ^
/root/build/flexisip_clean/submodules/mediastreamer2/src/crypto/zrtp.c:71:8: note: each undeclared identifier is reported only once for each function it appears in
/root/build/flexisip_clean/submodules/mediastreamer2/src/crypto/zrtp.c:72:8: error: ‘ZRTP_KEYAGREEMENT_X448’ undeclared (first use in this function)
   case(ZRTP_KEYAGREEMENT_X448): return "ECDH-448";
        ^
/root/build/flexisip_clean/submodules/mediastreamer2/src/crypto/zrtp.c: In function ‘ms_zrtp_statusMessage’:
/root/build/flexisip_clean/submodules/mediastreamer2/src/crypto/zrtp.c:130:8: error: ‘BZRTP_MESSAGE_CACHEMISMATCH’ undeclared (first use in this function)
   case BZRTP_MESSAGE_CACHEMISMATCH:
        ^
/root/build/flexisip_clean/submodules/mediastreamer2/src/crypto/zrtp.c:137:8: error: ‘BZRTP_MESSAGE_PEERVERSIONOBSOLETE’ undeclared (first use in this function)
   case BZRTP_MESSAGE_PEERVERSIONOBSOLETE:
        ^
/root/build/flexisip_clean/submodules/mediastreamer2/src/crypto/zrtp.c:143:8: error: ‘BZRTP_MESSAGE_PEERNOTBZRTP’ undeclared (first use in this function)
   case BZRTP_MESSAGE_PEERNOTBZRTP:
        ^
/root/build/flexisip_clean/submodules/mediastreamer2/src/crypto/zrtp.c: In function ‘ms_zrtp_startSrtpSession’:
/root/build/flexisip_clean/submodules/mediastreamer2/src/crypto/zrtp.c:294:53: error: ‘bzrtpSrtpSecrets_t {aka const struct bzrtpSrtpSecrets_struct}’ has no member named ‘cacheMis
match’
 eventData->info.zrtp_info.cache_mismatch=( secrets->cacheMismatch != 0) ? TRUE : FALSE;
                                                     ^
/root/build/flexisip_clean/submodules/mediastreamer2/src/crypto/zrtp.c: In function ‘ms_zrtp_addExportedKeysInZidCache’:
/root/build/flexisip_clean/submodules/mediastreamer2/src/crypto/zrtp.c:337:2: error: implicit declaration of function ‘bzrtp_exportKey’ [-Werror=implicit-function-declaration]
  bzrtp_exportKey(zrtpContext, ((role==BZRTP_ROLE_RESPONDER)?"ResponderKey":"InitiatorKey"), 12, colValues[0], &colLength[0]); /* sndKey */
  ^
/root/build/flexisip_clean/submodules/mediastreamer2/src/crypto/zrtp.c:337:39: error: ‘BZRTP_ROLE_RESPONDER’ undeclared (first use in this function)
  bzrtp_exportKey(zrtpContext, ((role==BZRTP_ROLE_RESPONDER)?"ResponderKey":"InitiatorKey"), 12, colValues[0], &colLength[0]); /* sndKey */
                                       ^
/root/build/flexisip_clean/submodules/mediastreamer2/src/crypto/zrtp.c:366:8: error: implicit declaration of function ‘bzrtp_cache_write’ [-Werror=implicit-function-declaration]
  ret = bzrtp_cache_write(userData->cacheDB, zuid, "lime", colNames, colValues, colLength, 7);
        ^
/root/build/flexisip_clean/submodules/mediastreamer2/src/crypto/zrtp.c: In function ‘set_key_agreement_suites’:
/root/build/flexisip_clean/submodules/mediastreamer2/src/crypto/zrtp.c:550:75: error: ‘ZRTP_KEYAGREEMENT_X255’ undeclared (first use in this function)
    case MS_ZRTP_KEY_AGREEMENT_X255:    bzrtpKeyAgreements[bzrtpCount++] = ZRTP_KEYAGREEMENT_X255; break;
                                                                           ^
/root/build/flexisip_clean/submodules/mediastreamer2/src/crypto/zrtp.c:551:75: error: ‘ZRTP_KEYAGREEMENT_X448’ undeclared (first use in this function)
    case MS_ZRTP_KEY_AGREEMENT_X448:    bzrtpKeyAgreements[bzrtpCount++] = ZRTP_KEYAGREEMENT_X448; break;
                                                                           ^
/root/build/flexisip_clean/submodules/mediastreamer2/src/crypto/zrtp.c: In function ‘ms_zrtp_context_new’:
/root/build/flexisip_clean/submodules/mediastreamer2/src/crypto/zrtp.c:599:3: error: implicit declaration of function ‘bzrtp_setZIDCache’ [-Werror=implicit-function-declaration]
   bzrtp_setZIDCache(context, params->zidCacheDB, params->selfUri, params->peerUri);
   ^
/root/build/flexisip_clean/submodules/mediastreamer2/src/crypto/zrtp.c:600:40: error: assignment from incompatible pointer type [-Werror=incompatible-pointer-types]
   cbs.bzrtp_contextReadyForExportedKeys=ms_zrtp_addExportedKeysInZidCache;
                                        ^
/root/build/flexisip_clean/submodules/mediastreamer2/src/crypto/zrtp.c:607:5: error: ‘bzrtpCallbacks_t {aka struct bzrtpCallbacks_struct}’ has no member named ‘bzrtp_statusMessage
’
  cbs.bzrtp_statusMessage=ms_zrtp_statusMessage;
     ^
/root/build/flexisip_clean/submodules/mediastreamer2/src/crypto/zrtp.c:608:5: error: ‘bzrtpCallbacks_t {aka struct bzrtpCallbacks_struct}’ has no member named ‘bzrtp_messageLevel’
  cbs.bzrtp_messageLevel=BZRTP_MESSAGE_LOG; /* get log, warnings and error messages from bzrtp lib */
     ^
/root/build/flexisip_clean/submodules/mediastreamer2/src/crypto/zrtp.c:608:25: error: ‘BZRTP_MESSAGE_LOG’ undeclared (first use in this function)
  cbs.bzrtp_messageLevel=BZRTP_MESSAGE_LOG; /* get log, warnings and error messages from bzrtp lib */
                         ^
/root/build/flexisip_clean/submodules/mediastreamer2/src/crypto/zrtp.c: In function ‘ms_zrtp_initCache’:
/root/build/flexisip_clean/submodules/mediastreamer2/src/crypto/zrtp.c:706:12: error: implicit declaration of function ‘bzrtp_initCache’ [-Werror=implicit-function-declaration]
  int ret = bzrtp_initCache(db);
           ^
/root/build/flexisip_clean/submodules/mediastreamer2/src/crypto/zrtp.c:708:8: error: ‘BZRTP_CACHE_SETUP’ undeclared (first use in this function)
   case BZRTP_CACHE_SETUP:
        ^
/root/build/flexisip_clean/submodules/mediastreamer2/src/crypto/zrtp.c:710:8: error: ‘BZRTP_CACHE_UPDATE’ undeclared (first use in this function)
   case BZRTP_CACHE_UPDATE:
        ^
/root/build/flexisip_clean/submodules/mediastreamer2/src/crypto/zrtp.c: In function ‘ms_zrtp_cache_migration’:
/root/build/flexisip_clean/submodules/mediastreamer2/src/crypto/zrtp.c:731:12: error: implicit declaration of function ‘bzrtp_cache_migration’ [-Werror=implicit-function-declarati
on]
  int ret = bzrtp_cache_migration(cacheXmlPtr, cacheSqlite, selfURI);
            ^
/root/build/flexisip_clean/submodules/mediastreamer2/src/crypto/zrtp.c:733:8: error: ‘BZRTP_ERROR_CACHEDISABLED’ undeclared (first use in this function)
   case BZRTP_ERROR_CACHEDISABLED:
        ^
/root/build/flexisip_clean/submodules/mediastreamer2/src/crypto/zrtp.c:735:8: error: ‘BZRTP_ERROR_CACHEMIGRATIONFAILED’ undeclared (first use in this function)
   case BZRTP_ERROR_CACHEMIGRATIONFAILED:
        ^
/root/build/flexisip_clean/submodules/mediastreamer2/src/crypto/zrtp.c: At top level:
cc1: error: unrecognized command line option ‘-Wno-format-truncation’ [-Werror]
cc1: all warnings being treated as errors
src/CMakeFiles/mediastreamer_voip.dir/build.make:566: recipe for target 'src/CMakeFiles/mediastreamer_voip.dir/crypto/zrtp.c.o' failed
make[6]: *** [src/CMakeFiles/mediastreamer_voip.dir/crypto/zrtp.c.o] Error 1
make[6]: Leaving directory '/root/build/flexisip_clean/WORK/flexisip/Build/ms2'
CMakeFiles/Makefile2:180: recipe for target 'src/CMakeFiles/mediastreamer_voip.dir/all' failed
make[5]: *** [src/CMakeFiles/mediastreamer_voip.dir/all] Error 2
make[5]: Leaving directory '/root/build/flexisip_clean/WORK/flexisip/Build/ms2'
Makefile:149: recipe for target 'all' failed
make[4]: *** [all] Error 2
make[4]: Leaving directory '/root/build/flexisip_clean/WORK/flexisip/Build/ms2'
CMakeFiles/EP_ms2.dir/build.make:124: recipe for target '/root/build/flexisip_clean/WORK/flexisip/Stamp/EP_ms2/EP_ms2-build' failed
make[3]: *** [/root/build/flexisip_clean/WORK/flexisip/Stamp/EP_ms2/EP_ms2-build] Error 2
make[3]: Leaving directory '/root/build/flexisip_clean/WORK/flexisip/cmake'
CMakeFiles/Makefile2:195: recipe for target 'CMakeFiles/EP_ms2.dir/all' failed
make[2]: *** [CMakeFiles/EP_ms2.dir/all] Error 2
make[2]: Leaving directory '/root/build/flexisip_clean/WORK/flexisip/cmake'