Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(523)

Side by Side Diff: pc/srtptransport.cc

Issue 3012953002: Created the DtlsSrtpTransport.
Patch Set: Resolved the comments. Created 3 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright 2017 The WebRTC project authors. All Rights Reserved. 2 * Copyright 2017 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 235 matching lines...) Expand 10 before | Expand all | Expand 10 after
246 } 246 }
247 247
248 void SrtpTransport::ResetParams() { 248 void SrtpTransport::ResetParams() {
249 send_session_ = nullptr; 249 send_session_ = nullptr;
250 recv_session_ = nullptr; 250 recv_session_ = nullptr;
251 send_rtcp_session_ = nullptr; 251 send_rtcp_session_ = nullptr;
252 recv_rtcp_session_ = nullptr; 252 recv_rtcp_session_ = nullptr;
253 LOG(LS_INFO) << "The params in SRTP transport are reset."; 253 LOG(LS_INFO) << "The params in SRTP transport are reset.";
254 } 254 }
255 255
256 void SrtpTransport::SetEncryptedHeaderExtensionIds(
257 cricket::ContentSource source,
258 const std::vector<int>& extension_ids) {
259 if (source == cricket::CS_LOCAL) {
260 recv_encrypted_header_extension_ids_ = extension_ids;
261 } else {
262 send_encrypted_header_extension_ids_ = extension_ids;
263 }
264 }
265
266 void SrtpTransport::CreateSrtpSessions() { 256 void SrtpTransport::CreateSrtpSessions() {
267 send_session_.reset(new cricket::SrtpSession()); 257 send_session_.reset(new cricket::SrtpSession());
268 recv_session_.reset(new cricket::SrtpSession()); 258 recv_session_.reset(new cricket::SrtpSession());
269 259
270 if (external_auth_enabled_) { 260 if (external_auth_enabled_) {
271 send_session_->EnableExternalAuth(); 261 send_session_->EnableExternalAuth();
272 } 262 }
273 } 263 }
274 264
275 bool SrtpTransport::ProtectRtp(void* p, int in_len, int max_len, int* out_len) { 265 bool SrtpTransport::ProtectRtp(void* p, int in_len, int max_len, int* out_len) {
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after
368 if (!IsActive()) { 358 if (!IsActive()) {
369 LOG(LS_WARNING) << "Failed to check IsExternalAuthActive: SRTP not active"; 359 LOG(LS_WARNING) << "Failed to check IsExternalAuthActive: SRTP not active";
370 return false; 360 return false;
371 } 361 }
372 362
373 RTC_CHECK(send_session_); 363 RTC_CHECK(send_session_);
374 return send_session_->IsExternalAuthActive(); 364 return send_session_->IsExternalAuthActive();
375 } 365 }
376 366
377 } // namespace webrtc 367 } // namespace webrtc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698