]> sjero.net Git - linphone/commitdiff
Fix compilation on iPhone srtp/zrtp (disable tests)
authorGuillaume Beraudo <guillaume.beraudo@linphone.org>
Fri, 26 Aug 2011 12:30:36 +0000 (14:30 +0200)
committerGuillaume Beraudo <guillaume.beraudo@linphone.org>
Fri, 26 Aug 2011 12:30:36 +0000 (14:30 +0200)
configure.ac
coreapi/Makefile.am
coreapi/help/Makefile.am
coreapi/linphonecall.c
mediastreamer2
oRTP

index dd0c4d9461869e6699b59ffd130d8b5d2b025086..379f23491733a8d1ac4cad1723734bf26bad80e2 100644 (file)
@@ -462,6 +462,15 @@ AC_SUBST(ORTP_LIBS)
 AC_SUBST([ORTP_VERSION])
 AC_SUBST([ORTP_DIR])
 
+AC_ARG_ENABLE(tests_enabled,
+      [  --disable-tests    Disable compilation of tests],
+      [case "${enableval}" in
+        yes) tests_enabled=true ;;
+        no)  tests_enabled=false ;;
+        *) AC_MSG_ERROR(bad value ${enableval} for --disable-tests) ;;
+      esac],[tests_enabled=false])
+AM_CONDITIONAL(ENABLE_TESTS, test x$tests_enabled = xyes)
+
 dnl ##################################################
 dnl # Check for doxygen
 dnl ##################################################
index a362dda837bf66a2b4ab28a46222cd5b9462ed14..6ea151e0ab4ca032443cc3c0ee8310cc1f9be1e7 100644 (file)
@@ -50,6 +50,7 @@ if BUILD_WIN32
 liblinphone_la_LIBADD+=$(top_builddir)/oRTP/src/libortp.la
 endif
 
+if ENABLE_TESTS
 noinst_PROGRAMS=test_lsd test_ecc
 
 test_lsd_SOURCES=test_lsd.c
@@ -59,7 +60,7 @@ test_lsd_LDADD=liblinphone.la $(liblinphone_la_LIBADD)
 test_ecc_SOURCES=test_ecc.c
 
 test_ecc_LDADD=liblinphone.la $(liblinphone_la_LIBADD)
-
+endif
 
 
 AM_CFLAGS=$(STRICT_OPTIONS)  -DIN_LINPHONE \
index 74767bea3a3de5f0fb811e93b50348dbc70878cb..6690fd4a6379842cb90d456afd77afdccf3cd940 100644 (file)
@@ -32,6 +32,7 @@ endif
 clean-local:
        rm -rf doc
 
+if ENABLE_TESTS
 #tutorials
 
 noinst_PROGRAMS=helloworld registration buddy_status chatroom
@@ -57,6 +58,7 @@ chatroom_SOURCES=chatroom.c
 LINPHONE_TUTOS+=$(chatroom_SOURCES)
 
 chatroom_LDADD=$(helloworld_LDADD)
+endif
                                                                                                
                                
 
index 393d43d8fae9aa81dfcc36e058e2efec58dc24c9..210c2c453817448341c2bb3fb9b58f31688fea59 100644 (file)
@@ -41,17 +41,14 @@ static MSWebCam *get_nowebcam_device(){
 }
 #endif
 
-static const char* get_zrtp_identifier(LinphoneCore *lc){
+static const char* get_hexa_zrtp_identifier(LinphoneCore *lc){
        const char *confZid=lp_config_get_string(lc->config,"rtp","zid",NULL);
        if (confZid != NULL) {
                return confZid;
        } else {
-               int32_t *zid=calloc(3,32);
-               int i=0;
-               for(;i<3;i++) {
-                       zid[i]=rand();
-               }
-               lp_config_set_string(lc->config,"rtp","zid",(char*)zid);
+        char zidstr[128];
+        snprintf(zidstr,sizeof(zidstr),"%x-%x-%x",rand(),rand(),rand());
+               lp_config_set_string(lc->config,"rtp","zid",zidstr);
                return lp_config_get_string(lc->config,"rtp","zid",NULL);
        }
 }
@@ -123,7 +120,7 @@ static void linphone_call_audiostream_encryption_changed(void *data, bool_t encr
        if (params->has_video) {
                ms_message("Trying to enable encryption on video stream");
                OrtpZrtpParams params;
-               params.zid=get_zrtp_identifier(call->core);
+               params.zid=get_hexa_zrtp_identifier(call->core);
                params.zid_file=NULL; //unused
                video_stream_enable_zrtp(call->videostream,call->audiostream,&params);
        }
@@ -1130,7 +1127,7 @@ void linphone_call_start_media_streams(LinphoneCall *call, bool_t all_inputs_mut
        
        if (ortp_zrtp_available()) {
                OrtpZrtpParams params;
-               params.zid=get_zrtp_identifier(lc);
+               params.zid=get_hexa_zrtp_identifier(lc);
                params.zid_file=lc->zrtp_secrets_cache;
                audio_stream_enable_zrtp(call->audiostream,&params);
        }
index 83459cfa169478fc563b606fb141b60fa07ab861..45067312fd5296d01ea66c851a0f87f9a993b52b 160000 (submodule)
@@ -1 +1 @@
-Subproject commit 83459cfa169478fc563b606fb141b60fa07ab861
+Subproject commit 45067312fd5296d01ea66c851a0f87f9a993b52b
diff --git a/oRTP b/oRTP
index 6eabe8e0490f3c88becfaf403444bb1285edde9d..e16102322baf5bc6079216c44722f79d1a6202d4 160000 (submodule)
--- a/oRTP
+++ b/oRTP
@@ -1 +1 @@
-Subproject commit 6eabe8e0490f3c88becfaf403444bb1285edde9d
+Subproject commit e16102322baf5bc6079216c44722f79d1a6202d4