| 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 29 matching lines...) Expand all Loading... |
| 40 RECEIVE_ONLY, | 40 RECEIVE_ONLY, |
| 41 }; | 41 }; |
| 42 | 42 |
| 43 // CreateForClient() and CreateForHost() create an authenticator | 43 // CreateForClient() and CreateForHost() create an authenticator |
| 44 // instances for client and host. |auth_key| specifies shared key | 44 // instances for client and host. |auth_key| specifies shared key |
| 45 // known by both host and client. In case of V1Authenticator the | 45 // known by both host and client. In case of V1Authenticator the |
| 46 // |auth_key| is set to access code. For EKE-based authentication | 46 // |auth_key| is set to access code. For EKE-based authentication |
| 47 // |auth_key| is the key established using EKE over the signaling | 47 // |auth_key| is the key established using EKE over the signaling |
| 48 // channel. | 48 // channel. |
| 49 static scoped_ptr<SslHmacChannelAuthenticator> CreateForClient( | 49 static scoped_ptr<SslHmacChannelAuthenticator> CreateForClient( |
| 50 const std::string& remote_cert, | |
| 51 const std::string& auth_key); | 50 const std::string& auth_key); |
| 52 | 51 |
| 53 static scoped_ptr<SslHmacChannelAuthenticator> CreateForHost( | 52 static scoped_ptr<SslHmacChannelAuthenticator> CreateForHost( |
| 54 const std::string& local_cert, | 53 const std::string& local_cert, |
| 55 scoped_refptr<RsaKeyPair> key_pair, | 54 scoped_refptr<RsaKeyPair> key_pair, |
| 56 const std::string& auth_key); | 55 const std::string& auth_key); |
| 57 | 56 |
| 58 ~SslHmacChannelAuthenticator() override; | 57 ~SslHmacChannelAuthenticator() override; |
| 59 | 58 |
| 60 // ChannelAuthenticator interface. | 59 // ChannelAuthenticator interface. |
| (...skipping 20 matching lines...) Expand all Loading... |
| 81 void NotifyError(int error); | 80 void NotifyError(int error); |
| 82 | 81 |
| 83 // The mutual secret used for authentication. | 82 // The mutual secret used for authentication. |
| 84 std::string auth_key_; | 83 std::string auth_key_; |
| 85 | 84 |
| 86 // Used in the SERVER mode only. | 85 // Used in the SERVER mode only. |
| 87 std::string local_cert_; | 86 std::string local_cert_; |
| 88 scoped_refptr<RsaKeyPair> local_key_pair_; | 87 scoped_refptr<RsaKeyPair> local_key_pair_; |
| 89 | 88 |
| 90 // Used in the CLIENT mode only. | 89 // Used in the CLIENT mode only. |
| 91 std::string remote_cert_; | |
| 92 scoped_ptr<net::TransportSecurityState> transport_security_state_; | 90 scoped_ptr<net::TransportSecurityState> transport_security_state_; |
| 93 scoped_ptr<net::CertVerifier> cert_verifier_; | 91 scoped_ptr<net::CertVerifier> cert_verifier_; |
| 94 | 92 |
| 95 scoped_ptr<net::SSLSocket> socket_; | 93 scoped_ptr<net::SSLSocket> socket_; |
| 96 DoneCallback done_callback_; | 94 DoneCallback done_callback_; |
| 97 | 95 |
| 98 scoped_refptr<net::DrainableIOBuffer> auth_write_buf_; | 96 scoped_refptr<net::DrainableIOBuffer> auth_write_buf_; |
| 99 scoped_refptr<net::GrowableIOBuffer> auth_read_buf_; | 97 scoped_refptr<net::GrowableIOBuffer> auth_read_buf_; |
| 100 | 98 |
| 101 DISALLOW_COPY_AND_ASSIGN(SslHmacChannelAuthenticator); | 99 DISALLOW_COPY_AND_ASSIGN(SslHmacChannelAuthenticator); |
| 102 }; | 100 }; |
| 103 | 101 |
| 104 } // namespace protocol | 102 } // namespace protocol |
| 105 } // namespace remoting | 103 } // namespace remoting |
| 106 | 104 |
| 107 #endif // REMOTING_PROTOCOL_SSL_HMAC_CHANNEL_AUTHENTICATOR_H_ | 105 #endif // REMOTING_PROTOCOL_SSL_HMAC_CHANNEL_AUTHENTICATOR_H_ |
| OLD | NEW |