summaryrefslogtreecommitdiff
path: root/configure.ac
diff options
context:
space:
mode:
authorSean Bright <sean.bright@gmail.com>2017-05-26 12:13:36 -0400
committerSean Bright <sean.bright@gmail.com>2017-05-26 12:14:44 -0400
commit009e2cdb2ebec253fa364d85cafa18cc05c1eadd (patch)
tree43e690d13ae02694a7b1edffa28968bd495832a7 /configure.ac
parent4e757a4ca0ebc9abbf52abd1991f1dfa03c55a17 (diff)
res_srtp: Add support for libsrtp2
ASTERISK-25294 #close Reported by: Tzafrir Cohen ASTERISK-26976 #close Reported by: Alex Change-Id: I789b1c3d1ed31365bbd9339fa58ef36f48833c40
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac95
1 files changed, 53 insertions, 42 deletions
diff --git a/configure.ac b/configure.ac
index 4c6c0f21b..2bab855d7 100644
--- a/configure.ac
+++ b/configure.ac
@@ -2440,53 +2440,64 @@ then
AST_C_DEFINE_CHECK([SSL_OP_NO_TLSV1_2], [SSL_OP_NO_TLSv1_2], [openssl/ssl.h])
fi
-AST_EXT_LIB_CHECK([SRTP], [srtp], [srtp_init], [srtp/srtp.h])
-
-if test "$PBX_SRTP" = "1";
+AST_EXT_LIB_CHECK([SRTP], [srtp2], [srtp_init], [srtp2/srtp.h], [], [], [2])
+AST_EXT_LIB_CHECK_SHARED([SRTP], [srtp2], [srtp_init], [srtp2/srtp.h], [], [], [], [
+ AC_MSG_WARN([***])
+ AC_MSG_WARN([*** libsrtp2 could not be linked as a shared object.])
+ AC_MSG_WARN([*** Try compiling libsrtp2 manually. Configure libsrtp2])
+ AC_MSG_WARN([*** with ./configure --prefix=/usr replacing /usr with])
+ AC_MSG_WARN([*** the prefix of your choice, and then make with])
+ AC_MSG_WARN([*** 'make libsrtp2.so'])
+ AC_MSG_WARN([***])
+ AC_MSG_WARN([*** After re-installing libsrtp2, re-run the Asterisk])
+ AC_MSG_WARN([*** configure script.])
+ AC_MSG_WARN([***])
+ AC_MSG_WARN([*** If you do not need SRTP support re-run configure])
+ AC_MSG_WARN([*** with the --without-srtp option.])
+ exit 1
+])
+
+if test "x$PBX_SRTP" = x1;
then
- saved_libs="${LIBS}"
- saved_ldflags="${LDFLAGS}"
- saved_cflags="${CFLAGS}"
- LIBS="${LIBS} ${SRTP_LIB}"
- LDFLAGS="${LDFLAGS} -shared -fPIC"
- CFLAGS="${CFLAGS} ${SRTP_INCLUDE}"
- AC_MSG_CHECKING(for the ability of -lsrtp to be linked in a shared object)
- AC_LINK_IFELSE(
- [
- AC_LANG_PROGRAM(
- [#include <srtp/srtp.h>],
- [srtp_init();]
- )
- ],
- [ AC_MSG_RESULT(yes) ],
- [
- AC_MSG_RESULT(no)
- AC_MSG_WARN(***)
- AC_MSG_WARN(*** libsrtp could not be linked as a shared object.)
- AC_MSG_WARN(*** Try compiling libsrtp manually. Configure libsrtp)
- AC_MSG_WARN(*** with ./configure CFLAGS=-fPIC --prefix=/usr)
- AC_MSG_WARN(*** replacing /usr with the prefix of your choice.)
- AC_MSG_WARN(*** After re-installing libsrtp, re-run the Asterisk)
- AC_MSG_WARN(*** configure script.)
- AC_MSG_WARN(***)
- AC_MSG_WARN(*** If you do not need SRTP support re-run configure)
- AC_MSG_WARN(*** with the --without-srtp option.)
- exit 1
- ]
- )
- LIBS="${saved_libs}"
- LDFLAGS="${saved_ldflags}"
- CFLAGS="${saved_cflags}"
+ AST_EXT_LIB_CHECK([SRTP_256], [srtp2], [srtp_crypto_policy_set_aes_cm_256_hmac_sha1_80])
+ AST_EXT_LIB_CHECK([SRTP_GCM], [srtp2], [srtp_crypto_policy_set_aes_gcm_128_8_auth])
+ AST_EXT_LIB_CHECK([SRTP_SHUTDOWN], [srtp2], [srtp_shutdown], [srtp2/srtp.h])
+
+ # libsrtp2 removed support for PRNG, so we require OpenSSL
+ if test "x$PBX_OPENSSL" != x1;
+ then
+ AC_MSG_WARN([***])
+ AC_MSG_WARN([*** OpenSSL required when using libsrtp2, checking for libsrtp instead.])
+ AC_MSG_WARN([***])
+ PBX_SRTP=0
+ fi
fi
-if test "$PBX_SRTP" = "1";
+if test "x$PBX_SRTP" != x1;
then
- AST_EXT_LIB_CHECK([SRTP_256], [srtp], [crypto_policy_set_aes_cm_256_hmac_sha1_80])
- AST_EXT_LIB_CHECK([SRTP_192], [srtp], [crypto_policy_set_aes_cm_192_hmac_sha1_80])
- AST_EXT_LIB_CHECK([SRTP_GCM], [srtp], [aes_gcm_128_openssl])
-fi
+ AST_EXT_LIB_CHECK([SRTP], [srtp], [srtp_init], [srtp/srtp.h], [], [], [1])
+ AST_EXT_LIB_CHECK_SHARED([SRTP], [srtp], [srtp_init], [srtp/srtp.h], [], [], [], [
+ AC_MSG_WARN([***])
+ AC_MSG_WARN([*** libsrtp could not be linked as a shared object.])
+ AC_MSG_WARN([*** Try compiling libsrtp manually. Configure libsrtp])
+ AC_MSG_WARN([*** with ./configure CFLAGS=-fPIC --prefix=/usr])
+ AC_MSG_WARN([*** replacing /usr with the prefix of your choice.])
+ AC_MSG_WARN([*** After re-installing libsrtp, re-run the Asterisk])
+ AC_MSG_WARN([*** configure script.])
+ AC_MSG_WARN([***])
+ AC_MSG_WARN([*** If you do not need SRTP support re-run configure])
+ AC_MSG_WARN([*** with the --without-srtp option.])
+ exit 1
+ ])
-AST_EXT_LIB_CHECK([SRTP_SHUTDOWN], [srtp], [srtp_shutdown], [srtp/srtp.h])
+ if test "x$PBX_SRTP" = x1;
+ then
+ AST_EXT_LIB_CHECK([SRTP_256], [srtp], [crypto_policy_set_aes_cm_256_hmac_sha1_80])
+ AST_EXT_LIB_CHECK([SRTP_192], [srtp], [crypto_policy_set_aes_cm_192_hmac_sha1_80])
+ AST_EXT_LIB_CHECK([SRTP_GCM], [srtp], [crypto_policy_set_aes_gcm_128_8_auth])
+ AST_EXT_LIB_CHECK([SRTP_SHUTDOWN], [srtp], [srtp_shutdown], [srtp/srtp.h])
+ fi
+fi
for ver in 2.0 2.2 2.4 2.6; do
AST_PKG_CONFIG_CHECK([GMIME], gmime-$ver)