| 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 |
| 11 #ifndef WEBRTC_P2P_BASE_DTLSTRANSPORT_H_ | 11 #ifndef WEBRTC_P2P_BASE_DTLSTRANSPORT_H_ |
| 12 #define WEBRTC_P2P_BASE_DTLSTRANSPORT_H_ | 12 #define WEBRTC_P2P_BASE_DTLSTRANSPORT_H_ |
| 13 | 13 |
| 14 #include <memory> |
| 15 |
| 14 #include "webrtc/p2p/base/dtlstransportchannel.h" | 16 #include "webrtc/p2p/base/dtlstransportchannel.h" |
| 15 #include "webrtc/p2p/base/transport.h" | 17 #include "webrtc/p2p/base/transport.h" |
| 16 | 18 |
| 17 namespace rtc { | 19 namespace rtc { |
| 18 class SSLIdentity; | 20 class SSLIdentity; |
| 19 } | 21 } |
| 20 | 22 |
| 21 namespace cricket { | 23 namespace cricket { |
| 22 | 24 |
| 23 class PortAllocator; | 25 class PortAllocator; |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 60 } | 62 } |
| 61 | 63 |
| 62 bool ApplyLocalTransportDescription(TransportChannelImpl* channel, | 64 bool ApplyLocalTransportDescription(TransportChannelImpl* channel, |
| 63 std::string* error_desc) override { | 65 std::string* error_desc) override { |
| 64 rtc::SSLFingerprint* local_fp = | 66 rtc::SSLFingerprint* local_fp = |
| 65 Base::local_description()->identity_fingerprint.get(); | 67 Base::local_description()->identity_fingerprint.get(); |
| 66 | 68 |
| 67 if (local_fp) { | 69 if (local_fp) { |
| 68 // Sanity check local fingerprint. | 70 // Sanity check local fingerprint. |
| 69 if (certificate_) { | 71 if (certificate_) { |
| 70 rtc::scoped_ptr<rtc::SSLFingerprint> local_fp_tmp( | 72 std::unique_ptr<rtc::SSLFingerprint> local_fp_tmp( |
| 71 rtc::SSLFingerprint::Create(local_fp->algorithm, | 73 rtc::SSLFingerprint::Create(local_fp->algorithm, |
| 72 certificate_->identity())); | 74 certificate_->identity())); |
| 73 ASSERT(local_fp_tmp.get() != NULL); | 75 ASSERT(local_fp_tmp.get() != NULL); |
| 74 if (!(*local_fp_tmp == *local_fp)) { | 76 if (!(*local_fp_tmp == *local_fp)) { |
| 75 std::ostringstream desc; | 77 std::ostringstream desc; |
| 76 desc << "Local fingerprint does not match identity. Expected: "; | 78 desc << "Local fingerprint does not match identity. Expected: "; |
| 77 desc << local_fp_tmp->ToString(); | 79 desc << local_fp_tmp->ToString(); |
| 78 desc << " Got: " << local_fp->ToString(); | 80 desc << " Got: " << local_fp->ToString(); |
| 79 return BadTransportDescription(desc.str(), error_desc); | 81 return BadTransportDescription(desc.str(), error_desc); |
| 80 } | 82 } |
| (...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 235 remote_fingerprint_->digest.size())) { | 237 remote_fingerprint_->digest.size())) { |
| 236 return BadTransportDescription("Failed to apply remote fingerprint.", | 238 return BadTransportDescription("Failed to apply remote fingerprint.", |
| 237 error_desc); | 239 error_desc); |
| 238 } | 240 } |
| 239 return Base::ApplyNegotiatedTransportDescription(channel, error_desc); | 241 return Base::ApplyNegotiatedTransportDescription(channel, error_desc); |
| 240 } | 242 } |
| 241 | 243 |
| 242 rtc::scoped_refptr<rtc::RTCCertificate> certificate_; | 244 rtc::scoped_refptr<rtc::RTCCertificate> certificate_; |
| 243 rtc::SSLRole secure_role_; | 245 rtc::SSLRole secure_role_; |
| 244 rtc::SSLProtocolVersion ssl_max_version_; | 246 rtc::SSLProtocolVersion ssl_max_version_; |
| 245 rtc::scoped_ptr<rtc::SSLFingerprint> remote_fingerprint_; | 247 std::unique_ptr<rtc::SSLFingerprint> remote_fingerprint_; |
| 246 }; | 248 }; |
| 247 | 249 |
| 248 } // namespace cricket | 250 } // namespace cricket |
| 249 | 251 |
| 250 #endif // WEBRTC_P2P_BASE_DTLSTRANSPORT_H_ | 252 #endif // WEBRTC_P2P_BASE_DTLSTRANSPORT_H_ |
| OLD | NEW |