Chromium Code Reviews| 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 2cfb3b4b5450c99e9843e57cb1d22bc4611d60a8..17503151a0988e1fd1b399970aa2e5141be347f7 100644 |
| --- a/remoting/protocol/ssl_hmac_channel_authenticator.cc |
| +++ b/remoting/protocol/ssl_hmac_channel_authenticator.cc |
| @@ -17,6 +17,7 @@ |
| #include "net/socket/ssl_client_socket.h" |
| #include "net/socket/ssl_server_socket.h" |
| #include "remoting/protocol/auth_util.h" |
| +#include "remoting/protocol/key_pair.h" |
| namespace remoting { |
| namespace protocol { |
| @@ -35,19 +36,18 @@ SslHmacChannelAuthenticator::CreateForClient( |
| scoped_ptr<SslHmacChannelAuthenticator> |
| SslHmacChannelAuthenticator::CreateForHost( |
| const std::string& local_cert, |
| - crypto::RSAPrivateKey* local_private_key, |
| + scoped_ptr<KeyPair> key_pair, |
| const std::string& auth_key) { |
| scoped_ptr<SslHmacChannelAuthenticator> result( |
| new SslHmacChannelAuthenticator(auth_key)); |
| result->local_cert_ = local_cert; |
| - result->local_private_key_ = local_private_key; |
| + result->key_pair_ = key_pair.Pass(); |
| return result.Pass(); |
| } |
| SslHmacChannelAuthenticator::SslHmacChannelAuthenticator( |
| const std::string& auth_key) |
| - : auth_key_(auth_key), |
| - local_private_key_(NULL) { |
| + : auth_key_(auth_key) { |
| } |
| SslHmacChannelAuthenticator::~SslHmacChannelAuthenticator() { |
| @@ -73,7 +73,7 @@ void SslHmacChannelAuthenticator::SecureAndAuthenticate( |
| net::SSLConfig ssl_config; |
| net::SSLServerSocket* server_socket = net::CreateSSLServerSocket( |
| - socket.release(), cert, local_private_key_, ssl_config); |
| + socket.release(), cert, key_pair_->private_key(), ssl_config); |
|
Wez
2013/02/23 03:43:20
What is the SSL Server Socket lifetime requirement
rmsousa
2013/02/26 02:38:52
SSLServerSocket copies the key.
|
| socket_.reset(server_socket); |
| result = server_socket->Handshake(base::Bind( |
| @@ -113,7 +113,7 @@ void SslHmacChannelAuthenticator::SecureAndAuthenticate( |
| } |
| bool SslHmacChannelAuthenticator::is_ssl_server() { |
| - return local_private_key_ != NULL; |
| + return key_pair_.get() != NULL; |
| } |
| void SslHmacChannelAuthenticator::OnConnected(int result) { |