| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 |
| OLD | NEW |