OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "remoting/protocol/ssl_hmac_channel_authenticator.h" | 5 #include "remoting/protocol/ssl_hmac_channel_authenticator.h" |
6 | 6 |
7 #include <stdint.h> | 7 #include <stdint.h> |
8 | 8 |
9 #include <utility> | 9 #include <utility> |
10 | 10 |
(...skipping 16 matching lines...) Expand all Loading... |
27 #include "net/socket/client_socket_handle.h" | 27 #include "net/socket/client_socket_handle.h" |
28 #include "net/socket/ssl_client_socket.h" | 28 #include "net/socket/ssl_client_socket.h" |
29 #include "net/socket/ssl_server_socket.h" | 29 #include "net/socket/ssl_server_socket.h" |
30 #include "net/ssl/ssl_config_service.h" | 30 #include "net/ssl/ssl_config_service.h" |
31 #include "net/ssl/ssl_server_config.h" | 31 #include "net/ssl/ssl_server_config.h" |
32 #include "remoting/base/rsa_key_pair.h" | 32 #include "remoting/base/rsa_key_pair.h" |
33 #include "remoting/protocol/auth_util.h" | 33 #include "remoting/protocol/auth_util.h" |
34 #include "remoting/protocol/p2p_stream_socket.h" | 34 #include "remoting/protocol/p2p_stream_socket.h" |
35 | 35 |
36 #if defined(OS_NACL) | 36 #if defined(OS_NACL) |
37 #include "net/socket/ssl_client_socket_openssl.h" | 37 #include "net/socket/ssl_client_socket_impl.h" |
38 #else | 38 #else |
39 #include "net/socket/client_socket_factory.h" | 39 #include "net/socket/client_socket_factory.h" |
40 #endif | 40 #endif |
41 | 41 |
42 namespace remoting { | 42 namespace remoting { |
43 namespace protocol { | 43 namespace protocol { |
44 | 44 |
45 namespace { | 45 namespace { |
46 | 46 |
47 // A CertVerifier which rejects every certificate. | 47 // A CertVerifier which rejects every certificate. |
(...skipping 214 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
262 net::SSLClientSocketContext context; | 262 net::SSLClientSocketContext context; |
263 context.transport_security_state = transport_security_state_.get(); | 263 context.transport_security_state = transport_security_state_.get(); |
264 context.cert_verifier = cert_verifier_.get(); | 264 context.cert_verifier = cert_verifier_.get(); |
265 std::unique_ptr<net::ClientSocketHandle> socket_handle( | 265 std::unique_ptr<net::ClientSocketHandle> socket_handle( |
266 new net::ClientSocketHandle); | 266 new net::ClientSocketHandle); |
267 socket_handle->SetSocket( | 267 socket_handle->SetSocket( |
268 base::WrapUnique(new NetStreamSocketAdapter(std::move(socket)))); | 268 base::WrapUnique(new NetStreamSocketAdapter(std::move(socket)))); |
269 | 269 |
270 #if defined(OS_NACL) | 270 #if defined(OS_NACL) |
271 // net_nacl doesn't include ClientSocketFactory. | 271 // net_nacl doesn't include ClientSocketFactory. |
272 socket_.reset(new net::SSLClientSocketOpenSSL( | 272 socket_.reset(new net::SSLClientSocketImpl( |
273 std::move(socket_handle), host_and_port, ssl_config, context)); | 273 std::move(socket_handle), host_and_port, ssl_config, context)); |
274 #else | 274 #else |
275 socket_ = | 275 socket_ = |
276 net::ClientSocketFactory::GetDefaultFactory()->CreateSSLClientSocket( | 276 net::ClientSocketFactory::GetDefaultFactory()->CreateSSLClientSocket( |
277 std::move(socket_handle), host_and_port, ssl_config, context); | 277 std::move(socket_handle), host_and_port, ssl_config, context); |
278 #endif | 278 #endif |
279 | 279 |
280 result = socket_->Connect( | 280 result = socket_->Connect( |
281 base::Bind(&SslHmacChannelAuthenticator::OnConnected, | 281 base::Bind(&SslHmacChannelAuthenticator::OnConnected, |
282 base::Unretained(this))); | 282 base::Unretained(this))); |
(...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
437 std::move(socket_), std::move(server_context_)))); | 437 std::move(socket_), std::move(server_context_)))); |
438 } | 438 } |
439 } | 439 } |
440 | 440 |
441 void SslHmacChannelAuthenticator::NotifyError(int error) { | 441 void SslHmacChannelAuthenticator::NotifyError(int error) { |
442 base::ResetAndReturn(&done_callback_).Run(error, nullptr); | 442 base::ResetAndReturn(&done_callback_).Run(error, nullptr); |
443 } | 443 } |
444 | 444 |
445 } // namespace protocol | 445 } // namespace protocol |
446 } // namespace remoting | 446 } // namespace remoting |
OLD | NEW |