OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2017 The WebRTC Project Authors. All rights reserved. | 2 * Copyright 2017 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 104 matching lines...) Loading... |
115 return true; | 115 return true; |
116 } | 116 } |
117 bool SetSslRole(rtc::SSLRole role) override { | 117 bool SetSslRole(rtc::SSLRole role) override { |
118 ssl_role_ = role; | 118 ssl_role_ = role; |
119 return true; | 119 return true; |
120 } | 120 } |
121 bool GetSslRole(rtc::SSLRole* role) const override { | 121 bool GetSslRole(rtc::SSLRole* role) const override { |
122 *role = ssl_role_; | 122 *role = ssl_role_; |
123 return true; | 123 return true; |
124 } | 124 } |
| 125 const rtc::CryptoOptions& crypto_options() const override { |
| 126 return crypto_options_; |
| 127 } |
| 128 void SetCryptoOptions(const rtc::CryptoOptions& crypto_options) { |
| 129 crypto_options_ = crypto_options; |
| 130 } |
125 bool SetLocalCertificate( | 131 bool SetLocalCertificate( |
126 const rtc::scoped_refptr<rtc::RTCCertificate>& certificate) override { | 132 const rtc::scoped_refptr<rtc::RTCCertificate>& certificate) override { |
127 local_cert_ = certificate; | 133 local_cert_ = certificate; |
128 return true; | 134 return true; |
129 } | 135 } |
130 void SetRemoteSSLCertificate(rtc::FakeSSLCertificate* cert) { | 136 void SetRemoteSSLCertificate(rtc::FakeSSLCertificate* cert) { |
131 remote_cert_ = cert; | 137 remote_cert_ = cert; |
132 } | 138 } |
133 bool IsDtlsActive() const override { return do_dtls_; } | 139 bool IsDtlsActive() const override { return do_dtls_; } |
134 bool GetSrtpCryptoSuite(int* crypto_suite) override { | 140 bool GetSrtpCryptoSuite(int* crypto_suite) override { |
135 if (!do_dtls_) { | 141 if (!do_dtls_) { |
136 return false; | 142 return false; |
137 } | 143 } |
138 *crypto_suite = rtc::SRTP_AES128_CM_SHA1_80; | 144 *crypto_suite = crypto_suite_; |
139 return true; | 145 return true; |
140 } | 146 } |
| 147 void SetSrtpCryptoSuite(int crypto_suite) { |
| 148 crypto_suite_ = crypto_suite; |
| 149 } |
141 bool GetSslCipherSuite(int* cipher_suite) override { return false; } | 150 bool GetSslCipherSuite(int* cipher_suite) override { return false; } |
142 rtc::scoped_refptr<rtc::RTCCertificate> GetLocalCertificate() const override { | 151 rtc::scoped_refptr<rtc::RTCCertificate> GetLocalCertificate() const override { |
143 return local_cert_; | 152 return local_cert_; |
144 } | 153 } |
145 std::unique_ptr<rtc::SSLCertificate> GetRemoteSSLCertificate() | 154 std::unique_ptr<rtc::SSLCertificate> GetRemoteSSLCertificate() |
146 const override { | 155 const override { |
147 return remote_cert_ ? std::unique_ptr<rtc::SSLCertificate>( | 156 return remote_cert_ ? std::unique_ptr<rtc::SSLCertificate>( |
148 remote_cert_->GetReference()) | 157 remote_cert_->GetReference()) |
149 : nullptr; | 158 : nullptr; |
150 } | 159 } |
(...skipping 72 matching lines...) Loading... |
223 std::unique_ptr<FakeIceTransport> owned_ice_transport_; | 232 std::unique_ptr<FakeIceTransport> owned_ice_transport_; |
224 std::string transport_name_; | 233 std::string transport_name_; |
225 int component_; | 234 int component_; |
226 FakeDtlsTransport* dest_ = nullptr; | 235 FakeDtlsTransport* dest_ = nullptr; |
227 rtc::scoped_refptr<rtc::RTCCertificate> local_cert_; | 236 rtc::scoped_refptr<rtc::RTCCertificate> local_cert_; |
228 rtc::FakeSSLCertificate* remote_cert_ = nullptr; | 237 rtc::FakeSSLCertificate* remote_cert_ = nullptr; |
229 bool do_dtls_ = false; | 238 bool do_dtls_ = false; |
230 rtc::SSLProtocolVersion ssl_max_version_ = rtc::SSL_PROTOCOL_DTLS_12; | 239 rtc::SSLProtocolVersion ssl_max_version_ = rtc::SSL_PROTOCOL_DTLS_12; |
231 rtc::SSLFingerprint dtls_fingerprint_; | 240 rtc::SSLFingerprint dtls_fingerprint_; |
232 rtc::SSLRole ssl_role_ = rtc::SSL_CLIENT; | 241 rtc::SSLRole ssl_role_ = rtc::SSL_CLIENT; |
| 242 int crypto_suite_ = rtc::SRTP_AES128_CM_SHA1_80; |
| 243 rtc::CryptoOptions crypto_options_; |
233 | 244 |
234 DtlsTransportState dtls_state_ = DTLS_TRANSPORT_NEW; | 245 DtlsTransportState dtls_state_ = DTLS_TRANSPORT_NEW; |
235 | 246 |
236 bool receiving_ = false; | 247 bool receiving_ = false; |
237 bool writable_ = false; | 248 bool writable_ = false; |
238 }; | 249 }; |
239 | 250 |
240 } // namespace cricket | 251 } // namespace cricket |
241 | 252 |
242 #endif // WEBRTC_P2P_BASE_FAKEDTLSTRANSPORT_H_ | 253 #endif // WEBRTC_P2P_BASE_FAKEDTLSTRANSPORT_H_ |
OLD | NEW |