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

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

Issue 9150014: Cleanup AuthenticatorFactory implementations. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: merged Created 8 years, 11 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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_V1_AUTHENTICATOR_H_ 5 #ifndef REMOTING_PROTOCOL_V1_AUTHENTICATOR_H_
6 #define REMOTING_PROTOCOL_V1_AUTHENTICATOR_H_ 6 #define REMOTING_PROTOCOL_V1_AUTHENTICATOR_H_
7 7
8 #include "base/basictypes.h" 8 #include "base/basictypes.h"
9 #include "base/compiler_specific.h" 9 #include "base/compiler_specific.h"
10 #include "base/memory/scoped_ptr.h" 10 #include "base/memory/scoped_ptr.h"
(...skipping 24 matching lines...) Expand all
35 std::string remote_cert_; 35 std::string remote_cert_;
36 State state_; 36 State state_;
37 37
38 DISALLOW_COPY_AND_ASSIGN(V1ClientAuthenticator); 38 DISALLOW_COPY_AND_ASSIGN(V1ClientAuthenticator);
39 }; 39 };
40 40
41 class V1HostAuthenticator : public Authenticator { 41 class V1HostAuthenticator : public Authenticator {
42 public: 42 public:
43 // Doesn't take ownership of |local_private_key|. 43 // Doesn't take ownership of |local_private_key|.
44 V1HostAuthenticator(const std::string& local_cert, 44 V1HostAuthenticator(const std::string& local_cert,
45 const crypto::RSAPrivateKey* local_private_key, 45 const crypto::RSAPrivateKey& local_private_key,
46 const std::string& shared_secret, 46 const std::string& shared_secret,
47 const std::string& remote_jid); 47 const std::string& remote_jid);
48 virtual ~V1HostAuthenticator(); 48 virtual ~V1HostAuthenticator();
49 49
50 // Authenticator interface. 50 // Authenticator interface.
51 virtual State state() const OVERRIDE; 51 virtual State state() const OVERRIDE;
52 virtual void ProcessMessage(const buzz::XmlElement* message) OVERRIDE; 52 virtual void ProcessMessage(const buzz::XmlElement* message) OVERRIDE;
53 virtual buzz::XmlElement* GetNextMessage() OVERRIDE; 53 virtual buzz::XmlElement* GetNextMessage() OVERRIDE;
54 virtual ChannelAuthenticator* CreateChannelAuthenticator() const OVERRIDE; 54 virtual ChannelAuthenticator* CreateChannelAuthenticator() const OVERRIDE;
55 55
56 private: 56 private:
57 std::string local_cert_; 57 std::string local_cert_;
58 scoped_ptr<crypto::RSAPrivateKey> local_private_key_; 58 scoped_ptr<crypto::RSAPrivateKey> local_private_key_;
59 std::string shared_secret_; 59 std::string shared_secret_;
60 std::string remote_jid_; 60 std::string remote_jid_;
61 State state_; 61 State state_;
62 62
63 DISALLOW_COPY_AND_ASSIGN(V1HostAuthenticator); 63 DISALLOW_COPY_AND_ASSIGN(V1HostAuthenticator);
64 }; 64 };
65 65
66 class V1HostAuthenticatorFactory : public AuthenticatorFactory {
67 public:
68 // Doesn't take ownership of |local_private_key|.
69 V1HostAuthenticatorFactory(const std::string& local_cert,
70 const crypto::RSAPrivateKey* local_private_key,
71 const std::string& shared_secret);
72 virtual ~V1HostAuthenticatorFactory();
73
74 // AuthenticatorFactory interface.
75 virtual Authenticator* CreateAuthenticator(
76 const std::string& remote_jid,
77 const buzz::XmlElement* first_message) OVERRIDE;
78
79 private:
80 std::string local_cert_;
81 scoped_ptr<crypto::RSAPrivateKey> local_private_key_;
82 std::string shared_secret_;
83
84 DISALLOW_COPY_AND_ASSIGN(V1HostAuthenticatorFactory);
85 };
86
87 } // namespace protocol 66 } // namespace protocol
88 } // namespace remoting 67 } // namespace remoting
89 68
90 #endif // REMOTING_PROTOCOL_V1_AUTHENTICATOR_H_ 69 #endif // REMOTING_PROTOCOL_V1_AUTHENTICATOR_H_
OLDNEW
« no previous file with comments | « remoting/protocol/me2me_host_authenticator_factory.cc ('k') | remoting/protocol/v1_authenticator.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698