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_SSL_HMAC_CHANNEL_AUTHENTICATOR_H_ | 5 #ifndef REMOTING_PROTOCOL_SSL_HMAC_CHANNEL_AUTHENTICATOR_H_ |
6 #define REMOTING_PROTOCOL_SSL_HMAC_CHANNEL_AUTHENTICATOR_H_ | 6 #define REMOTING_PROTOCOL_SSL_HMAC_CHANNEL_AUTHENTICATOR_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/callback.h" | 10 #include "base/callback.h" |
(...skipping 27 matching lines...) Expand all Loading... |
38 SEND_ONLY, | 38 SEND_ONLY, |
39 RECEIVE_ONLY, | 39 RECEIVE_ONLY, |
40 }; | 40 }; |
41 | 41 |
42 // CreateForClient() and CreateForHost() create an authenticator | 42 // CreateForClient() and CreateForHost() create an authenticator |
43 // instances for client and host. |auth_key| specifies shared key | 43 // instances for client and host. |auth_key| specifies shared key |
44 // known by both host and client. In case of V1Authenticator the | 44 // known by both host and client. In case of V1Authenticator the |
45 // |auth_key| is set to access code. For EKE-based authentication | 45 // |auth_key| is set to access code. For EKE-based authentication |
46 // |auth_key| is the key established using EKE over the signaling | 46 // |auth_key| is the key established using EKE over the signaling |
47 // channel. | 47 // channel. |
48 static SslHmacChannelAuthenticator* CreateForClient( | 48 static scoped_ptr<SslHmacChannelAuthenticator> CreateForClient( |
49 const std::string& remote_cert, | 49 const std::string& remote_cert, |
50 const std::string& auth_key); | 50 const std::string& auth_key); |
51 | 51 |
52 static SslHmacChannelAuthenticator* CreateForHost( | 52 static scoped_ptr<SslHmacChannelAuthenticator> CreateForHost( |
53 const std::string& local_cert, | 53 const std::string& local_cert, |
54 crypto::RSAPrivateKey* local_private_key, | 54 crypto::RSAPrivateKey* local_private_key, |
55 const std::string& auth_key); | 55 const std::string& auth_key); |
56 | 56 |
57 // TODO(sergeyu): This method is used only for the legacy | 57 // TODO(sergeyu): This method is used only for the legacy |
58 // V1Authenticator. Remove it when V1Authenticator is removed. | 58 // V1Authenticator. Remove it when V1Authenticator is removed. |
59 void SetLegacyOneWayMode(LegacyMode legacy_mode); | 59 void SetLegacyOneWayMode(LegacyMode legacy_mode); |
60 | 60 |
61 virtual ~SslHmacChannelAuthenticator(); | 61 virtual ~SslHmacChannelAuthenticator(); |
62 | 62 |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
101 scoped_refptr<net::DrainableIOBuffer> auth_write_buf_; | 101 scoped_refptr<net::DrainableIOBuffer> auth_write_buf_; |
102 scoped_refptr<net::GrowableIOBuffer> auth_read_buf_; | 102 scoped_refptr<net::GrowableIOBuffer> auth_read_buf_; |
103 | 103 |
104 DISALLOW_COPY_AND_ASSIGN(SslHmacChannelAuthenticator); | 104 DISALLOW_COPY_AND_ASSIGN(SslHmacChannelAuthenticator); |
105 }; | 105 }; |
106 | 106 |
107 } // namespace protocol | 107 } // namespace protocol |
108 } // namespace remoting | 108 } // namespace remoting |
109 | 109 |
110 #endif // REMOTING_PROTOCOL_SSL_HMAC_CHANNEL_AUTHENTICATOR_H_ | 110 #endif // REMOTING_PROTOCOL_SSL_HMAC_CHANNEL_AUTHENTICATOR_H_ |
OLD | NEW |