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

Unified Diff: remoting/protocol/v2_authenticator.cc

Issue 12316083: Move HostKeyPair into protocol::KeyPair. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Add missing files, move TestKeyPair. Created 7 years, 10 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/protocol/v2_authenticator.cc
diff --git a/remoting/protocol/v2_authenticator.cc b/remoting/protocol/v2_authenticator.cc
index 95b42d53270639c2d8f5c92fd41fe6f59ffd469a..b159fc56c6b5668d33a5d7c53c8fb5b16d08ea7d 100644
--- a/remoting/protocol/v2_authenticator.cc
+++ b/remoting/protocol/v2_authenticator.cc
@@ -6,7 +6,6 @@
#include "base/base64.h"
#include "base/logging.h"
-#include "crypto/rsa_private_key.h"
#include "remoting/base/constants.h"
#include "remoting/protocol/ssl_hmac_channel_authenticator.h"
#include "third_party/libjingle/source/talk/xmllite/xmlelement.h"
@@ -45,13 +44,13 @@ scoped_ptr<Authenticator> V2Authenticator::CreateForClient(
// static
scoped_ptr<Authenticator> V2Authenticator::CreateForHost(
const std::string& local_cert,
- const crypto::RSAPrivateKey& local_private_key,
+ scoped_ptr<KeyPair> key_pair,
const std::string& shared_secret,
Authenticator::State initial_state) {
scoped_ptr<V2Authenticator> result(new V2Authenticator(
P224EncryptedKeyExchange::kPeerTypeServer, shared_secret, initial_state));
result->local_cert_ = local_cert;
- result->local_private_key_.reset(local_private_key.Copy());
+ result->key_pair_ = key_pair.Pass();
return scoped_ptr<Authenticator>(result.Pass());
}
@@ -187,7 +186,7 @@ V2Authenticator::CreateChannelAuthenticator() const {
if (is_host_side()) {
return scoped_ptr<ChannelAuthenticator>(
SslHmacChannelAuthenticator::CreateForHost(
- local_cert_, local_private_key_.get(), auth_key_).Pass());
+ local_cert_, key_pair_->Copy(), auth_key_).Pass());
} else {
return scoped_ptr<ChannelAuthenticator>(
SslHmacChannelAuthenticator::CreateForClient(
@@ -196,7 +195,7 @@ V2Authenticator::CreateChannelAuthenticator() const {
}
bool V2Authenticator::is_host_side() const {
- return local_private_key_.get() != NULL;
+ return key_pair_.get() != NULL;
}
} // namespace protocol

Powered by Google App Engine
This is Rietveld 408576698