OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
46 // channel. | 46 // channel. |
47 static scoped_ptr<SslHmacChannelAuthenticator> CreateForClient( | 47 static scoped_ptr<SslHmacChannelAuthenticator> CreateForClient( |
48 const std::string& remote_cert, | 48 const std::string& remote_cert, |
49 const std::string& auth_key); | 49 const std::string& auth_key); |
50 | 50 |
51 static scoped_ptr<SslHmacChannelAuthenticator> CreateForHost( | 51 static scoped_ptr<SslHmacChannelAuthenticator> CreateForHost( |
52 const std::string& local_cert, | 52 const std::string& local_cert, |
53 scoped_refptr<RsaKeyPair> key_pair, | 53 scoped_refptr<RsaKeyPair> key_pair, |
54 const std::string& auth_key); | 54 const std::string& auth_key); |
55 | 55 |
56 virtual ~SslHmacChannelAuthenticator(); | 56 ~SslHmacChannelAuthenticator() override; |
57 | 57 |
58 // ChannelAuthenticator interface. | 58 // ChannelAuthenticator interface. |
59 virtual void SecureAndAuthenticate( | 59 void SecureAndAuthenticate(scoped_ptr<net::StreamSocket> socket, |
60 scoped_ptr<net::StreamSocket> socket, | 60 const DoneCallback& done_callback) override; |
61 const DoneCallback& done_callback) override; | |
62 | 61 |
63 private: | 62 private: |
64 SslHmacChannelAuthenticator(const std::string& auth_key); | 63 SslHmacChannelAuthenticator(const std::string& auth_key); |
65 | 64 |
66 bool is_ssl_server(); | 65 bool is_ssl_server(); |
67 | 66 |
68 void OnConnected(int result); | 67 void OnConnected(int result); |
69 | 68 |
70 void WriteAuthenticationBytes(bool* callback_called); | 69 void WriteAuthenticationBytes(bool* callback_called); |
71 void OnAuthBytesWritten(int result); | 70 void OnAuthBytesWritten(int result); |
(...skipping 25 matching lines...) Expand all Loading... |
97 scoped_refptr<net::DrainableIOBuffer> auth_write_buf_; | 96 scoped_refptr<net::DrainableIOBuffer> auth_write_buf_; |
98 scoped_refptr<net::GrowableIOBuffer> auth_read_buf_; | 97 scoped_refptr<net::GrowableIOBuffer> auth_read_buf_; |
99 | 98 |
100 DISALLOW_COPY_AND_ASSIGN(SslHmacChannelAuthenticator); | 99 DISALLOW_COPY_AND_ASSIGN(SslHmacChannelAuthenticator); |
101 }; | 100 }; |
102 | 101 |
103 } // namespace protocol | 102 } // namespace protocol |
104 } // namespace remoting | 103 } // namespace remoting |
105 | 104 |
106 #endif // REMOTING_PROTOCOL_SSL_HMAC_CHANNEL_AUTHENTICATOR_H_ | 105 #endif // REMOTING_PROTOCOL_SSL_HMAC_CHANNEL_AUTHENTICATOR_H_ |
OLD | NEW |