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_THIRD_PARTY_HOST_AUTHENTICATOR_H_ | 5 #ifndef REMOTING_PROTOCOL_THIRD_PARTY_HOST_AUTHENTICATOR_H_ |
6 #define REMOTING_PROTOCOL_THIRD_PARTY_HOST_AUTHENTICATOR_H_ | 6 #define REMOTING_PROTOCOL_THIRD_PARTY_HOST_AUTHENTICATOR_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/callback.h" | 10 #include "base/callback.h" |
(...skipping 17 matching lines...) Expand all Loading... |
28 // |V2Authenticator|, which is used to establish the encrypted connection. | 28 // |V2Authenticator|, which is used to establish the encrypted connection. |
29 class ThirdPartyHostAuthenticator : public ThirdPartyAuthenticatorBase { | 29 class ThirdPartyHostAuthenticator : public ThirdPartyAuthenticatorBase { |
30 public: | 30 public: |
31 // Creates a third-party host authenticator. |local_cert| and |key_pair| are | 31 // Creates a third-party host authenticator. |local_cert| and |key_pair| are |
32 // used by the underlying V2Authenticator to create the SSL channels. | 32 // used by the underlying V2Authenticator to create the SSL channels. |
33 // |token_validator| contains the token parameters to be sent to the client | 33 // |token_validator| contains the token parameters to be sent to the client |
34 // and is used to obtain the shared secret. | 34 // and is used to obtain the shared secret. |
35 ThirdPartyHostAuthenticator(const std::string& local_cert, | 35 ThirdPartyHostAuthenticator(const std::string& local_cert, |
36 scoped_refptr<RsaKeyPair> key_pair, | 36 scoped_refptr<RsaKeyPair> key_pair, |
37 scoped_ptr<TokenValidator> token_validator); | 37 scoped_ptr<TokenValidator> token_validator); |
38 virtual ~ThirdPartyHostAuthenticator(); | 38 ~ThirdPartyHostAuthenticator() override; |
39 | 39 |
40 protected: | 40 protected: |
41 // ThirdPartyAuthenticator implementation. | 41 // ThirdPartyAuthenticator implementation. |
42 virtual void ProcessTokenMessage( | 42 void ProcessTokenMessage(const buzz::XmlElement* message, |
43 const buzz::XmlElement* message, | 43 const base::Closure& resume_callback) override; |
44 const base::Closure& resume_callback) override; | 44 void AddTokenElements(buzz::XmlElement* message) override; |
45 virtual void AddTokenElements(buzz::XmlElement* message) override; | |
46 | 45 |
47 private: | 46 private: |
48 void OnThirdPartyTokenValidated(const buzz::XmlElement* message, | 47 void OnThirdPartyTokenValidated(const buzz::XmlElement* message, |
49 const base::Closure& resume_callback, | 48 const base::Closure& resume_callback, |
50 const std::string& shared_secret); | 49 const std::string& shared_secret); |
51 | 50 |
52 std::string local_cert_; | 51 std::string local_cert_; |
53 scoped_refptr<RsaKeyPair> key_pair_; | 52 scoped_refptr<RsaKeyPair> key_pair_; |
54 scoped_ptr<TokenValidator> token_validator_; | 53 scoped_ptr<TokenValidator> token_validator_; |
55 | 54 |
56 DISALLOW_COPY_AND_ASSIGN(ThirdPartyHostAuthenticator); | 55 DISALLOW_COPY_AND_ASSIGN(ThirdPartyHostAuthenticator); |
57 }; | 56 }; |
58 | 57 |
59 } // namespace protocol | 58 } // namespace protocol |
60 } // namespace remoting | 59 } // namespace remoting |
61 | 60 |
62 #endif // REMOTING_PROTOCOL_THIRD_PARTY_HOST_AUTHENTICATOR_H_ | 61 #endif // REMOTING_PROTOCOL_THIRD_PARTY_HOST_AUTHENTICATOR_H_ |
OLD | NEW |