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

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

Issue 1304043008: Replacing SSLIdentity* with scoped_refptr<RTCCertificate> in TransportChannel layer (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Created 5 years, 3 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<rtc::RTCCertificate>& certificate) override;
104 bool GetLocalCertificate(
105 rtc::scoped_refptr<rtc::RTCCertificate>* 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 26 matching lines...) Expand all
140 virtual bool GetSrtpCipher(std::string* cipher); 142 virtual bool GetSrtpCipher(std::string* cipher);
141 143
142 virtual bool GetSslRole(rtc::SSLRole* role) const; 144 virtual bool GetSslRole(rtc::SSLRole* role) const;
143 virtual bool SetSslRole(rtc::SSLRole role); 145 virtual bool SetSslRole(rtc::SSLRole role);
144 146
145 // Find out which DTLS cipher was negotiated 147 // Find out which DTLS cipher was negotiated
146 virtual bool GetSslCipher(std::string* cipher); 148 virtual bool GetSslCipher(std::string* cipher);
147 149
148 // Once DTLS has been established, this method retrieves the certificate in 150 // Once DTLS has been established, this method retrieves the certificate in
149 // use by the remote peer, for use in external identity verification. 151 // use by the remote peer, for use in external identity verification.
150 virtual bool GetRemoteCertificate(rtc::SSLCertificate** cert) const; 152 bool GetRemoteSSLCertificate(rtc::SSLCertificate** cert) const override;
151 153
152 // Once DTLS has established (i.e., this channel is writable), this method 154 // Once DTLS has established (i.e., this channel is writable), this method
153 // extracts the keys negotiated during the DTLS handshake, for use in external 155 // extracts the keys negotiated during the DTLS handshake, for use in external
154 // encryption. DTLS-SRTP uses this to extract the needed SRTP keys. 156 // encryption. DTLS-SRTP uses this to extract the needed SRTP keys.
155 // See the SSLStreamAdapter documentation for info on the specific parameters. 157 // See the SSLStreamAdapter documentation for info on the specific parameters.
156 virtual bool ExportKeyingMaterial(const std::string& label, 158 virtual bool ExportKeyingMaterial(const std::string& label,
157 const uint8* context, 159 const uint8* context,
158 size_t context_len, 160 size_t context_len,
159 bool use_context, 161 bool use_context,
160 uint8* result, 162 uint8* result,
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
223 void OnRouteChange(TransportChannel* channel, const Candidate& candidate); 225 void OnRouteChange(TransportChannel* channel, const Candidate& candidate);
224 void OnConnectionRemoved(TransportChannelImpl* channel); 226 void OnConnectionRemoved(TransportChannelImpl* channel);
225 227
226 Transport* transport_; // The transport_ that created us. 228 Transport* transport_; // The transport_ that created us.
227 rtc::Thread* worker_thread_; // Everything should occur on this thread. 229 rtc::Thread* worker_thread_; // Everything should occur on this thread.
228 TransportChannelImpl* channel_; // Underlying channel, owned by transport_. 230 TransportChannelImpl* channel_; // Underlying channel, owned by transport_.
229 rtc::scoped_ptr<rtc::SSLStreamAdapter> dtls_; // The DTLS stream 231 rtc::scoped_ptr<rtc::SSLStreamAdapter> dtls_; // The DTLS stream
230 StreamInterfaceChannel* downward_; // Wrapper for channel_, owned by dtls_. 232 StreamInterfaceChannel* downward_; // Wrapper for channel_, owned by dtls_.
231 std::vector<std::string> srtp_ciphers_; // SRTP ciphers to use with DTLS. 233 std::vector<std::string> srtp_ciphers_; // SRTP ciphers to use with DTLS.
232 State dtls_state_; 234 State dtls_state_;
233 rtc::SSLIdentity* local_identity_; 235 rtc::scoped_refptr<rtc::RTCCertificate> local_certificate_;
234 rtc::SSLRole ssl_role_; 236 rtc::SSLRole ssl_role_;
235 rtc::SSLProtocolVersion ssl_max_version_; 237 rtc::SSLProtocolVersion ssl_max_version_;
236 rtc::Buffer remote_fingerprint_value_; 238 rtc::Buffer remote_fingerprint_value_;
237 std::string remote_fingerprint_algorithm_; 239 std::string remote_fingerprint_algorithm_;
238 240
239 DISALLOW_COPY_AND_ASSIGN(DtlsTransportChannelWrapper); 241 DISALLOW_COPY_AND_ASSIGN(DtlsTransportChannelWrapper);
240 }; 242 };
241 243
242 } // namespace cricket 244 } // namespace cricket
243 245
244 #endif // WEBRTC_P2P_BASE_DTLSTRANSPORTCHANNEL_H_ 246 #endif // WEBRTC_P2P_BASE_DTLSTRANSPORTCHANNEL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698