Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(785)

Unified Diff: remoting/host/plugin/host_script_object.cc

Issue 10919277: Handle certificate generation errors in chromoting host. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « remoting/host/host_key_pair.cc ('k') | remoting/host/remoting_me2me_host.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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());
{
« no previous file with comments | « remoting/host/host_key_pair.cc ('k') | remoting/host/remoting_me2me_host.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698