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 11 matching lines...) Expand all Loading... |
22 class RsaKeyPair; | 22 class RsaKeyPair; |
23 | 23 |
24 namespace protocol { | 24 namespace protocol { |
25 | 25 |
26 // Host-side implementation of NegotiatingAuthenticatorBase. | 26 // Host-side implementation of NegotiatingAuthenticatorBase. |
27 // See comments in negotiating_authenticator_base.h for a general explanation. | 27 // See comments in negotiating_authenticator_base.h for a general explanation. |
28 class NegotiatingHostAuthenticator : public NegotiatingAuthenticatorBase { | 28 class NegotiatingHostAuthenticator : public NegotiatingAuthenticatorBase { |
29 public: | 29 public: |
30 ~NegotiatingHostAuthenticator() override; | 30 ~NegotiatingHostAuthenticator() override; |
31 | 31 |
32 // Creates a host authenticator, using a fixed shared secret/PIN hash. | 32 // Creates a host authenticator for It2Me host. |
33 // If |pairing_registry| is non-nullptr then the Spake2Pair method will | 33 static scoped_ptr<Authenticator> CreateForIt2Me( |
34 // be offered, supporting PIN-less authentication. | |
35 static scoped_ptr<Authenticator> CreateWithSharedSecret( | |
36 const std::string& local_cert, | 34 const std::string& local_cert, |
37 scoped_refptr<RsaKeyPair> key_pair, | 35 scoped_refptr<RsaKeyPair> key_pair, |
38 const std::string& shared_secret_hash, | 36 const std::string& access_code); |
39 AuthenticationMethod::HashFunction hash_function, | 37 |
| 38 // Creates a host authenticator, using a fixed PIN. |
| 39 // If |pairing_registry| is non-nullptr then the spake2_pair method will |
| 40 // be offered, supporting PIN-less authentication. |
| 41 static scoped_ptr<Authenticator> CreateWithPin( |
| 42 const std::string& local_cert, |
| 43 scoped_refptr<RsaKeyPair> key_pair, |
| 44 const std::string& pin_hash, |
40 scoped_refptr<PairingRegistry> pairing_registry); | 45 scoped_refptr<PairingRegistry> pairing_registry); |
41 | 46 |
42 // Creates a host authenticator, using third party authentication. | 47 // Creates a host authenticator, using third party authentication. |
43 static scoped_ptr<Authenticator> CreateWithThirdPartyAuth( | 48 static scoped_ptr<Authenticator> CreateWithThirdPartyAuth( |
44 const std::string& local_cert, | 49 const std::string& local_cert, |
45 scoped_refptr<RsaKeyPair> key_pair, | 50 scoped_refptr<RsaKeyPair> key_pair, |
46 scoped_ptr<TokenValidator> token_validator); | 51 scoped_ptr<TokenValidator> token_validator); |
47 | 52 |
48 // Overriden from Authenticator. | 53 // Overriden from Authenticator. |
49 void ProcessMessage(const buzz::XmlElement* message, | 54 void ProcessMessage(const buzz::XmlElement* message, |
(...skipping 24 matching lines...) Expand all Loading... |
74 // Used only for pairing authenticators. | 79 // Used only for pairing authenticators. |
75 scoped_refptr<PairingRegistry> pairing_registry_; | 80 scoped_refptr<PairingRegistry> pairing_registry_; |
76 | 81 |
77 DISALLOW_COPY_AND_ASSIGN(NegotiatingHostAuthenticator); | 82 DISALLOW_COPY_AND_ASSIGN(NegotiatingHostAuthenticator); |
78 }; | 83 }; |
79 | 84 |
80 } // namespace protocol | 85 } // namespace protocol |
81 } // namespace remoting | 86 } // namespace remoting |
82 | 87 |
83 #endif // REMOTING_PROTOCOL_NEGOTIATING_HOST_AUTHENTICATOR_H_ | 88 #endif // REMOTING_PROTOCOL_NEGOTIATING_HOST_AUTHENTICATOR_H_ |
OLD | NEW |