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

Unified Diff: remoting/protocol/ssl_hmac_channel_authenticator.cc

Issue 234023003: Build remoting for PNaCl (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: update net.gypi Created 6 years, 7 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
« no previous file with comments | « remoting/protocol/libjingle_transport_factory.cc ('k') | remoting/remoting_client.gypi » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/protocol/ssl_hmac_channel_authenticator.cc
diff --git a/remoting/protocol/ssl_hmac_channel_authenticator.cc b/remoting/protocol/ssl_hmac_channel_authenticator.cc
index 7e45acd281152d4bc443be5a7d149ebf65f01fe3..d85ad5f17ed99db39f6e5c9755e35fdf114bacd2 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,
« no previous file with comments | « remoting/protocol/libjingle_transport_factory.cc ('k') | remoting/remoting_client.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698