Chromium Code Reviews

Side by Side Diff: webrtc/p2p/base/transportcontroller.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.
Jump to:
View unified diff |
OLDNEW
1 /* 1 /*
2 * Copyright 2015 The WebRTC Project Authors. All rights reserved. 2 * Copyright 2015 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 38 matching lines...)
49 rtc::Bind(&TransportController::DestroyAllTransports_w, this)); 49 rtc::Bind(&TransportController::DestroyAllTransports_w, this));
50 signaling_thread_->Clear(this); 50 signaling_thread_->Clear(this);
51 } 51 }
52 52
53 bool TransportController::SetSslMaxProtocolVersion( 53 bool TransportController::SetSslMaxProtocolVersion(
54 rtc::SSLProtocolVersion version) { 54 rtc::SSLProtocolVersion version) {
55 return worker_thread_->Invoke<bool>(rtc::Bind( 55 return worker_thread_->Invoke<bool>(rtc::Bind(
56 &TransportController::SetSslMaxProtocolVersion_w, this, version)); 56 &TransportController::SetSslMaxProtocolVersion_w, this, version));
57 } 57 }
58 58
59 bool TransportController::SetEnableGcmCiphers(bool enable) {
60 return worker_thread_->Invoke<bool>(rtc::Bind(
61 &TransportController::SetEnableGcmCiphers_w, this, enable));
62 }
63
59 void TransportController::SetIceConfig(const IceConfig& config) { 64 void TransportController::SetIceConfig(const IceConfig& config) {
60 worker_thread_->Invoke<void>( 65 worker_thread_->Invoke<void>(
61 rtc::Bind(&TransportController::SetIceConfig_w, this, config)); 66 rtc::Bind(&TransportController::SetIceConfig_w, this, config));
62 } 67 }
63 68
64 void TransportController::SetIceRole(IceRole ice_role) { 69 void TransportController::SetIceRole(IceRole ice_role) {
65 worker_thread_->Invoke<void>( 70 worker_thread_->Invoke<void>(
66 rtc::Bind(&TransportController::SetIceRole_w, this, ice_role)); 71 rtc::Bind(&TransportController::SetIceRole_w, this, ice_role));
67 } 72 }
68 73
(...skipping 207 matching lines...)
276 281
277 Transport* transport = GetTransport_w(transport_name); 282 Transport* transport = GetTransport_w(transport_name);
278 if (transport) { 283 if (transport) {
279 return transport; 284 return transport;
280 } 285 }
281 286
282 transport = CreateTransport_w(transport_name); 287 transport = CreateTransport_w(transport_name);
283 // The stuff below happens outside of CreateTransport_w so that unit tests 288 // The stuff below happens outside of CreateTransport_w so that unit tests
284 // can override CreateTransport_w to return a different type of transport. 289 // can override CreateTransport_w to return a different type of transport.
285 transport->SetSslMaxProtocolVersion(ssl_max_version_); 290 transport->SetSslMaxProtocolVersion(ssl_max_version_);
291 transport->SetEnableGcmCiphers(enable_gcm_ciphers_);
286 transport->SetIceConfig(ice_config_); 292 transport->SetIceConfig(ice_config_);
287 transport->SetIceRole(ice_role_); 293 transport->SetIceRole(ice_role_);
288 transport->SetIceTiebreaker(ice_tiebreaker_); 294 transport->SetIceTiebreaker(ice_tiebreaker_);
289 if (certificate_) { 295 if (certificate_) {
290 transport->SetLocalCertificate(certificate_); 296 transport->SetLocalCertificate(certificate_);
291 } 297 }
292 transports_[transport_name] = transport; 298 transports_[transport_name] = transport;
293 299
294 return transport; 300 return transport;
295 } 301 }
(...skipping 24 matching lines...)
320 326
321 // Max SSL version can only be set before transports are created. 327 // Max SSL version can only be set before transports are created.
322 if (!transports_.empty()) { 328 if (!transports_.empty()) {
323 return false; 329 return false;
324 } 330 }
325 331
326 ssl_max_version_ = version; 332 ssl_max_version_ = version;
327 return true; 333 return true;
328 } 334 }
329 335
336 bool TransportController::SetEnableGcmCiphers_w(bool enable) {
337 RTC_DCHECK(worker_thread_->IsCurrent());
338
339 // GCM ciphers can only be enabled before transports are created.
340 if (!transports_.empty()) {
341 return false;
342 }
343
344 enable_gcm_ciphers_ = enable;
345 return true;
346 }
347
330 void TransportController::SetIceConfig_w(const IceConfig& config) { 348 void TransportController::SetIceConfig_w(const IceConfig& config) {
331 RTC_DCHECK(worker_thread_->IsCurrent()); 349 RTC_DCHECK(worker_thread_->IsCurrent());
332 ice_config_ = config; 350 ice_config_ = config;
333 for (const auto& kv : transports_) { 351 for (const auto& kv : transports_) {
334 kv.second->SetIceConfig(ice_config_); 352 kv.second->SetIceConfig(ice_config_);
335 } 353 }
336 } 354 }
337 355
338 void TransportController::SetIceRole_w(IceRole ice_role) { 356 void TransportController::SetIceRole_w(IceRole ice_role) {
339 RTC_DCHECK(worker_thread_->IsCurrent()); 357 RTC_DCHECK(worker_thread_->IsCurrent());
(...skipping 256 matching lines...)
596 } 614 }
597 if (gathering_state_ != new_gathering_state) { 615 if (gathering_state_ != new_gathering_state) {
598 gathering_state_ = new_gathering_state; 616 gathering_state_ = new_gathering_state;
599 signaling_thread_->Post( 617 signaling_thread_->Post(
600 this, MSG_ICEGATHERINGSTATE, 618 this, MSG_ICEGATHERINGSTATE,
601 new rtc::TypedMessageData<IceGatheringState>(new_gathering_state)); 619 new rtc::TypedMessageData<IceGatheringState>(new_gathering_state));
602 } 620 }
603 } 621 }
604 622
605 } // namespace cricket 623 } // namespace cricket
OLDNEW
« talk/session/media/srtpfilter.cc ('K') | « webrtc/p2p/base/transportcontroller.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine