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