| 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 #ifndef REMOTING_PROTOCOL_V2_AUTHENTICATOR_H_ | 5 #ifndef REMOTING_PROTOCOL_V2_AUTHENTICATOR_H_ |
| 6 #define REMOTING_PROTOCOL_V2_AUTHENTICATOR_H_ | 6 #define REMOTING_PROTOCOL_V2_AUTHENTICATOR_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 #include <queue> | 9 #include <queue> |
| 10 | 10 |
| (...skipping 19 matching lines...) Expand all Loading... |
| 30 const std::string& local_cert, | 30 const std::string& local_cert, |
| 31 scoped_refptr<RsaKeyPair> key_pair, | 31 scoped_refptr<RsaKeyPair> key_pair, |
| 32 const std::string& shared_secret, | 32 const std::string& shared_secret, |
| 33 State initial_state); | 33 State initial_state); |
| 34 | 34 |
| 35 virtual ~V2Authenticator(); | 35 virtual ~V2Authenticator(); |
| 36 | 36 |
| 37 // Authenticator interface. | 37 // Authenticator interface. |
| 38 virtual State state() const OVERRIDE; | 38 virtual State state() const OVERRIDE; |
| 39 virtual RejectionReason rejection_reason() const OVERRIDE; | 39 virtual RejectionReason rejection_reason() const OVERRIDE; |
| 40 virtual void ProcessMessage(const buzz::XmlElement* message) OVERRIDE; | 40 virtual void ProcessMessage(const base::Closure& resume_callback, |
| 41 const buzz::XmlElement* message) OVERRIDE; |
| 41 virtual scoped_ptr<buzz::XmlElement> GetNextMessage() OVERRIDE; | 42 virtual scoped_ptr<buzz::XmlElement> GetNextMessage() OVERRIDE; |
| 42 virtual scoped_ptr<ChannelAuthenticator> | 43 virtual scoped_ptr<ChannelAuthenticator> |
| 43 CreateChannelAuthenticator() const OVERRIDE; | 44 CreateChannelAuthenticator() const OVERRIDE; |
| 44 | 45 |
| 45 private: | 46 private: |
| 46 FRIEND_TEST_ALL_PREFIXES(V2AuthenticatorTest, InvalidSecret); | 47 FRIEND_TEST_ALL_PREFIXES(V2AuthenticatorTest, InvalidSecret); |
| 47 | 48 |
| 48 V2Authenticator(crypto::P224EncryptedKeyExchange::PeerType type, | 49 V2Authenticator(crypto::P224EncryptedKeyExchange::PeerType type, |
| 49 const std::string& shared_secret, | 50 const std::string& shared_secret, |
| 50 State initial_state); | 51 State initial_state); |
| 51 | 52 |
| 53 virtual void ProcessMessageInternal(const buzz::XmlElement* message); |
| 54 |
| 52 bool is_host_side() const; | 55 bool is_host_side() const; |
| 53 | 56 |
| 54 // Used only for host authenticators. | 57 // Used only for host authenticators. |
| 55 std::string local_cert_; | 58 std::string local_cert_; |
| 56 scoped_refptr<RsaKeyPair> local_key_pair_; | 59 scoped_refptr<RsaKeyPair> local_key_pair_; |
| 57 bool certificate_sent_; | 60 bool certificate_sent_; |
| 58 | 61 |
| 59 // Used only for client authenticators. | 62 // Used only for client authenticators. |
| 60 std::string remote_cert_; | 63 std::string remote_cert_; |
| 61 | 64 |
| 62 // Used for both host and client authenticators. | 65 // Used for both host and client authenticators. |
| 63 crypto::P224EncryptedKeyExchange key_exchange_impl_; | 66 crypto::P224EncryptedKeyExchange key_exchange_impl_; |
| 64 State state_; | 67 State state_; |
| 65 RejectionReason rejection_reason_; | 68 RejectionReason rejection_reason_; |
| 66 std::queue<std::string> pending_messages_; | 69 std::queue<std::string> pending_messages_; |
| 67 std::string auth_key_; | 70 std::string auth_key_; |
| 68 | 71 |
| 69 DISALLOW_COPY_AND_ASSIGN(V2Authenticator); | 72 DISALLOW_COPY_AND_ASSIGN(V2Authenticator); |
| 70 }; | 73 }; |
| 71 | 74 |
| 72 } // namespace protocol | 75 } // namespace protocol |
| 73 } // namespace remoting | 76 } // namespace remoting |
| 74 | 77 |
| 75 #endif // REMOTING_PROTOCOL_V2_AUTHENTICATOR_H_ | 78 #endif // REMOTING_PROTOCOL_V2_AUTHENTICATOR_H_ |
| OLD | NEW |