OLD | NEW |
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_HOST_CHANNEL_AUTHENTICATOR_H_ | 5 #ifndef REMOTING_PROTOCOL_V1_HOST_CHANNEL_AUTHENTICATOR_H_ |
6 #define REMOTING_PROTOCOL_V1_HOST_CHANNEL_AUTHENTICATOR_H_ | 6 #define REMOTING_PROTOCOL_V1_HOST_CHANNEL_AUTHENTICATOR_H_ |
7 | 7 |
8 #include "remoting/protocol/channel_authenticator.h" | 8 #include "remoting/protocol/channel_authenticator.h" |
9 | 9 |
10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
11 #include "base/threading/non_thread_safe.h" | 11 #include "base/threading/non_thread_safe.h" |
12 #include "net/base/completion_callback.h" | 12 #include "net/base/completion_callback.h" |
13 | 13 |
14 namespace crypto { | 14 namespace crypto { |
15 class RSAPrivateKey; | 15 class RSAPrivateKey; |
16 } // namespace crypto | 16 } // namespace crypto |
17 | 17 |
18 namespace net { | 18 namespace net { |
19 class GrowableIOBuffer; | 19 class GrowableIOBuffer; |
20 class SSLServerSocket; | 20 class SSLServerSocket; |
21 class SSLSocket; | 21 class SSLSocket; |
22 } // namespace net | 22 } // namespace net |
23 | 23 |
24 namespace remoting { | 24 namespace remoting { |
25 namespace protocol { | 25 namespace protocol { |
26 | 26 |
27 class V1HostChannelAuthenticator : public ChannelAuthenticator, | 27 class V1HostChannelAuthenticator : public ChannelAuthenticator, |
28 public base::NonThreadSafe { | 28 public base::NonThreadSafe { |
29 public: | 29 public: |
30 // Caller retains ownership of |local_private_key|. It must exist | 30 // Caller retains ownership of |local_private_key|. It must exist |
31 // while this object exists. | 31 // while this object exists. |
32 V1HostChannelAuthenticator(const std::string& local_cert, | 32 V1HostChannelAuthenticator(const std::string& local_cert, |
33 crypto::RSAPrivateKey* local_private_key, | 33 crypto::RSAPrivateKey* local_private_key, |
34 const std::string& shared_secret); | 34 const std::string& shared_secret); |
35 virtual ~V1HostChannelAuthenticator(); | 35 virtual ~V1HostChannelAuthenticator(); |
36 | 36 |
37 // ChannelAuthenticator interface. | 37 // ChannelAuthenticator interface. |
38 virtual void SecureAndAuthenticate( | 38 virtual void SecureAndAuthenticate( |
39 net::StreamSocket* socket, const DoneCallback& done_callback) OVERRIDE; | 39 net::StreamSocket* socket, const DoneCallback& done_callback) OVERRIDE; |
40 | 40 |
41 private: | 41 private: |
42 void OnConnected(int result); | 42 void OnConnected(int result); |
43 void DoAuthRead(); | 43 void DoAuthRead(); |
44 void OnAuthBytesRead(int result); | 44 void OnAuthBytesRead(int result); |
(...skipping 13 matching lines...) Expand all Loading... |
58 net::OldCompletionCallbackImpl<V1HostChannelAuthenticator> | 58 net::OldCompletionCallbackImpl<V1HostChannelAuthenticator> |
59 auth_read_callback_; | 59 auth_read_callback_; |
60 | 60 |
61 DISALLOW_COPY_AND_ASSIGN(V1HostChannelAuthenticator); | 61 DISALLOW_COPY_AND_ASSIGN(V1HostChannelAuthenticator); |
62 }; | 62 }; |
63 | 63 |
64 } // namespace protocol | 64 } // namespace protocol |
65 } // namespace remoting | 65 } // namespace remoting |
66 | 66 |
67 #endif // REMOTING_PROTOCOL_V1_HOST_CHANNEL_AUTHENTICATOR_H_ | 67 #endif // REMOTING_PROTOCOL_V1_HOST_CHANNEL_AUTHENTICATOR_H_ |
OLD | NEW |