| 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 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 55 const std::string& auth_key); | 55 const std::string& auth_key); |
| 56 | 56 |
| 57 virtual ~SslHmacChannelAuthenticator(); | 57 virtual ~SslHmacChannelAuthenticator(); |
| 58 | 58 |
| 59 // ChannelAuthenticator interface. | 59 // ChannelAuthenticator interface. |
| 60 virtual void SecureAndAuthenticate( | 60 virtual void SecureAndAuthenticate( |
| 61 scoped_ptr<net::StreamSocket> socket, | 61 scoped_ptr<net::StreamSocket> socket, |
| 62 const DoneCallback& done_callback) OVERRIDE; | 62 const DoneCallback& done_callback) OVERRIDE; |
| 63 | 63 |
| 64 private: | 64 private: |
| 65 SslHmacChannelAuthenticator(const std::string& auth_key); | 65 explicit SslHmacChannelAuthenticator(const std::string& auth_key); |
| 66 | 66 |
| 67 bool is_ssl_server(); | 67 bool is_ssl_server(); |
| 68 | 68 |
| 69 void OnConnected(int result); | 69 void OnConnected(int result); |
| 70 | 70 |
| 71 void WriteAuthenticationBytes(bool* callback_called); | 71 void WriteAuthenticationBytes(bool* callback_called); |
| 72 void OnAuthBytesWritten(int result); | 72 void OnAuthBytesWritten(int result); |
| 73 bool HandleAuthBytesWritten(int result, bool* callback_called); | 73 bool HandleAuthBytesWritten(int result, bool* callback_called); |
| 74 | 74 |
| 75 void ReadAuthenticationBytes(); | 75 void ReadAuthenticationBytes(); |
| (...skipping 21 matching lines...) Expand all Loading... |
| 97 scoped_refptr<net::DrainableIOBuffer> auth_write_buf_; | 97 scoped_refptr<net::DrainableIOBuffer> auth_write_buf_; |
| 98 scoped_refptr<net::GrowableIOBuffer> auth_read_buf_; | 98 scoped_refptr<net::GrowableIOBuffer> auth_read_buf_; |
| 99 | 99 |
| 100 DISALLOW_COPY_AND_ASSIGN(SslHmacChannelAuthenticator); | 100 DISALLOW_COPY_AND_ASSIGN(SslHmacChannelAuthenticator); |
| 101 }; | 101 }; |
| 102 | 102 |
| 103 } // namespace protocol | 103 } // namespace protocol |
| 104 } // namespace remoting | 104 } // namespace remoting |
| 105 | 105 |
| 106 #endif // REMOTING_PROTOCOL_SSL_HMAC_CHANNEL_AUTHENTICATOR_H_ | 106 #endif // REMOTING_PROTOCOL_SSL_HMAC_CHANNEL_AUTHENTICATOR_H_ |
| OLD | NEW |