Index: remoting/protocol/simple_client_channel_authenticator.h |
diff --git a/remoting/protocol/simple_client_channel_authenticator.h b/remoting/protocol/simple_client_channel_authenticator.h |
new file mode 100644 |
index 0000000000000000000000000000000000000000..be2059cae35a9de2e82ff3280f24658ad7f11f56 |
--- /dev/null |
+++ b/remoting/protocol/simple_client_channel_authenticator.h |
@@ -0,0 +1,62 @@ |
+// 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_SIMPLE_CLIENT_CHANNEL_AUTHENTICATOR_H_ |
+#define REMOTING_PROTOCOL_SIMPLE_CLIENT_CHANNEL_AUTHENTICATOR_H_ |
+ |
+#include <string> |
+ |
+#include "base/callback.h" |
+#include "base/memory/ref_counted.h" |
+#include "base/memory/scoped_ptr.h" |
+#include "base/threading/non_thread_safe.h" |
+#include "net/base/completion_callback.h" |
+#include "remoting/protocol/channel_authenticator.h" |
+ |
+namespace net { |
+class CertVerifier; |
+class DrainableIOBuffer; |
+class GrowableIOBuffer; |
+class SSLClientSocket; |
+} // namespace net |
+ |
+namespace remoting { |
+namespace protocol { |
+ |
+class SimpleClientChannelAuthenticator : public ChannelAuthenticator { |
Wez
2011/11/22 22:29:48
I don't think "simple" is sufficiently descriptive
Sergey Ulanov
2011/11/23 01:23:42
How about Legacy?
|
+ public: |
+ SimpleClientChannelAuthenticator(const std::string& remote_cert, |
+ const std::string& shared_secret); |
+ virtual ~SimpleClientChannelAuthenticator(); |
+ |
+ // ChannelAuthenticator implementation. |
+ virtual void SecureAndAuthenticate( |
+ net::StreamSocket* socket, const DoneCallback& done_callback); |
Wez
2011/11/22 22:29:48
OVERRIDE?
Sergey Ulanov
2011/11/23 01:23:42
Done.
|
+ |
+ private: |
+ void OnConnected(int result); |
+ void DoAuthWrite(); |
+ void OnAuthBytesWritten(int result); |
+ bool HandleAuthBytesWritten(int result); |
+ |
+ std::string remote_cert_; |
+ std::string shared_secret_; |
+ scoped_ptr<net::SSLClientSocket> socket_; |
+ DoneCallback done_callback_; |
+ |
+ scoped_ptr<net::CertVerifier> cert_verifier_; |
+ scoped_refptr<net::DrainableIOBuffer> auth_write_buf_; |
+ |
+ net::OldCompletionCallbackImpl<SimpleClientChannelAuthenticator> |
+ connect_callback_; |
+ net::OldCompletionCallbackImpl<SimpleClientChannelAuthenticator> |
+ auth_write_callback_; |
+ |
+ DISALLOW_COPY_AND_ASSIGN(SimpleClientChannelAuthenticator); |
+}; |
+ |
+} // namespace protocol |
+} // namespace remoting |
+ |
+#endif // REMOTING_PROTOCOL_SIMPLE_CLIENT_CHANNEL_AUTHENTICATOR_H_ |