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

Unified Diff: remoting/protocol/negotiating_host_authenticator.cc

Issue 1788443005: Make TokenValidatorFactory ref-counted. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 9 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
« no previous file with comments | « remoting/protocol/negotiating_host_authenticator.h ('k') | remoting/protocol/token_validator.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/protocol/negotiating_host_authenticator.cc
diff --git a/remoting/protocol/negotiating_host_authenticator.cc b/remoting/protocol/negotiating_host_authenticator.cc
index de6b894dcaf09be8f4e261998b2672b3e41d0280..5a3d51e36a1b8ca9c33dbb24e8661e601de4b361 100644
--- a/remoting/protocol/negotiating_host_authenticator.cc
+++ b/remoting/protocol/negotiating_host_authenticator.cc
@@ -78,11 +78,11 @@ NegotiatingHostAuthenticator::CreateWithThirdPartyAuth(
const std::string& remote_id,
const std::string& local_cert,
scoped_refptr<RsaKeyPair> key_pair,
- scoped_ptr<TokenValidator> token_validator) {
+ scoped_refptr<TokenValidatorFactory> token_validator_factory) {
scoped_ptr<NegotiatingHostAuthenticator> result(
new NegotiatingHostAuthenticator(local_id, remote_id, local_cert,
key_pair));
- result->token_validator_ = std::move(token_validator);
+ result->token_validator_factory_ = token_validator_factory;
result->AddMethod(Method::THIRD_PARTY_SPAKE2_CURVE25519);
result->AddMethod(Method::THIRD_PARTY_SPAKE2_P224);
return std::move(result);
@@ -183,23 +183,15 @@ void NegotiatingHostAuthenticator::CreateAuthenticator(
DCHECK(current_method_ != Method::INVALID);
if (current_method_ == Method::THIRD_PARTY_SPAKE2_P224) {
- // |ThirdPartyHostAuthenticator| takes ownership of |token_validator_|.
- // The authentication method negotiation logic should guarantee that only
- // one |ThirdPartyHostAuthenticator| will need to be created per session.
- DCHECK(token_validator_);
current_authenticator_.reset(new ThirdPartyHostAuthenticator(
base::Bind(&V2Authenticator::CreateForHost, local_cert_,
local_key_pair_),
- std::move(token_validator_)));
+ token_validator_factory_->CreateTokenValidator(local_id_, remote_id_)));
} else if (current_method_ == Method::THIRD_PARTY_SPAKE2_CURVE25519) {
- // |ThirdPartyHostAuthenticator| takes ownership of |token_validator_|.
- // The authentication method negotiation logic should guarantee that only
- // one |ThirdPartyHostAuthenticator| will need to be created per session.
- DCHECK(token_validator_);
current_authenticator_.reset(new ThirdPartyHostAuthenticator(
base::Bind(&Spake2Authenticator::CreateForHost, local_id_, remote_id_,
local_cert_, local_key_pair_),
- std::move(token_validator_)));
+ token_validator_factory_->CreateTokenValidator(local_id_, remote_id_)));
} else if (current_method_ == Method::SHARED_SECRET_SPAKE2_CURVE25519) {
current_authenticator_ = Spake2Authenticator::CreateForHost(
local_id_, remote_id_, local_cert_, local_key_pair_,
« no previous file with comments | « remoting/protocol/negotiating_host_authenticator.h ('k') | remoting/protocol/token_validator.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698