| 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 "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/bind_helpers.h" | 8 #include "base/bind_helpers.h" |
| 9 #include "base/callback_helpers.h" | 9 #include "base/callback_helpers.h" |
| 10 #include "base/logging.h" | 10 #include "base/logging.h" |
| (...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 102 scoped_refptr<net::X509Certificate> cert = | 102 scoped_refptr<net::X509Certificate> cert = |
| 103 net::X509Certificate::CreateFromBytes( | 103 net::X509Certificate::CreateFromBytes( |
| 104 local_cert_.data(), local_cert_.length()); | 104 local_cert_.data(), local_cert_.length()); |
| 105 if (!cert.get()) { | 105 if (!cert.get()) { |
| 106 LOG(ERROR) << "Failed to parse X509Certificate"; | 106 LOG(ERROR) << "Failed to parse X509Certificate"; |
| 107 NotifyError(net::ERR_FAILED); | 107 NotifyError(net::ERR_FAILED); |
| 108 return; | 108 return; |
| 109 } | 109 } |
| 110 | 110 |
| 111 net::SSLConfig ssl_config; | 111 net::SSLConfig ssl_config; |
| 112 ssl_config.require_forward_secrecy = true; | 112 ssl_config.require_ecdhe = true; |
| 113 | 113 |
| 114 scoped_ptr<net::SSLServerSocket> server_socket = | 114 scoped_ptr<net::SSLServerSocket> server_socket = |
| 115 net::CreateSSLServerSocket(socket.Pass(), | 115 net::CreateSSLServerSocket(socket.Pass(), |
| 116 cert.get(), | 116 cert.get(), |
| 117 local_key_pair_->private_key(), | 117 local_key_pair_->private_key(), |
| 118 ssl_config); | 118 ssl_config); |
| 119 net::SSLServerSocket* raw_server_socket = server_socket.get(); | 119 net::SSLServerSocket* raw_server_socket = server_socket.get(); |
| 120 socket_ = server_socket.Pass(); | 120 socket_ = server_socket.Pass(); |
| 121 result = raw_server_socket->Handshake( | 121 result = raw_server_socket->Handshake( |
| 122 base::Bind(&SslHmacChannelAuthenticator::OnConnected, | 122 base::Bind(&SslHmacChannelAuthenticator::OnConnected, |
| (...skipping 191 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 314 base::ResetAndReturn(&done_callback_).Run(net::OK, socket_.Pass()); | 314 base::ResetAndReturn(&done_callback_).Run(net::OK, socket_.Pass()); |
| 315 } | 315 } |
| 316 } | 316 } |
| 317 | 317 |
| 318 void SslHmacChannelAuthenticator::NotifyError(int error) { | 318 void SslHmacChannelAuthenticator::NotifyError(int error) { |
| 319 base::ResetAndReturn(&done_callback_).Run(error, nullptr); | 319 base::ResetAndReturn(&done_callback_).Run(error, nullptr); |
| 320 } | 320 } |
| 321 | 321 |
| 322 } // namespace protocol | 322 } // namespace protocol |
| 323 } // namespace remoting | 323 } // namespace remoting |
| OLD | NEW |