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

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

Issue 1311903004: Replacing SSLIdentity* with scoped_refptr<RTCCertificate> in TransportDescriptionFactory layer (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: 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 7654fdfcf504a1abd5f4e97ed8db4c75eee8548f..4c701df0dde5c5b4457dafbcb1958d91bbb2a067 100644
--- a/webrtc/p2p/base/transportdescriptionfactory.cc
+++ b/webrtc/p2p/base/transportdescriptionfactory.cc
@@ -20,8 +20,7 @@
namespace cricket {
TransportDescriptionFactory::TransportDescriptionFactory()
- : secure_(SEC_DISABLED),
- identity_(NULL) {
+ : secure_(SEC_DISABLED) {
}
TransportDescription* TransportDescriptionFactory::CreateOffer(
@@ -97,8 +96,8 @@ TransportDescription* TransportDescriptionFactory::CreateAnswer(
bool TransportDescriptionFactory::SetSecurityInfo(
TransportDescription* desc, ConnectionRole role) const {
- if (!identity_) {
- LOG(LS_ERROR) << "Cannot create identity digest with no identity";
+ if (!certificate_) {
+ LOG(LS_ERROR) << "Cannot create identity digest with no certificate";
return false;
}
@@ -106,13 +105,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_->ssl_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;
« no previous file with comments | « webrtc/p2p/base/transportdescriptionfactory.h ('k') | webrtc/p2p/base/transportdescriptionfactory_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698