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

Side by Side Diff: remoting/protocol/simple_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: - 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 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_SIMPLE_HOST_CHANNEL_AUTHENTICATOR_H_
6 #define REMOTING_PROTOCOL_SIMPLE_HOST_CHANNEL_AUTHENTICATOR_H_
7
8 #include "remoting/protocol/channel_authenticator.h"
9
10 #include "base/memory/scoped_ptr.h"
11 #include "net/base/completion_callback.h"
12
13 namespace crypto {
14 class RSAPrivateKey;
15 } // namespace crypto
16
17 namespace net {
18 class GrowableIOBuffer;
19 class SSLServerSocket;
20 class SSLSocket;
21 } // namespace net
22
23 namespace remoting {
24 namespace protocol {
25
26 class SimpleHostChannelAuthenticator : public ChannelAuthenticator {
Wez 2011/11/22 22:29:48 See previous comment about the naming of this.
27 public:
28 // Caller retains ownership of |local_private_key|.
29 SimpleHostChannelAuthenticator(const std::string& local_cert,
30 crypto::RSAPrivateKey* local_private_key,
Wez 2011/11/22 22:29:48 Can this parameter be const&?
Sergey Ulanov 2011/11/23 01:23:42 Currently net::CreateSSLServerSocket() expects non
31 const std::string& shared_secret);
32 virtual ~SimpleHostChannelAuthenticator();
33
34 // ChannelAuthenticator implementation.
Wez 2011/11/22 22:29:48 nit: implementation -> interface?
Sergey Ulanov 2011/11/23 01:23:42 Done.
35 virtual void SecureAndAuthenticate(
36 net::StreamSocket* socket, const DoneCallback& done_callback) OVERRIDE;
37
38 private:
39 void OnConnected(int result);
40 void DoAuthRead();
41 void OnAuthBytesRead(int result);
42 bool HandleAuthBytesRead(int result);
43 bool VerifyAuthBytes(const std::string& received_auth_bytes);
44
45 std::string local_cert_;
46 crypto::RSAPrivateKey* local_private_key_;
47 std::string shared_secret_;
48 std::string auth_bytes_;
Wez 2011/11/22 22:29:48 Why store |auth_bytes_|, rather than deriving it f
Sergey Ulanov 2011/11/23 01:23:42 Done.
49 scoped_ptr<net::SSLServerSocket> socket_;
50 DoneCallback done_callback_;
51
52 scoped_refptr<net::GrowableIOBuffer> auth_read_buf_;
53
54 net::OldCompletionCallbackImpl<SimpleHostChannelAuthenticator>
55 connect_callback_;
56 net::OldCompletionCallbackImpl<SimpleHostChannelAuthenticator>
57 auth_read_callback_;
58
59 DISALLOW_COPY_AND_ASSIGN(SimpleHostChannelAuthenticator);
60 };
61
62 } // namespace protocol
63 } // namespace remoting
64
65 #endif // REMOTING_PROTOCOL_SIMPLE_HOST_CHANNEL_AUTHENTICATOR_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698