| Index: webrtc/p2p/base/dtlstransport.h
|
| diff --git a/webrtc/p2p/base/dtlstransport.h b/webrtc/p2p/base/dtlstransport.h
|
| index 27cece49d04ea9cfe328ad0084eca36a7b967f93..a07f2216691a7b42d1cddf2708dda63c672970b7 100644
|
| --- a/webrtc/p2p/base/dtlstransport.h
|
| +++ b/webrtc/p2p/base/dtlstransport.h
|
| @@ -30,9 +30,9 @@ class DtlsTransport : public Base {
|
| rtc::Thread* worker_thread,
|
| const std::string& content_name,
|
| PortAllocator* allocator,
|
| - rtc::SSLIdentity* identity)
|
| + rtc::scoped_refptr<webrtc::DtlsCertificate> certificate)
|
| : Base(signaling_thread, worker_thread, content_name, allocator),
|
| - identity_(identity),
|
| + certificate_(certificate),
|
| secure_role_(rtc::SSL_CLIENT),
|
| ssl_max_version_(rtc::SSL_PROTOCOL_DTLS_10) {
|
| }
|
| @@ -40,14 +40,16 @@ class DtlsTransport : public Base {
|
| ~DtlsTransport() {
|
| Base::DestroyAllChannels();
|
| }
|
| - virtual void SetIdentity_w(rtc::SSLIdentity* identity) {
|
| - identity_ = identity;
|
| + void SetCertificate_w(
|
| + rtc::scoped_refptr<webrtc::DtlsCertificate> certificate) override {
|
| + certificate_ = certificate;
|
| }
|
| - virtual bool GetIdentity_w(rtc::SSLIdentity** identity) {
|
| - if (!identity_)
|
| + bool GetCertificate_w(
|
| + rtc::scoped_refptr<webrtc::DtlsCertificate>* certificate) override {
|
| + if (!certificate_.get())
|
| return false;
|
|
|
| - *identity = identity_->GetReference();
|
| + *certificate = certificate_;
|
| return true;
|
| }
|
|
|
| @@ -63,10 +65,10 @@ class DtlsTransport : public Base {
|
|
|
| if (local_fp) {
|
| // Sanity check local fingerprint.
|
| - if (identity_) {
|
| + if (certificate_.get()) {
|
| rtc::scoped_ptr<rtc::SSLFingerprint> local_fp_tmp(
|
| rtc::SSLFingerprint::Create(local_fp->algorithm,
|
| - identity_));
|
| + certificate_->identity()));
|
| ASSERT(local_fp_tmp.get() != NULL);
|
| if (!(*local_fp_tmp == *local_fp)) {
|
| std::ostringstream desc;
|
| @@ -81,10 +83,10 @@ class DtlsTransport : public Base {
|
| error_desc);
|
| }
|
| } else {
|
| - identity_ = NULL;
|
| + certificate_ = nullptr;
|
| }
|
|
|
| - if (!channel->SetLocalIdentity(identity_)) {
|
| + if (!channel->SetLocalCertificate(certificate_)) {
|
| return BadTransportDescription("Failed to set local identity.",
|
| error_desc);
|
| }
|
| @@ -237,7 +239,7 @@ class DtlsTransport : public Base {
|
| return Base::ApplyNegotiatedTransportDescription_w(channel, error_desc);
|
| }
|
|
|
| - rtc::SSLIdentity* identity_;
|
| + rtc::scoped_refptr<webrtc::DtlsCertificate> certificate_;
|
| rtc::SSLRole secure_role_;
|
| rtc::SSLProtocolVersion ssl_max_version_;
|
| rtc::scoped_ptr<rtc::SSLFingerprint> remote_fingerprint_;
|
|
|