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

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

Issue 8604001: Move SSL layer initialization into ChannelAuthenticator implementations. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Simple->V1 Created 9 years 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
(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_V1_HOST_CHANNEL_AUTHENTICATOR_H_
6 #define REMOTING_PROTOCOL_V1_HOST_CHANNEL_AUTHENTICATOR_H_
7
8 #include "remoting/protocol/channel_authenticator.h"
9
10 #include "base/memory/scoped_ptr.h"
11 #include "base/threading/non_thread_safe.h"
12 #include "net/base/completion_callback.h"
13
14 namespace crypto {
15 class RSAPrivateKey;
16 } // namespace crypto
17
18 namespace net {
19 class GrowableIOBuffer;
20 class SSLServerSocket;
21 class SSLSocket;
22 } // namespace net
23
24 namespace remoting {
25 namespace protocol {
26
27 class V1HostChannelAuthenticator : public ChannelAuthenticator,
28 public base::NonThreadSafe {
29 public:
30 // Caller retains ownership of |local_private_key|. It must exist
31 // while this object exists.
32 V1HostChannelAuthenticator(const std::string& local_cert,
33 crypto::RSAPrivateKey* local_private_key,
34 const std::string& shared_secret);
35 virtual ~V1HostChannelAuthenticator();
36
37 // ChannelAuthenticator interface.
38 virtual void SecureAndAuthenticate(
39 net::StreamSocket* socket, const DoneCallback& done_callback) OVERRIDE;
40
41 private:
42 void OnConnected(int result);
43 void DoAuthRead();
44 void OnAuthBytesRead(int result);
45 bool HandleAuthBytesRead(int result);
46 bool VerifyAuthBytes(const std::string& received_auth_bytes);
47
48 std::string local_cert_;
49 crypto::RSAPrivateKey* local_private_key_;
50 std::string shared_secret_;
51 scoped_ptr<net::SSLServerSocket> socket_;
52 DoneCallback done_callback_;
53
54 scoped_refptr<net::GrowableIOBuffer> auth_read_buf_;
55
56 net::OldCompletionCallbackImpl<V1HostChannelAuthenticator>
57 connect_callback_;
58 net::OldCompletionCallbackImpl<V1HostChannelAuthenticator>
59 auth_read_callback_;
60
61 DISALLOW_COPY_AND_ASSIGN(V1HostChannelAuthenticator);
62 };
63
64 } // namespace protocol
65 } // namespace remoting
66
67 #endif // REMOTING_PROTOCOL_V1_HOST_CHANNEL_AUTHENTICATOR_H_
OLDNEW
« no previous file with comments | « remoting/protocol/v1_client_channel_authenticator.cc ('k') | remoting/protocol/v1_host_channel_authenticator.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698