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 c4989c6ddc7f4bdd15418a2560872021fea7af9b..043bc7546765cf4cbc126bb6be2e601ff9fed31f 100644 |
--- a/remoting/host/plugin/host_script_object.cc |
+++ b/remoting/host/plugin/host_script_object.cc |
@@ -1002,10 +1002,18 @@ void HostNPScriptObject::OnReceivedSupportID( |
std::string host_secret = GenerateSupportHostSecret(); |
std::string access_code = support_id + host_secret; |
+ |
+ std::string local_certificate = host_key_pair_.GenerateCertificate(); |
+ if (local_certificate.empty()) { |
+ LOG(ERROR) << "Failed to generate host certificate."; |
+ SetState(kError); |
+ DisconnectInternal(); |
+ return; |
+ } |
+ |
scoped_ptr<protocol::AuthenticatorFactory> factory( |
new protocol::It2MeHostAuthenticatorFactory( |
- host_key_pair_.GenerateCertificate(), *host_key_pair_.private_key(), |
- access_code)); |
+ local_certificate, *host_key_pair_.private_key(), access_code)); |
host_->SetAuthenticatorFactory(factory.Pass()); |
{ |