| OLD | NEW |
| 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 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 97 channel_->SetIceRole(role); | 97 channel_->SetIceRole(role); |
| 98 } | 98 } |
| 99 IceRole GetIceRole() const override { | 99 IceRole GetIceRole() const override { |
| 100 return channel_->GetIceRole(); | 100 return channel_->GetIceRole(); |
| 101 } | 101 } |
| 102 bool SetLocalCertificate( | 102 bool SetLocalCertificate( |
| 103 const rtc::scoped_refptr<rtc::RTCCertificate>& certificate) override; | 103 const rtc::scoped_refptr<rtc::RTCCertificate>& certificate) override; |
| 104 rtc::scoped_refptr<rtc::RTCCertificate> GetLocalCertificate() const override; | 104 rtc::scoped_refptr<rtc::RTCCertificate> GetLocalCertificate() const override; |
| 105 | 105 |
| 106 bool SetRemoteFingerprint(const std::string& digest_alg, | 106 bool SetRemoteFingerprint(const std::string& digest_alg, |
| 107 const uint8* digest, | 107 const uint8_t* digest, |
| 108 size_t digest_len) override; | 108 size_t digest_len) override; |
| 109 bool IsDtlsActive() const override { return dtls_state_ != STATE_NONE; } | 109 bool IsDtlsActive() const override { return dtls_state_ != STATE_NONE; } |
| 110 | 110 |
| 111 // Called to send a packet (via DTLS, if turned on). | 111 // Called to send a packet (via DTLS, if turned on). |
| 112 int SendPacket(const char* data, size_t size, | 112 int SendPacket(const char* data, size_t size, |
| 113 const rtc::PacketOptions& options, | 113 const rtc::PacketOptions& options, |
| 114 int flags) override; | 114 int flags) override; |
| 115 | 115 |
| 116 // TransportChannel calls that we forward to the wrapped transport. | 116 // TransportChannel calls that we forward to the wrapped transport. |
| 117 int SetOption(rtc::Socket::Option opt, int value) override { | 117 int SetOption(rtc::Socket::Option opt, int value) override { |
| (...skipping 30 matching lines...) Expand all Loading... |
| 148 | 148 |
| 149 // Once DTLS has been established, this method retrieves the certificate in | 149 // Once DTLS has been established, this method retrieves the certificate in |
| 150 // use by the remote peer, for use in external identity verification. | 150 // use by the remote peer, for use in external identity verification. |
| 151 bool GetRemoteSSLCertificate(rtc::SSLCertificate** cert) const override; | 151 bool GetRemoteSSLCertificate(rtc::SSLCertificate** cert) const override; |
| 152 | 152 |
| 153 // Once DTLS has established (i.e., this channel is writable), this method | 153 // Once DTLS has established (i.e., this channel is writable), this method |
| 154 // extracts the keys negotiated during the DTLS handshake, for use in external | 154 // extracts the keys negotiated during the DTLS handshake, for use in external |
| 155 // encryption. DTLS-SRTP uses this to extract the needed SRTP keys. | 155 // encryption. DTLS-SRTP uses this to extract the needed SRTP keys. |
| 156 // See the SSLStreamAdapter documentation for info on the specific parameters. | 156 // See the SSLStreamAdapter documentation for info on the specific parameters. |
| 157 bool ExportKeyingMaterial(const std::string& label, | 157 bool ExportKeyingMaterial(const std::string& label, |
| 158 const uint8* context, | 158 const uint8_t* context, |
| 159 size_t context_len, | 159 size_t context_len, |
| 160 bool use_context, | 160 bool use_context, |
| 161 uint8* result, | 161 uint8_t* result, |
| 162 size_t result_len) override { | 162 size_t result_len) override { |
| 163 return (dtls_.get()) ? dtls_->ExportKeyingMaterial(label, context, | 163 return (dtls_.get()) ? dtls_->ExportKeyingMaterial(label, context, |
| 164 context_len, | 164 context_len, |
| 165 use_context, | 165 use_context, |
| 166 result, result_len) | 166 result, result_len) |
| 167 : false; | 167 : false; |
| 168 } | 168 } |
| 169 | 169 |
| 170 // TransportChannelImpl calls. | 170 // TransportChannelImpl calls. |
| 171 Transport* GetTransport() override { | 171 Transport* GetTransport() override { |
| 172 return transport_; | 172 return transport_; |
| 173 } | 173 } |
| 174 | 174 |
| 175 TransportChannelState GetState() const override { | 175 TransportChannelState GetState() const override { |
| 176 return channel_->GetState(); | 176 return channel_->GetState(); |
| 177 } | 177 } |
| 178 void SetIceTiebreaker(uint64 tiebreaker) override { | 178 void SetIceTiebreaker(uint64_t tiebreaker) override { |
| 179 channel_->SetIceTiebreaker(tiebreaker); | 179 channel_->SetIceTiebreaker(tiebreaker); |
| 180 } | 180 } |
| 181 void SetIceCredentials(const std::string& ice_ufrag, | 181 void SetIceCredentials(const std::string& ice_ufrag, |
| 182 const std::string& ice_pwd) override { | 182 const std::string& ice_pwd) override { |
| 183 channel_->SetIceCredentials(ice_ufrag, ice_pwd); | 183 channel_->SetIceCredentials(ice_ufrag, ice_pwd); |
| 184 } | 184 } |
| 185 void SetRemoteIceCredentials(const std::string& ice_ufrag, | 185 void SetRemoteIceCredentials(const std::string& ice_ufrag, |
| 186 const std::string& ice_pwd) override { | 186 const std::string& ice_pwd) override { |
| 187 channel_->SetRemoteIceCredentials(ice_ufrag, ice_pwd); | 187 channel_->SetRemoteIceCredentials(ice_ufrag, ice_pwd); |
| 188 } | 188 } |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 236 rtc::SSLProtocolVersion ssl_max_version_; | 236 rtc::SSLProtocolVersion ssl_max_version_; |
| 237 rtc::Buffer remote_fingerprint_value_; | 237 rtc::Buffer remote_fingerprint_value_; |
| 238 std::string remote_fingerprint_algorithm_; | 238 std::string remote_fingerprint_algorithm_; |
| 239 | 239 |
| 240 RTC_DISALLOW_COPY_AND_ASSIGN(DtlsTransportChannelWrapper); | 240 RTC_DISALLOW_COPY_AND_ASSIGN(DtlsTransportChannelWrapper); |
| 241 }; | 241 }; |
| 242 | 242 |
| 243 } // namespace cricket | 243 } // namespace cricket |
| 244 | 244 |
| 245 #endif // WEBRTC_P2P_BASE_DTLSTRANSPORTCHANNEL_H_ | 245 #endif // WEBRTC_P2P_BASE_DTLSTRANSPORTCHANNEL_H_ |
| OLD | NEW |