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

Side by Side Diff: remoting/protocol/me2me_host_authenticator_factory.cc

Issue 15782010: Update remoting/ and jingle/ to use scoped_refptr<T>::get() rather than implicit "operator T*" (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 6 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « remoting/protocol/fake_session.cc ('k') | remoting/protocol/message_decoder.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 #include "remoting/protocol/me2me_host_authenticator_factory.h" 5 #include "remoting/protocol/me2me_host_authenticator_factory.h"
6 6
7 #include "base/base64.h" 7 #include "base/base64.h"
8 #include "base/string_util.h" 8 #include "base/string_util.h"
9 #include "remoting/base/rsa_key_pair.h" 9 #include "remoting/base/rsa_key_pair.h"
10 #include "remoting/protocol/channel_authenticator.h" 10 #include "remoting/protocol/channel_authenticator.h"
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after
116 // Verify that the client's jid is an ASCII string, and then check 116 // Verify that the client's jid is an ASCII string, and then check
117 // that the client has the same bare jid as the host, i.e. client's 117 // that the client has the same bare jid as the host, i.e. client's
118 // full JID starts with host's bare jid. Comparison is case 118 // full JID starts with host's bare jid. Comparison is case
119 // insensitive. 119 // insensitive.
120 if (!IsStringASCII(remote_jid) || 120 if (!IsStringASCII(remote_jid) ||
121 !StartsWithASCII(remote_jid, local_jid.substr(0, slash_pos + 1), false)) { 121 !StartsWithASCII(remote_jid, local_jid.substr(0, slash_pos + 1), false)) {
122 LOG(ERROR) << "Rejecting incoming connection from " << remote_jid; 122 LOG(ERROR) << "Rejecting incoming connection from " << remote_jid;
123 return scoped_ptr<Authenticator>(new RejectingAuthenticator()); 123 return scoped_ptr<Authenticator>(new RejectingAuthenticator());
124 } 124 }
125 125
126 if (!local_cert_.empty() && key_pair_) { 126 if (!local_cert_.empty() && key_pair_.get()) {
127 if (token_validator_factory_) { 127 if (token_validator_factory_) {
128 return NegotiatingHostAuthenticator::CreateWithThirdPartyAuth( 128 return NegotiatingHostAuthenticator::CreateWithThirdPartyAuth(
129 local_cert_, key_pair_, 129 local_cert_, key_pair_,
130 token_validator_factory_->CreateTokenValidator( 130 token_validator_factory_->CreateTokenValidator(
131 local_jid, remote_jid)); 131 local_jid, remote_jid));
132 } 132 }
133 133
134 return NegotiatingHostAuthenticator::CreateWithSharedSecret( 134 return NegotiatingHostAuthenticator::CreateWithSharedSecret(
135 local_cert_, key_pair_, shared_secret_hash_.value, 135 local_cert_, key_pair_, shared_secret_hash_.value,
136 shared_secret_hash_.hash_function, pairing_registry_); 136 shared_secret_hash_.hash_function, pairing_registry_);
137 } 137 }
138 138
139 return scoped_ptr<Authenticator>(new RejectingAuthenticator()); 139 return scoped_ptr<Authenticator>(new RejectingAuthenticator());
140 } 140 }
141 141
142 } // namespace protocol 142 } // namespace protocol
143 } // namespace remoting 143 } // namespace remoting
OLDNEW
« no previous file with comments | « remoting/protocol/fake_session.cc ('k') | remoting/protocol/message_decoder.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698