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

Side by Side Diff: webrtc/p2p/base/dtlstransportchannel.h

Issue 1269843005: Added DtlsCertificate, a ref counted object owning an SSLIdentity (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Merge with master Created 5 years, 4 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 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 81 matching lines...) Expand 10 before | Expand all | Expand 10 after
92 DtlsTransportChannelWrapper(Transport* transport, 92 DtlsTransportChannelWrapper(Transport* transport,
93 TransportChannelImpl* channel); 93 TransportChannelImpl* channel);
94 virtual ~DtlsTransportChannelWrapper(); 94 virtual ~DtlsTransportChannelWrapper();
95 95
96 virtual void SetIceRole(IceRole role) { 96 virtual void SetIceRole(IceRole role) {
97 channel_->SetIceRole(role); 97 channel_->SetIceRole(role);
98 } 98 }
99 virtual IceRole GetIceRole() const { 99 virtual IceRole GetIceRole() const {
100 return channel_->GetIceRole(); 100 return channel_->GetIceRole();
101 } 101 }
102 virtual bool SetLocalIdentity(rtc::SSLIdentity *identity); 102 bool SetLocalCertificate(
103 virtual bool GetLocalIdentity(rtc::SSLIdentity** identity) const; 103 const rtc::scoped_refptr<webrtc::DtlsCertificate>& certificate) override;
104 bool GetLocalCertificate(
105 rtc::scoped_refptr<webrtc::DtlsCertificate>* certificate) const override;
104 106
105 virtual bool SetRemoteFingerprint(const std::string& digest_alg, 107 virtual bool SetRemoteFingerprint(const std::string& digest_alg,
106 const uint8* digest, 108 const uint8* digest,
107 size_t digest_len); 109 size_t digest_len);
108 virtual bool IsDtlsActive() const { return dtls_state_ != STATE_NONE; } 110 virtual bool IsDtlsActive() const { return dtls_state_ != STATE_NONE; }
109 111
110 // Called to send a packet (via DTLS, if turned on). 112 // Called to send a packet (via DTLS, if turned on).
111 virtual int SendPacket(const char* data, size_t size, 113 virtual int SendPacket(const char* data, size_t size,
112 const rtc::PacketOptions& options, 114 const rtc::PacketOptions& options,
113 int flags); 115 int flags);
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after
229 void OnRouteChange(TransportChannel* channel, const Candidate& candidate); 231 void OnRouteChange(TransportChannel* channel, const Candidate& candidate);
230 void OnConnectionRemoved(TransportChannelImpl* channel); 232 void OnConnectionRemoved(TransportChannelImpl* channel);
231 233
232 Transport* transport_; // The transport_ that created us. 234 Transport* transport_; // The transport_ that created us.
233 rtc::Thread* worker_thread_; // Everything should occur on this thread. 235 rtc::Thread* worker_thread_; // Everything should occur on this thread.
234 TransportChannelImpl* channel_; // Underlying channel, owned by transport_. 236 TransportChannelImpl* channel_; // Underlying channel, owned by transport_.
235 rtc::scoped_ptr<rtc::SSLStreamAdapter> dtls_; // The DTLS stream 237 rtc::scoped_ptr<rtc::SSLStreamAdapter> dtls_; // The DTLS stream
236 StreamInterfaceChannel* downward_; // Wrapper for channel_, owned by dtls_. 238 StreamInterfaceChannel* downward_; // Wrapper for channel_, owned by dtls_.
237 std::vector<std::string> srtp_ciphers_; // SRTP ciphers to use with DTLS. 239 std::vector<std::string> srtp_ciphers_; // SRTP ciphers to use with DTLS.
238 State dtls_state_; 240 State dtls_state_;
239 rtc::SSLIdentity* local_identity_; 241 rtc::scoped_refptr<webrtc::DtlsCertificate> local_certificate_;
240 rtc::SSLRole ssl_role_; 242 rtc::SSLRole ssl_role_;
241 rtc::SSLProtocolVersion ssl_max_version_; 243 rtc::SSLProtocolVersion ssl_max_version_;
242 rtc::Buffer remote_fingerprint_value_; 244 rtc::Buffer remote_fingerprint_value_;
243 std::string remote_fingerprint_algorithm_; 245 std::string remote_fingerprint_algorithm_;
244 246
245 DISALLOW_COPY_AND_ASSIGN(DtlsTransportChannelWrapper); 247 DISALLOW_COPY_AND_ASSIGN(DtlsTransportChannelWrapper);
246 }; 248 };
247 249
248 } // namespace cricket 250 } // namespace cricket
249 251
250 #endif // WEBRTC_P2P_BASE_DTLSTRANSPORTCHANNEL_H_ 252 #endif // WEBRTC_P2P_BASE_DTLSTRANSPORTCHANNEL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698