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 #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 "crypto/rsa_private_key.h" | 9 #include "crypto/rsa_private_key.h" |
10 #include "remoting/protocol/channel_authenticator.h" | 10 #include "remoting/protocol/channel_authenticator.h" |
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
100 // Verify that the client's jid is an ASCII string, and then check | 100 // Verify that the client's jid is an ASCII string, and then check |
101 // that the client has the same bare jid as the host, i.e. client's | 101 // that the client has the same bare jid as the host, i.e. client's |
102 // full JID starts with host's bare jid. Comparison is case | 102 // full JID starts with host's bare jid. Comparison is case |
103 // insensitive. | 103 // insensitive. |
104 if (!IsStringASCII(remote_jid) || | 104 if (!IsStringASCII(remote_jid) || |
105 !StartsWithASCII(remote_jid, local_jid_prefix_, false)) { | 105 !StartsWithASCII(remote_jid, local_jid_prefix_, false)) { |
106 LOG(ERROR) << "Rejecting incoming connection from " << remote_jid; | 106 LOG(ERROR) << "Rejecting incoming connection from " << remote_jid; |
107 return scoped_ptr<Authenticator>(new RejectingAuthenticator()); | 107 return scoped_ptr<Authenticator>(new RejectingAuthenticator()); |
108 } | 108 } |
109 | 109 |
110 if (NegotiatingAuthenticator::IsNegotiableMessage(first_message)) { | 110 return NegotiatingAuthenticator::CreateForHost( |
111 return NegotiatingAuthenticator::CreateForHost( | 111 local_cert_, *local_private_key_, shared_secret_hash_.value, |
112 local_cert_, *local_private_key_, shared_secret_hash_.value, | 112 shared_secret_hash_.hash_function); |
Jamie
2012/02/06 21:03:45
I take it that IsNegotiableMessage was being used
| |
113 shared_secret_hash_.hash_function); | |
114 } | |
115 | |
116 // TODO(sergeyu): Old clients still use V1 auth protocol. Remove | |
117 // this once we are done migrating to V2. crbug.com/110483 . | |
118 return scoped_ptr<Authenticator>(new V1HostAuthenticator( | |
119 local_cert_, *local_private_key_, "", remote_jid)); | |
120 } | 113 } |
121 | 114 |
122 } // namespace protocol | 115 } // namespace protocol |
123 } // namespace remoting | 116 } // namespace remoting |
OLD | NEW |