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

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

Issue 1269843005: Added DtlsCertificate, a ref counted object owning an SSLIdentity (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Merge with master Created 5 years, 4 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
Index: webrtc/p2p/base/dtlstransportchannel.cc
diff --git a/webrtc/p2p/base/dtlstransportchannel.cc b/webrtc/p2p/base/dtlstransportchannel.cc
index f56001ba4d3a51943e414bad8fa97f9f86916f80..c5b0fe6bdb4b576ee40b46fa23a73d6996849f39 100644
--- a/webrtc/p2p/base/dtlstransportchannel.cc
+++ b/webrtc/p2p/base/dtlstransportchannel.cc
@@ -95,7 +95,7 @@ DtlsTransportChannelWrapper::DtlsTransportChannelWrapper(
channel_(channel),
downward_(NULL),
dtls_state_(STATE_NONE),
- local_identity_(NULL),
+ local_certificate_(nullptr),
ssl_role_(rtc::SSL_CLIENT),
ssl_max_version_(rtc::SSL_PROTOCOL_DTLS_10) {
channel_->SignalReadableState.connect(this,
@@ -133,10 +133,10 @@ void DtlsTransportChannelWrapper::Connect() {
channel_->Connect();
}
-bool DtlsTransportChannelWrapper::SetLocalIdentity(
- rtc::SSLIdentity* identity) {
+bool DtlsTransportChannelWrapper::SetLocalCertificate(
+ const rtc::scoped_refptr<webrtc::DtlsCertificate>& 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 +146,8 @@ bool DtlsTransportChannelWrapper::SetLocalIdentity(
}
}
- if (identity) {
- local_identity_ = identity;
+ if (certificate.get()) {
+ local_certificate_ = certificate;
dtls_state_ = STATE_OFFERED;
} else {
LOG_J(LS_INFO, this) << "NULL DTLS identity supplied. Not doing DTLS";
@@ -156,12 +156,12 @@ bool DtlsTransportChannelWrapper::SetLocalIdentity(
return true;
}
-bool DtlsTransportChannelWrapper::GetLocalIdentity(
- rtc::SSLIdentity** identity) const {
- if (!local_identity_)
+bool DtlsTransportChannelWrapper::GetLocalCertificate(
+ rtc::scoped_refptr<webrtc::DtlsCertificate>* certificate) const {
+ if (!local_certificate_)
return false;
- *identity = local_identity_->GetReference();
+ *certificate = local_certificate_;
return true;
}
@@ -265,7 +265,7 @@ bool DtlsTransportChannelWrapper::SetupDtls() {
downward_ = downward;
- dtls_->SetIdentity(local_identity_->GetReference());
+ dtls_->SetCertificate(local_certificate_);
dtls_->SetMode(rtc::SSL_MODE_DTLS);
dtls_->SetMaxProtocolVersion(ssl_max_version_);
dtls_->SetServerRole(ssl_role_);

Powered by Google App Engine
This is Rietveld 408576698