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

Unified Diff: remoting/protocol/v1_authenticator.h

Issue 8647001: Add implementation for current IT2Me auth. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: - Created 9 years, 1 month 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « remoting/protocol/authenticator.h ('k') | remoting/protocol/v1_authenticator.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/protocol/v1_authenticator.h
diff --git a/remoting/protocol/v1_authenticator.h b/remoting/protocol/v1_authenticator.h
new file mode 100644
index 0000000000000000000000000000000000000000..d53c5bfd90e1bda2f2e8bbb549c707f28394edbd
--- /dev/null
+++ b/remoting/protocol/v1_authenticator.h
@@ -0,0 +1,89 @@
+// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef REMOTING_PROTOCOL_V1_AUTHENTICATOR_H_
+#define REMOTING_PROTOCOL_V1_AUTHENTICATOR_H_
+
+#include "base/basictypes.h"
+#include "base/compiler_specific.h"
+#include "base/memory/scoped_ptr.h"
+#include "remoting/protocol/authenticator.h"
+
+namespace crypto {
+class RSAPrivateKey;
+} // namespace base
+
+namespace remoting {
+namespace protocol {
+
+class V1ClientAuthenticator : public Authenticator {
+ public:
+ explicit V1ClientAuthenticator(const std::string& local_jid,
+ const std::string& shared_secret);
+ virtual ~V1ClientAuthenticator();
+
+ // Authenticator interface.
+ virtual State state() const OVERRIDE;
+ virtual void ProcessMessage(const buzz::XmlElement* message) OVERRIDE;
+ virtual buzz::XmlElement* GetNextMessage() OVERRIDE;
+ virtual ChannelAuthenticator* CreateChannelAuthenticator() const OVERRIDE;
+
+ private:
+ std::string local_jid_;
+ std::string shared_secret_;
+ std::string remote_cert_;
+ State state_;
+
+ DISALLOW_COPY_AND_ASSIGN(V1ClientAuthenticator);
+};
+
+class V1HostAuthenticator : public Authenticator {
+ public:
+ explicit V1HostAuthenticator(const std::string& local_cert,
+ crypto::RSAPrivateKey* local_private_key,
+ const std::string& shared_secret,
+ const std::string& remote_jid);
+ virtual ~V1HostAuthenticator();
+
+ // Authenticator interface.
+ virtual State state() const OVERRIDE;
+ virtual void ProcessMessage(const buzz::XmlElement* message) OVERRIDE;
+ virtual buzz::XmlElement* GetNextMessage() OVERRIDE;
+ virtual ChannelAuthenticator* CreateChannelAuthenticator() const OVERRIDE;
+
+ private:
+ std::string local_cert_;
+ crypto::RSAPrivateKey* local_private_key_;
+ std::string shared_secret_;
+ std::string remote_jid_;
+ State state_;
+
+ DISALLOW_COPY_AND_ASSIGN(V1HostAuthenticator);
+};
+
+class V1HostAuthenticatorFactory : public AuthenticatorFactory {
+ public:
+ // Doesn't take ownership of |local_private_key|.
+ V1HostAuthenticatorFactory(const std::string& local_cert,
+ crypto::RSAPrivateKey* local_private_key,
+ const std::string& shared_secret);
+ virtual ~V1HostAuthenticatorFactory();
+
+ // AuthenticatorFactory interface.
+ virtual Authenticator* CreateAuthenticator(
+ const std::string& remote_jid,
+ const buzz::XmlElement* first_message) OVERRIDE;
+
+ private:
+ std::string local_cert_;
+ scoped_ptr<crypto::RSAPrivateKey> local_private_key_;
+ std::string shared_secret_;
+
+ DISALLOW_COPY_AND_ASSIGN(V1HostAuthenticatorFactory);
+};
+
+} // namespace protocol
+} // namespace remoting
+
+#endif // REMOTING_PROTOCOL_V1_AUTHENTICATOR_H_
« no previous file with comments | « remoting/protocol/authenticator.h ('k') | remoting/protocol/v1_authenticator.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698