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

Side by Side Diff: remoting/protocol/me2me_host_authenticator_factory.cc

Issue 14793021: PairingAuthenticator implementation and plumbing. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fixed clang errors. Created 7 years, 7 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "remoting/protocol/me2me_host_authenticator_factory.h" 5 #include "remoting/protocol/me2me_host_authenticator_factory.h"
6 6
7 #include "base/base64.h" 7 #include "base/base64.h"
8 #include "base/string_util.h" 8 #include "base/string_util.h"
9 #include "remoting/base/rsa_key_pair.h" 9 #include "remoting/base/rsa_key_pair.h"
10 #include "remoting/protocol/channel_authenticator.h" 10 #include "remoting/protocol/channel_authenticator.h"
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
56 State state_; 56 State state_;
57 }; 57 };
58 58
59 } // namespace 59 } // namespace
60 60
61 // static 61 // static
62 scoped_ptr<AuthenticatorFactory> 62 scoped_ptr<AuthenticatorFactory>
63 Me2MeHostAuthenticatorFactory::CreateWithSharedSecret( 63 Me2MeHostAuthenticatorFactory::CreateWithSharedSecret(
64 const std::string& local_cert, 64 const std::string& local_cert,
65 scoped_refptr<RsaKeyPair> key_pair, 65 scoped_refptr<RsaKeyPair> key_pair,
66 const SharedSecretHash& shared_secret_hash) { 66 const SharedSecretHash& shared_secret_hash,
67 scoped_refptr<PairingRegistry> pairing_registry) {
67 scoped_ptr<Me2MeHostAuthenticatorFactory> result( 68 scoped_ptr<Me2MeHostAuthenticatorFactory> result(
68 new Me2MeHostAuthenticatorFactory()); 69 new Me2MeHostAuthenticatorFactory());
69 result->local_cert_ = local_cert; 70 result->local_cert_ = local_cert;
70 result->key_pair_ = key_pair; 71 result->key_pair_ = key_pair;
71 result->shared_secret_hash_ = shared_secret_hash; 72 result->shared_secret_hash_ = shared_secret_hash;
73 result->pairing_registry_ = pairing_registry;
72 return scoped_ptr<AuthenticatorFactory>(result.Pass()); 74 return scoped_ptr<AuthenticatorFactory>(result.Pass());
73 } 75 }
74 76
75 77
76 // static 78 // static
77 scoped_ptr<AuthenticatorFactory> 79 scoped_ptr<AuthenticatorFactory>
78 Me2MeHostAuthenticatorFactory::CreateWithThirdPartyAuth( 80 Me2MeHostAuthenticatorFactory::CreateWithThirdPartyAuth(
79 const std::string& local_cert, 81 const std::string& local_cert,
80 scoped_refptr<RsaKeyPair> key_pair, 82 scoped_refptr<RsaKeyPair> key_pair,
81 scoped_ptr<ThirdPartyHostAuthenticator::TokenValidatorFactory> 83 scoped_ptr<ThirdPartyHostAuthenticator::TokenValidatorFactory>
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
124 if (!local_cert_.empty() && key_pair_) { 126 if (!local_cert_.empty() && key_pair_) {
125 if (token_validator_factory_) { 127 if (token_validator_factory_) {
126 return NegotiatingHostAuthenticator::CreateWithThirdPartyAuth( 128 return NegotiatingHostAuthenticator::CreateWithThirdPartyAuth(
127 local_cert_, key_pair_, 129 local_cert_, key_pair_,
128 token_validator_factory_->CreateTokenValidator( 130 token_validator_factory_->CreateTokenValidator(
129 local_jid, remote_jid)); 131 local_jid, remote_jid));
130 } 132 }
131 133
132 return NegotiatingHostAuthenticator::CreateWithSharedSecret( 134 return NegotiatingHostAuthenticator::CreateWithSharedSecret(
133 local_cert_, key_pair_, shared_secret_hash_.value, 135 local_cert_, key_pair_, shared_secret_hash_.value,
134 shared_secret_hash_.hash_function); 136 shared_secret_hash_.hash_function, pairing_registry_);
135 } 137 }
136 138
137 return scoped_ptr<Authenticator>(new RejectingAuthenticator()); 139 return scoped_ptr<Authenticator>(new RejectingAuthenticator());
138 } 140 }
139 141
140 } // namespace protocol 142 } // namespace protocol
141 } // namespace remoting 143 } // namespace remoting
OLDNEW
« no previous file with comments | « remoting/protocol/me2me_host_authenticator_factory.h ('k') | remoting/protocol/negotiating_authenticator_base.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698