diff options
author | Nikos Mavrogiannopoulos <nmav@gnutls.org> | 2012-11-05 21:44:44 +0100 |
---|---|---|
committer | Nikos Mavrogiannopoulos <nmav@gnutls.org> | 2012-11-05 21:53:35 +0100 |
commit | 3fcb006e28f946fa73660c0dc6c844a76cbc0f84 (patch) | |
tree | 1cce039c9959ca0c8d5a5d8cd67582133eb9f453 | |
parent | b47ec12f7ac7e08c4456ffa5cb513a408d8d962e (diff) | |
download | gnutls-3fcb006e28f946fa73660c0dc6c844a76cbc0f84.tar.gz |
Added conditional to disable DTLS-SRTP support.
-rw-r--r-- | configure.ac | 1 | ||||
-rw-r--r-- | doc/cha-library.texi | 1 | ||||
-rw-r--r-- | lib/ext/Makefile.am | 5 | ||||
-rw-r--r-- | lib/gnutls_extensions.c | 2 | ||||
-rw-r--r-- | m4/hooks.m4 | 15 | ||||
-rw-r--r-- | src/cli.c | 2 | ||||
-rw-r--r-- | src/common.c | 2 | ||||
-rw-r--r-- | src/serv.c | 2 | ||||
-rw-r--r-- | tests/mini-dtls-srtp.c | 4 |
9 files changed, 31 insertions, 3 deletions
diff --git a/configure.ac b/configure.ac index 736f815055..0891360266 100644 --- a/configure.ac +++ b/configure.ac @@ -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 diff --git a/doc/cha-library.texi b/doc/cha-library.texi index 338658af7f..4f2e16f168 100644 --- a/doc/cha-library.texi +++ b/doc/cha-library.texi @@ -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}. diff --git a/lib/ext/Makefile.am b/lib/ext/Makefile.am index 0d97132537..1719fd75a4 100644 --- a/lib/ext/Makefile.am +++ b/lib/ext/Makefile.am @@ -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 diff --git a/lib/gnutls_extensions.c b/lib/gnutls_extensions.c index 28a852b7d2..2cf9c26d92 100644 --- a/lib/gnutls_extensions.c +++ b/lib/gnutls_extensions.c @@ -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; } diff --git a/m4/hooks.m4 b/m4/hooks.m4 index 6117e83cba..3ec50447e2 100644 --- a/m4/hooks.m4 +++ b/m4/hooks.m4 @@ -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, @@ -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; } diff --git a/src/common.c b/src/common.c index 9836125f7d..7eca925b32 100644 --- a/src/common.c +++ b/src/common.c @@ -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) { diff --git a/src/serv.c b/src/serv.c index 3541fbd52b..3fc9845c0d 100644 --- a/src/serv.c +++ b/src/serv.c @@ -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; } diff --git a/tests/mini-dtls-srtp.c b/tests/mini-dtls-srtp.c index 3a5878a592..11bf746275 100644 --- a/tests/mini-dtls-srtp.c +++ b/tests/mini-dtls-srtp.c @@ -27,10 +27,10 @@ #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); } |