| Index: remoting/protocol/negotiating_authenticator.cc
|
| diff --git a/remoting/protocol/negotiating_authenticator.cc b/remoting/protocol/negotiating_authenticator.cc
|
| index efdbb3204c29e2cafc8a8c8eb8258c9c0ec69290..ae994f491c3c0196859f1bf0e32862c1c61ee6a4 100644
|
| --- a/remoting/protocol/negotiating_authenticator.cc
|
| +++ b/remoting/protocol/negotiating_authenticator.cc
|
| @@ -7,10 +7,12 @@
|
| #include <algorithm>
|
| #include <sstream>
|
|
|
| +#include "base/bind.h"
|
| +#include "base/callback.h"
|
| #include "base/logging.h"
|
| #include "base/string_split.h"
|
| -#include "crypto/rsa_private_key.h"
|
| #include "remoting/protocol/channel_authenticator.h"
|
| +#include "remoting/protocol/key_pair.h"
|
| #include "remoting/protocol/v2_authenticator.h"
|
| #include "third_party/libjingle/source/talk/xmllite/xmlelement.h"
|
|
|
| @@ -55,13 +57,13 @@ scoped_ptr<Authenticator> NegotiatingAuthenticator::CreateForClient(
|
| // static
|
| scoped_ptr<Authenticator> NegotiatingAuthenticator::CreateForHost(
|
| const std::string& local_cert,
|
| - const crypto::RSAPrivateKey& local_private_key,
|
| + scoped_ptr<KeyPair> key_pair,
|
| const std::string& shared_secret_hash,
|
| AuthenticationMethod::HashFunction hash_function) {
|
| scoped_ptr<NegotiatingAuthenticator> result(
|
| new NegotiatingAuthenticator(WAITING_MESSAGE));
|
| result->local_cert_ = local_cert;
|
| - result->local_private_key_.reset(local_private_key.Copy());
|
| + result->key_pair_ = key_pair.Pass();
|
| result->shared_secret_hash_ = shared_secret_hash;
|
|
|
| result->AddMethod(AuthenticationMethod::Spake2(hash_function));
|
| @@ -69,11 +71,9 @@ scoped_ptr<Authenticator> NegotiatingAuthenticator::CreateForHost(
|
| return scoped_ptr<Authenticator>(result.Pass());
|
| }
|
|
|
| -
|
| NegotiatingAuthenticator::NegotiatingAuthenticator(
|
| Authenticator::State initial_state)
|
| - : certificate_sent_(false),
|
| - current_method_(AuthenticationMethod::Invalid()),
|
| + : current_method_(AuthenticationMethod::Invalid()),
|
| state_(initial_state),
|
| rejection_reason_(INVALID_CREDENTIALS) {
|
| }
|
| @@ -209,20 +209,19 @@ NegotiatingAuthenticator::CreateChannelAuthenticator() const {
|
| }
|
|
|
| bool NegotiatingAuthenticator::is_host_side() const {
|
| - return local_private_key_.get() != NULL;
|
| + return key_pair_.get() != NULL;
|
| }
|
|
|
| void NegotiatingAuthenticator::CreateAuthenticator(State initial_state) {
|
| if (is_host_side()) {
|
| current_authenticator_ = V2Authenticator::CreateForHost(
|
| - local_cert_, *local_private_key_.get(),
|
| + local_cert_, key_pair_->Copy(),
|
| shared_secret_hash_, initial_state);
|
| } else {
|
| current_authenticator_ = V2Authenticator::CreateForClient(
|
| AuthenticationMethod::ApplyHashFunction(
|
| current_method_.hash_function(),
|
| - authentication_tag_, shared_secret_),
|
| - initial_state);
|
| + authentication_tag_, shared_secret_), initial_state);
|
| }
|
| }
|
|
|
|
|