Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(440)

Unified Diff: remoting/protocol/channel_authenticator.h

Issue 8527018: Refactor ChannelAuthenticator so that it can be used with Authenticator. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | remoting/protocol/channel_authenticator.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/protocol/channel_authenticator.h
diff --git a/remoting/protocol/channel_authenticator.h b/remoting/protocol/channel_authenticator.h
index 4d2dc0591a8fbb09d0babe5598cd158b6993aad9..a95fd3d543ad4e78b0e054e49bcd94c60b0e86a1 100644
--- a/remoting/protocol/channel_authenticator.h
+++ b/remoting/protocol/channel_authenticator.h
@@ -15,8 +15,7 @@
namespace net {
class DrainableIOBuffer;
class GrowableIOBuffer;
-class SSLClientSocket;
-class SSLServerSocket;
+class SSLSocket;
} // namespace net
namespace remoting {
@@ -38,7 +37,7 @@ class ChannelAuthenticator : public base::NonThreadSafe {
// when authentication is finished. Caller retains ownership of
// |socket|. |shared_secret| is a shared secret that we use to
// authenticate the channel.
- virtual void Authenticate(const std::string& shared_secret,
+ virtual void Authenticate(net::SSLSocket* socket,
const DoneCallback& done_callback) = 0;
private:
@@ -47,11 +46,11 @@ class ChannelAuthenticator : public base::NonThreadSafe {
class HostChannelAuthenticator : public ChannelAuthenticator {
public:
- HostChannelAuthenticator(net::SSLServerSocket* socket);
+ HostChannelAuthenticator(const std::string& shared_secret);
virtual ~HostChannelAuthenticator();
// ChannelAuthenticator overrides.
- virtual void Authenticate(const std::string& shared_secret,
+ virtual void Authenticate(net::SSLSocket* socket,
const DoneCallback& done_callback) OVERRIDE;
private:
@@ -60,8 +59,9 @@ class HostChannelAuthenticator : public ChannelAuthenticator {
bool HandleAuthBytesRead(int result);
bool VerifyAuthBytes(const std::string& received_auth_bytes);
+ std::string shared_secret_;
std::string auth_bytes_;
- net::SSLServerSocket* socket_;
+ net::SSLSocket* socket_;
DoneCallback done_callback_;
scoped_refptr<net::GrowableIOBuffer> auth_read_buf_;
@@ -73,11 +73,11 @@ class HostChannelAuthenticator : public ChannelAuthenticator {
class ClientChannelAuthenticator : public ChannelAuthenticator {
public:
- ClientChannelAuthenticator(net::SSLClientSocket* socket);
+ ClientChannelAuthenticator(const std::string& shared_secret);
virtual ~ClientChannelAuthenticator();
// ChannelAuthenticator overrides.
- virtual void Authenticate(const std::string& shared_secret,
+ virtual void Authenticate(net::SSLSocket* socket,
const DoneCallback& done_callback);
private:
@@ -85,12 +85,14 @@ class ClientChannelAuthenticator : public ChannelAuthenticator {
void OnAuthBytesWritten(int result);
bool HandleAuthBytesWritten(int result);
- net::SSLClientSocket* socket_;
+ std::string shared_secret_;
+ net::SSLSocket* socket_;
DoneCallback done_callback_;
scoped_refptr<net::DrainableIOBuffer> auth_write_buf_;
- net::OldCompletionCallbackImpl<ClientChannelAuthenticator> auth_write_callback_;
+ net::OldCompletionCallbackImpl<ClientChannelAuthenticator>
+ auth_write_callback_;
DISALLOW_COPY_AND_ASSIGN(ClientChannelAuthenticator);
};
« no previous file with comments | « no previous file | remoting/protocol/channel_authenticator.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698