diff options
author | sergeyu@chromium.org <sergeyu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-11-30 06:50:51 +0000 |
---|---|---|
committer | sergeyu@chromium.org <sergeyu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-11-30 06:50:51 +0000 |
commit | d264be9d7a5f4daf94c6226715ea9a4833f24cb2 (patch) | |
tree | 645a7edcc2c1308f72e2007a574b9bfb5d529e37 /remoting | |
parent | 221c035c00435d12b33b026b0402cc6e18ee7e13 (diff) | |
download | chromium_src-d264be9d7a5f4daf94c6226715ea9a4833f24cb2.zip chromium_src-d264be9d7a5f4daf94c6226715ea9a4833f24cb2.tar.gz chromium_src-d264be9d7a5f4daf94c6226715ea9a4833f24cb2.tar.bz2 |
Fix leak in remoting_unittests caused by crrev.com/112127
TBR=wez@chromium.org
BUG=105214
Review URL: http://codereview.chromium.org/8746008
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@112154 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'remoting')
-rw-r--r-- | remoting/host/chromoting_host.cc | 2 | ||||
-rw-r--r-- | remoting/host/host_key_pair.h | 2 | ||||
-rw-r--r-- | remoting/protocol/jingle_session_unittest.cc | 2 |
3 files changed, 4 insertions, 2 deletions
diff --git a/remoting/host/chromoting_host.cc b/remoting/host/chromoting_host.cc index 9e3d514..1e958cc 100644 --- a/remoting/host/chromoting_host.cc +++ b/remoting/host/chromoting_host.cc @@ -165,7 +165,7 @@ void ChromotingHost::SetSharedSecret(const std::string& shared_secret) { DCHECK(context_->network_message_loop()->BelongsToCurrentThread()); session_manager_->set_authenticator_factory( new protocol::V1HostAuthenticatorFactory( - key_pair_.GenerateCertificate(), key_pair_.CopyPrivateKey(), + key_pair_.GenerateCertificate(), key_pair_.private_key(), shared_secret)); } diff --git a/remoting/host/host_key_pair.h b/remoting/host/host_key_pair.h index 2ea00a0..41a5420 100644 --- a/remoting/host/host_key_pair.h +++ b/remoting/host/host_key_pair.h @@ -30,6 +30,8 @@ class HostKeyPair { bool Load(HostConfig* host_config); void Save(MutableHostConfig* host_config); + crypto::RSAPrivateKey* private_key() { return key_.get(); } + std::string GetPublicKey() const; std::string GetSignature(const std::string& message) const; diff --git a/remoting/protocol/jingle_session_unittest.cc b/remoting/protocol/jingle_session_unittest.cc index 9dd5143..8e7043b1 100644 --- a/remoting/protocol/jingle_session_unittest.cc +++ b/remoting/protocol/jingle_session_unittest.cc @@ -310,7 +310,7 @@ class JingleSessionTest : public testing::Test { } else { host_server_->set_authenticator_factory( new V1HostAuthenticatorFactory( - cert_der, private_key.release(), kTestSharedSecret)); + cert_der, private_key.get(), kTestSharedSecret)); } EXPECT_CALL(client_server_listener_, OnSessionManagerInitialized()) |