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

Unified Diff: remoting/protocol/ssl_hmac_channel_authenticator.cc

Issue 10830184: Remove V1 authenticators (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 4 months 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 | « remoting/protocol/ssl_hmac_channel_authenticator.h ('k') | remoting/protocol/v1_authenticator.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/protocol/ssl_hmac_channel_authenticator.cc
diff --git a/remoting/protocol/ssl_hmac_channel_authenticator.cc b/remoting/protocol/ssl_hmac_channel_authenticator.cc
index 9e9a5f4d0117917e7aaa4172ea6b75ab38e0fa72..2cfb3b4b5450c99e9843e57cb1d22bc4611d60a8 100644
--- a/remoting/protocol/ssl_hmac_channel_authenticator.cc
+++ b/remoting/protocol/ssl_hmac_channel_authenticator.cc
@@ -47,19 +47,12 @@ SslHmacChannelAuthenticator::CreateForHost(
SslHmacChannelAuthenticator::SslHmacChannelAuthenticator(
const std::string& auth_key)
: auth_key_(auth_key),
- local_private_key_(NULL),
- legacy_mode_(NONE) {
+ local_private_key_(NULL) {
}
SslHmacChannelAuthenticator::~SslHmacChannelAuthenticator() {
}
-void SslHmacChannelAuthenticator::SetLegacyOneWayMode(LegacyMode legacy_mode) {
- // Must be called before SecureAndAuthenticate().
- DCHECK(done_callback_.is_null());
- legacy_mode_ = legacy_mode;
-}
-
void SslHmacChannelAuthenticator::SecureAndAuthenticate(
scoped_ptr<net::StreamSocket> socket, const DoneCallback& done_callback) {
DCHECK(CalledOnValidThread());
@@ -130,34 +123,29 @@ void SslHmacChannelAuthenticator::OnConnected(int result) {
return;
}
- if (legacy_mode_ != RECEIVE_ONLY) {
- // Generate authentication digest to write to the socket.
- std::string auth_bytes = GetAuthBytes(
- socket_.get(), is_ssl_server() ?
- kHostAuthSslExporterLabel : kClientAuthSslExporterLabel, auth_key_);
- if (auth_bytes.empty()) {
- NotifyError(net::ERR_FAILED);
- return;
- }
-
- // Allocate a buffer to write the digest.
- auth_write_buf_ = new net::DrainableIOBuffer(
- new net::StringIOBuffer(auth_bytes), auth_bytes.size());
+ // Generate authentication digest to write to the socket.
+ std::string auth_bytes = GetAuthBytes(
+ socket_.get(), is_ssl_server() ?
+ kHostAuthSslExporterLabel : kClientAuthSslExporterLabel, auth_key_);
+ if (auth_bytes.empty()) {
+ NotifyError(net::ERR_FAILED);
+ return;
}
- if (legacy_mode_ != SEND_ONLY) {
- // Read an incoming token.
- auth_read_buf_ = new net::GrowableIOBuffer();
- auth_read_buf_->SetCapacity(kAuthDigestLength);
- }
+ // Allocate a buffer to write the digest.
+ auth_write_buf_ = new net::DrainableIOBuffer(
+ new net::StringIOBuffer(auth_bytes), auth_bytes.size());
+
+ // Read an incoming token.
+ auth_read_buf_ = new net::GrowableIOBuffer();
+ auth_read_buf_->SetCapacity(kAuthDigestLength);
// If WriteAuthenticationBytes() results in |done_callback_| being
// called then we must not do anything else because this object may
// be destroyed at that point.
bool callback_called = false;
- if (legacy_mode_ != RECEIVE_ONLY)
- WriteAuthenticationBytes(&callback_called);
- if (!callback_called && legacy_mode_ != SEND_ONLY)
+ WriteAuthenticationBytes(&callback_called);
+ if (!callback_called)
ReadAuthenticationBytes();
}
« no previous file with comments | « remoting/protocol/ssl_hmac_channel_authenticator.h ('k') | remoting/protocol/v1_authenticator.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698