diff options
author | hclam@chromium.org <hclam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-01-27 01:55:04 +0000 |
---|---|---|
committer | hclam@chromium.org <hclam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-01-27 01:55:04 +0000 |
commit | 74c3fb5ff6eec3ce2b9c18aeb0aab42c0db25034 (patch) | |
tree | 73248bf3aafda20cce9a0c09b10ebdaa37bac11c /remoting/protocol | |
parent | a999ab29cbfd88365b88c00a8b482de97044572f (diff) | |
download | chromium_src-74c3fb5ff6eec3ce2b9c18aeb0aab42c0db25034.zip chromium_src-74c3fb5ff6eec3ce2b9c18aeb0aab42c0db25034.tar.gz chromium_src-74c3fb5ff6eec3ce2b9c18aeb0aab42c0db25034.tar.bz2 |
Use a random number to generate a self-signed certiciate for chromoting
Chromoting host to use a random number to generate self-signed certificate.
This method is still not optimal, in case of collision SSLServerSocketNSS will
fail to start due to NSS rejecting the certificate.
Using a random number is a temporary solution until we can assign certificates
to the host.
BUG=70013
TEST=Connect to the same chromoting host after client is disconnected.
Review URL: http://codereview.chromium.org/6315009
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@72745 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'remoting/protocol')
-rw-r--r-- | remoting/protocol/jingle_session_manager.cc | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/remoting/protocol/jingle_session_manager.cc b/remoting/protocol/jingle_session_manager.cc index ffd5141..6bb710f 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" #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()), base::TimeDelta::FromDays(1)); CHECK(certificate_); } |