OLD | NEW |
---|---|
(Empty) | |
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 | |
3 // found in the LICENSE file. | |
4 | |
5 #ifndef REMOTING_PROTOCOL_SIMPLE_CLIENT_CHANNEL_AUTHENTICATOR_H_ | |
6 #define REMOTING_PROTOCOL_SIMPLE_CLIENT_CHANNEL_AUTHENTICATOR_H_ | |
7 | |
8 #include <string> | |
9 | |
10 #include "base/callback.h" | |
11 #include "base/memory/ref_counted.h" | |
12 #include "base/memory/scoped_ptr.h" | |
13 #include "base/threading/non_thread_safe.h" | |
14 #include "net/base/completion_callback.h" | |
15 #include "remoting/protocol/channel_authenticator.h" | |
16 | |
17 namespace net { | |
18 class CertVerifier; | |
19 class DrainableIOBuffer; | |
20 class GrowableIOBuffer; | |
21 class SSLClientSocket; | |
22 } // namespace net | |
23 | |
24 namespace remoting { | |
25 namespace protocol { | |
26 | |
27 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?
| |
28 public: | |
29 SimpleClientChannelAuthenticator(const std::string& remote_cert, | |
30 const std::string& shared_secret); | |
31 virtual ~SimpleClientChannelAuthenticator(); | |
32 | |
33 // ChannelAuthenticator implementation. | |
34 virtual void SecureAndAuthenticate( | |
35 net::StreamSocket* socket, const DoneCallback& done_callback); | |
Wez
2011/11/22 22:29:48
OVERRIDE?
Sergey Ulanov
2011/11/23 01:23:42
Done.
| |
36 | |
37 private: | |
38 void OnConnected(int result); | |
39 void DoAuthWrite(); | |
40 void OnAuthBytesWritten(int result); | |
41 bool HandleAuthBytesWritten(int result); | |
42 | |
43 std::string remote_cert_; | |
44 std::string shared_secret_; | |
45 scoped_ptr<net::SSLClientSocket> socket_; | |
46 DoneCallback done_callback_; | |
47 | |
48 scoped_ptr<net::CertVerifier> cert_verifier_; | |
49 scoped_refptr<net::DrainableIOBuffer> auth_write_buf_; | |
50 | |
51 net::OldCompletionCallbackImpl<SimpleClientChannelAuthenticator> | |
52 connect_callback_; | |
53 net::OldCompletionCallbackImpl<SimpleClientChannelAuthenticator> | |
54 auth_write_callback_; | |
55 | |
56 DISALLOW_COPY_AND_ASSIGN(SimpleClientChannelAuthenticator); | |
57 }; | |
58 | |
59 } // namespace protocol | |
60 } // namespace remoting | |
61 | |
62 #endif // REMOTING_PROTOCOL_SIMPLE_CLIENT_CHANNEL_AUTHENTICATOR_H_ | |
OLD | NEW |