| 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" |
| 11 #include "base/macros.h" | 11 #include "base/macros.h" |
| 12 #include "base/memory/ref_counted.h" | 12 #include "base/memory/ref_counted.h" |
| 13 #include "base/memory/scoped_ptr.h" | 13 #include "base/memory/scoped_ptr.h" |
| 14 #include "base/threading/non_thread_safe.h" | 14 #include "base/threading/non_thread_safe.h" |
| 15 #include "remoting/protocol/channel_authenticator.h" | 15 #include "remoting/protocol/channel_authenticator.h" |
| 16 | 16 |
| 17 namespace net { | 17 namespace net { |
| 18 class CertVerifier; | 18 class CertVerifier; |
| 19 class DrainableIOBuffer; | 19 class DrainableIOBuffer; |
| 20 class GrowableIOBuffer; | 20 class GrowableIOBuffer; |
| 21 class SSLServerContext; |
| 21 class SSLSocket; | 22 class SSLSocket; |
| 22 class TransportSecurityState; | 23 class TransportSecurityState; |
| 23 } // namespace net | 24 } // namespace net |
| 24 | 25 |
| 25 namespace remoting { | 26 namespace remoting { |
| 26 | 27 |
| 27 class RsaKeyPair; | 28 class RsaKeyPair; |
| 28 | 29 |
| 29 namespace protocol { | 30 namespace protocol { |
| 30 | 31 |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 73 bool HandleAuthBytesWritten(int result, bool* callback_called); | 74 bool HandleAuthBytesWritten(int result, bool* callback_called); |
| 74 | 75 |
| 75 void ReadAuthenticationBytes(); | 76 void ReadAuthenticationBytes(); |
| 76 void OnAuthBytesRead(int result); | 77 void OnAuthBytesRead(int result); |
| 77 bool HandleAuthBytesRead(int result); | 78 bool HandleAuthBytesRead(int result); |
| 78 bool VerifyAuthBytes(const std::string& received_auth_bytes); | 79 bool VerifyAuthBytes(const std::string& received_auth_bytes); |
| 79 | 80 |
| 80 void CheckDone(bool* callback_called); | 81 void CheckDone(bool* callback_called); |
| 81 void NotifyError(int error); | 82 void NotifyError(int error); |
| 82 | 83 |
| 84 void InitializeSSLServerContext(); |
| 85 |
| 83 // The mutual secret used for authentication. | 86 // The mutual secret used for authentication. |
| 84 std::string auth_key_; | 87 std::string auth_key_; |
| 85 | 88 |
| 86 // Used in the SERVER mode only. | 89 // Used in the SERVER mode only. |
| 87 std::string local_cert_; | 90 std::string local_cert_; |
| 88 scoped_refptr<RsaKeyPair> local_key_pair_; | 91 scoped_refptr<RsaKeyPair> local_key_pair_; |
| 92 scoped_ptr<net::SSLServerContext> server_context_; |
| 89 | 93 |
| 90 // Used in the CLIENT mode only. | 94 // Used in the CLIENT mode only. |
| 91 std::string remote_cert_; | 95 std::string remote_cert_; |
| 92 scoped_ptr<net::TransportSecurityState> transport_security_state_; | 96 scoped_ptr<net::TransportSecurityState> transport_security_state_; |
| 93 scoped_ptr<net::CertVerifier> cert_verifier_; | 97 scoped_ptr<net::CertVerifier> cert_verifier_; |
| 94 | 98 |
| 95 scoped_ptr<net::SSLSocket> socket_; | 99 scoped_ptr<net::SSLSocket> socket_; |
| 96 DoneCallback done_callback_; | 100 DoneCallback done_callback_; |
| 97 | 101 |
| 98 scoped_refptr<net::DrainableIOBuffer> auth_write_buf_; | 102 scoped_refptr<net::DrainableIOBuffer> auth_write_buf_; |
| 99 scoped_refptr<net::GrowableIOBuffer> auth_read_buf_; | 103 scoped_refptr<net::GrowableIOBuffer> auth_read_buf_; |
| 100 | 104 |
| 101 DISALLOW_COPY_AND_ASSIGN(SslHmacChannelAuthenticator); | 105 DISALLOW_COPY_AND_ASSIGN(SslHmacChannelAuthenticator); |
| 102 }; | 106 }; |
| 103 | 107 |
| 104 } // namespace protocol | 108 } // namespace protocol |
| 105 } // namespace remoting | 109 } // namespace remoting |
| 106 | 110 |
| 107 #endif // REMOTING_PROTOCOL_SSL_HMAC_CHANNEL_AUTHENTICATOR_H_ | 111 #endif // REMOTING_PROTOCOL_SSL_HMAC_CHANNEL_AUTHENTICATOR_H_ |
| OLD | NEW |