diff --git a/webrtc/BUILD.gn b/webrtc/BUILD.gn index c8b74f0269..f06597dffa 100644 --- a/webrtc/BUILD.gn +++ b/webrtc/BUILD.gn @@ -147,7 +147,6 @@ config("common_config") { "HAVE_WEBRTC_VIDEO", "HAVE_WEBRTC_VOICE", "LOGGING_INSIDE_WEBRTC", - "SRTP_RELATIVE_PATH", "SSL_USE_OPENSSL", "USE_WEBRTC_DEV_BRANCH", ] diff --git a/webrtc/build/common.gypi b/webrtc/build/common.gypi index 5bf40047d2..304c933c38 100644 --- a/webrtc/build/common.gypi +++ b/webrtc/build/common.gypi @@ -294,7 +294,6 @@ 'LOGGING_INSIDE_WEBRTC', 'NO_MAIN_THREAD_WRAPPING', 'NO_SOUND_SYSTEM', - 'SRTP_RELATIVE_PATH', 'SSL_USE_OPENSSL', 'USE_WEBRTC_DEV_BRANCH', 'WEBRTC_CHROMIUM_BUILD', diff --git a/webrtc/pc/BUILD.gn b/webrtc/pc/BUILD.gn index 7efe1f175f..fe8711fa26 100644 --- a/webrtc/pc/BUILD.gn +++ b/webrtc/pc/BUILD.gn @@ -16,7 +16,6 @@ group("pc") { config("rtc_pc_config") { defines = [ - "SRTP_RELATIVE_PATH", "HAVE_SCTP", "HAVE_SRTP", ] diff --git a/webrtc/pc/externalhmac.cc b/webrtc/pc/externalhmac.cc index a094ff8432..ec71833d75 100644 --- a/webrtc/pc/externalhmac.cc +++ b/webrtc/pc/externalhmac.cc @@ -12,31 +12,12 @@ #include // For malloc/free. -#ifdef HAVE_SRTP -extern "C" { -#ifdef SRTP_RELATIVE_PATH -#include "crypto_kernel.h" // NOLINT -#include "srtp.h" // NOLINT -#else -#include "third_party/libsrtp/crypto/include/crypto_kernel.h" -#include "third_party/libsrtp/include/srtp.h" -#endif // SRTP_RELATIVE_PATH -} -#endif // HAVE_SRTP - #include "webrtc/base/logging.h" -#ifdef COMPILING_AGAINST_LIBSRTP1 -#define srtp_auth_type_t auth_type_t - -#define srtp_auth_init_func auth_init_func -#define srtp_auth_compute_func auth_compute_func -#define srtp_auth_update_func auth_update_func -#define srtp_auth_start_func auth_start_func -#define srtp_auth_test_case_t auth_test_case_t - -#define srtp_replace_auth_type crypto_kernel_replace_auth_type -#endif // COMPILING_AGAINST_LIBSRTP1 +#ifdef HAVE_SRTP +#include "third_party/libsrtp/crypto/include/crypto_kernel.h" +#include "third_party/libsrtp/include/srtp.h" +#endif // HAVE_SRTP #if defined(HAVE_SRTP) && defined(ENABLE_EXTERNAL_AUTH) @@ -71,21 +52,6 @@ static const char kExternalHmacDescription[] = // srtp_auth_type_t external_hmac is the hmac metaobject -#ifdef COMPILING_AGAINST_LIBSRTP1 -static const srtp_auth_type_t external_hmac = { - external_hmac_alloc, - external_hmac_dealloc, - (srtp_auth_init_func) external_hmac_init, - (srtp_auth_compute_func) external_hmac_compute, - (srtp_auth_update_func) external_hmac_update, - (srtp_auth_start_func) external_hmac_start, - const_cast(kExternalHmacDescription), - 0, // Instance count. - const_cast(&kExternalHmacTestCase0), - NULL, // No debugging module. - EXTERNAL_HMAC_SHA1 -}; -#else static const srtp_auth_type_t external_hmac = { external_hmac_alloc, external_hmac_dealloc, @@ -97,7 +63,6 @@ static const srtp_auth_type_t external_hmac = { const_cast(&kExternalHmacTestCase0), EXTERNAL_HMAC_SHA1 }; -#endif // COMPILING_AGAINST_LIBSRTP1 srtp_err_status_t external_hmac_alloc(srtp_auth_t** a, int key_len, diff --git a/webrtc/pc/externalhmac.h b/webrtc/pc/externalhmac.h index 091412e6a9..f9f1a2cc6f 100644 --- a/webrtc/pc/externalhmac.h +++ b/webrtc/pc/externalhmac.h @@ -30,26 +30,9 @@ #include "webrtc/base/basictypes.h" #ifdef HAVE_SRTP -extern "C" { -#ifdef SRTP_RELATIVE_PATH -#include "auth.h" // NOLINT -#else #include "third_party/libsrtp/crypto/include/auth.h" -#endif // SRTP_RELATIVE_PATH -} #endif // HAVE_SRTP -#if defined(HAVE_SRTP) && !defined(SRTP_HMAC_SHA1) -// Include compatibility shims to compile against libsrtp 1.x. -// TODO(mattdr): Remove once Chromium uses libsrtp 2. - -// Remember that the definition of SRTP_HMAC_SHA1 is synthetic. -#define COMPILING_AGAINST_LIBSRTP1 1 - -#define SRTP_HMAC_SHA1 HMAC_SHA1 -#define srtp_auth_t auth_t -#endif - #if defined(HAVE_SRTP) && defined(ENABLE_EXTERNAL_AUTH) #define EXTERNAL_HMAC_SHA1 SRTP_HMAC_SHA1 + 1 diff --git a/webrtc/pc/pc.gyp b/webrtc/pc/pc.gyp index 36be48d56d..3a1ca20098 100755 --- a/webrtc/pc/pc.gyp +++ b/webrtc/pc/pc.gyp @@ -10,7 +10,6 @@ 'includes': ['../build/common.gypi'], 'variables': { 'rtc_pc_defines': [ - 'SRTP_RELATIVE_PATH', 'HAVE_SCTP', 'HAVE_SRTP', ], diff --git a/webrtc/pc/srtpfilter.cc b/webrtc/pc/srtpfilter.cc index f1ecff1001..5e2dbb0eb6 100644 --- a/webrtc/pc/srtpfilter.cc +++ b/webrtc/pc/srtpfilter.cc @@ -14,6 +14,8 @@ #include +#include "third_party/libsrtp/include/srtp.h" +#include "third_party/libsrtp/include/srtp_priv.h" #include "webrtc/base/base64.h" #include "webrtc/base/buffer.h" #include "webrtc/base/byteorder.h" @@ -25,18 +27,6 @@ #include "webrtc/media/base/rtputils.h" #include "webrtc/pc/externalhmac.h" -#ifdef HAVE_SRTP -extern "C" { -#ifdef SRTP_RELATIVE_PATH -#include "srtp.h" // NOLINT -#include "srtp_priv.h" // NOLINT -#else -#include "third_party/libsrtp/include/srtp.h" -#include "third_party/libsrtp/include/srtp_priv.h" -#endif // SRTP_RELATIVE_PATH -} -#endif // HAVE_SRTP - namespace cricket { #ifndef HAVE_SRTP diff --git a/webrtc/pc/srtpfilter.h b/webrtc/pc/srtpfilter.h index abea50744d..ec91805e30 100644 --- a/webrtc/pc/srtpfilter.h +++ b/webrtc/pc/srtpfilter.h @@ -28,11 +28,6 @@ // Forward declaration to avoid pulling in libsrtp headers here struct srtp_event_data_t; - -// Libsrtp V1/V2 compatibility hack. -// TODO(mattdr): Remove this #define after libsrtp 2.0 is in. -#define srtp_ctx_t_ srtp_ctx_t - struct srtp_ctx_t_; namespace cricket { diff --git a/webrtc/pc/srtpfilter_unittest.cc b/webrtc/pc/srtpfilter_unittest.cc index fda571195c..32cd20ed6a 100644 --- a/webrtc/pc/srtpfilter_unittest.cc +++ b/webrtc/pc/srtpfilter_unittest.cc @@ -8,6 +8,9 @@ * be found in the AUTHORS file in the root of the source tree. */ +#include "webrtc/pc/srtpfilter.h" + +#include "third_party/libsrtp/include/srtp.h" #include "webrtc/base/byteorder.h" #include "webrtc/base/constructormagic.h" #include "webrtc/base/gunit.h" @@ -15,14 +18,6 @@ #include "webrtc/media/base/cryptoparams.h" #include "webrtc/media/base/fakertp.h" #include "webrtc/p2p/base/sessiondescription.h" -#include "webrtc/pc/srtpfilter.h" -extern "C" { -#ifdef SRTP_RELATIVE_PATH -#include "crypto/include/err.h" -#else -#include "third_party/libsrtp/crypto/include/err.h" -#endif -} using rtc::CS_AES_CM_128_HMAC_SHA1_80; using rtc::CS_AES_CM_128_HMAC_SHA1_32;