Index: remoting/protocol/jingle_session.cc |
diff --git a/remoting/protocol/jingle_session.cc b/remoting/protocol/jingle_session.cc |
index e0b94508ee8255c35c554e1fc20cf8e01cbc13f5..3f55c9d589f9d2efd645520e23f59688fc8a003f 100644 |
--- a/remoting/protocol/jingle_session.cc |
+++ b/remoting/protocol/jingle_session.cc |
@@ -14,6 +14,8 @@ |
#include "net/base/net_errors.h" |
#include "net/socket/stream_socket.h" |
#include "remoting/base/constants.h" |
+#include "remoting/protocol/simple_client_channel_authenticator.h" |
+#include "remoting/protocol/simple_host_channel_authenticator.h" |
#include "remoting/protocol/jingle_datagram_connector.h" |
#include "remoting/protocol/jingle_session_manager.h" |
#include "remoting/protocol/jingle_stream_connector.h" |
@@ -427,8 +429,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 SimpleClientChannelAuthenticator( |
+ remote_cert_, shared_secret_); |
+ } else { |
+ authenticator = new SimpleHostChannelAuthenticator( |
+ local_cert_, local_private_key_.get(), shared_secret_); |
+ } |
Wez
2011/11/22 22:29:48
Is the intent for this code to be replaced with ca
Sergey Ulanov
2011/11/23 01:23:42
Yes, and I have it cooking: http://codereview.chro
|
+ 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. |