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

Unified Diff: remoting/host/host_key_pair.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
Index: remoting/host/host_key_pair.cc
diff --git a/remoting/host/host_key_pair.cc b/remoting/host/host_key_pair.cc
index 704f8f88c4745fc5b42a5caf11c0652bfa917e01..41f6a7d12e6dc9af7f3241f47cb4b943ecc51f40 100644
--- a/remoting/host/host_key_pair.cc
+++ b/remoting/host/host_key_pair.cc
@@ -105,6 +105,9 @@ std::string HostKeyPair::GenerateCertificate() const {
key_.get(), "CN=chromoting",
base::RandInt(1, std::numeric_limits<int>::max()),
base::TimeDelta::FromDays(1));
+ if (!cert)
+ return "";
alexeypa (please no reviews) 2012/09/13 23:09:25 nit: return std::string();? Or you can wrap net::
Sergey Ulanov 2012/09/13 23:25:17 Done.
+
std::string encoded;
bool result = net::X509Certificate::GetDEREncoded(cert->os_cert_handle(),
&encoded);

Powered by Google App Engine
This is Rietveld 408576698