Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(244)

Side by Side Diff: remoting/protocol/v2_authenticator.h

Issue 12389010: Refactor of Authenticator to allow it to ProcessMessage asynchronously and then call a callback (Closed) Base URL: http://git.chromium.org/chromium/src.git@host_key_pair
Patch Set: Rebase missed one include Created 7 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « remoting/protocol/session.h ('k') | remoting/protocol/v2_authenticator.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 22 matching lines...) Expand all
33 const std::string& local_cert, 33 const std::string& local_cert,
34 const crypto::RSAPrivateKey& local_private_key, 34 const crypto::RSAPrivateKey& local_private_key,
35 const std::string& shared_secret, 35 const std::string& shared_secret,
36 State initial_state); 36 State initial_state);
37 37
38 virtual ~V2Authenticator(); 38 virtual ~V2Authenticator();
39 39
40 // Authenticator interface. 40 // Authenticator interface.
41 virtual State state() const OVERRIDE; 41 virtual State state() const OVERRIDE;
42 virtual RejectionReason rejection_reason() const OVERRIDE; 42 virtual RejectionReason rejection_reason() const OVERRIDE;
43 virtual void ProcessMessage(const buzz::XmlElement* message) OVERRIDE; 43 virtual void ProcessMessage(const buzz::XmlElement* message,
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
56 virtual void ProcessMessageInternal(const buzz::XmlElement* message);
57
55 bool is_host_side() const; 58 bool is_host_side() const;
56 59
57 // Used only for host authenticators. 60 // Used only for host authenticators.
58 std::string local_cert_; 61 std::string local_cert_;
59 scoped_ptr<crypto::RSAPrivateKey> local_private_key_; 62 scoped_ptr<crypto::RSAPrivateKey> local_private_key_;
60 bool certificate_sent_; 63 bool certificate_sent_;
61 64
62 // Used only for client authenticators. 65 // Used only for client authenticators.
63 std::string remote_cert_; 66 std::string remote_cert_;
64 67
65 // Used for both host and client authenticators. 68 // Used for both host and client authenticators.
66 crypto::P224EncryptedKeyExchange key_exchange_impl_; 69 crypto::P224EncryptedKeyExchange key_exchange_impl_;
67 State state_; 70 State state_;
68 RejectionReason rejection_reason_; 71 RejectionReason rejection_reason_;
69 std::queue<std::string> pending_messages_; 72 std::queue<std::string> pending_messages_;
70 std::string auth_key_; 73 std::string auth_key_;
71 74
72 DISALLOW_COPY_AND_ASSIGN(V2Authenticator); 75 DISALLOW_COPY_AND_ASSIGN(V2Authenticator);
73 }; 76 };
74 77
75 } // namespace protocol 78 } // namespace protocol
76 } // namespace remoting 79 } // namespace remoting
77 80
78 #endif // REMOTING_PROTOCOL_V2_AUTHENTICATOR_H_ 81 #endif // REMOTING_PROTOCOL_V2_AUTHENTICATOR_H_
OLDNEW
« no previous file with comments | « remoting/protocol/session.h ('k') | remoting/protocol/v2_authenticator.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698