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

Side by Side Diff: webrtc/p2p/base/dtlstransportchannel.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 * Copyright 2011 The WebRTC Project Authors. All rights reserved. 2 * Copyright 2011 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 77 matching lines...) Expand 10 before | Expand all | Expand 10 after
88 88
89 DtlsTransportChannelWrapper::DtlsTransportChannelWrapper( 89 DtlsTransportChannelWrapper::DtlsTransportChannelWrapper(
90 Transport* transport, 90 Transport* transport,
91 TransportChannelImpl* channel) 91 TransportChannelImpl* channel)
92 : TransportChannelImpl(channel->transport_name(), channel->component()), 92 : TransportChannelImpl(channel->transport_name(), channel->component()),
93 transport_(transport), 93 transport_(transport),
94 worker_thread_(rtc::Thread::Current()), 94 worker_thread_(rtc::Thread::Current()),
95 channel_(channel), 95 channel_(channel),
96 downward_(NULL), 96 downward_(NULL),
97 ssl_role_(rtc::SSL_CLIENT), 97 ssl_role_(rtc::SSL_CLIENT),
98 ssl_max_version_(rtc::SSL_PROTOCOL_DTLS_10) { 98 ssl_max_version_(rtc::SSL_PROTOCOL_DTLS_10),
99 enable_gcm_ciphers_(false) {
99 channel_->SignalWritableState.connect(this, 100 channel_->SignalWritableState.connect(this,
100 &DtlsTransportChannelWrapper::OnWritableState); 101 &DtlsTransportChannelWrapper::OnWritableState);
101 channel_->SignalReadPacket.connect(this, 102 channel_->SignalReadPacket.connect(this,
102 &DtlsTransportChannelWrapper::OnReadPacket); 103 &DtlsTransportChannelWrapper::OnReadPacket);
103 channel_->SignalSentPacket.connect( 104 channel_->SignalSentPacket.connect(
104 this, &DtlsTransportChannelWrapper::OnSentPacket); 105 this, &DtlsTransportChannelWrapper::OnSentPacket);
105 channel_->SignalReadyToSend.connect(this, 106 channel_->SignalReadyToSend.connect(this,
106 &DtlsTransportChannelWrapper::OnReadyToSend); 107 &DtlsTransportChannelWrapper::OnReadyToSend);
107 channel_->SignalGatheringState.connect( 108 channel_->SignalGatheringState.connect(
108 this, &DtlsTransportChannelWrapper::OnGatheringState); 109 this, &DtlsTransportChannelWrapper::OnGatheringState);
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
160 if (dtls_active_) { 161 if (dtls_active_) {
161 LOG(LS_ERROR) << "Not changing max. protocol version " 162 LOG(LS_ERROR) << "Not changing max. protocol version "
162 << "while DTLS is negotiating"; 163 << "while DTLS is negotiating";
163 return false; 164 return false;
164 } 165 }
165 166
166 ssl_max_version_ = version; 167 ssl_max_version_ = version;
167 return true; 168 return true;
168 } 169 }
169 170
171 bool DtlsTransportChannelWrapper::SetEnableGcmCiphers(bool enable) {
172 if (dtls_active_) {
173 LOG(LS_ERROR) << "Not changing enabled GCM ciphers "
174 << "while DTLS is negotiating";
175 return false;
176 }
177
178 enable_gcm_ciphers_ = enable;
179 return true;
180 }
181
182 bool DtlsTransportChannelWrapper::IsEnableGcmCiphers() const {
183 return enable_gcm_ciphers_;
184 }
185
170 bool DtlsTransportChannelWrapper::SetSslRole(rtc::SSLRole role) { 186 bool DtlsTransportChannelWrapper::SetSslRole(rtc::SSLRole role) {
171 if (dtls_state() == DTLS_TRANSPORT_CONNECTED) { 187 if (dtls_state() == DTLS_TRANSPORT_CONNECTED) {
172 if (ssl_role_ != role) { 188 if (ssl_role_ != role) {
173 LOG(LS_ERROR) << "SSL Role can't be reversed after the session is setup."; 189 LOG(LS_ERROR) << "SSL Role can't be reversed after the session is setup.";
174 return false; 190 return false;
175 } 191 }
176 return true; 192 return true;
177 } 193 }
178 194
179 ssl_role_ = role; 195 ssl_role_ = role;
(...skipping 448 matching lines...) Expand 10 before | Expand all | Expand 10 after
628 644
629 void DtlsTransportChannelWrapper::Reconnect() { 645 void DtlsTransportChannelWrapper::Reconnect() {
630 set_dtls_state(DTLS_TRANSPORT_NEW); 646 set_dtls_state(DTLS_TRANSPORT_NEW);
631 set_writable(false); 647 set_writable(false);
632 if (channel_->writable()) { 648 if (channel_->writable()) {
633 OnWritableState(channel_); 649 OnWritableState(channel_);
634 } 650 }
635 } 651 }
636 652
637 } // namespace cricket 653 } // namespace cricket
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698