Index: remoting/protocol/me2me_host_authenticator_factory.cc |
diff --git a/remoting/protocol/me2me_host_authenticator_factory.cc b/remoting/protocol/me2me_host_authenticator_factory.cc |
index 4ee7b65eff1aa1f202d3d0c80cde5ad143683576..a7159c8ec61aeeca92ffc7b88e05c6928173ec99 100644 |
--- a/remoting/protocol/me2me_host_authenticator_factory.cc |
+++ b/remoting/protocol/me2me_host_authenticator_factory.cc |
@@ -61,10 +61,13 @@ class RejectingAuthenticator : public Authenticator { |
Me2MeHostAuthenticatorFactory::Me2MeHostAuthenticatorFactory( |
const std::string& local_cert, |
scoped_refptr<RsaKeyPair> key_pair, |
- const SharedSecretHash& shared_secret_hash) |
+ const SharedSecretHash& shared_secret_hash, |
+ scoped_ptr<ThirdPartyHostAuthenticator::TokenValidatorFactory> |
+ token_validator_factory) |
: local_cert_(local_cert), |
key_pair_(key_pair), |
- shared_secret_hash_(shared_secret_hash) { |
+ shared_secret_hash_(shared_secret_hash), |
+ token_validator_factory_(token_validator_factory.Pass()) { |
} |
Me2MeHostAuthenticatorFactory::~Me2MeHostAuthenticatorFactory() { |
@@ -91,9 +94,14 @@ scoped_ptr<Authenticator> Me2MeHostAuthenticatorFactory::CreateAuthenticator( |
return scoped_ptr<Authenticator>(new RejectingAuthenticator()); |
} |
- return scoped_ptr<Authenticator>(new NegotiatingHostAuthenticator( |
+ if (token_validator_factory_->IsEnabled()) { |
+ return NegotiatingHostAuthenticator::CreateWithThirdPartyAuth( |
+ local_cert_, key_pair_, token_validator_factory_->CreateTokenValidator( |
+ local_jid, remote_jid)); |
+ } |
Wez
2013/04/05 22:46:12
nit: blank line after this
rmsousa
2013/04/06 00:37:25
Done.
|
+ return NegotiatingHostAuthenticator::CreateWithSharedSecret( |
local_cert_, key_pair_, shared_secret_hash_.value, |
- shared_secret_hash_.hash_function)); |
+ shared_secret_hash_.hash_function); |
} |
} // namespace protocol |