Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(406)

Unified Diff: webrtc/p2p/base/dtlstransportchannel.cc

Issue 1304043008: Replacing SSLIdentity* with scoped_refptr<RTCCertificate> in TransportChannel layer (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Making overriding "virtual" methods use the override keyword Created 5 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « webrtc/p2p/base/dtlstransportchannel.h ('k') | webrtc/p2p/base/dtlstransportchannel_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/p2p/base/dtlstransportchannel.cc
diff --git a/webrtc/p2p/base/dtlstransportchannel.cc b/webrtc/p2p/base/dtlstransportchannel.cc
index f56001ba4d3a51943e414bad8fa97f9f86916f80..bf1dc35e75cb567305c38aef2ca011d083366032 100644
--- a/webrtc/p2p/base/dtlstransportchannel.cc
+++ b/webrtc/p2p/base/dtlstransportchannel.cc
@@ -95,7 +95,6 @@ DtlsTransportChannelWrapper::DtlsTransportChannelWrapper(
channel_(channel),
downward_(NULL),
dtls_state_(STATE_NONE),
- local_identity_(NULL),
ssl_role_(rtc::SSL_CLIENT),
ssl_max_version_(rtc::SSL_PROTOCOL_DTLS_10) {
channel_->SignalReadableState.connect(this,
@@ -133,10 +132,10 @@ void DtlsTransportChannelWrapper::Connect() {
channel_->Connect();
}
-bool DtlsTransportChannelWrapper::SetLocalIdentity(
- rtc::SSLIdentity* identity) {
+bool DtlsTransportChannelWrapper::SetLocalCertificate(
+ const rtc::scoped_refptr<rtc::RTCCertificate>& certificate) {
if (dtls_state_ != STATE_NONE) {
- if (identity == local_identity_) {
+ if (certificate == local_certificate_) {
// This may happen during renegotiation.
LOG_J(LS_INFO, this) << "Ignoring identical DTLS identity";
return true;
@@ -146,8 +145,8 @@ bool DtlsTransportChannelWrapper::SetLocalIdentity(
}
}
- if (identity) {
- local_identity_ = identity;
+ if (certificate) {
+ local_certificate_ = certificate;
dtls_state_ = STATE_OFFERED;
} else {
LOG_J(LS_INFO, this) << "NULL DTLS identity supplied. Not doing DTLS";
@@ -156,13 +155,9 @@ bool DtlsTransportChannelWrapper::SetLocalIdentity(
return true;
}
-bool DtlsTransportChannelWrapper::GetLocalIdentity(
- rtc::SSLIdentity** identity) const {
- if (!local_identity_)
- return false;
-
- *identity = local_identity_->GetReference();
- return true;
+rtc::scoped_refptr<rtc::RTCCertificate>
+DtlsTransportChannelWrapper::GetLocalCertificate() const {
+ return local_certificate_;
}
bool DtlsTransportChannelWrapper::SetSslMaxProtocolVersion(
@@ -245,7 +240,7 @@ bool DtlsTransportChannelWrapper::SetRemoteFingerprint(
return true;
}
-bool DtlsTransportChannelWrapper::GetRemoteCertificate(
+bool DtlsTransportChannelWrapper::GetRemoteSSLCertificate(
rtc::SSLCertificate** cert) const {
if (!dtls_)
return false;
@@ -265,7 +260,7 @@ bool DtlsTransportChannelWrapper::SetupDtls() {
downward_ = downward;
- dtls_->SetIdentity(local_identity_->GetReference());
+ dtls_->SetIdentity(local_certificate_->identity()->GetReference());
dtls_->SetMode(rtc::SSL_MODE_DTLS);
dtls_->SetMaxProtocolVersion(ssl_max_version_);
dtls_->SetServerRole(ssl_role_);
« no previous file with comments | « webrtc/p2p/base/dtlstransportchannel.h ('k') | webrtc/p2p/base/dtlstransportchannel_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698