| 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 <memory> | 8 #include <memory> |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| 11 #include "base/callback.h" | 11 #include "base/callback.h" |
| 12 #include "base/macros.h" | 12 #include "base/macros.h" |
| 13 #include "base/memory/ref_counted.h" | 13 #include "base/memory/ref_counted.h" |
| 14 #include "base/threading/non_thread_safe.h" | 14 #include "base/sequence_checker.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 CTPolicyEnforcer; | 19 class CTPolicyEnforcer; |
| 20 class CTVerifier; | 20 class CTVerifier; |
| 21 class DrainableIOBuffer; | 21 class DrainableIOBuffer; |
| 22 class GrowableIOBuffer; | 22 class GrowableIOBuffer; |
| 23 class SSLServerContext; | 23 class SSLServerContext; |
| 24 class SSLSocket; | 24 class SSLSocket; |
| 25 class TransportSecurityState; | 25 class TransportSecurityState; |
| 26 } // namespace net | 26 } // namespace net |
| 27 | 27 |
| 28 namespace remoting { | 28 namespace remoting { |
| 29 | 29 |
| 30 class RsaKeyPair; | 30 class RsaKeyPair; |
| 31 | 31 |
| 32 namespace protocol { | 32 namespace protocol { |
| 33 | 33 |
| 34 // SslHmacChannelAuthenticator implements ChannelAuthenticator that | 34 // SslHmacChannelAuthenticator implements ChannelAuthenticator that |
| 35 // secures channels using SSL and authenticates them with a shared | 35 // secures channels using SSL and authenticates them with a shared |
| 36 // secret HMAC. | 36 // secret HMAC. |
| 37 class SslHmacChannelAuthenticator : public ChannelAuthenticator, | 37 class SslHmacChannelAuthenticator : public ChannelAuthenticator { |
| 38 public base::NonThreadSafe { | |
| 39 public: | 38 public: |
| 40 enum LegacyMode { | 39 enum LegacyMode { |
| 41 NONE, | 40 NONE, |
| 42 SEND_ONLY, | 41 SEND_ONLY, |
| 43 RECEIVE_ONLY, | 42 RECEIVE_ONLY, |
| 44 }; | 43 }; |
| 45 | 44 |
| 46 // CreateForClient() and CreateForHost() create an authenticator | 45 // CreateForClient() and CreateForHost() create an authenticator |
| 47 // instances for client and host. |auth_key| specifies shared key | 46 // instances for client and host. |auth_key| specifies shared key |
| 48 // known by both host and client. In case of V1Authenticator the | 47 // known by both host and client. In case of V1Authenticator the |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 97 std::unique_ptr<net::CertVerifier> cert_verifier_; | 96 std::unique_ptr<net::CertVerifier> cert_verifier_; |
| 98 std::unique_ptr<net::CTVerifier> ct_verifier_; | 97 std::unique_ptr<net::CTVerifier> ct_verifier_; |
| 99 std::unique_ptr<net::CTPolicyEnforcer> ct_policy_enforcer_; | 98 std::unique_ptr<net::CTPolicyEnforcer> ct_policy_enforcer_; |
| 100 | 99 |
| 101 std::unique_ptr<net::SSLSocket> socket_; | 100 std::unique_ptr<net::SSLSocket> socket_; |
| 102 DoneCallback done_callback_; | 101 DoneCallback done_callback_; |
| 103 | 102 |
| 104 scoped_refptr<net::DrainableIOBuffer> auth_write_buf_; | 103 scoped_refptr<net::DrainableIOBuffer> auth_write_buf_; |
| 105 scoped_refptr<net::GrowableIOBuffer> auth_read_buf_; | 104 scoped_refptr<net::GrowableIOBuffer> auth_read_buf_; |
| 106 | 105 |
| 106 SEQUENCE_CHECKER(sequence_checker_); |
| 107 |
| 107 DISALLOW_COPY_AND_ASSIGN(SslHmacChannelAuthenticator); | 108 DISALLOW_COPY_AND_ASSIGN(SslHmacChannelAuthenticator); |
| 108 }; | 109 }; |
| 109 | 110 |
| 110 } // namespace protocol | 111 } // namespace protocol |
| 111 } // namespace remoting | 112 } // namespace remoting |
| 112 | 113 |
| 113 #endif // REMOTING_PROTOCOL_SSL_HMAC_CHANNEL_AUTHENTICATOR_H_ | 114 #endif // REMOTING_PROTOCOL_SSL_HMAC_CHANNEL_AUTHENTICATOR_H_ |
| OLD | NEW |