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

Unified Diff: remoting/protocol/jingle_session.cc

Issue 8604001: Move SSL layer initialization into ChannelAuthenticator implementations. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Simple->V1 Created 9 years, 1 month 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 | « remoting/protocol/jingle_datagram_connector.cc ('k') | remoting/protocol/jingle_stream_connector.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/protocol/jingle_session.cc
diff --git a/remoting/protocol/jingle_session.cc b/remoting/protocol/jingle_session.cc
index 8e22f543b34af37b4a1d37188dcec3ccafbf7cf6..21f8426baa91523e519578a9548b4be39db020d7 100644
--- a/remoting/protocol/jingle_session.cc
+++ b/remoting/protocol/jingle_session.cc
@@ -17,6 +17,8 @@
#include "remoting/protocol/jingle_datagram_connector.h"
#include "remoting/protocol/jingle_session_manager.h"
#include "remoting/protocol/jingle_stream_connector.h"
+#include "remoting/protocol/v1_client_channel_authenticator.h"
+#include "remoting/protocol/v1_host_channel_authenticator.h"
#include "third_party/libjingle/source/talk/base/thread.h"
#include "third_party/libjingle/source/talk/p2p/base/p2ptransportchannel.h"
#include "third_party/libjingle/source/talk/p2p/base/session.h"
@@ -413,8 +415,15 @@ void JingleSession::AddChannelConnector(
}
channel_connectors_[name] = connector;
- connector->Connect(cricket_session_->initiator(), local_cert_,
- remote_cert_, local_private_key_.get(), raw_channel);
+ ChannelAuthenticator* authenticator;
+ if (cricket_session_->initiator()) {
+ authenticator = new V1ClientChannelAuthenticator(
+ remote_cert_, shared_secret_);
+ } else {
+ authenticator = new V1HostChannelAuthenticator(
+ local_cert_, local_private_key_.get(), shared_secret_);
+ }
+ connector->Connect(authenticator, raw_channel);
// Workaround bug in libjingle - it doesn't connect channels if they
// are created after the session is accepted. See crbug.com/89384.
« no previous file with comments | « remoting/protocol/jingle_datagram_connector.cc ('k') | remoting/protocol/jingle_stream_connector.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698