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 ##################################################
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
test_ecc_SOURCES=test_ecc.c
test_ecc_LDADD=liblinphone.la $(liblinphone_la_LIBADD)
-
+endif
AM_CFLAGS=$(STRICT_OPTIONS) -DIN_LINPHONE \
}
#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);
}
}
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,¶ms);
}
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,¶ms);
}