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

Side by Side Diff: talk/app/webrtc/peerconnection.cc

Issue 1528843005: Add support for GCM cipher suites from RFC 7714. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Added PeerConnection tests using GCM ciphers, fixed passing of flag through DtlsTransportChannel. Created 5 years 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 * libjingle 2 * libjingle
3 * Copyright 2012 Google Inc. 3 * Copyright 2012 Google Inc.
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are met: 6 * modification, are permitted provided that the following conditions are met:
7 * 7 *
8 * 1. Redistributions of source code must retain the above copyright notice, 8 * 1. Redistributions of source code must retain the above copyright notice,
9 * this list of conditions and the following disclaimer. 9 * this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright notice, 10 * 2. Redistributions in binary form must reproduce the above copyright notice,
(...skipping 1454 matching lines...) Expand 10 before | Expand all | Expand 10 after
1465 !remote_video_tracks_.empty(); 1465 !remote_video_tracks_.empty();
1466 } 1466 }
1467 session_options->bundle_enabled = 1467 session_options->bundle_enabled =
1468 session_options->bundle_enabled && 1468 session_options->bundle_enabled &&
1469 (session_options->has_audio() || session_options->has_video() || 1469 (session_options->has_audio() || session_options->has_video() ||
1470 session_options->has_data()); 1470 session_options->has_data());
1471 1471
1472 if (session_->data_channel_type() == cricket::DCT_SCTP && HasDataChannels()) { 1472 if (session_->data_channel_type() == cricket::DCT_SCTP && HasDataChannels()) {
1473 session_options->data_channel_type = cricket::DCT_SCTP; 1473 session_options->data_channel_type = cricket::DCT_SCTP;
1474 } 1474 }
1475 session_options->enable_gcm_ciphers = factory_->options().enable_gcm_ciphers;
1475 return true; 1476 return true;
1476 } 1477 }
1477 1478
1478 bool PeerConnection::GetOptionsForAnswer( 1479 bool PeerConnection::GetOptionsForAnswer(
1479 const MediaConstraintsInterface* constraints, 1480 const MediaConstraintsInterface* constraints,
1480 cricket::MediaSessionOptions* session_options) { 1481 cricket::MediaSessionOptions* session_options) {
1481 session_options->recv_audio = false; 1482 session_options->recv_audio = false;
1482 session_options->recv_video = false; 1483 session_options->recv_video = false;
1483 if (!ParseConstraintsForAnswer(constraints, session_options)) { 1484 if (!ParseConstraintsForAnswer(constraints, session_options)) {
1484 return false; 1485 return false;
1485 } 1486 }
1486 1487
1487 AddSendStreams(session_options, senders_, rtp_data_channels_); 1488 AddSendStreams(session_options, senders_, rtp_data_channels_);
1488 session_options->bundle_enabled = 1489 session_options->bundle_enabled =
1489 session_options->bundle_enabled && 1490 session_options->bundle_enabled &&
1490 (session_options->has_audio() || session_options->has_video() || 1491 (session_options->has_audio() || session_options->has_video() ||
1491 session_options->has_data()); 1492 session_options->has_data());
1492 1493
1493 // RTP data channel is handled in MediaSessionOptions::AddStream. SCTP streams 1494 // RTP data channel is handled in MediaSessionOptions::AddStream. SCTP streams
1494 // are not signaled in the SDP so does not go through that path and must be 1495 // are not signaled in the SDP so does not go through that path and must be
1495 // handled here. 1496 // handled here.
1496 if (session_->data_channel_type() == cricket::DCT_SCTP) { 1497 if (session_->data_channel_type() == cricket::DCT_SCTP) {
1497 session_options->data_channel_type = cricket::DCT_SCTP; 1498 session_options->data_channel_type = cricket::DCT_SCTP;
1498 } 1499 }
1500 session_options->enable_gcm_ciphers = factory_->options().enable_gcm_ciphers;
1499 return true; 1501 return true;
1500 } 1502 }
1501 1503
1502 void PeerConnection::RemoveTracks(cricket::MediaType media_type) { 1504 void PeerConnection::RemoveTracks(cricket::MediaType media_type) {
1503 UpdateLocalTracks(std::vector<cricket::StreamParams>(), media_type); 1505 UpdateLocalTracks(std::vector<cricket::StreamParams>(), media_type);
1504 UpdateRemoteStreamsList(std::vector<cricket::StreamParams>(), false, 1506 UpdateRemoteStreamsList(std::vector<cricket::StreamParams>(), false,
1505 media_type, nullptr); 1507 media_type, nullptr);
1506 } 1508 }
1507 1509
1508 void PeerConnection::UpdateRemoteStreamsList( 1510 void PeerConnection::UpdateRemoteStreamsList(
(...skipping 511 matching lines...) Expand 10 before | Expand all | Expand 10 after
2020 DataChannel* PeerConnection::FindDataChannelBySid(int sid) const { 2022 DataChannel* PeerConnection::FindDataChannelBySid(int sid) const {
2021 for (const auto& channel : sctp_data_channels_) { 2023 for (const auto& channel : sctp_data_channels_) {
2022 if (channel->id() == sid) { 2024 if (channel->id() == sid) {
2023 return channel; 2025 return channel;
2024 } 2026 }
2025 } 2027 }
2026 return nullptr; 2028 return nullptr;
2027 } 2029 }
2028 2030
2029 } // namespace webrtc 2031 } // namespace webrtc
OLDNEW
« no previous file with comments | « no previous file | talk/app/webrtc/peerconnection_unittest.cc » ('j') | talk/app/webrtc/peerconnection_unittest.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698