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

Unified Diff: remoting/protocol/v1_authenticator.cc

Issue 8727014: Implement RSAPrivateKey::Copy() (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: - Created 9 years, 1 month 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
« crypto/rsa_private_key_win.cc ('K') | « remoting/protocol/v1_authenticator.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/protocol/v1_authenticator.cc
diff --git a/remoting/protocol/v1_authenticator.cc b/remoting/protocol/v1_authenticator.cc
index 2daf246f26705b523319a42d58a1cf96e2c7cc4a..44c58e34eccf25f994a8241629fa78b0f11e9f18 100644
--- a/remoting/protocol/v1_authenticator.cc
+++ b/remoting/protocol/v1_authenticator.cc
@@ -91,7 +91,7 @@ V1HostAuthenticator::V1HostAuthenticator(
const std::string& shared_secret,
const std::string& remote_jid)
: local_cert_(local_cert),
- local_private_key_(local_private_key),
+ local_private_key_(local_private_key->Copy()),
shared_secret_(shared_secret),
remote_jid_(remote_jid),
state_(WAITING_MESSAGE) {
@@ -141,22 +141,16 @@ ChannelAuthenticator*
V1HostAuthenticator::CreateChannelAuthenticator() const {
DCHECK_EQ(state_, ACCEPTED);
return new V1HostChannelAuthenticator(
- local_cert_, local_private_key_, shared_secret_);
+ local_cert_, local_private_key_.get(), shared_secret_);
};
V1HostAuthenticatorFactory::V1HostAuthenticatorFactory(
const std::string& local_cert,
- crypto::RSAPrivateKey* local_private_key,
+ const crypto::RSAPrivateKey* local_private_key,
const std::string& shared_secret)
: local_cert_(local_cert),
+ local_private_key_(local_private_key->Copy()),
shared_secret_(shared_secret) {
- DCHECK(local_private_key);
-
- // TODO(hclam): Need a better way to clone a key. See crbug.com/105220 .
- std::vector<uint8> key_bytes;
- CHECK(local_private_key->ExportPrivateKey(&key_bytes));
- local_private_key_.reset(
- crypto::RSAPrivateKey::CreateFromPrivateKeyInfo(key_bytes));
CHECK(local_private_key_.get());
}
« crypto/rsa_private_key_win.cc ('K') | « remoting/protocol/v1_authenticator.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698