| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2004 The WebRTC project authors. All Rights Reserved. | 2 * Copyright 2004 The WebRTC project authors. All Rights Reserved. |
| 3 * | 3 * |
| 4 * Use of this source code is governed by a BSD-style license | 4 * Use of this source code is governed by a BSD-style license |
| 5 * that can be found in the LICENSE file in the root of the source | 5 * that can be found in the LICENSE file in the root of the source |
| 6 * tree. An additional intellectual property rights grant can be found | 6 * tree. An additional intellectual property rights grant can be found |
| 7 * in the file PATENTS. All contributing project authors may | 7 * in the file PATENTS. All contributing project authors may |
| 8 * be found in the AUTHORS file in the root of the source tree. | 8 * be found in the AUTHORS file in the root of the source tree. |
| 9 */ | 9 */ |
| 10 | 10 |
| (...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 190 } | 190 } |
| 191 | 191 |
| 192 void GetSupportedAudioCryptoSuiteNames(const rtc::CryptoOptions& crypto_options, | 192 void GetSupportedAudioCryptoSuiteNames(const rtc::CryptoOptions& crypto_options, |
| 193 std::vector<std::string>* crypto_suite_names) { | 193 std::vector<std::string>* crypto_suite_names) { |
| 194 GetSupportedCryptoSuiteNames(GetSupportedAudioCryptoSuites, | 194 GetSupportedCryptoSuiteNames(GetSupportedAudioCryptoSuites, |
| 195 crypto_options, crypto_suite_names); | 195 crypto_options, crypto_suite_names); |
| 196 } | 196 } |
| 197 | 197 |
| 198 void GetSupportedVideoCryptoSuites(const rtc::CryptoOptions& crypto_options, | 198 void GetSupportedVideoCryptoSuites(const rtc::CryptoOptions& crypto_options, |
| 199 std::vector<int>* crypto_suites) { | 199 std::vector<int>* crypto_suites) { |
| 200 GetDefaultSrtpCryptoSuites(crypto_options, crypto_suites); | 200 rtc::GetDefaultSrtpCryptoSuites(crypto_options, crypto_suites); |
| 201 } | 201 } |
| 202 | 202 |
| 203 void GetSupportedVideoCryptoSuiteNames(const rtc::CryptoOptions& crypto_options, | 203 void GetSupportedVideoCryptoSuiteNames(const rtc::CryptoOptions& crypto_options, |
| 204 std::vector<std::string>* crypto_suite_names) { | 204 std::vector<std::string>* crypto_suite_names) { |
| 205 GetSupportedCryptoSuiteNames(GetSupportedVideoCryptoSuites, | 205 GetSupportedCryptoSuiteNames(GetSupportedVideoCryptoSuites, |
| 206 crypto_options, crypto_suite_names); | 206 crypto_options, crypto_suite_names); |
| 207 } | 207 } |
| 208 | 208 |
| 209 void GetSupportedDataCryptoSuites(const rtc::CryptoOptions& crypto_options, | 209 void GetSupportedDataCryptoSuites(const rtc::CryptoOptions& crypto_options, |
| 210 std::vector<int>* crypto_suites) { | 210 std::vector<int>* crypto_suites) { |
| 211 GetDefaultSrtpCryptoSuites(crypto_options, crypto_suites); | 211 rtc::GetDefaultSrtpCryptoSuites(crypto_options, crypto_suites); |
| 212 } | 212 } |
| 213 | 213 |
| 214 void GetSupportedDataCryptoSuiteNames(const rtc::CryptoOptions& crypto_options, | 214 void GetSupportedDataCryptoSuiteNames(const rtc::CryptoOptions& crypto_options, |
| 215 std::vector<std::string>* crypto_suite_names) { | 215 std::vector<std::string>* crypto_suite_names) { |
| 216 GetSupportedCryptoSuiteNames(GetSupportedDataCryptoSuites, | 216 GetSupportedCryptoSuiteNames(GetSupportedDataCryptoSuites, |
| 217 crypto_options, crypto_suite_names); | 217 crypto_options, crypto_suite_names); |
| 218 } | 218 } |
| 219 | 219 |
| 220 void GetDefaultSrtpCryptoSuites(const rtc::CryptoOptions& crypto_options, | |
| 221 std::vector<int>* crypto_suites) { | |
| 222 if (crypto_options.enable_gcm_crypto_suites) { | |
| 223 crypto_suites->push_back(rtc::SRTP_AEAD_AES_256_GCM); | |
| 224 crypto_suites->push_back(rtc::SRTP_AEAD_AES_128_GCM); | |
| 225 } | |
| 226 crypto_suites->push_back(rtc::SRTP_AES128_CM_SHA1_80); | |
| 227 } | |
| 228 | |
| 229 void GetDefaultSrtpCryptoSuiteNames(const rtc::CryptoOptions& crypto_options, | 220 void GetDefaultSrtpCryptoSuiteNames(const rtc::CryptoOptions& crypto_options, |
| 230 std::vector<std::string>* crypto_suite_names) { | 221 std::vector<std::string>* crypto_suite_names) { |
| 231 GetSupportedCryptoSuiteNames(GetDefaultSrtpCryptoSuites, | 222 GetSupportedCryptoSuiteNames(rtc::GetDefaultSrtpCryptoSuites, crypto_options, |
| 232 crypto_options, crypto_suite_names); | 223 crypto_suite_names); |
| 233 } | 224 } |
| 234 | 225 |
| 235 // Support any GCM cipher (if enabled through options). For video support only | 226 // Support any GCM cipher (if enabled through options). For video support only |
| 236 // 80-bit SHA1 HMAC. For audio 32-bit HMAC is tolerated unless bundle is enabled | 227 // 80-bit SHA1 HMAC. For audio 32-bit HMAC is tolerated unless bundle is enabled |
| 237 // because it is low overhead. | 228 // because it is low overhead. |
| 238 // Pick the crypto in the list that is supported. | 229 // Pick the crypto in the list that is supported. |
| 239 static bool SelectCrypto(const MediaContentDescription* offer, | 230 static bool SelectCrypto(const MediaContentDescription* offer, |
| 240 bool bundle, | 231 bool bundle, |
| 241 const rtc::CryptoOptions& crypto_options, | 232 const rtc::CryptoOptions& crypto_options, |
| 242 CryptoParams *crypto) { | 233 CryptoParams *crypto) { |
| (...skipping 1940 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2183 GetFirstMediaContentDescription(sdesc, MEDIA_TYPE_VIDEO)); | 2174 GetFirstMediaContentDescription(sdesc, MEDIA_TYPE_VIDEO)); |
| 2184 } | 2175 } |
| 2185 | 2176 |
| 2186 DataContentDescription* GetFirstDataContentDescription( | 2177 DataContentDescription* GetFirstDataContentDescription( |
| 2187 SessionDescription* sdesc) { | 2178 SessionDescription* sdesc) { |
| 2188 return static_cast<DataContentDescription*>( | 2179 return static_cast<DataContentDescription*>( |
| 2189 GetFirstMediaContentDescription(sdesc, MEDIA_TYPE_DATA)); | 2180 GetFirstMediaContentDescription(sdesc, MEDIA_TYPE_DATA)); |
| 2190 } | 2181 } |
| 2191 | 2182 |
| 2192 } // namespace cricket | 2183 } // namespace cricket |
| OLD | NEW |