]> git.ipfire.org Git - thirdparty/gnutls.git/commitdiff
Added conditional to disable DTLS-SRTP support.
authorNikos Mavrogiannopoulos <nmav@gnutls.org>
Mon, 5 Nov 2012 20:44:44 +0000 (21:44 +0100)
committerNikos Mavrogiannopoulos <nmav@gnutls.org>
Mon, 5 Nov 2012 20:53:35 +0000 (21:53 +0100)
configure.ac
doc/cha-library.texi
lib/ext/Makefile.am
lib/gnutls_extensions.c
m4/hooks.m4
src/cli.c
src/common.c
src/serv.c
tests/mini-dtls-srtp.c

index 736f815055bd6ba7cfffe0d7ec29f974f4b2117b..08913602665eaaf6fd035c83a411f4d6713aa1cc 100644 (file)
@@ -640,6 +640,7 @@ AC_MSG_NOTICE([Optional features:
 (note that included applications might not compile properly
 if features are disabled)
 
+  DTLS-SRTP support:$ac_enable_srtp
   OCSP support:     $ac_enable_ocsp
   OpenPGP support:  $ac_enable_openpgp
   SRP support:      $ac_enable_srp
index 338658af7f3422b126c3756c423432442b5f7cad..4f2e16f168ebd19cb774f85436c733638adbf3d1 100644 (file)
@@ -98,6 +98,7 @@ options are given.
 --disable-libdane
 --without-p11-kit
 --without-tpm
+--disable-dtls-srtp-support
 @end verbatim
 
 For the complete list, refer to the output from @code{configure --help}.
index 0d97132537a291f3ff4819f205798c2c7899360f..1719fd75a4e1a6c05e0af25ee3d54d851cc468c3 100644 (file)
@@ -39,5 +39,8 @@ libgnutls_ext_la_SOURCES = max_record.c cert_type.c \
        max_record.h cert_type.h server_name.h srp.h \
        session_ticket.h signature.h safe_renegotiation.h \
        session_ticket.c srp.c ecc.c ecc.h heartbeat.c heartbeat.h \
-       status_request.h status_request.c srtp.c srtp.h
+       status_request.h status_request.c
 
+if ENABLE_DTLS_SRTP
+libgnutls_ext_la_SOURCES += srtp.c srtp.h
+endif
index 28a852b7d238ebb9ca3763de52c790408fbb348d..2cf9c26d9271c36375f247ecc7d7b6422e1d6102 100644 (file)
@@ -355,9 +355,11 @@ _gnutls_ext_init (void)
   if (ret != GNUTLS_E_SUCCESS)
     return ret;
 
+#ifdef ENABLE_DTLS_SRTP
   ret = _gnutls_ext_register (&ext_mod_srtp);
   if (ret != GNUTLS_E_SUCCESS)
     return ret;
+#endif
 
   return GNUTLS_E_SUCCESS;
 }
index 6117e83cbaa57cef81e6ae4518ac3f64229f39fd..3ec50447e27b3262e071820539885a28d3dadb6a 100644 (file)
@@ -134,6 +134,21 @@ fi
     AC_MSG_WARN([C99 macros not supported. This may affect compiling.])
   ])
 
+  ac_enable_srtp=yes
+  AC_MSG_CHECKING([whether to disable DTLS-SRTP extension])
+  AC_ARG_ENABLE(dtls-srtp-support,
+    AS_HELP_STRING([--disable-dtls-srtp-support],
+                   [disable support for the DTLS-SRTP extension]),
+    ac_enable_srtp=no)
+  if test x$ac_enable_srtp != xno; then
+   AC_MSG_RESULT(no)
+   AC_DEFINE([ENABLE_DTLS_SRTP], 1, [enable DTLS-SRTP support])
+  else
+   ac_full=0
+   AC_MSG_RESULT(yes)
+  fi
+  AM_CONDITIONAL(ENABLE_DTLS_SRTP, test "$ac_enable_srtp" != "no")
+
   ac_enable_srp=yes
   AC_MSG_CHECKING([whether to disable SRP authentication support])
   AC_ARG_ENABLE(srp-authentication,
index 954cde1da4efa5c2bf4f5b5544e8c06b15557ec0..074adebd7856d608c0b0815cf1f062ce0d7b4f97 100644 (file)
--- a/src/cli.c
+++ b/src/cli.c
@@ -673,6 +673,7 @@ init_tls_session (const char *hostname)
   if (HAVE_OPT(HEARTBEAT))
     gnutls_heartbeat_enable (session, GNUTLS_HB_PEER_ALLOWED_TO_SEND);
 
+#ifdef ENABLE_DTLS_SRTP
   if (HAVE_OPT(SRTP_PROFILES))
     {
       ret = gnutls_srtp_set_profile_direct (session, OPT_ARG(SRTP_PROFILES), &err);
@@ -681,6 +682,7 @@ init_tls_session (const char *hostname)
         fprintf(stderr, "Error in profiles: %s\n", gnutls_strerror(ret));
       exit (1);
     }
+#endif
 
   return session;
 }
index 9836125f7d503539ed8eca900cfd24c6c468a111..7eca925b3292943b628d2bc229963025c1ca3013 100644 (file)
@@ -553,9 +553,11 @@ print_info (gnutls_session_t session, int verbose, int print_cert)
             (gnutls_compression_get (session)));
     printf ("- Compression: %s\n", tmp);
 
+#ifdef ENABLE_DTLS_SRTP
     rc = gnutls_srtp_get_selected_profile (session, &srtp_profile);
     if (rc == 0)
       printf ("- SRTP profile: %s\n", gnutls_srtp_get_profile_name (srtp_profile));
+#endif
 
     if (verbose)
       {
index 3541fbd52b23b23dfad4dbb205e27f14f39d9f72..3fc9845c0d8875bb7d5eb0df8ea11157ffe32fc0 100644 (file)
@@ -394,6 +394,7 @@ gnutls_session_t initialize_session (int dtls)
   if (HAVE_OPT (HEARTBEAT))
     gnutls_heartbeat_enable(session, GNUTLS_HB_PEER_ALLOWED_TO_SEND);
 
+#ifdef ENABLE_DTLS_SRTP
   if (HAVE_OPT (SRTP_PROFILES))
     {
       ret = gnutls_srtp_set_profile_direct (session, OPT_ARG(SRTP_PROFILES), &err);
@@ -402,6 +403,7 @@ gnutls_session_t initialize_session (int dtls)
         fprintf(stderr, "Error in profiles: %s\n", gnutls_strerror(ret));
       exit (1);
     }
+#endif
 
   return session;
 }
index 3a5878a592b9ce30a84a650c8d328af4f84074f7..11bf746275a3db4ea5c57b0b142bf27ba46aa92a 100644 (file)
 #include <stdio.h>
 #include <stdlib.h>
 
-#if defined(_WIN32)
+#if defined(_WIN32) || !defined(ENABLE_DTLS_SRTP)
 
 int
-main ()
+main (int argc, char** argv)
 {
     exit (77);
 }