| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 #ifndef REMOTING_PROTOCOL_NEGOTIATING_HOST_AUTHENTICATOR_H_ | 5 #ifndef REMOTING_PROTOCOL_NEGOTIATING_HOST_AUTHENTICATOR_H_ |
| 6 #define REMOTING_PROTOCOL_NEGOTIATING_HOST_AUTHENTICATOR_H_ | 6 #define REMOTING_PROTOCOL_NEGOTIATING_HOST_AUTHENTICATOR_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 13 matching lines...) Expand all Loading... |
| 24 | 24 |
| 25 class TokenValidatorFactory; | 25 class TokenValidatorFactory; |
| 26 | 26 |
| 27 // Host-side implementation of NegotiatingAuthenticatorBase. | 27 // Host-side implementation of NegotiatingAuthenticatorBase. |
| 28 // See comments in negotiating_authenticator_base.h for a general explanation. | 28 // See comments in negotiating_authenticator_base.h for a general explanation. |
| 29 class NegotiatingHostAuthenticator : public NegotiatingAuthenticatorBase { | 29 class NegotiatingHostAuthenticator : public NegotiatingAuthenticatorBase { |
| 30 public: | 30 public: |
| 31 ~NegotiatingHostAuthenticator() override; | 31 ~NegotiatingHostAuthenticator() override; |
| 32 | 32 |
| 33 // Creates a host authenticator for It2Me host. | 33 // Creates a host authenticator for It2Me host. |
| 34 static scoped_ptr<Authenticator> CreateForIt2Me( | 34 static scoped_ptr<NegotiatingHostAuthenticator> CreateForIt2Me( |
| 35 const std::string& local_id, | 35 const std::string& local_id, |
| 36 const std::string& remote_id, | 36 const std::string& remote_id, |
| 37 const std::string& local_cert, | 37 const std::string& local_cert, |
| 38 scoped_refptr<RsaKeyPair> key_pair, | 38 scoped_refptr<RsaKeyPair> key_pair, |
| 39 const std::string& access_code); | 39 const std::string& access_code); |
| 40 | 40 |
| 41 // Creates a host authenticator, using a fixed PIN. If |pairing_registry| is | 41 // Creates a host authenticator, using a fixed PIN. If |pairing_registry| is |
| 42 // non-nullptr then the paired methods will be offered, supporting | 42 // non-nullptr then the paired methods will be offered, supporting |
| 43 // PIN-less authentication. | 43 // PIN-less authentication. |
| 44 static scoped_ptr<Authenticator> CreateWithPin( | 44 static scoped_ptr<NegotiatingHostAuthenticator> CreateWithPin( |
| 45 const std::string& local_id, | 45 const std::string& local_id, |
| 46 const std::string& remote_id, | 46 const std::string& remote_id, |
| 47 const std::string& local_cert, | 47 const std::string& local_cert, |
| 48 scoped_refptr<RsaKeyPair> key_pair, | 48 scoped_refptr<RsaKeyPair> key_pair, |
| 49 const std::string& pin_hash, | 49 const std::string& pin_hash, |
| 50 scoped_refptr<PairingRegistry> pairing_registry); | 50 scoped_refptr<PairingRegistry> pairing_registry); |
| 51 | 51 |
| 52 // Creates a host authenticator, using third party authentication. | 52 // Creates a host authenticator, using third party authentication. |
| 53 static scoped_ptr<Authenticator> CreateWithThirdPartyAuth( | 53 static scoped_ptr<NegotiatingHostAuthenticator> CreateWithThirdPartyAuth( |
| 54 const std::string& local_id, | 54 const std::string& local_id, |
| 55 const std::string& remote_id, | 55 const std::string& remote_id, |
| 56 const std::string& local_cert, | 56 const std::string& local_cert, |
| 57 scoped_refptr<RsaKeyPair> key_pair, | 57 scoped_refptr<RsaKeyPair> key_pair, |
| 58 scoped_refptr<TokenValidatorFactory> token_validator_factory); | 58 scoped_refptr<TokenValidatorFactory> token_validator_factory); |
| 59 | 59 |
| 60 // Overriden from Authenticator. | 60 // Overriden from Authenticator. |
| 61 void ProcessMessage(const buzz::XmlElement* message, | 61 void ProcessMessage(const buzz::XmlElement* message, |
| 62 const base::Closure& resume_callback) override; | 62 const base::Closure& resume_callback) override; |
| 63 scoped_ptr<buzz::XmlElement> GetNextMessage() override; | 63 scoped_ptr<buzz::XmlElement> GetNextMessage() override; |
| (...skipping 27 matching lines...) Expand all Loading... |
| 91 | 91 |
| 92 std::string client_id_; | 92 std::string client_id_; |
| 93 | 93 |
| 94 DISALLOW_COPY_AND_ASSIGN(NegotiatingHostAuthenticator); | 94 DISALLOW_COPY_AND_ASSIGN(NegotiatingHostAuthenticator); |
| 95 }; | 95 }; |
| 96 | 96 |
| 97 } // namespace protocol | 97 } // namespace protocol |
| 98 } // namespace remoting | 98 } // namespace remoting |
| 99 | 99 |
| 100 #endif // REMOTING_PROTOCOL_NEGOTIATING_HOST_AUTHENTICATOR_H_ | 100 #endif // REMOTING_PROTOCOL_NEGOTIATING_HOST_AUTHENTICATOR_H_ |
| OLD | NEW |