diff options
Diffstat (limited to 'remoting/protocol')
-rw-r--r-- | remoting/protocol/jingle_session_unittest.cc | 2 | ||||
-rw-r--r-- | remoting/protocol/libjingle_transport_factory.cc | 2 | ||||
-rw-r--r-- | remoting/protocol/ssl_hmac_channel_authenticator.cc | 22 |
3 files changed, 21 insertions, 5 deletions
diff --git a/remoting/protocol/jingle_session_unittest.cc b/remoting/protocol/jingle_session_unittest.cc index 2f95100..037cbcb 100644 --- a/remoting/protocol/jingle_session_unittest.cc +++ b/remoting/protocol/jingle_session_unittest.cc @@ -9,6 +9,7 @@ #include "base/run_loop.h" #include "base/test/test_timeouts.h" #include "base/time/time.h" +#include "jingle/glue/thread_wrapper.h" #include "net/socket/socket.h" #include "net/socket/stream_socket.h" #include "net/url_request/url_request_context_getter.h" @@ -94,6 +95,7 @@ class JingleSessionTest : public testing::Test { public: JingleSessionTest() { message_loop_.reset(new base::MessageLoopForIO()); + jingle_glue::JingleThreadWrapper::EnsureForCurrentMessageLoop(); } // Helper method that handles OnIncomingSession(). diff --git a/remoting/protocol/libjingle_transport_factory.cc b/remoting/protocol/libjingle_transport_factory.cc index b37cbb4..afea1d5 100644 --- a/remoting/protocol/libjingle_transport_factory.cc +++ b/remoting/protocol/libjingle_transport_factory.cc @@ -10,7 +10,6 @@ #include "base/timer/timer.h" #include "jingle/glue/channel_socket_adapter.h" #include "jingle/glue/pseudotcp_adapter.h" -#include "jingle/glue/thread_wrapper.h" #include "jingle/glue/utils.h" #include "net/base/net_errors.h" #include "remoting/base/constants.h" @@ -411,7 +410,6 @@ LibjingleTransportFactory::LibjingleTransportFactory( : signal_strategy_(signal_strategy), port_allocator_(port_allocator.Pass()), network_settings_(network_settings) { - jingle_glue::JingleThreadWrapper::EnsureForCurrentMessageLoop(); } LibjingleTransportFactory::~LibjingleTransportFactory() { diff --git a/remoting/protocol/ssl_hmac_channel_authenticator.cc b/remoting/protocol/ssl_hmac_channel_authenticator.cc index 7e45acd..d85ad5f 100644 --- a/remoting/protocol/ssl_hmac_channel_authenticator.cc +++ b/remoting/protocol/ssl_hmac_channel_authenticator.cc @@ -15,6 +15,7 @@ #include "net/socket/client_socket_factory.h" #include "net/socket/client_socket_handle.h" #include "net/socket/ssl_client_socket.h" +#include "net/socket/ssl_client_socket_openssl.h" #include "net/socket/ssl_server_socket.h" #include "net/ssl/ssl_config_service.h" #include "remoting/base/rsa_key_pair.h" @@ -63,6 +64,12 @@ void SslHmacChannelAuthenticator::SecureAndAuthenticate( int result; if (is_ssl_server()) { +#if defined(OS_NACL) + // Client plugin doesn't use server SSL sockets, and so SSLServerSocket + // implementation is not compiled for NaCl as part of net_nacl. + NOTREACHED(); + result = net::ERR_FAILED; +#else scoped_refptr<net::X509Certificate> cert = net::X509Certificate::CreateFromBytes( local_cert_.data(), local_cert_.length()); @@ -85,6 +92,7 @@ void SslHmacChannelAuthenticator::SecureAndAuthenticate( result = raw_server_socket->Handshake( base::Bind(&SslHmacChannelAuthenticator::OnConnected, base::Unretained(this))); +#endif } else { transport_security_state_.reset(new net::TransportSecurityState); @@ -104,11 +112,19 @@ void SslHmacChannelAuthenticator::SecureAndAuthenticate( net::HostPortPair host_and_port(kSslFakeHostName, 0); net::SSLClientSocketContext context; context.transport_security_state = transport_security_state_.get(); - scoped_ptr<net::ClientSocketHandle> connection(new net::ClientSocketHandle); - connection->SetSocket(socket.Pass()); + scoped_ptr<net::ClientSocketHandle> socket_handle( + new net::ClientSocketHandle); + socket_handle->SetSocket(socket.Pass()); + +#if defined(OS_NACL) + // net_nacl doesn't include ClientSocketFactory. + socket_.reset(new net::SSLClientSocketOpenSSL( + socket_handle.Pass(), host_and_port, ssl_config, context)); +#else socket_ = net::ClientSocketFactory::GetDefaultFactory()->CreateSSLClientSocket( - connection.Pass(), host_and_port, ssl_config, context); + socket_handle.Pass(), host_and_port, ssl_config, context); +#endif result = socket_->Connect( base::Bind(&SslHmacChannelAuthenticator::OnConnected, |