Remove remnants of libsrtp1

Now that Chromium has taken libsrtp2, remove any compatibility bridge code in WebRTC that was only needed for libsrtp1.

Remove SRTP_RELATIVE_PATH now that Google's internal copy of libsrtp and the Chromium copy have the same directory structure.

Fix some include orderings per the Chromium C++ style guide.

Remove the `extern "C"` blocks now that the libsrtp headers include them (https://github.com/cisco/libsrtp/pull/195).

BUG=webrtc:6376

Review-Url: https://codereview.webrtc.org/2447893002
Cr-Commit-Position: refs/heads/master@{#14776}
This commit is contained in:
mattdr 2016-10-25 09:47:26 -07:00 committed by Commit bot
parent 257dc39841
commit 0d8ade543d
9 changed files with 9 additions and 85 deletions

View File

@ -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",
]

View File

@ -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',

View File

@ -16,7 +16,6 @@ group("pc") {
config("rtc_pc_config") {
defines = [
"SRTP_RELATIVE_PATH",
"HAVE_SCTP",
"HAVE_SRTP",
]

View File

@ -12,31 +12,12 @@
#include <stdlib.h> // 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<char*>(kExternalHmacDescription),
0, // Instance count.
const_cast<srtp_auth_test_case_t*>(&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<srtp_auth_test_case_t*>(&kExternalHmacTestCase0),
EXTERNAL_HMAC_SHA1
};
#endif // COMPILING_AGAINST_LIBSRTP1
srtp_err_status_t external_hmac_alloc(srtp_auth_t** a,
int key_len,

View File

@ -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

View File

@ -10,7 +10,6 @@
'includes': ['../build/common.gypi'],
'variables': {
'rtc_pc_defines': [
'SRTP_RELATIVE_PATH',
'HAVE_SCTP',
'HAVE_SRTP',
],

View File

@ -14,6 +14,8 @@
#include <algorithm>
#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

View File

@ -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 {

View File

@ -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;