| Index: talk/session/media/mediasession.cc
|
| diff --git a/talk/session/media/mediasession.cc b/talk/session/media/mediasession.cc
|
| index ed626e2f3478b99d432e8a4a9ddcfdcc61d01162..7413026092f1d6f8c8742e407d48376ac5a5ea01 100644
|
| --- a/talk/session/media/mediasession.cc
|
| +++ b/talk/session/media/mediasession.cc
|
| @@ -50,17 +50,6 @@
|
|
|
| namespace {
|
| const char kInline[] = "inline:";
|
| -
|
| -void GetSupportedCryptoSuiteNames(void (*func)(std::vector<int>*),
|
| - std::vector<std::string>* names) {
|
| -#ifdef HAVE_SRTP
|
| - std::vector<int> crypto_suites;
|
| - func(&crypto_suites);
|
| - for (const auto crypto : crypto_suites) {
|
| - names->push_back(rtc::SrtpCryptoSuiteToName(crypto));
|
| - }
|
| -#endif
|
| -}
|
| }
|
|
|
| namespace cricket {
|
| @@ -163,48 +152,28 @@
|
| }
|
|
|
| // For audio, HMAC 32 is prefered because of the low overhead.
|
| -void GetSupportedAudioCryptoSuites(std::vector<int>* crypto_suites) {
|
| +void GetSupportedAudioCryptoSuites(
|
| + std::vector<std::string>* crypto_suites) {
|
| #ifdef HAVE_SRTP
|
| - crypto_suites->push_back(rtc::SRTP_AES128_CM_SHA1_32);
|
| - crypto_suites->push_back(rtc::SRTP_AES128_CM_SHA1_80);
|
| + crypto_suites->push_back(rtc::CS_AES_CM_128_HMAC_SHA1_32);
|
| + crypto_suites->push_back(rtc::CS_AES_CM_128_HMAC_SHA1_80);
|
| #endif
|
| }
|
|
|
| -void GetSupportedAudioCryptoSuiteNames(
|
| - std::vector<std::string>* crypto_suite_names) {
|
| - GetSupportedCryptoSuiteNames(GetSupportedAudioCryptoSuites,
|
| - crypto_suite_names);
|
| -}
|
| -
|
| -void GetSupportedVideoCryptoSuites(std::vector<int>* crypto_suites) {
|
| - GetDefaultSrtpCryptoSuites(crypto_suites);
|
| -}
|
| -
|
| -void GetSupportedVideoCryptoSuiteNames(
|
| - std::vector<std::string>* crypto_suite_names) {
|
| - GetSupportedCryptoSuiteNames(GetSupportedVideoCryptoSuites,
|
| - crypto_suite_names);
|
| -}
|
| -
|
| -void GetSupportedDataCryptoSuites(std::vector<int>* crypto_suites) {
|
| - GetDefaultSrtpCryptoSuites(crypto_suites);
|
| -}
|
| -
|
| -void GetSupportedDataCryptoSuiteNames(
|
| - std::vector<std::string>* crypto_suite_names) {
|
| - GetSupportedCryptoSuiteNames(GetSupportedDataCryptoSuites,
|
| - crypto_suite_names);
|
| -}
|
| -
|
| -void GetDefaultSrtpCryptoSuites(std::vector<int>* crypto_suites) {
|
| +void GetSupportedVideoCryptoSuites(
|
| + std::vector<std::string>* crypto_suites) {
|
| + GetDefaultSrtpCryptoSuiteNames(crypto_suites);
|
| +}
|
| +
|
| +void GetSupportedDataCryptoSuites(
|
| + std::vector<std::string>* crypto_suites) {
|
| + GetDefaultSrtpCryptoSuiteNames(crypto_suites);
|
| +}
|
| +
|
| +void GetDefaultSrtpCryptoSuiteNames(std::vector<std::string>* crypto_suites) {
|
| #ifdef HAVE_SRTP
|
| - crypto_suites->push_back(rtc::SRTP_AES128_CM_SHA1_80);
|
| + crypto_suites->push_back(rtc::CS_AES_CM_128_HMAC_SHA1_80);
|
| #endif
|
| -}
|
| -
|
| -void GetDefaultSrtpCryptoSuiteNames(
|
| - std::vector<std::string>* crypto_suite_names) {
|
| - GetSupportedCryptoSuiteNames(GetDefaultSrtpCryptoSuites, crypto_suite_names);
|
| }
|
|
|
| // For video support only 80-bit SHA1 HMAC. For audio 32-bit HMAC is
|
| @@ -1545,7 +1514,7 @@
|
|
|
| scoped_ptr<AudioContentDescription> audio(new AudioContentDescription());
|
| std::vector<std::string> crypto_suites;
|
| - GetSupportedAudioCryptoSuiteNames(&crypto_suites);
|
| + GetSupportedAudioCryptoSuites(&crypto_suites);
|
| if (!CreateMediaContentOffer(
|
| options,
|
| audio_codecs,
|
| @@ -1599,7 +1568,7 @@
|
|
|
| scoped_ptr<VideoContentDescription> video(new VideoContentDescription());
|
| std::vector<std::string> crypto_suites;
|
| - GetSupportedVideoCryptoSuiteNames(&crypto_suites);
|
| + GetSupportedVideoCryptoSuites(&crypto_suites);
|
| if (!CreateMediaContentOffer(
|
| options,
|
| video_codecs,
|
| @@ -1669,7 +1638,7 @@
|
| data->set_protocol(
|
| secure_transport ? kMediaProtocolDtlsSctp : kMediaProtocolSctp);
|
| } else {
|
| - GetSupportedDataCryptoSuiteNames(&crypto_suites);
|
| + GetSupportedDataCryptoSuites(&crypto_suites);
|
| }
|
|
|
| if (!CreateMediaContentOffer(
|
|
|