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

Unified Diff: webrtc/p2p/base/transportdescriptionfactory.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/transportdescriptionfactory.cc
diff --git a/webrtc/p2p/base/transportdescriptionfactory.cc b/webrtc/p2p/base/transportdescriptionfactory.cc
index 1230ba52c18dee87447875245c289e048a47f21a..2c3f5fdf248cdc7ec82ebf3d73667f1cb44f86d8 100644
--- a/webrtc/p2p/base/transportdescriptionfactory.cc
+++ b/webrtc/p2p/base/transportdescriptionfactory.cc
@@ -24,7 +24,7 @@ static TransportProtocol kDefaultProtocol = ICEPROTO_RFC5245;
TransportDescriptionFactory::TransportDescriptionFactory()
: protocol_(kDefaultProtocol),
secure_(SEC_DISABLED),
- identity_(NULL) {
+ certificate_(nullptr) {
}
TransportDescription* TransportDescriptionFactory::CreateOffer(
@@ -129,7 +129,7 @@ TransportDescription* TransportDescriptionFactory::CreateAnswer(
bool TransportDescriptionFactory::SetSecurityInfo(
TransportDescription* desc, ConnectionRole role) const {
- if (!identity_) {
+ if (!certificate_) {
LOG(LS_ERROR) << "Cannot create identity digest with no identity";
return false;
}
@@ -138,13 +138,14 @@ bool TransportDescriptionFactory::SetSecurityInfo(
// RFC 4572 Section 5 requires that those lines use the same hash function as
// the certificate's signature.
std::string digest_alg;
- if (!identity_->certificate().GetSignatureDigestAlgorithm(&digest_alg)) {
+ if (!certificate_->identity()->certificate().GetSignatureDigestAlgorithm(
+ &digest_alg)) {
LOG(LS_ERROR) << "Failed to retrieve the certificate's digest algorithm";
return false;
}
desc->identity_fingerprint.reset(
- rtc::SSLFingerprint::Create(digest_alg, identity_));
+ rtc::SSLFingerprint::Create(digest_alg, certificate_->identity()));
if (!desc->identity_fingerprint.get()) {
LOG(LS_ERROR) << "Failed to create identity fingerprint, alg="
<< digest_alg;

Powered by Google App Engine
This is Rietveld 408576698