Index: remoting/host/plugin/host_script_object.cc |
diff --git a/remoting/host/plugin/host_script_object.cc b/remoting/host/plugin/host_script_object.cc |
index 02ade7b7f2a1569ad1d31785e56c3df4944c4ba5..0d453c5316421f0d70de8be0450136853ee7b86e 100644 |
--- a/remoting/host/plugin/host_script_object.cc |
+++ b/remoting/host/plugin/host_script_object.cc |
@@ -18,12 +18,12 @@ |
#include "net/base/net_util.h" |
#include "remoting/base/auth_token_util.h" |
#include "remoting/base/auto_thread.h" |
+#include "remoting/base/rsa_key_pair.h" |
#include "remoting/host/basic_desktop_environment.h" |
#include "remoting/host/chromoting_host.h" |
#include "remoting/host/chromoting_host_context.h" |
#include "remoting/host/host_config.h" |
#include "remoting/host/host_event_logger.h" |
-#include "remoting/host/host_key_pair.h" |
#include "remoting/host/host_secret.h" |
#include "remoting/host/host_status_observer.h" |
#include "remoting/host/it2me_host_user_interface.h" |
@@ -162,7 +162,7 @@ class HostNPScriptObject::It2MeImpl |
State state_; |
- HostKeyPair host_key_pair_; |
+ scoped_refptr<RsaKeyPair> host_key_pair_; |
scoped_ptr<SignalStrategy> signal_strategy_; |
scoped_ptr<RegisterSupportHostRequest> register_request_; |
scoped_ptr<LogToServer> log_to_server_; |
@@ -344,7 +344,7 @@ void HostNPScriptObject::It2MeImpl::FinishConnect( |
// Generate a key pair for the Host to use. |
// TODO(wez): Move this to the worker thread. |
- host_key_pair_.Generate(); |
+ host_key_pair_->Generate(); |
// Create XMPP connection. |
scoped_ptr<SignalStrategy> signal_strategy( |
@@ -355,7 +355,7 @@ void HostNPScriptObject::It2MeImpl::FinishConnect( |
// Request registration of the host for support. |
scoped_ptr<RegisterSupportHostRequest> register_request( |
new RegisterSupportHostRequest( |
- signal_strategy.get(), &host_key_pair_, directory_bot_jid_, |
+ signal_strategy.get(), host_key_pair_, directory_bot_jid_, |
base::Bind(&It2MeImpl::OnReceivedSupportID, |
base::Unretained(this)))); |
@@ -641,7 +641,7 @@ void HostNPScriptObject::It2MeImpl::OnReceivedSupportID( |
std::string host_secret = GenerateSupportHostSecret(); |
std::string access_code = support_id + host_secret; |
- std::string local_certificate = host_key_pair_.GenerateCertificate(); |
+ std::string local_certificate = host_key_pair_->GenerateCertificate(); |
if (local_certificate.empty()) { |
LOG(ERROR) << "Failed to generate host certificate."; |
SetState(kError); |
@@ -651,7 +651,7 @@ void HostNPScriptObject::It2MeImpl::OnReceivedSupportID( |
scoped_ptr<protocol::AuthenticatorFactory> factory( |
new protocol::It2MeHostAuthenticatorFactory( |
- local_certificate, *host_key_pair_.private_key(), access_code)); |
+ local_certificate, host_key_pair_, access_code)); |
host_->SetAuthenticatorFactory(factory.Pass()); |
// Pass the Access Code to the script object before changing state. |
@@ -1447,10 +1447,10 @@ bool HostNPScriptObject::LocalizeStringWithSubstitution( |
} |
void HostNPScriptObject::DoGenerateKeyPair(const ScopedRefNPObject& callback) { |
- HostKeyPair key_pair; |
- key_pair.Generate(); |
- InvokeGenerateKeyPairCallback(callback, key_pair.GetAsString(), |
- key_pair.GetPublicKey()); |
+ scoped_refptr<RsaKeyPair> key_pair(new RsaKeyPair); |
+ key_pair->Generate(); |
+ InvokeGenerateKeyPairCallback(callback, key_pair->GetAsString(), |
+ key_pair->GetPublicKey()); |
} |
void HostNPScriptObject::InvokeGenerateKeyPairCallback( |