| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2012 The WebRTC Project Authors. All rights reserved. | 2 * Copyright 2012 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 211 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 222 private: | 222 private: |
| 223 bool ApplyNegotiatedTransportDescription(TransportChannelImpl* channel, | 223 bool ApplyNegotiatedTransportDescription(TransportChannelImpl* channel, |
| 224 std::string* error_desc) override { | 224 std::string* error_desc) override { |
| 225 // Set ssl role. Role must be set before fingerprint is applied, which | 225 // Set ssl role. Role must be set before fingerprint is applied, which |
| 226 // initiates DTLS setup. | 226 // initiates DTLS setup. |
| 227 if (!channel->SetSslRole(secure_role_)) { | 227 if (!channel->SetSslRole(secure_role_)) { |
| 228 return BadTransportDescription("Failed to set ssl role for the channel.", | 228 return BadTransportDescription("Failed to set ssl role for the channel.", |
| 229 error_desc); | 229 error_desc); |
| 230 } | 230 } |
| 231 // Apply remote fingerprint. | 231 // Apply remote fingerprint. |
| 232 if (!channel->SetRemoteFingerprint( | 232 if (!channel->SetRemoteFingerprint(remote_fingerprint_->algorithm, |
| 233 remote_fingerprint_->algorithm, | 233 reinterpret_cast<const uint8_t*>( |
| 234 reinterpret_cast<const uint8*>(remote_fingerprint_->digest.data()), | 234 remote_fingerprint_->digest.data()), |
| 235 remote_fingerprint_->digest.size())) { | 235 remote_fingerprint_->digest.size())) { |
| 236 return BadTransportDescription("Failed to apply remote fingerprint.", | 236 return BadTransportDescription("Failed to apply remote fingerprint.", |
| 237 error_desc); | 237 error_desc); |
| 238 } | 238 } |
| 239 return Base::ApplyNegotiatedTransportDescription(channel, error_desc); | 239 return Base::ApplyNegotiatedTransportDescription(channel, error_desc); |
| 240 } | 240 } |
| 241 | 241 |
| 242 rtc::scoped_refptr<rtc::RTCCertificate> certificate_; | 242 rtc::scoped_refptr<rtc::RTCCertificate> certificate_; |
| 243 rtc::SSLRole secure_role_; | 243 rtc::SSLRole secure_role_; |
| 244 rtc::SSLProtocolVersion ssl_max_version_; | 244 rtc::SSLProtocolVersion ssl_max_version_; |
| 245 rtc::scoped_ptr<rtc::SSLFingerprint> remote_fingerprint_; | 245 rtc::scoped_ptr<rtc::SSLFingerprint> remote_fingerprint_; |
| 246 }; | 246 }; |
| 247 | 247 |
| 248 } // namespace cricket | 248 } // namespace cricket |
| 249 | 249 |
| 250 #endif // WEBRTC_P2P_BASE_DTLSTRANSPORT_H_ | 250 #endif // WEBRTC_P2P_BASE_DTLSTRANSPORT_H_ |
| OLD | NEW |