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

Unified Diff: remoting/protocol/jingle_session_manager.cc

Issue 6315009: Use a random number to generate a self-signed certiciate for chromoting (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 11 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/protocol/jingle_session_manager.cc
diff --git a/remoting/protocol/jingle_session_manager.cc b/remoting/protocol/jingle_session_manager.cc
index 1ca26bde8cbdbdcc1654a04d43b9df3d821f59cc..6b8eb42547c0ee290693a29de2837aef1e0dfcb4 100644
--- a/remoting/protocol/jingle_session_manager.cc
+++ b/remoting/protocol/jingle_session_manager.cc
@@ -2,10 +2,13 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
+#include <limits>
+
#include "remoting/protocol/jingle_session_manager.h"
wtc 2011/01/20 01:33:05 Nit: the Style Guide recommends that this header b
#include "base/base64.h"
#include "base/message_loop.h"
+#include "base/rand_util.h"
#include "base/string_number_conversions.h"
#include "remoting/base/constants.h"
#include "remoting/jingle_glue/jingle_thread.h"
@@ -282,7 +285,8 @@ void JingleSessionManager::OnSessionCreate(
if (!certificate_) {
private_key_.reset(base::RSAPrivateKey::Create(1024));
certificate_ = net::X509Certificate::CreateSelfSigned(
- private_key_.get(), "CN=chromoting", 1,
+ private_key_.get(), "CN=chromoting",
+ base::RandInt(1, std::numeric_limits<int>::max()),
wtc 2011/01/20 01:33:05 This is correct. But it uses only half of the pos
base::TimeDelta::FromDays(1));
CHECK(certificate_);
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698