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 |
11 #include "base/basictypes.h" | 11 #include "base/basictypes.h" |
12 #include "base/memory/ref_counted.h" | 12 #include "base/memory/ref_counted.h" |
13 #include "base/memory/scoped_ptr.h" | 13 #include "base/memory/scoped_ptr.h" |
14 #include "base/memory/weak_ptr.h" | |
15 #include "remoting/protocol/authentication_method.h" | 14 #include "remoting/protocol/authentication_method.h" |
16 #include "remoting/protocol/authenticator.h" | 15 #include "remoting/protocol/authenticator.h" |
17 #include "remoting/protocol/negotiating_authenticator_base.h" | 16 #include "remoting/protocol/negotiating_authenticator_base.h" |
17 #include "remoting/protocol/pairing_registry.h" | |
18 #include "remoting/protocol/third_party_host_authenticator.h" | 18 #include "remoting/protocol/third_party_host_authenticator.h" |
19 | 19 |
20 namespace remoting { | 20 namespace remoting { |
21 | 21 |
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 virtual ~NegotiatingHostAuthenticator(); | 30 virtual ~NegotiatingHostAuthenticator(); |
31 | 31 |
32 // Creates a host authenticator, using a fixed shared secret/PIN hash. | 32 // Creates a host authenticator, using a fixed shared secret/PIN hash. |
Wez
2013/05/18 20:08:36
nit: Can we updated this e.g. to "... using the su
Jamie
2013/05/21 01:24:34
I don't think that's any clearer than what we have
| |
33 // If a pairing registry is provided, then it will support the SpakePair | |
34 // authentication for PIN-less authentication; to disable this, pass a | |
35 // NULL pairing registry. | |
Wez
2013/05/18 20:08:36
nit: Suggest "If |pairing_registry| is non-NULL th
Jamie
2013/05/21 01:24:34
Done.
| |
33 static scoped_ptr<Authenticator> CreateWithSharedSecret( | 36 static scoped_ptr<Authenticator> CreateWithSharedSecret( |
34 const std::string& local_cert, | 37 const std::string& local_cert, |
35 scoped_refptr<RsaKeyPair> key_pair, | 38 scoped_refptr<RsaKeyPair> key_pair, |
36 const std::string& shared_secret_hash, | 39 const std::string& shared_secret_hash, |
37 AuthenticationMethod::HashFunction hash_function); | 40 AuthenticationMethod::HashFunction hash_function, |
41 scoped_refptr<PairingRegistry> pairing_registry); | |
38 | 42 |
39 // Creates a host authenticator, using third party authentication. | 43 // Creates a host authenticator, using third party authentication. |
40 static scoped_ptr<Authenticator> CreateWithThirdPartyAuth( | 44 static scoped_ptr<Authenticator> CreateWithThirdPartyAuth( |
41 const std::string& local_cert, | 45 const std::string& local_cert, |
42 scoped_refptr<RsaKeyPair> key_pair, | 46 scoped_refptr<RsaKeyPair> key_pair, |
43 scoped_ptr<ThirdPartyHostAuthenticator::TokenValidator> token_validator); | 47 scoped_ptr<ThirdPartyHostAuthenticator::TokenValidator> token_validator); |
44 | 48 |
45 // Overriden from Authenticator. | 49 // Overriden from Authenticator. |
46 virtual void ProcessMessage(const buzz::XmlElement* message, | 50 virtual void ProcessMessage(const buzz::XmlElement* message, |
47 const base::Closure& resume_callback) OVERRIDE; | 51 const base::Closure& resume_callback) OVERRIDE; |
(...skipping 13 matching lines...) Expand all Loading... | |
61 | 65 |
62 std::string local_cert_; | 66 std::string local_cert_; |
63 scoped_refptr<RsaKeyPair> local_key_pair_; | 67 scoped_refptr<RsaKeyPair> local_key_pair_; |
64 | 68 |
65 // Used only for shared secret host authenticators. | 69 // Used only for shared secret host authenticators. |
66 std::string shared_secret_hash_; | 70 std::string shared_secret_hash_; |
67 | 71 |
68 // Used only for third party host authenticators. | 72 // Used only for third party host authenticators. |
69 scoped_ptr<ThirdPartyHostAuthenticator::TokenValidator> token_validator_; | 73 scoped_ptr<ThirdPartyHostAuthenticator::TokenValidator> token_validator_; |
70 | 74 |
75 // Used only for pairing authenticators. | |
76 scoped_refptr<PairingRegistry> pairing_registry_; | |
77 | |
71 DISALLOW_COPY_AND_ASSIGN(NegotiatingHostAuthenticator); | 78 DISALLOW_COPY_AND_ASSIGN(NegotiatingHostAuthenticator); |
72 }; | 79 }; |
73 | 80 |
74 } // namespace protocol | 81 } // namespace protocol |
75 } // namespace remoting | 82 } // namespace remoting |
76 | 83 |
77 #endif // REMOTING_PROTOCOL_NEGOTIATING_HOST_AUTHENTICATOR_H_ | 84 #endif // REMOTING_PROTOCOL_NEGOTIATING_HOST_AUTHENTICATOR_H_ |
OLD | NEW |